/*
  style.css — Peng 个人主页
  设计：全屏沉浸式问题页 + 主页面板块布局
  色调：墨黑 #1a1a1a，暖白 #faf8f5，点缀 #c9a96e（暗金）/ #5b8c5a（墨绿）
  移动端适配：viewport、768px 媒体查询、flex 弹性布局、无横向滚动
*/

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* 禁止横向滚动 */
  overflow-x: hidden;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'STKaiti', 'KaiTi', sans-serif;
  background: #faf8f5;
  color: #1a1a1a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* 防止移动端字体缩放 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 确保宽度不超出屏幕 */
  max-width: 100vw;
}

/* 所有图片和视频自适应宽度 */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== Full-screen Page ========== */
.fullscreen-page {
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100vw;
  height: 100%;
  height: 100vh;
  /* iOS Safari 兼容 */
  height: -webkit-fill-available;
  overflow: hidden;
  z-index: 1;
}

/* ========== 移动端播放引导覆盖层 ========== */
.mobile-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
}

.mobile-play-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-play-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.mobile-play-btn {
  width: 100px;
  height: 100px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
  animation: playBtnPulse 2s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.mobile-play-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.mobile-play-btn svg {
  width: 80px;
  height: 80px;
}

@keyframes playBtnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(255,255,255,0); }
}

.mobile-play-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-align: center;
  animation: fadeInUp 0.8s ease 0.3s both;
}

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

/* ========== Video Intro ========== */
.video-intro {
  z-index: 100;
  background: #000;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  background: #000;
}

/* 手机端：完整显示视频（contain），避免 16:9 横屏视频在竖屏手机上被裁切到边缘丢失 */
@media (max-width: 768px) {
  .intro-video {
    object-fit: contain;
    /* 上下自然留黑边，与 .video-intro 的 #000 背景融为一体 */
  }
}

.video-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  pointer-events: none;
  background: rgba(0,0,0,0.6);
  transition: opacity 0.4s ease;
}

.video-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.3) 0%,
    rgba(0,0,0,0.15) 30%,
    rgba(0,0,0,0.15) 70%,
    rgba(0,0,0,0.5) 100%
  );
  pointer-events: none;
}

/* 幽默字幕 */
.video-captions {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
}

