/* 全局样式和变量 */
:root {
  --primary-color: #1b5e20;
  --primary-hover: #2e7d32;
  --accent-color: #2e7d32;
  --accent-hover: #388e3c;
  --text-color: #222;
  --text-light: #666;
  --text-lighter: #888;
  --bg-color: #fafbfc;
  --card-bg: #fff;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #ffffff;
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

/* 顶部导航栏 */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.nav-logo:hover {
  color: var(--primary-hover);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-color);
  background: transparent;
}

.nav-links a.active {
  color: var(--primary-color);
  background: transparent;
  border-bottom: 2px solid var(--primary-color);
}

/* 头部样式（保留用于其他页面） */
header {
  text-align: center;
  padding: 4rem 1rem 2.5rem 1rem;
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.header-content {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.8rem 0;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  animation: fadeInDown 0.8s ease-out;
}

.subtitle {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.95);
  margin: 0;
  font-weight: 300;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 主内容区域 */
main {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* 首页布局 */
.home-main {
  min-height: calc(100vh - 200px);
  padding: 3rem 0;
}

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

/* 个人资料侧边栏 */
.profile-sidebar {
  position: sticky;
  top: 100px;
}

.profile-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.profile-avatar {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  margin-bottom: 1.5rem;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 0.25rem 0;
}

.profile-name-en {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0 0 0.75rem 0;
  font-weight: 400;
}

.profile-title {
  font-size: 1rem;
  color: var(--text-color);
  margin: 0.5rem 0;
  font-weight: 500;
}

.profile-subtitle {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0.5rem 0 0 0;
}

/* 邮箱样式 */
.profile-email {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(27, 94, 32, 0.05);
  border-radius: 8px;
}

.email-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: var(--transition);
}

.email-link:hover {
  color: var(--primary-color);
}

.email-icon {
  font-size: 1.2rem;
}

/* 教育经历样式 */
.profile-education {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: rgba(27, 94, 32, 0.05);
  border-radius: 8px;
}

.education-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  text-align: center;
}

.education-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(27, 94, 32, 0.1);
}

.education-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.education-degree {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.education-school {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.education-major {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}

.profile-contact {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: rgba(27, 94, 32, 0.05);
  border-radius: 8px;
}

.contact-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  text-align: center;
}

.profile-contact .profile-email {
  margin-bottom: 1rem;
}

.social-links-profile {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-link-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(27, 94, 32, 0.1);
  transition: var(--transition);
  text-decoration: none;
}

.social-link-item:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-link-item img {
  width: 24px;
  height: 24px;
  transition: var(--transition);
  opacity: 0.7;
  display: block;
}

.social-link-item:hover img {
  opacity: 1;
  transform: scale(1.1);
}

/* 内容区域 */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.content-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.content-section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

.section-content {
  color: var(--text-light);
  line-height: 1.8;
}

.section-content p {
  margin: 0 0 1rem 0;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* 快速链接卡片 */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(27, 94, 32, 0.05);
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  text-decoration: none;
  transition: var(--transition);
}

.quick-link-card:hover {
  background: rgba(27, 94, 32, 0.1);
  border-color: var(--primary-color);
  transform: translateX(5px);
}

.quick-link-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  border-radius: 12px;
  flex-shrink: 0;
}

.quick-link-content {
  flex: 1;
}

.quick-link-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.25rem 0;
}

.quick-link-content p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0;
}

.quick-link-arrow {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: var(--transition);
}

.quick-link-card:hover .quick-link-arrow {
  transform: translateX(5px);
}

/* 区块样式 */
section {
  margin-bottom: 2.5rem;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

section:hover::before {
  transform: scaleX(1);
}

section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  position: relative;
  padding-bottom: 0.5rem;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 100%);
  border-radius: 2px;
}

/* 作品展示区 */
.works-list {
  min-height: 100px;
}

.works-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.works-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
}

.works-image:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.works-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-lighter);
  font-style: italic;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border-radius: 8px;
  border: 2px dashed #ddd;
}

.works-placeholder p {
  margin: 0;
  font-size: 1.1rem;
}

/* 照片滚动区域 */
.photos-scroll {
  display: flex;
  flex-direction: row;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 10px 20px 10px;
  scrollbar-width: thin;
  scrollbar-color: #667eea #f5f5f5;
  scroll-behavior: smooth;
}

.photos-scroll::-webkit-scrollbar {
  height: 10px;
}

.photos-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 5px;
}

.photos-scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 5px;
}

