/* ===== CSS 变量 ===== */
:root {
  --yellow: #FFD76D;
  --cream: #FFFDF7;
  --coral: #FF8C8C;
  --blue: #7EC8E3;
  --text: #4A3728;
  --text-light: #8B7355;
  --card-bg: #FFFFFF;
  --card-shadow: 0 4px 20px rgba(255, 140, 140, 0.15);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-main);
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 253, 247, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid rgba(255, 215, 109, 0.3);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

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

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
}

.nav-logo:hover {
  color: var(--coral);
  transform: scale(1.05);
}

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

.nav-link {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--coral);
  background: rgba(255, 140, 140, 0.08);
}

.nav-link.active {
  color: #fff;
  background: var(--coral);
}

/* 汉堡菜单 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 253, 247, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 12px;
    transform: translateY(-120%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    z-index: -1;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .hamburger {
    display: flex;
  }
}

/* ===== 区域显隐 ===== */
.section {
  display: none;
  min-height: 100vh;
  padding: 100px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.section.active {
  display: block;
}

.section-title {
  font-size: 2.2rem;
  text-align: center;
  color: var(--text);
  margin-bottom: 48px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--yellow);
  border-radius: 2px;
  margin: 12px auto 0;
}

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

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ===== 首页 Hero ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
  text-align: center;
  padding: 60px 0;
}

.hero-img-wrap {
  display: inline-block;
  margin-bottom: 32px;
}

.hero-img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--yellow);
  box-shadow: 0 8px 40px rgba(255, 215, 109, 0.35);
  transition: var(--transition);
}

.hero-img:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 12px 50px rgba(255, 215, 109, 0.5);
}

/* 浮动动画 */
.floating {
  animation: float 3s ease-in-out infinite;
}

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

.hero-name {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-quote {
  font-size: 1.25rem;
  color: var(--coral);
  font-weight: 500;
  margin-bottom: 48px;
  background: rgba(255, 140, 140, 0.08);
  padding: 12px 28px;
  border-radius: var(--radius-full);
}

.hero-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 36px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  min-width: 140px;
}

.hero-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 36px rgba(255, 140, 140, 0.25);
  background: var(--yellow);
}

.card-emoji {
  font-size: 2.2rem;
}

.hero-card span:last-child {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ===== 关于我 ===== */
.about-container {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.about-avatar {
  flex-shrink: 0;
}

.about-avatar img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--coral);
  box-shadow: 0 8px 30px rgba(255, 140, 140, 0.25);
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  flex: 1;
}

.attr-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
  border-left: 4px solid var(--yellow);
}

.attr-card:nth-child(odd) {
  border-left-color: var(--coral);
}

.attr-card:nth-child(3n) {
  border-left-color: var(--blue);
}

.attr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(255, 140, 140, 0.2);
}

.attr-icon {
  font-size: 1.6rem;
}

.attr-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.attr-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
    align-items: center;
  }

  .about-avatar img {
    width: 150px;
    height: 150px;
  }

  .about-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ===== 日常动态 ===== */
.timeline {
  max-width: 660px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--yellow), var(--coral), var(--blue));
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  gap: 28px;
  margin-bottom: 36px;
  position: relative;
  padding-left: 48px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 8px;
  width: 20px;
  height: 20px;
  background: var(--yellow);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(255, 140, 140, 0.2);
  z-index: 2;
}

.timeline-item:nth-child(odd)::before {
  background: var(--coral);
}

.timeline-date {
  flex-shrink: 0;
  width: 110px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--coral);
  padding-top: 6px;
}

.timeline-content {
  background: var(--card-bg);
  padding: 18px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  flex: 1;
  transition: var(--transition);
}

.timeline-content:hover {
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(255, 140, 140, 0.2);
}

.timeline-content p {
  line-height: 1.7;
  color: var(--text);
}

@media (max-width: 768px) {
  .timeline-item {
    padding-left: 40px;
  }

  .timeline-date {
    width: 80px;
    font-size: 0.8rem;
  }
}

/* ===== 相册 ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
  aspect-ratio: 1;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(255, 140, 140, 0.25);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.gallery-hint {
  text-align: center;
  margin-top: 24px;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* 灯箱 */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 36px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

/* ===== 装饰元素 ===== */
.deco {
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

/* 星星：用 CSS 绘制 */
.deco-star-1 {
  top: 15%;
  right: 8%;
  width: 40px;
  height: 40px;
  background: var(--yellow);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: twinkle 2s ease-in-out infinite;
}

.deco-star-2 {
  top: 70%;
  left: 6%;
  width: 30px;
  height: 30px;
  background: var(--coral);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: twinkle 2.5s ease-in-out 0.8s infinite;
}

.deco-star-3 {
  bottom: 10%;
  right: 10%;
  width: 24px;
  height: 24px;
  background: var(--blue);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: twinkle 2.2s ease-in-out 0.4s infinite;
}

/* 云朵：用 CSS 绘制 */
.deco-cloud-1 {
  top: 25%;
  left: 10%;
  width: 100px;
  height: 40px;
  background: white;
  border-radius: 40px;
  box-shadow:
    25px -18px 0 8px white,
    60px -8px 0 4px white;
  opacity: 0.6;
  animation: drift 8s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(30px); }
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-light);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 215, 109, 0.3);
}

/* ===== 响应式字体 ===== */
@media (max-width: 768px) {
  .hero-name { font-size: 2.2rem; }
  .hero-quote { font-size: 1.05rem; }
  .section-title { font-size: 1.8rem; }
  .hero-img { width: 180px; height: 180px; }
}