.caption {
  position: absolute;
  text-align: center;
  color: #fff;
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.8;
  text-shadow: 0 2px 20px rgba(0,0,0,0.7), 0 0 60px rgba(0,0,0,0.4);
  padding: 1rem 2rem;
  max-width: 90vw;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.caption.show {
  opacity: 1;
  transform: translateY(0);
}

/* 底部区域 */
.video-bottom-hint {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom, 2rem));
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.video-bottom-hint > span {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

.skip-video-btn {
  padding: 0.55rem 1.6rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.35s ease;
  font-family: inherit;
  /* 手机端更易点击 */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.skip-video-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .video-bottom-hint {
    flex-direction: column;
    gap: 0.6rem;
    bottom: max(1.2rem, env(safe-area-inset-bottom, 1.2rem));
  }

  .caption {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    padding: 0.8rem 1rem;
    max-width: 95vw;
  }
}

/* ========== Question Pages ========== */
.question-page {
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-page.active {
  opacity: 1;
  pointer-events: auto;
}

.question-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0a0a0f;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 桌面端 contain + 两侧高级渐变填充 */
@media (min-width: 769px) {
  .question-bg {
    background-size: contain;
    background-color: transparent;
  }

  /* 渐变氛围直接设在 question-page 上，透过 question-bg 的透明区域显示 */
  #q1 {
    background:
      radial-gradient(ellipse at 0% 50%, rgba(30, 50, 120, 1) 0%, rgba(25, 40, 100, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 100% 50%, rgba(30, 50, 120, 1) 0%, rgba(25, 40, 100, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 0% 20%, rgba(130, 90, 200, 0.25) 0%, transparent 45%),
      radial-gradient(ellipse at 100% 80%, rgba(130, 90, 200, 0.25) 0%, transparent 45%),
      #0a0a18;
  }

  #q2 {
    background:
      radial-gradient(ellipse at 0% 50%, rgba(50, 35, 15, 1) 0%, rgba(60, 42, 18, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 100% 50%, rgba(50, 35, 15, 1) 0%, rgba(60, 42, 18, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 0% 70%, rgba(200, 150, 60, 0.2) 0%, transparent 45%),
      radial-gradient(ellipse at 100% 30%, rgba(200, 150, 60, 0.2) 0%, transparent 45%),
      #0e0a04;
  }

  #q3 {
    background:
      radial-gradient(ellipse at 0% 50%, rgba(12, 45, 30, 1) 0%, rgba(15, 55, 35, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 100% 50%, rgba(12, 45, 30, 1) 0%, rgba(15, 55, 35, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 0% 40%, rgba(60, 170, 100, 0.18) 0%, transparent 45%),
      radial-gradient(ellipse at 100% 60%, rgba(60, 170, 100, 0.18) 0%, transparent 45%),
      #040e08;
  }

  #q4 {
    background:
      radial-gradient(ellipse at 0% 50%, rgba(35, 20, 60, 1) 0%, rgba(45, 25, 75, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 100% 50%, rgba(35, 20, 60, 1) 0%, rgba(45, 25, 75, 0.85) 30%, transparent 65%),
      radial-gradient(ellipse at 0% 60%, rgba(140, 80, 200, 0.2) 0%, transparent 45%),
      radial-gradient(ellipse at 100% 40%, rgba(140, 80, 200, 0.2) 0%, transparent 45%),
      #0a0610;
  }
}

.question-page.active .question-bg {
  transform: scale(1.03);
}

.question-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.45) 100%);
}

/* 各问题页默认主题渐变（当CDN图片未加载时的兜底） */
#q1 .question-bg {
  background-image: linear-gradient(170deg, #0d1b2a 0%, #1b2838 30%, #1565a0 60%, #2989c4 100%);
}
#q2 .question-bg {
  background-image: linear-gradient(170deg, #1a1208 0%, #2a1f10 30%, #1976b8 60%, #3598cc 100%);
}
#q3 .question-bg {
  background-image: linear-gradient(170deg, #0a1a10 0%, #122a1a 30%, #2e7d48 60%, #4a9a5e 100%);
}
#q4 .question-bg {
  background-image: linear-gradient(170deg, #0f0a1a 0%, #1a1030 30%, #388056 60%, #5aaa6e 100%);
}

/* ========== Question Card ========== */
.question-card {
  position: absolute;
  z-index: 2;
  width: min(340px, 88vw);
  padding: 1.8rem 1.5rem 1.5rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.3) inset;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

/* 前两题（Q1 Q2）→ 浅蓝色卡片 */
#q1 .question-card,
#q2 .question-card {
  background: rgba(215, 235, 252, 0.85);
  border: 1px solid rgba(160, 200, 235, 0.6);
  box-shadow: 0 20px 60px rgba(100, 150, 200, 0.15), 0 0 0 1px rgba(200, 225, 250, 0.4) inset;
}

/* 后两题（Q3 Q4）→ 浅绿色卡片 */
#q3 .question-card,
#q4 .question-card {
  background: rgba(210, 242, 220, 0.85);
  border: 1px solid rgba(150, 210, 170, 0.6);
  box-shadow: 0 20px 60px rgba(100, 170, 130, 0.15), 0 0 0 1px rgba(200, 235, 210, 0.4) inset;
}

.question-page.active .question-card {
  transform: translateY(0);
  opacity: 1;
}

.question-card .q-number {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: #999;
  margin-bottom: 0.6rem;
  font-family: 'SF Mono', 'Consolas', monospace;
}

.question-card label {
  display: block;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.8rem;
  letter-spacing: 0.04em;
}

.question-card input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  font-size: 1rem;
  color: #1a1a1a;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
  /* 手机端防止自动缩放 */
  font-size: max(16px, 1rem);
  /* 禁止 iOS 圆角覆盖 */
  -webkit-appearance: none;
  appearance: none;
}

.question-card input:focus {
  border-color: #c9a96e;
  box-shadow: 0 0 0 8px rgba(201,169,110,0.1);
  background: rgba(255,255,255,0.95);
}

.question-card .q-tip {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: #8a8a8a;
  line-height: 1.5;
}

.q-next-btn {
  display: block;
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.85rem 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a1a1a, #333);
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  /* 手机端最小点击区域 */
  min-height: 48px;
}

