/* ===== 基础重置 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #e07a5f;
  --primary-light: #f2a68d;
  --secondary: #3d405b;
  --accent: #81b29a;
  --accent-light: #a8d5ba;
  --bg: #faf9f7;
  --bg-alt: #f0eeeb;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 导航栏 ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}

#navbar.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  padding: 10px 0;
}

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

.nav-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

#navbar.scrolled .nav-logo {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

#navbar.scrolled .nav-links a {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

#navbar.scrolled .nav-toggle span {
  background: var(--secondary);
}

/* ===== Hero 首屏 ===== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('assets/hero-bg.jpg') center/cover no-repeat;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(61, 64, 91, 0.85) 0%,
    rgba(129, 178, 154, 0.6) 50%,
    rgba(224, 122, 95, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 24px;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: float 3s ease-in-out infinite;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 24px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.tag {
  padding: 8px 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.tag:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.hero-btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--white);
  color: var(--secondary);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.wheel {
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  animation: scroll 1.5s infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ===== 通用 Section ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  color: var(--secondary);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ===== 关于我 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 2;
}

.about-text strong {
  color: var(--secondary);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--white);
  padding: 28px 20px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.stat-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.stat-card h3 {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 6px;
}

.stat-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== 教育背景 ===== */
.timeline {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--accent);
  transition: var(--transition);
}

.timeline-item.active .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 6px rgba(224, 122, 95, 0.2);
}

.timeline-content {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-hover);
}

.timeline-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-content h3 {
  font-size: 1.3rem;
  color: var(--secondary);
  margin-bottom: 4px;
}

.timeline-content h4 {
  font-size: 1.05rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-content p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.timeline-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-skills span {
  padding: 4px 14px;
  background: var(--bg-alt);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--secondary);
  border: 1px solid rgba(0,0,0,0.06);
}

/* ===== 兴趣爱好 ===== */
.hobbies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.hobby-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.hobby-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.hobby-img {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.hobby-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hobby-card:hover .hobby-img img {
  transform: scale(1.08);
}

.hobby-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 64, 91, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.hobby-card:hover .hobby-overlay {
  opacity: 1;
}

.hobby-overlay span {
  font-size: 3rem;
  transform: scale(0.5);
  transition: var(--transition);
}

.hobby-card:hover .hobby-overlay span {
  transform: scale(1);
}

.hobby-info {
  padding: 28px;
}

.hobby-info h3 {
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.hobby-info p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===== 作品集 ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item.large {
  grid-column: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--white);
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

.gallery-caption h4 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.gallery-caption p {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ===== 联系我 ===== */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-desc {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 40px;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--secondary);
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  color: var(--primary);
}

.contact-icon {
  width: 24px;
  height: 24px;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

/* ===== 页脚 ===== */
footer {
  padding: 40px 0;
  text-align: center;
  background: var(--secondary);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* ===== 子页面头部 ===== */
.page-header {
  position: relative;
  height: 45vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('assets/hero-bg.jpg') center/cover no-repeat;
  overflow: hidden;
}

.page-header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(61, 64, 91, 0.88) 0%,
    rgba(129, 178, 154, 0.65) 50%,
    rgba(224, 122, 95, 0.75) 100%
  );
}

.page-header .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 24px;
}

/* ===== 课程卡片 ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.course-card {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.course-number {
  font-family: 'Noto Serif SC', serif;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(224, 122, 95, 0.12);
  position: absolute;
  top: 12px;
  right: 20px;
  line-height: 1;
}

.course-card h3 {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.course-card > p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.course-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-points li {
  padding: 4px 14px;
  background: var(--bg-alt);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--secondary);
}

/* ===== 笔记卡片 ===== */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.note-card {
  background: var(--white);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.note-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.note-category {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--white);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 16px;
  align-self: flex-start;
}

.note-card h3 {
  font-size: 1.15rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.note-card > p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 16px;
}

.note-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.note-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.note-link:hover {
  color: var(--secondary);
  transform: translateX(4px);
  display: inline-block;
}

/* ===== 项目卡片 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.project-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.08);
}

.project-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 14px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
}

.project-status.completed {
  background: var(--accent);
}

.project-info {
  padding: 24px;
}

.project-info h3 {
  font-size: 1.15rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.project-info > p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  padding: 4px 12px;
  background: var(--bg-alt);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--secondary);
}

/* ===== 动画 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    color: var(--text) !important;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hobbies-grid {
    grid-template-columns: 1fr;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 180px;
  }

  .gallery-item.large {
    grid-column: span 2;
  }

  .section {
    padding: 70px 0;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }

  .gallery-item.large {
    grid-column: span 1;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .hero-avatar {
    width: 110px;
    height: 110px;
  }

  .hero-tags {
    gap: 8px;
  }

  .tag {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
}