.photo-item {
  flex: 0 0 auto;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.photo-item:hover {
  transform: translateY(-5px);
}

.photo-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.photo-wrapper:hover {
  box-shadow: var(--shadow-lg);
}

.photo-wrapper img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 94, 32, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.photo-wrapper:hover .photo-overlay {
  opacity: 1;
}

.photo-view-icon {
  font-size: 2rem;
  color: #fff;
  transform: scale(0.8);
  transition: var(--transition);
}

.photo-wrapper:hover .photo-view-icon {
  transform: scale(1);
}

.photo-caption {
  margin-top: 12px;
  font-size: 0.95em;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
  max-width: 100%;
  font-weight: 500;
}

/* 社交媒体链接 */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  justify-content: flex-start;
}

.social-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 2px solid transparent;
  font-weight: 500;
}

.social-item:hover {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.social-item span {
  transition: var(--transition);
}

.social-icon {
  width: 32px;
  height: 32px;
  margin-right: 0.8em;
  display: inline-block;
  vertical-align: middle;
  transition: var(--transition);
  filter: brightness(0) saturate(100%);
}

.social-item:hover .social-icon {
  filter: brightness(0) invert(1);
  transform: scale(1.1);
}

/* 页脚 */
footer {
  text-align: center;
  color: var(--text-lighter);
  font-size: 0.95rem;
  padding: 3rem 0 2rem 0;
  background: none;
}

.beian {
  color: var(--text-lighter);
  font-size: 0.92rem;
  text-decoration: none;
  margin-top: 0.2em;
  display: inline-block;
  transition: var(--transition);
}

.beian:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* 深绿色主题变量 */
:root {
  --accent: var(--primary-color);
  --accent-dark: var(--primary-hover);
}

.beian-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.modal-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: zoomIn 0.3s ease;
}

.modal-caption {
  margin-top: 1.5rem;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  padding: 0 2rem;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.modal-close:hover {
  transform: rotate(90deg) scale(1.1);
  background: rgba(255,255,255,0.2);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease-out both;
}

.fade-in:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.3s;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header {
    padding: 3rem 1rem 2rem 1rem;
  }
  
  header h1 {
    font-size: 2.2rem;
  }
  
  .subtitle {
    font-size: 1.1rem;
  }
  
  main {
    margin: 2rem auto;
    padding: 0 1rem;
  }
  
  section {
    padding: 1.8rem 1.2rem;
  }
  
  section h2 {
    font-size: 1.5rem;
  }
  
  .photos-scroll {
    gap: 16px;
    padding: 8px 8px 16px 8px;
  }
  
  .photo-item {
    width: 160px;
  }
  
  .photo-wrapper img {
    height: 140px;
  }
  
  .social-links {
    gap: 0.8rem;
  }
  
  .social-item {
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }
  
  .modal-close {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    width: 40px;
    height: 40px;
  }
  
  .modal-caption {
    font-size: 1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 1.25rem;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .nav-links a {
    width: 100%;
    text-align: center;
  }
  
  .home-container {
    padding: 0 1rem;
  }
  
  .profile-name {
    font-size: 1.5rem;
  }
  
  .content-section {
    padding: 1.5rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .quick-link-card {
    flex-direction: column;
    text-align: center;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  main {
    padding: 0 0.75rem;
  }
  
  section {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }
  
  .photos-scroll {
    gap: 12px;
  }
  
  .photo-item {
    width: 140px;
  }
  
  .photo-wrapper img {
    height: 120px;
  }
  
  .social-item {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: center;
    min-width: 140px;
  }
  
  .works-placeholder {
    padding: 2rem 1rem;
  }
  
  .works-placeholder p {
    font-size: 1rem;
  }
}

/* 深色模式样式 */
[data-theme="dark"],
body.dark-mode {
  --text-color: #e0e0e0;
  --text-light: #b0b0b0;
  --text-lighter: #888;
  --bg-color: #1a1a1a;
  --card-bg: #2a2a2a;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

[data-theme="dark"] body,
body.dark-mode {
  background: linear-gradient(135deg, #1b3e1f 0%, #2d4e2f 100%);
}

[data-theme="dark"] section,
body.dark-mode section {
  background: var(--card-bg);
  border-color: #3a3a3a;
}

[data-theme="dark"] .search-box input,
body.dark-mode .search-box input {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: var(--text-color);
}

[data-theme="dark"] .filter-btn,
body.dark-mode .filter-btn {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: var(--text-color);
}

[data-theme="dark"] .filter-chip,
body.dark-mode .filter-chip {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: var(--text-color);
}

[data-theme="dark"] .filter-chip.active,
body.dark-mode .filter-chip.active {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .publication-item,
body.dark-mode .publication-item {
  background: var(--card-bg);
  border-color: #3a3a3a;
}

[data-theme="dark"] .expandable-content,
body.dark-mode .expandable-content {
  background: #1a1a1a;
  border-color: #3a3a3a;
}

/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

[data-theme="dark"] .theme-toggle,
body.dark-mode .theme-toggle {
  border-color: rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
}

/* 减少动画（尊重用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