.q-next-btn:hover {
  background: linear-gradient(135deg, #333, #1a1a1a);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}

.q-enter-btn {
  background: linear-gradient(135deg, #c9a96e, #b8944a);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.q-enter-btn:hover {
  background: linear-gradient(135deg, #d4b87a, #c9a96e);
  box-shadow: 0 8px 30px rgba(201,169,110,0.4);
}

/* ========== Question Card 位置（桌面） ========== */
.q-pos-1 { bottom: 14%; left: 8%; }
.q-pos-2 { bottom: 18%; right: 6%; }
.q-pos-3 { top: 22%; right: 10%; }
.q-pos-4 { bottom: 16%; right: 8%; }

/* ========== 移动端：问题卡片居中 ========== */
@media (max-width: 768px) {
  .q-pos-1,
  .q-pos-2,
  .q-pos-3,
  .q-pos-4 {
    top: auto;
    bottom: auto;
    left: 50%;
    right: auto;
    /* 垂直居中偏下 */
    top: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    width: min(360px, 92vw);
  }

  .question-page.active .q-pos-1,
  .question-page.active .q-pos-2,
  .question-page.active .q-pos-3,
  .question-page.active .q-pos-4 {
    transform: translate(-50%, -50%);
  }

  /* 有键盘弹起时往上移 */
  @supports (height: 100dvh) {
    .q-pos-1,
    .q-pos-2,
    .q-pos-3,
    .q-pos-4 {
      top: 45%;
    }
  }
}

@media (max-width: 480px) {
  .question-card {
    width: min(340px, 93vw);
    padding: 1.4rem 1.2rem 1.2rem;
  }
  .question-card .q-tip {
    font-size: 0.8rem;
  }
}

/* ========== Progress Dots ========== */
.q-progress {
  position: fixed;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.q-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: 1.5px solid rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.35s ease;
}

.q-dot.active {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.6);
  transform: scale(1.3);
}

.q-dot.done {
  background: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.9);
}

@media (max-width: 768px) {
  .q-progress {
    right: 0.5rem;
    gap: 0.7rem;
  }
  .q-dot {
    width: 8px;
    height: 8px;
  }
}

/* ========== Page Transition: 问题页淡出 ========== */
.question-page.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ========== Main Content ========== */
.main-content {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  width: 100%;
}

/* ========== Main Nav ========== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  /* 防止内容溢出 */
  flex-wrap: wrap;
  gap: 0.4rem;
}

.main-nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1a1a;
  font-family: 'STKaiti', 'KaiTi', serif;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  flex-wrap: nowrap;
}

.nav-links a {
  text-decoration: none;
  color: #555;
  font-size: 0.93rem;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
  position: relative;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #c9a96e;
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active-link {
  color: #1a1a1a;
}

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

/* 导航移动端适配 */
@media (max-width: 768px) {
  .main-nav {
    padding: 0.7rem 1rem;
    gap: 0.3rem;
  }
  .nav-links {
    gap: 0.9rem;
  }
  .nav-links a {
    font-size: 0.82rem;
  }
  .nav-brand {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .main-nav {
    padding: 0.6rem 0.8rem;
  }
  .nav-links {
    gap: 0.55rem;
  }
  .nav-links a {
    font-size: 0.73rem;
    padding: 0.3rem 0;
  }
  .nav-brand {
    font-size: 0.95rem;
  }
}

/* ========== Hero Section ========== */
.hero {
  position: relative;
  height: 60vh;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  max-width: 960px;
  margin: 5rem auto 0;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: #1a1a1a;
  background-size: cover;
  background-position: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, rgba(245,240,232,0.55) 0%, rgba(237,228,211,0.45) 30%, rgba(232,220,200,0.5) 60%, rgba(250,248,245,0.7) 100%);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(91,140,90,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #bbb;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 2;
  white-space: nowrap;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 768px) {
  .hero {
    height: 42vh;
    min-height: 240px;
    margin: 3.5rem 0.8rem 0;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .hero {
    height: 38vh;
    min-height: 200px;
    margin: 3.2rem 0.6rem 0;
    border-radius: 12px;
  }
  .hero-scroll-hint {
    font-size: 0.75rem;
    bottom: 1.2rem;
  }
}

/* ========== Side Panels（纸张分隔区域） ========== */
.side-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  width: clamp(40px, 8vw, 160px);
}

.side-panel-left {
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(235, 230, 220, 0.9) 0%,
    rgba(240, 236, 228, 0.7) 30%,
    rgba(245, 242, 236, 0.4) 60%,
    rgba(250, 248, 245, 0) 100%
  );
  border-right: 1px solid rgba(180, 170, 150, 0.2);
  box-shadow: inset -4px 0 12px rgba(0,0,0,0.03);
}

.side-panel-right {
  right: 0;
  background: linear-gradient(
    270deg,
    rgba(235, 230, 220, 0.9) 0%,
    rgba(240, 236, 228, 0.7) 30%,
    rgba(245, 242, 236, 0.4) 60%,
    rgba(250, 248, 245, 0) 100%
  );
  border-left: 1px solid rgba(180, 170, 150, 0.2);
  box-shadow: inset 4px 0 12px rgba(0,0,0,0.03);
}

/* 移动端隐藏侧边装饰 */
@media (max-width: 768px) {
  .side-panel {
    display: none;
  }
}

/* ========== Welcome Banner ========== */
.welcome-banner {
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
  background: #faf8f5;
}

.welcome-banner p {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-weight: 700;
  color: #3a3a3a;
  letter-spacing: 0.08em;
  line-height: 1.6;
  margin: 0;
  word-break: keep-all;
}

@media (max-width: 480px) {
  .welcome-banner {
    padding: 2rem 1rem 1rem;
  }
}

/* ========== Section Panels ========== */
.panel {
  padding: 5rem 1.5rem;
  overflow: hidden;
}

.panel-alt {
  background: #f3efe8;
}

.panel-inner {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.panel-title {
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-family: 'STKaiti', 'KaiTi', serif;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: 0.08em;
  position: relative;
}

.panel-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: #c9a96e;
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .panel {
    padding: 3rem 1rem;
  }
}

@media (max-width: 480px) {
  .panel {
    padding: 2.5rem 0.8rem;
  }
}

/* ========== About ========== */
.about-body {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.about-avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8dcc8, #d4c5a9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.about-text {
  flex: 1;
  min-width: 260px;
}

.about-lead {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.8rem;
}

.about-text p {
  color: #555;
  font-size: clamp(0.9rem, 2.5vw, 1.02rem);
  line-height: 1.85;
  margin-bottom: 0.8rem;
}

@media (max-width: 768px) {
  .about-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  .about-text {
    min-width: unset;
    width: 100%;
  }
}

/* ========== Hobbies ========== */
.hobbies-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.trait-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0,0,0,0.04);
}

.trait-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

.trait-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.8rem;
}

.trait-card h3 {
  font-size: 1.05rem;
  color: #1a1a1a;
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.trait-card p {
  color: #777;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: left;
}

@media (max-width: 768px) {
  .hobbies-body {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .trait-card {
    padding: 1.4rem 1.1rem;
  }
  .trait-card p {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .hobbies-body {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
}

/* ========== Dreams & Travel ========== */
.dream-quote {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.dream-quote p {
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: clamp(0.95rem, 2.5vw, 1.3rem);
  color: #888;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.8;
}

/* 相册网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.7rem;
  margin-bottom: 2.5rem;
}

.gallery-card {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.gallery-card::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.gallery-card:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.gallery-img {
  width: 100%;
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: #e8dcc8;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-card:hover .gallery-img {
  transform: scale(1.08);
  filter: brightness(0.7);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }
  .gallery-img {
    height: 100px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  .gallery-img {
    height: 90px;
  }
}

.dream-list {
  background: #fff;
  border-radius: 16px;
  padding: 1.8rem 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.dream-list h3 {
  font-size: 1.1rem;
  color: #1a1a1a;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.dream-list ul {
  list-style: none;
}

.dream-list li {
  padding: 0.65rem 0;
  color: #555;
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  letter-spacing: 0.03em;
}

.dream-list li:last-child {
  border-bottom: none;
}

@media (max-width: 480px) {
  .dream-list {
    padding: 1.4rem 1.2rem;
  }
}

/* ========== Projects & Experience ========== */
.proj-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.proj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 2.5rem;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.06em;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  min-height: 52px;
}

.proj-btn-left {
  background: linear-gradient(135deg, #3b5998, #4a6fa5);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59,89,152,0.25);
}

.proj-btn-left:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(59,89,152,0.4);
}

.proj-btn-right {
  background: linear-gradient(135deg, #5b8c5a, #6da67d);
  color: #fff;
  box-shadow: 0 4px 20px rgba(91,140,90,0.25);
}

.proj-btn-right:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(91,140,90,0.4);
}

@media (max-width: 480px) {
  .proj-buttons {
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .proj-btn {
    padding: 0.9rem 1.8rem;
    min-width: 120px;
    font-size: 0.9rem;
  }
}

.proj-category {
  margin-bottom: 2.5rem;
}

.proj-category > h3 {
  font-size: 1.15rem;
  color: #1a1a1a;
  margin-bottom: 1.2rem;
  letter-spacing: 0.04em;
}

/* ========== Thanks List ========== */
.thanks-intro {
  text-align: center;
  color: #888;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.thanks-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.thanks-list span {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: #fff;
  border-radius: 999px;
  color: #555;
  font-size: clamp(0.8rem, 2.5vw, 0.92rem);
  letter-spacing: 0.04em;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.25s ease;
}

.thanks-list span:hover {
  background: #f3efe8;
  color: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.thanks-ending {
  text-align: center;
  color: #aaa;
  font-size: clamp(0.82rem, 2.2vw, 0.9rem);
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

@media (max-width: 480px) {
  .thanks-list {
    gap: 0.4rem;
  }
  .thanks-list span {
    padding: 0.35rem 0.7rem;
  }
}

/* ========== Footer ========== */
.main-footer {
  text-align: center;
  padding: 4rem 1.5rem max(3rem, env(safe-area-inset-bottom, 3rem));
  background: #1a1a1a;
  color: #ccc;
}

.main-footer h2 {
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  color: #aaa;
  word-break: break-all;
}

.footer-item a {
  color: #c9a96e;
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-item a:hover {
  color: #d4b87a;
}

.footer-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.footer-copy {
  font-size: 0.82rem;
  color: #666;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .main-footer {
    padding: 3rem 1.2rem max(2rem, env(safe-area-inset-bottom, 2rem));
  }
  .footer-links {
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
  }
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* 防止背景滚动穿透 */
  overflow: hidden;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  /* 移动端滚动顺滑 */
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), inset 0 0 80px rgba(139,119,80,0.08);
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-letter {
  background: #fdf8ed;
  background-image:
    linear-gradient(rgba(180,160,120,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,160,120,0.12) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 30%, rgba(210,185,140,0.25) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 80%, rgba(190,160,120,0.15) 0%, transparent 60%);
  background-size: 100% 2.2rem, 2.2rem 100%, 100% 100%, 100% 100%;
  border: 2px solid #d4c5a0;
  box-shadow:
    0 4px 24px rgba(120,90,50,0.25),
    inset 0 0 60px rgba(200,175,130,0.1),
    0 0 0 8px #f5eedb,
    0 0 0 10px #c8b88a;
}

.modal-letter::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(200,170,110,0.18) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(190,155,100,0.13) 0%, transparent 35%);
  pointer-events: none;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #b8a070;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 2;
  line-height: 1;
  /* 手机端更易点击 */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.modal-close:hover {
  color: #7a5e3e;
}

.modal-title {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  color: #5a3e2b;
  text-align: center;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  padding-right: 2rem;
}

.modal-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #c8a86a, #d4bc8a, #c8a86a);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}

.modal-body {
  position: relative;
  z-index: 1;
}

.modal-project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-project-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: rgba(255,255,255,0.5);
  border: 1px dashed #d4c5a0;
  border-radius: 6px;
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  font-size: clamp(1rem, 3vw, 1.15rem);
  flex-wrap: wrap;
}

.modal-project-label {
  font-weight: 700;
  color: #5a3e2b;
  min-width: 70px;
  flex-shrink: 0;
}

.modal-project-url {
  color: #b8a070;
  font-style: italic;
  word-break: break-all;
}

.modal-project-detail {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  line-height: 1.8;
  color: #5a3e2b;
}

.modal-project-detail a {
  color: #7a5c3a;
  text-decoration: underline;
  word-break: break-all;
}

.modal-essay {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  line-height: 2rem;
  color: #4a3520;
  letter-spacing: 0.03em;
}

.modal-essay p {
  text-indent: 2em;
  margin-bottom: 0.8rem;
}

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

@media (max-width: 768px) {
  .modal-box {
    padding: 1.8rem 1.2rem 1.5rem;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px;
  }

  .modal-letter {
    box-shadow:
      0 4px 20px rgba(120,90,50,0.25),
      inset 0 0 40px rgba(200,175,130,0.1),
      0 0 0 4px #f5eedb,
      0 0 0 6px #c8b88a;
  }

  .modal-essay {
    font-size: 0.95rem;
    line-height: 1.9rem;
  }
}

/* ========== Gallery Lightbox ========== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1rem;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: min(90vw, 100%);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* 图片自适应 */
  display: block;
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: max(1.2rem, env(safe-area-inset-top, 1.2rem));
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: color 0.25s;
  z-index: 1;
  line-height: 1;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-label {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom, 2rem));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .lightbox-img {
    max-width: 98vw;
    max-height: 80vh;
    border-radius: 6px;
  }
  .lightbox-close {
    top: 0.5rem;
    right: 0.8rem;
    font-size: 2rem;
  }
}