/* ===== CSS 变量 ===== */
:root {
  --army-dark: #1a1a0e;
  --army-green: #2d4a1e;
  --army-olive: #4a5c2a;
  --army-khaki: #8b8c4a;
  --army-sand: #c8b87a;
  --army-gold: #d4a017;
  --army-rust: #8b3a1e;
  --red-army: #8b1a1a;
  --red-light: #c0392b;
  --cream: #f5f0e0;
  --parchment: #e8dfc0;
  --aged-paper: #d4c8a0;
  --text-dark: #2c2416;
  --text-mid: #5a4a30;
  --text-light: #f5f0e0;
  --border-gold: rgba(212,160,23,0.4);
  --shadow: rgba(0,0,0,0.5);
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}
body {
  font-family: 'Noto Serif SC', 'SimSun', '宋体', 'Georgia', serif;
  font-weight: 500;
  background: var(--army-dark);
  color: var(--text-dark);
  overflow-x: hidden;
  max-width: 100%;
  font-size: 18px; /* 全局基准字体放大 */
  line-height: 1.7; /* 行高也适当加大，提高可读性 */
}


/* ===== 粒子背景 ===== */
#particles {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.particle {
  position: absolute; border-radius: 50%;
  background: rgba(212,160,23,0.3);
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-20px) rotate(360deg); opacity: 0; }
}

/* ===== 导航栏 ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15,15,8,0.95);
  border-bottom: 2px solid var(--army-gold);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem 0 2rem; height: 72px; /* 加高导航栏以容纳更大字体 */
  padding-right: 5.5rem; /* 右侧为黑胶唱片（64px）留出空间 */
}
.nav-logo {
  font-size: 1.25rem; color: var(--army-gold);
  letter-spacing: 0.1em; white-space: nowrap;
  display: flex; align-items: center; gap: 0.5rem;
}
.star-icon { color: var(--army-gold); font-size: 1rem; }
.nav-links {
  list-style: none; display: flex; gap: 0.3rem;
  flex-wrap: wrap;
}
.nav-links li a {
  color: var(--cream); text-decoration: none;
  padding: 0.5rem 0.8rem; border-radius: 4px;
  font-size: 1rem; transition: all 0.2s;
  letter-spacing: 0.05em;
}
.nav-links li a:hover { color: var(--army-gold); background: rgba(212,160,23,0.1); }
.admin-btn {
  background: var(--red-army) !important;
  border: 1px solid rgba(200,80,80,0.5) !important;
  color: #fff !important;
  border-radius: 4px;
}
.admin-btn:hover { background: var(--red-light) !important; }
.hamburger {
  display: none;
  cursor: pointer;
  color: var(--army-gold);
  font-size: 1.5rem;
  position: relative;
  z-index: 1002;
  line-height: 1;
  padding: 0;
  border: 1px solid rgba(212,160,23,0.45);
  background: rgba(15,15,8,0.88);
  border-radius: 8px;
}


/* ===== 英雄区 ===== */
#hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: 
    linear-gradient(135deg, rgba(26,26,14,0.92) 0%, rgba(45,74,30,0.85) 50%, rgba(26,26,14,0.95) 100%),
    repeating-linear-gradient(
      45deg,
      transparent, transparent 10px,
      rgba(212,160,23,0.03) 10px, rgba(212,160,23,0.03) 20px
    );
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(139,60,30,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(45,74,30,0.2) 0%, transparent 60%);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(212,160,23,0.08)'/%3E%3C/svg%3E") repeat;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 2rem;
  max-width: 900px;
}
.hero-badge {
  display: inline-block;
  border: 1px solid var(--army-gold);
  color: var(--army-gold);
  padding: 0.5rem 1.8rem;
  letter-spacing: 0.15em; font-size: 1rem;
  margin-bottom: 1.8rem;
  background: rgba(212,160,23,0.08);
}
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  color: var(--cream);
  letter-spacing: 0.15em;
  line-height: 1.3;
  white-space: nowrap;
  text-shadow: 0 0 40px rgba(212,160,23,0.3), 0 4px 20px rgba(0,0,0,0.5);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  font-weight: 700;
  gap: 0;
}
.name-xu { color: #e8d5a0; flex-shrink: 0; }
.divider-dot { color: var(--army-gold); margin: 0 0.5em; flex-shrink: 0; font-size: 0.9em; }
.name-zeng { color: #ffb3b3; flex-shrink: 0; }
.hero-subtitle {
  color: rgba(245,240,224,0.7); font-size: 1.15rem;
  letter-spacing: 0.12em; margin-bottom: 0.6rem;
}
.hero-quote {
  margin: 2rem auto 2.5rem;
  max-width: 550px;
  color: var(--army-gold);
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  padding: 1rem 1.8rem;
  border-left: 3px solid var(--army-gold);
  border-right: 3px solid var(--army-gold);
  background: rgba(212,160,23,0.06);
  font-style: italic;
}
.hero-btn {
  display: inline-block;
  background: var(--army-gold);
  color: var(--army-dark);
  padding: 0.9rem 2.8rem;
  font-size: 1.15rem; font-weight: bold;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: all 0.3s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.hero-btn:hover {
  background: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212,160,23,0.4);
}
.hero-scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}
.scroll-arrow { color: var(--army-gold); font-size: 1.5rem; }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-10px); } }

/* ===== 通用区块头部 ===== */
section { position: relative; z-index: 1; }
.section-header { text-align: center; padding: 4.5rem 2rem 2.5rem; }
.dark-header { background: var(--army-dark); }
.section-badge {
  display: inline-block;
  border: 1px solid var(--army-gold);
  color: var(--army-gold);
  padding: 0.35rem 1.2rem;
  font-size: 0.95rem; letter-spacing: 0.2em;
  margin-bottom: 1.2rem;
  background: rgba(212,160,23,0.08);
}
.section-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--text-dark);
  letter-spacing: 0.15em; margin-bottom: 1rem;
  font-weight: 700;
}
.dark-header .section-title { color: var(--cream); }
.title-decoration { color: var(--army-gold); font-size: 1.05rem; letter-spacing: 0.3em; }
.title-decoration.light { color: rgba(212,160,23,0.7); }

/* ===== 人物介绍区 ===== */
#profiles { background: var(--parchment); padding-bottom: 4rem; }
.profiles-container {
  max-width: 1300px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 2.5rem; padding: 0 2rem 2rem;
}
.profile-card {
  background: var(--cream);
  border: 1px solid rgba(139,140,74,0.3);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  display: flex; gap: 1.5rem;
  padding: 1.8rem;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.profile-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--army-olive), var(--army-gold), var(--army-olive));
}
.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}
.profile-photo-wrap { flex-shrink: 0; text-align: center; }
.profile-photo {
  width: 100%;
  height: 100%;
}
.profile-photo-frame {
  width: 140px; height: 170px;
  border: 3px solid var(--army-olive);
  padding: 4px;
  background: var(--aged-paper);
  position: relative;
}
.profile-photo-frame::before {
  content: '';
  position: absolute; inset: 4px;
  border: 1px dashed rgba(139,140,74,0.4);
  pointer-events: none;
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d4c8a0, #c8b87a);
  position: relative;
  overflow: hidden; /* 确保图片不溢出 */
}
.rank-badge {
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--army-olive);
  color: var(--army-sand);
  font-size: 0.95rem; padding: 5px 4px;
  letter-spacing: 0.08em; text-align: center;
  z-index: 2;
}
.red-badge { background: var(--red-army) !important; }
.silhouette-xu {
  font-size: 4rem; color: var(--army-olive);
  font-weight: bold; opacity: 0.4; margin-top: 1rem;
  z-index: 1;
}
/* 使用img标签显示头像 */
.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 改为contain，确保图片完整显示 */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1; /* 提高层级，确保在背景之上 */
}
.profile-ribbon {
  margin-top: 0.6rem; font-size: 0.75rem;
  color: var(--army-gold);
  background: var(--army-dark);
  padding: 4px 10px; letter-spacing: 0.08em;
}
.red-ribbon { background: var(--red-army) !important; }
.profile-info { flex: 1; display: flex; flex-direction: column; }
.profile-name {
  font-size: 2.1rem; color: var(--army-dark);
  letter-spacing: 0.15em; margin-bottom: 0.3rem;
  font-weight: 700;
}
.profile-alias { color: var(--army-khaki); font-size: 1rem; margin-bottom: 1.2rem; }
.profile-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.95rem; margin-bottom: 1.2rem;
}
.profile-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(139,140,74,0.2);
  vertical-align: top;
}
.profile-table td:first-child {
  color: var(--army-olive); font-weight: bold;
  white-space: nowrap; width: 90px;
}
.profile-intro {
  font-size: 0.98rem; line-height: 1.9;
  color: var(--text-mid); margin-bottom: 1.5rem;
  flex: 1;
}
.btn-detail {
  background: var(--army-olive); color: var(--cream);
  border: none; padding: 0.6rem 1.8rem;
  cursor: pointer; font-size: 0.98rem;
  letter-spacing: 0.1em; transition: all 0.2s;
}
.btn-detail:hover { background: var(--army-gold); color: var(--army-dark); }
.red-btn { background: var(--red-army) !important; }
.red-btn:hover { background: var(--red-light) !important; color: #fff !important; }

/* ===== 时间轴 ===== */
#timeline { background: var(--army-dark); padding: 0 0 4rem; overflow: hidden; }
.timeline-container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem; position: relative;
}
.timeline-container::before {
  content: '';
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--army-gold) 5%, var(--army-gold) 95%, transparent);
  transform: translateX(-50%);
}
/* 时间轴列标题 */
.timeline-header-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(212,160,23,0.2);
}
.tl-header-xu {
  text-align: right; padding-right: 1.5rem;
  color: var(--army-sand); font-size: 1.05rem;
  letter-spacing: 0.15em;
}
.tl-header-zeng {
  text-align: left; padding-left: 1.5rem;
  color: #ffb3b3; font-size: 1.05rem;
  letter-spacing: 0.15em;
}
.tl-header-center { text-align: center; color: var(--army-gold); font-size: 0.85rem; }
/* 每一行都使用三列grid: 左侧内容 | 中间dot | 右侧内容 */
.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: flex-start;
  margin-bottom: 1.8rem;
  position: relative;
}
.tl-left {
  grid-column: 1;
  padding-right: 1.5rem;
}
.tl-center {
  grid-column: 2;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 0.8rem;
  position: relative;
}
.tl-right {
  grid-column: 3;
  padding-left: 1.5rem;
}
/* 内容卡片 */
.tl-content {
  background: rgba(45,74,30,0.2);
  border: 1px solid rgba(212,160,23,0.2);
  padding: 1rem 1.2rem;
  position: relative;
  transition: all 0.3s;
}
/* 徐沛霖内容靠左，文字右对齐 */
.tl-left .tl-content {
  text-align: right;
  border-right: 3px solid var(--army-olive);
}
.tl-left .tl-content:hover {
  background: rgba(45,74,30,0.4);
  border-color: var(--army-gold);
  border-right-color: var(--army-gold);
  transform: scale(1.02);
}
/* 曾雪痕内容靠右，文字左对齐 */
.tl-right .tl-content {
  text-align: left;
  border-left: 3px solid var(--red-army);
}
.tl-right .tl-content:hover {
  background: rgba(139,26,26,0.2);
  border-color: var(--red-light);
  border-left-color: var(--red-light);
  transform: scale(1.02);
}
/* 双人内容 - 跨越两列 */
.tl-both-wrap {
  grid-column: 1 / -1;
  display: flex; justify-content: center;
  margin: 0.5rem 0;
  position: relative; /* 关键：建立层叠上下文 */
  z-index: 5; /* 确保在时间轴竖线上方 */
}
.tl-both-wrap .tl-content {
  max-width: 500px; width: 100%; text-align: center;
  border: 2px solid rgba(212,160,23,0.4);
  border-top: 3px solid var(--army-gold);
  background: rgba(30,40,20,0.95); /* 深色半透明背景，遮挡竖线 */
}
.tl-both-wrap .tl-content:hover {
  background: rgba(40,50,30,0.98);
  border-color: var(--army-gold);
  transform: scale(1.02);
}
.tl-year {
  color: var(--army-gold); font-weight: bold;
  font-size: 1.2rem; letter-spacing: 0.1em; margin-bottom: 0.4rem;
}
.tl-title { color: var(--cream); font-size: 1rem; margin-bottom: 0.4rem; }
.tl-desc { color: rgba(245,240,224,0.6); font-size: 0.92rem; line-height: 1.75; }
.tl-person {
  display: inline-block;
  font-size: 0.82rem; padding: 3px 10px;
  margin-bottom: 0.5rem;
}
.tl-xu { background: var(--army-olive); color: var(--cream); }
.tl-zeng { background: var(--red-army); color: #fff; }
.tl-both { background: var(--army-gold); color: var(--army-dark); }
/* 历史误差标注样式 */
.tl-note {
  display: inline-block;
  color: var(--army-gold);
  font-size: 0.78rem;
  border: 1px solid rgba(212,160,23,0.4);
  padding: 2px 8px;
  margin-top: 0.4rem;
  background: rgba(212,160,23,0.06);
  cursor: help;
  font-style: italic;
}
.tl-dot {
  width: 14px; height: 14px;
  background: var(--army-gold); border-radius: 50%;
  border: 2px solid var(--army-dark);
  flex-shrink: 0;
  z-index: 2;
}
.tl-dot.xu-dot { background: var(--army-olive); border-color: var(--army-gold); }
.tl-dot.zeng-dot { background: var(--red-army); border-color: #ff8888; }
.tl-dot.both-dot { background: var(--army-gold); border-color: var(--cream); width: 18px; height: 18px; }
.tl-spacer { flex: 1; }

/* ===== 历史相册（方案一：展柜陈列式） ===== */
#album { background: var(--parchment); padding-bottom: 4rem; }

/* --- 展柜展示区 --- */
.gallery-showcase-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 0 2.5rem 2rem;
}
.gallery-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.5rem;
}

/* 每个展柜项 */
.showcase-item {
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.4s, transform 0.4s;
}
.showcase-item.show { opacity: 1; transform: translateY(0); }

/* 相框 —— 浅米木色，与羊皮纸背景协调 */
.showcase-frame {
  width: 100%;
  background: #c8b070;          /* 浅金木色边框底 */
  border: 2px solid #a0893a;    /* 外框深金棕线 */
  padding: 10px;
  box-shadow: 0 4px 18px rgba(80,55,10,0.22),
              inset 0 0 0 1px rgba(255,240,180,0.35);
  position: relative;
  transition: all 0.4s;
}
/* 内嵌边线，仿博物馆镶框 */
.showcase-frame::before {
  content: '';
  position: absolute; inset: 4px;
  border: 1px solid rgba(160,137,58,0.5);
  pointer-events: none;
}
.showcase-item:hover .showcase-frame {
  border-color: #d4a017;
  box-shadow: 0 8px 32px rgba(80,55,10,0.38),
              0 0 18px rgba(212,160,23,0.22);
  transform: translateY(-5px);
}
.showcase-frame img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; display: block;
  filter: sepia(20%) brightness(0.92);
  transition: filter 0.4s;
}
.showcase-item:hover .showcase-frame img {
  filter: sepia(5%) brightness(1.0);
}

/* 编号标牌 */
.showcase-num {
  margin-top: 0.9rem;
  font-size: 0.62rem; letter-spacing: 0.28em;
  color: #6b4c18;               /* 深棕色，在浅背景上清晰可读 */
}
/* 说明文字 */
.showcase-caption {
  margin-top: 0.3rem;
  font-size: 0.88rem; color: #4a3210; /* 深棕色文字 */
  text-align: center; letter-spacing: 0.05em;
  line-height: 1.5;
}

/* 展柜占位 */
.showcase-placeholder {
  width: 100%; aspect-ratio: 4/3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d4c8a0, #b8a870);
  gap: 0.5rem; font-size: 2.2rem;
}
.showcase-placeholder-text {
  font-size: 0.8rem; color: var(--text-mid);
  text-align: center; padding: 0 0.5rem;
}

/* --- 进入全部照片按钮 --- */
.album-enter-wrap {
  display: flex; justify-content: center;
  padding: 2.8rem 2rem 0.5rem;
}
.album-enter-btn {
  display: flex; align-items: center; gap: 1.2rem;
  background: var(--army-dark);
  border: 1px solid rgba(212,160,23,0.5);
  color: var(--cream); text-decoration: none;
  padding: 1.2rem 2.4rem; border-radius: 4px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.album-enter-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,160,23,0.06), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.album-enter-btn:hover { border-color: var(--army-gold); box-shadow: 0 6px 30px rgba(0,0,0,0.5); }
.album-enter-btn:hover::before { opacity: 1; }
.album-enter-icon { font-size: 1.5rem; color: var(--army-gold); opacity: 0.85; }
.album-enter-text {
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--army-gold);
}
.album-enter-sub {
  font-size: 0.82rem; color: var(--army-sand); letter-spacing: 0.06em;
}
.album-enter-arrow {
  font-size: 1.4rem; color: var(--army-gold);
  transition: transform 0.3s; margin-left: 0.4rem;
}
.album-enter-btn:hover .album-enter-arrow { transform: translateX(5px); }

/* 旧版 album-grid/album-item/filter-btn 保留给 album.html 二级页 */
.album-filter {
  display: flex; justify-content: center; gap: 1rem;
  padding: 1rem 2rem 2rem; flex-wrap: wrap;
}
.filter-btn {
  padding: 0.4rem 1.2rem;
  background: transparent;
  border: 1px solid var(--army-olive);
  color: var(--army-olive);
  cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--army-olive); color: var(--cream);
}
.album-grid {
  max-width: 1300px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem; padding: 0 2rem;
}
.album-item {
  cursor: pointer; position: relative; overflow: hidden;
  background: var(--aged-paper);
  border: 2px solid rgba(139,140,74,0.3);
  transition: all 0.3s;
  aspect-ratio: 3/4;
}
.album-item:hover { transform: scale(1.03); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: var(--army-gold); }
.album-item img {
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(20%) brightness(0.95);
  transition: filter 0.3s;
}
.album-item:hover img { filter: sepia(0%) brightness(1); }
.album-item .album-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(15,15,8,0.85);
  color: var(--army-sand);
  font-size: 0.82rem; padding: 0.5rem 0.6rem;
  transform: translateY(100%); transition: transform 0.3s;
}
.album-item:hover .album-caption { transform: translateY(0); }
.album-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #d4c8a0, #b8a870);
  font-size: 2.5rem;
}
.album-placeholder-text {
  font-size: 0.82rem; color: var(--text-mid);
  text-align: center; padding: 0 0.6rem;
}
/* 灯箱 */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 2000;
  align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 0; /* 明确为最底层，不遮挡任何子元素 */
}
.lightbox-content {
  position: relative; z-index: 1;
  max-width: 88vw;
  display: flex; flex-direction: column; align-items: center;
  /* 为顶部关闭按钮留出空间 */
  padding-top: 2.8rem;
}
.lightbox-content img {
  /* 默认缩小尺寸，确保关闭按钮始终可见 */
  max-width: min(75vw, 700px);
  max-height: 65vh;
  object-fit: contain;
  border: 2px solid var(--army-gold);
  cursor: zoom-in;
  transition: opacity 0.2s ease;
  border-radius: 2px;
}
/* 放大状态：全屏铺满，让宽图/大图最大化显示 */
.lightbox-content img.zoomed {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: rgba(0,0,0,0.96);
  z-index: 2020;
  border: none;
  border-radius: 0;
  cursor: zoom-out;
  margin: 0;
  padding: 3rem 0 3.5rem; /* 顶部留关闭按钮位，底部留caption位 */
  box-sizing: border-box;
}
/* 放大时 caption 浮在底部 */
.lightbox-content:has(img.zoomed) .lightbox-caption,
.lightbox-content.zoomed-active .lightbox-caption {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2021;
  background: rgba(10,10,5,0.88);
  padding: 0.6rem 1rem;
  text-align: center;
  backdrop-filter: blur(6px);
  max-width: 100%;
}
/* 放大时关闭按钮浮在顶部右侧 */
.lightbox-content:has(img.zoomed) .lightbox-close,
.lightbox-content.zoomed-active .lightbox-close {
  position: fixed;
  top: 0.6rem; right: 0.8rem;
  z-index: 2022;
}
/* 放大时 zoom hint 隐藏（已是放大状态，提示无意义） */
.lightbox-content:has(img.zoomed) .lightbox-zoom-hint,
.lightbox-content.zoomed-active .lightbox-zoom-hint {
  display: none;
}
.lightbox-zoom-hint {
  color: rgba(212,160,23,0.5);
  font-size: 0.72rem;
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
  transition: opacity 0.3s;
}
.lightbox-caption {
  color: var(--army-sand); margin-top: 0.5rem;
  font-size: 0.9rem; text-align: center;
  max-width: 600px;
}
.lightbox-close {
  position: absolute; top: 0; right: 0;
  background: rgba(15,15,8,0.85);
  border: 1px solid rgba(212,160,23,0.5);
  color: var(--army-gold); font-size: 1.3rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.lightbox-close:hover { background: var(--army-gold); color: var(--army-dark); }
.lightbox-prev, .lightbox-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(212,160,23,0.2);
  border: 1px solid var(--army-gold);
  color: var(--army-gold);
  font-size: 2rem; padding: 0.5rem 1rem;
  cursor: pointer; transition: all 0.2s; z-index: 2010;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(212,160,23,0.4); }

/* ===== 家庭成员 ===== */
#family { background: #111108; padding-bottom: 4rem; }
.family-tree-wrap { max-width: 1200px; margin: 0 auto; padding: 0 2rem 2rem; }
.family-parents {
  display: flex; align-items: center; justify-content: center;
  gap: 2rem; margin-bottom: 1rem;
}
.family-connector {
  color: var(--red-light);
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}
.family-member-card {
  background: rgba(45,74,30,0.25);
  border: 1px solid rgba(212,160,23,0.3);
  padding: 1.4rem 1.5rem;
  text-align: center;
  min-width: 160px;
  position: relative;
  transition: all 0.3s;
}
.family-member-card:hover {
  background: rgba(45,74,30,0.45);
  border-color: var(--army-gold);
  transform: translateY(-3px);
}
/* 父母双卡：桌面端统一尺寸；资料信息按固定行槽渲染，确保两侧高低与节奏一致 */
.patriarch { border-top: 3px solid var(--army-gold); width: 260px; height: 300px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.matriarch { border-top: 3px solid var(--red-light); width: 260px; height: 300px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.member-icon { font-size: 2.3rem; margin-bottom: 0.6rem; }
.member-name { color: var(--cream); font-size: 1.4rem; letter-spacing: 0.08em; line-height: 1.3; }
.member-info {
  color: rgba(245,240,224,0.6);
  font-size: 0.88rem;
  margin: 0.7rem auto 0;
  width: 100%;
  max-width: 16em;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.22rem;
}
.member-info-line {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.65;
  white-space: nowrap;
}
.member-info-line.is-placeholder {
  visibility: hidden;
}
.member-role {
  display: inline-block; background: var(--army-olive);
  color: var(--cream); font-size: 0.82rem;
  padding: 3px 12px; margin-top: auto;
}
.family-branch-line {
  width: 2px; height: 40px; background: var(--army-gold);
  margin: 0 auto; opacity: 0.5;
}
.family-children {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  align-items: stretch;
  margin-bottom: 1rem;
}
.child-card {
  background: rgba(74,92,42,0.2);
  border: 1px solid rgba(139,140,74,0.3);
  padding: 0.8rem 1rem; text-align: center;
  min-width: 120px; position: relative;
  transition: all 0.3s;
  display: flex; flex-direction: column; align-items: center;
}
.child-card:hover { border-color: var(--army-gold); background: rgba(74,92,42,0.35); }
.child-name { color: var(--army-sand); font-size: 1.15rem; letter-spacing: 0.08em; font-weight: 600; }
.child-birth { color: rgba(245,240,224,0.5); font-size: 0.82rem; margin-top: 0.3rem; }
.child-notes { color: rgba(245,240,224,0.4); font-size: 0.75rem; margin-top: 0.4rem; font-style: italic; flex: 1; }
.family-grandchildren-wrap { margin-top: 1.95rem; }
.family-grandchildren-wrap.is-empty { display: none; }
.generation-panel {
  position: relative;
  padding-top: 1.05rem;
}
.generation-panel::before {
  content: '';
  display: block;
  width: min(100%, 40rem);
  height: 1px;
  margin: 0 auto 1.15rem;
  background: linear-gradient(90deg, rgba(212,160,23,0), rgba(212,160,23,0.42), rgba(212,160,23,0));
}
.generation-panel--greatgrand::before {
  background: linear-gradient(90deg, rgba(228,200,114,0), rgba(228,200,114,0.5), rgba(228,200,114,0));
}
.generation-panel--greatgreatgrand::before {
  background: linear-gradient(90deg, rgba(239,217,143,0), rgba(239,217,143,0.56), rgba(239,217,143,0));
}
.grandchildren-title {
  text-align: center; color: var(--army-khaki);
  font-size: 1rem; margin: 0 0 1.35rem;
  letter-spacing: 0.12em;
  line-height: 1.55;
  text-shadow: 0 1px 0 rgba(26,26,14,0.22);
}
.grandchildren-title--greatgrand {
  color: #e4c872;
}
.grandchildren-title--greatgreatgrand {
  color: #efd98f;
}
.grandchildren-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 12rem));
  gap: 1rem 0.95rem;
  justify-content: center;
}
.grandchild-card {
  width: 12rem;
  min-height: 7.6rem;
  background: linear-gradient(180deg, rgba(74,92,42,0.34) 0%, rgba(45,74,30,0.46) 100%);
  border: 1px solid rgba(212,160,23,0.28);
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
  padding: 0.95rem 1rem 0.9rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.38rem;
  border-radius: 0.35rem;
  transition: all 0.25s ease;
}
.grandchild-card:hover {
  border-color: rgba(212,160,23,0.45);
  background: linear-gradient(180deg, rgba(92,112,52,0.38) 0%, rgba(58,88,36,0.5) 100%);
}
.grandchild-card--greatgrand {
  background: linear-gradient(180deg, rgba(96,122,54,0.42) 0%, rgba(58,94,37,0.56) 100%);
  border-color: rgba(224,184,76,0.4);
  box-shadow: 0 12px 24px rgba(26, 28, 16, 0.2);
}
.grandchild-card--greatgrand:hover {
  border-color: rgba(232,198,104,0.56);
  background: linear-gradient(180deg, rgba(112,140,62,0.48) 0%, rgba(70,108,45,0.62) 100%);
}
.grandchild-card--greatgreatgrand {
  background: linear-gradient(180deg, rgba(122,146,66,0.48) 0%, rgba(74,112,44,0.62) 100%);
  border-color: rgba(240,205,112,0.48);
  box-shadow: 0 12px 26px rgba(22, 25, 14, 0.22);
}
.grandchild-card--greatgreatgrand:hover {
  border-color: rgba(248,220,138,0.62);
  background: linear-gradient(180deg, rgba(138,164,76,0.54) 0%, rgba(86,124,50,0.66) 100%);
}
.grandchild-name {
  color: #f0e3ba;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.4;
}
.grandchild-card--greatgrand .grandchild-name {
  color: #f6ebbf;
}
.grandchild-card--greatgreatgrand .grandchild-name {
  color: #fff1c7;
}
.grandchild-info {
  color: rgba(245,240,224,0.72);
  font-size: 0.79rem;
  line-height: 1.55;
  flex: 0 0 auto;
}
.grandchild-card .grandchild-info:first-of-type {
  min-height: 2.45em;
}
.grandchild-card--greatgrand .grandchild-info {
  color: rgba(249, 244, 226, 0.82);
}
.grandchild-card--greatgreatgrand .grandchild-info {
  color: rgba(252, 247, 232, 0.88);
}





.family-legacy-intro {
  max-width: 860px;
  margin: 0 auto 1.4rem;
  text-align: center;
}
.family-summary-stage {
  margin: 0 0 0.8rem;
  color: var(--army-gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.family-summary-lead {
  margin: 0;
  color: rgba(245,240,224,0.78);
  line-height: 1.95;
  font-size: 1rem;
}
.family-summary-grid {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
}
.family-summary-card {
  background: linear-gradient(180deg, rgba(45,74,30,0.3) 0%, rgba(26,36,18,0.82) 100%);
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 0.45rem;
  padding: 1.2rem 1rem 1.1rem;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}
.family-summary-card-label {
  color: rgba(245,240,224,0.72);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}
.family-summary-card-count {
  margin-top: 0.45rem;
  color: #f3e3a5;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
}
.family-summary-card-sub {
  margin-top: 0.35rem;
  color: rgba(245,240,224,0.5);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.family-legacy-actions {
  max-width: 760px;
  margin: 1.6rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.family-access-btn,
.family-gate-btn,
.family-lock-btn,
.family-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.8rem;
  padding: 0.78rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(212,160,23,0.45);
  background: linear-gradient(180deg, rgba(212,160,23,0.24) 0%, rgba(45,74,30,0.65) 100%);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.family-access-btn:hover,
.family-gate-btn:hover,
.family-lock-btn:hover,
.family-page-link:hover {
  transform: translateY(-2px);
  border-color: var(--army-gold);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}
.family-link-arrow {
  font-size: 1rem;
}
.family-access-note {
  margin: 0;
  color: rgba(245,240,224,0.62);
  line-height: 1.9;
}

/* ===== 家族成员私密页 ===== */
.family-subpage {
  background: radial-gradient(circle at top, rgba(45,74,30,0.25), transparent 32%), #111108;
  color: var(--cream);
  min-height: 100vh;
}
.family-page-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: rgba(10,10,6,0.92);
  border-bottom: 1px solid rgba(212,160,23,0.18);
  backdrop-filter: blur(10px);
}
.family-page-brand {
  color: var(--army-gold);
  font-size: 1rem;
  letter-spacing: 0.08em;
}
.family-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.family-access-hero {
  padding: 4.8rem 2rem 2.6rem;
  text-align: center;
}
.family-access-hero h1 {
  color: var(--cream);
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}
.family-access-hero p {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(245,240,224,0.72);
  line-height: 1.9;
}
.family-access-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}
.family-gate-card,
.family-detail-shell {
  background: rgba(18,25,12,0.88);
  border: 1px solid rgba(212,160,23,0.22);
  border-radius: 0.65rem;
  box-shadow: 0 16px 36px rgba(0,0,0,0.2);
}
.family-gate-card {
  padding: 1.6rem;
}
.family-gate-card h2 {
  color: var(--cream);
  margin-top: 0.4rem;
  margin-bottom: 0.75rem;
}
.family-gate-card p {
  color: rgba(245,240,224,0.68);
  line-height: 1.85;
}
.family-gate-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.25rem;
}
.family-gate-input {
  width: min(24rem, 100%);
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(212,160,23,0.3);
  background: rgba(9,13,7,0.94);
  color: var(--cream);
  outline: none;
}
.family-gate-input:focus {
  border-color: var(--army-gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}
.family-access-message {
  min-height: 1.6rem;
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.92rem;
}
.family-access-message.is-error {
  color: #ffb7a8;
}
.family-access-message.is-success {
  color: #cfe8a0;
}
.family-detail-shell {
  margin-top: 1.4rem;
  padding: 1.5rem;
}
.family-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.family-detail-meta {
  color: rgba(245,240,224,0.68);
  line-height: 1.8;
}
.family-tree-wrap--private {
  padding: 0 0 1rem;
}
.family-tree-wrap--private .family-branch-line {
  margin-bottom: 1rem;
}

/* ===== 简历区 ===== */
#resume { background: var(--parchment); padding-bottom: 4rem; }
.resume-tabs {
  display: flex; justify-content: center; gap: 0; flex-wrap: wrap;
  margin-bottom: 2rem; padding: 0 2rem;
}
.tab-btn {
  padding: 0.7rem 1.8rem;
  background: rgba(45,74,30,0.15);
  border: 1px solid rgba(139,140,74,0.3);
  border-right: none;
  color: var(--text-mid); cursor: pointer;
  font-size: 1rem; transition: all 0.2s;
  letter-spacing: 0.05em;
}
.tab-btn:last-child { border-right: 1px solid rgba(139,140,74,0.3); }
.tab-btn.active, .tab-btn:hover {
  background: var(--army-olive); color: var(--cream);
}
.resume-content { max-width: 900px; margin: 0 auto; padding: 0 2rem; }
.resume-content.hidden { display: none; }
.resume-header-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--army-dark);
  color: var(--cream);
  padding: 1.2rem 1.5rem; margin-bottom: 1.5rem;
  border-left: 4px solid var(--army-gold);
}
.red-card { border-left-color: var(--red-light) !important; }
.gold-card { border-left-color: var(--army-gold) !important; background: rgba(45,74,30,0.9) !important; }
.resume-emblem { font-size: 2rem; }
.resume-header-card h3 { font-size: 1.2rem; color: var(--army-gold); letter-spacing: 0.1em; }
.resume-header-card p { font-size: 0.8rem; color: rgba(245,240,224,0.6); margin-top: 0.2rem; }
.resume-list { }
.resume-entry {
  display: flex; gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(139,140,74,0.2);
  transition: background 0.2s;
}
.resume-entry:hover { background: rgba(139,140,74,0.1); }
.resume-entry-year {
  flex-shrink: 0; width: 165px;
  color: var(--army-olive); font-weight: bold;
  font-size: 0.95rem; white-space: nowrap;
}
.resume-entry-content { flex: 1; }
.resume-entry-title {
  color: var(--text-dark); font-size: 1rem;
  font-weight: bold; margin-bottom: 0.25rem;
}
.resume-entry-detail {
  color: var(--text-mid); font-size: 0.9rem; line-height: 1.7;
}
/* 黄埔档案表 */
.huangpu-table-wrap { }
.huangpu-info-table {
  width: 100%; border-collapse: collapse;
  background: var(--cream); font-size: 1rem;
}
.huangpu-info-table th, .huangpu-info-table td {
  border: 1px solid rgba(139,140,74,0.35);
  padding: 0.7rem 0.9rem;
  vertical-align: top;
}
.huangpu-info-table th {
  background: var(--army-olive); color: var(--cream);
  font-weight: normal; text-align: left; width: 140px;
  letter-spacing: 0.05em; white-space: nowrap;
}
.huangpu-info-table td { color: var(--text-dark); }

/* ===== 回忆录区 ===== */
#memoir { background: #111108; padding-bottom: 4rem; }
.memoir-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem; padding: 0 2rem 2rem;
}
.memoir-card {
  background: rgba(45,74,30,0.2);
  border: 1px solid rgba(212,160,23,0.2);
  padding: 1.5rem 1.8rem;
  cursor: pointer; transition: all 0.3s;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.memoir-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--army-gold), transparent);
  transform: scaleX(0); transition: transform 0.3s;
}
.memoir-card:hover::before { transform: scaleX(1); }
.memoir-card:hover {
  background: rgba(45,74,30,0.35);
  border-color: var(--army-gold);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.red-memoir { border-color: rgba(139,26,26,0.3) !important; }
.red-memoir:hover { border-color: var(--red-light) !important; }
.red-memoir::before { background: linear-gradient(90deg, transparent, var(--red-light), transparent) !important; }
.gold-memoir { border-color: rgba(212,160,23,0.35) !important; }
.memoir-tag {
  display: inline-block;
  background: var(--army-olive); color: var(--cream);
  font-size: 0.7rem; padding: 2px 10px;
  margin-bottom: 0.8rem; letter-spacing: 0.1em;
}
.red-tag { background: var(--red-army) !important; }
.gold-tag { background: rgba(212,160,23,0.8) !important; color: var(--army-dark) !important; }
.memoir-card h4 { color: var(--cream); font-size: 1.3rem; margin-bottom: 0.4rem; letter-spacing: 0.08em; }
.memoir-date { color: var(--army-gold); font-size: 0.88rem; margin-bottom: 1rem; }
.memoir-excerpt { color: rgba(245,240,224,0.6); font-size: 0.95rem; line-height: 1.9; margin-bottom: 1.2rem; flex: 1; }
.memoir-read-more { color: var(--army-gold); font-size: 0.92rem; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.88);
  align-items: center; justify-content: center;
  padding: 2rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--parchment);
  border: 1px solid var(--army-gold);
  max-width: 800px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  position: relative;
}
.modal-close {
  position: sticky; top: 0; float: right;
  background: var(--army-dark); border: none;
  color: var(--army-gold); font-size: 1.2rem;
  padding: 0.5rem 0.8rem; cursor: pointer; z-index: 1;
}
.modal-inner { padding: 1.5rem 2rem 2rem; }
.modal-inner h3 {
  color: var(--army-dark); font-size: 1.6rem;
  letter-spacing: 0.1em; margin-bottom: 0.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--army-olive);
}
.modal-meta { color: var(--army-khaki); font-size: 0.92rem; margin-bottom: 1.8rem; }
.modal-body {
  color: var(--text-mid); font-size: 1.05rem;
  line-height: 2.1; text-indent: 2em;
}
.modal-body p { margin-bottom: 1em; }
/* 回忆录诗文专用排版类 */
.memoir-section-title {
  font-size: 1.1rem; color: var(--army-green); font-weight: bold;
  text-align: center; margin: 2rem 0 1rem;
}
.memoir-poem-wrap {
  text-align: center; margin: 1.5rem 0;
}
.memoir-poem {
  display: inline-block; text-align: left;
  font-family: 'SimSun','Songti SC','Noto Serif CJK SC',serif;
  line-height: 2.2; font-size: 0.95rem; letter-spacing: 0.08em;
}
.memoir-poem-spacer { height: 0.8em; }
.memoir-sign {
  text-align: right; color: var(--text-mid);
  margin-top: 0.5rem;
}

/* ===== 页脚 ===== */
footer {
  background: #0a0a06;
  border-top: 2px solid rgba(212,160,23,0.3);
  text-align: center; padding: 4rem 2rem;
}
.footer-emblem {
  color: var(--army-gold); font-size: 2rem;
  letter-spacing: 0.2em; margin-bottom: 1.2rem;
  font-weight: 700;
}
.footer-motto { color: rgba(245,240,224,0.65); font-size: 1.3rem; font-style: italic; margin-bottom: 0.9rem; line-height: 1.8; }
.footer-years { color: var(--army-gold); font-size: 1.2rem; letter-spacing: 0.2em; margin-bottom: 0.8rem; }
.footer-credit { color: rgba(245,240,224,0.45); font-size: 1rem; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--army-dark); }
::-webkit-scrollbar-thumb { background: var(--army-olive); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--army-gold); }

/* ===== 黑胶唱片音乐播放器（嵌入导航栏右端） ===== */
.vinyl-player {
  position: fixed;
  top: 4px; right: 1.2rem;   /* 纵向居中于导航栏(72px)内，横向与导航链接区分隔 */
  z-index: 1001;              /* 高于导航栏(1000)，保证显示 */
  width: 64px; height: 64px;
  cursor: pointer;
  user-select: none;
}

/* 唱片圆盘 */
.vinyl-disc {
  width: 64px; height: 64px; border-radius: 50%;
  position: relative;
  /* 黑胶同心纹路 */
  background:
    radial-gradient(circle at 50% 50%, #1a0a0a 0%, #1a0a0a 18%,
      transparent 18.5%, transparent 19.5%,
      rgba(200,0,0,0.18) 19.5%, rgba(200,0,0,0.18) 24%,
      transparent 24.5%, transparent 25.5%,
      rgba(255,255,255,0.04) 25.5%, rgba(255,255,255,0.04) 28%,
      transparent 28%, transparent 30%,
      rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.03) 33%,
      transparent 33%, transparent 35%,
      rgba(255,255,255,0.025) 35%, rgba(255,255,255,0.025) 38%,
      transparent 38%, transparent 40%,
      rgba(255,255,255,0.02) 40%, rgba(255,255,255,0.02) 43%,
      transparent 43%, transparent 45%,
      rgba(255,255,255,0.015) 45%, rgba(255,255,255,0.015) 48%,
      transparent 48%, #1a0808 50%),
    radial-gradient(circle at 50% 50%, #1a0808 0%, #0d0505 100%);
  border: 3px solid #b22222;
  box-shadow:
    0 0 0 1px rgba(180,30,30,0.5),
    0 0 14px rgba(180,30,30,0.3),
    0 4px 16px rgba(0,0,0,0.65),
    inset 0 0 10px rgba(0,0,0,0.5);
  animation: vinyl-spin 4s linear infinite;
  animation-play-state: paused;
  transition: box-shadow 0.3s;
}
.vinyl-disc.spinning {
  animation-play-state: running;
}
.vinyl-player:hover .vinyl-disc {
  box-shadow:
    0 0 0 2px rgba(180,30,30,0.8),
    0 0 24px rgba(200,30,30,0.5),
    0 6px 22px rgba(0,0,0,0.75),
    inset 0 0 10px rgba(0,0,0,0.5);
}
@keyframes vinyl-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 唱片中心标签 */
.vinyl-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle, #8b1a1a 0%, #5a0e0e 100%);
  border: 1px solid rgba(212,160,23,0.6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

/* 中心音符：随唱片一起旋转（不反向抵消），播放时才转 */
.vinyl-note {
  font-size: 0.82rem;
  color: var(--army-gold);
  display: block;
  /* 暂停时静止，播放时跟随唱片旋转（由父元素 vinyl-disc 的动画带动） */
}

/* 悬停提示气泡（在唱片下方显示） */
.vinyl-tooltip {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: rgba(10,8,0,0.92);
  border: 1px solid rgba(212,160,23,0.5);
  color: var(--army-gold); font-size: 0.75rem;
  padding: 0.3rem 0.7rem; border-radius: 3px;
  white-space: nowrap; letter-spacing: 0.06em;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.vinyl-player:hover .vinyl-tooltip {
  opacity: 1; transform: translateY(0);
}

/* 响应式：手机端将唱片移到右下角，并把层级压到导航栏下方，避免遮挡汉堡按钮 */
@media (max-width: 767px) {
  .vinyl-player {
    top: auto;
    left: auto;
    right: max(0.8rem, env(safe-area-inset-right, 0px));
    bottom: calc(6.2rem + env(safe-area-inset-bottom, 0px));
    z-index: 990;
    width: 56px;
    height: 56px;
  }
  .vinyl-disc { width: 56px; height: 56px; }
}
@media (max-width: 480px) {
  .vinyl-player {
    top: auto;
    left: auto;
    right: max(0.6rem, env(safe-area-inset-right, 0px));
    bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
    z-index: 990;
    width: 48px;
    height: 48px;
  }
  .vinyl-disc { width: 48px; height: 48px; }
}


/* ===== 留言祭拜区 ===== */
#tribute { background: var(--army-dark); padding-bottom: 4rem; }
.section-sub {
  color: rgba(245,240,224,0.5); font-size: 1rem;
  margin-top: 0.6rem; letter-spacing: 0.05em;
}

/* 祭拜操作按钮 */
.tribute-actions {
  display: flex; justify-content: center; gap: 1.5rem;
  flex-wrap: wrap; padding: 1.8rem 2rem;
  max-width: 700px; margin: 0 auto;
}
.tribute-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: rgba(45,74,30,0.2);
  border: 1px solid rgba(212,160,23,0.25);
  padding: 0.9rem 1.4rem; cursor: pointer;
  color: var(--cream); font-size: 0.95rem;
  min-width: 90px; transition: all 0.3s;
  letter-spacing: 0.05em;
}
.tribute-btn:hover {
  background: rgba(212,160,23,0.15);
  border-color: var(--army-gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212,160,23,0.2);
}
.tribute-emoji { font-size: 2.1rem; }
.tribute-count {
  background: var(--army-gold); color: var(--army-dark);
  font-size: 1rem; padding: 2px 10px;
  border-radius: 10px; min-width: 32px; text-align: center;
  font-weight: bold;
}
.flower-btn:hover { border-color: #ffaacc; }
.wine-btn:hover { border-color: #aa8855; }
.incense-btn:hover { border-color: #ccaaff; }
.bow-btn:hover { border-color: var(--red-light); }

/* 漂浮动画区 */
.tribute-float-area {
  position: relative; height: 60px;
  overflow: visible; pointer-events: none;
  max-width: 700px; margin: 0 auto;
}
.float-item {
  position: absolute; bottom: 0;
  font-size: 1.5rem;
  animation: floatUp2 2.5s ease-out forwards;
  pointer-events: none;
}
@keyframes floatUp2 {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* 留言表单 */
.tribute-form-wrap {
  max-width: 700px; margin: 0 auto;
  padding: 0 2rem;
}
.tribute-form-title {
  color: var(--army-sand); font-size: 1rem;
  letter-spacing: 0.1em; margin-bottom: 1rem;
}
.tribute-form {
  background: rgba(45,74,30,0.15);
  border: 1px solid rgba(212,160,23,0.2);
  padding: 1.5rem;
}
.form-row {
  display: flex; gap: 0.8rem; margin-bottom: 0.8rem; flex-wrap: wrap;
}
.tribute-input, .tribute-select, .tribute-textarea {
  background: rgba(15,15,8,0.6);
  border: 1px solid rgba(212,160,23,0.3);
  color: var(--cream);
  padding: 0.7rem 1rem;
  font-family: inherit; font-size: 1rem;
  outline: none; transition: border-color 0.2s;
}
.tribute-input:focus, .tribute-select:focus, .tribute-textarea:focus {
  border-color: var(--army-gold);
}
.tribute-input { flex: 1; min-width: 140px; }
.tribute-select {
  background: rgba(15,15,8,0.8);
  color: var(--cream); cursor: pointer;
}
.tribute-select option { background: #1a1a0e; }
.tribute-textarea {
  width: 100%; resize: vertical; min-height: 90px;
  display: block;
}
.form-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.8rem;
}
.char-count { color: rgba(245,240,224,0.35); font-size: 0.85rem; }
.tribute-submit-btn {
  background: var(--army-olive);
  border: none; color: var(--cream);
  padding: 0.65rem 2rem;
  cursor: pointer; font-size: 1rem;
  letter-spacing: 0.1em; transition: all 0.2s;
}
.tribute-submit-btn:hover { background: var(--army-gold); color: var(--army-dark); }

/* 留言展示 */
.tribute-messages-wrap {
  max-width: 700px; margin: 2rem auto 0;
  padding: 0 2rem;
}
.tribute-messages-title {
  color: var(--army-sand); font-size: 1rem;
  letter-spacing: 0.1em; margin-bottom: 1rem;
}
.tribute-messages { display: flex; flex-direction: column; gap: 1rem; }
.tribute-msg-card {
  background: rgba(45,74,30,0.18);
  border: 1px solid rgba(212,160,23,0.18);
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--army-olive);
  position: relative;
  animation: fadeInMsg 0.4s ease-out;
}
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.tribute-msg-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
}
.tribute-msg-name {
  color: var(--army-gold); font-size: 1rem;
  font-weight: bold; letter-spacing: 0.05em;
}
.tribute-msg-relation {
  display: inline-block;
  background: rgba(212,160,23,0.12);
  border: 1px solid rgba(212,160,23,0.3);
  color: var(--army-sand);
  font-size: 0.75rem; padding: 2px 8px;
  margin-left: 0.6rem;
}
.tribute-msg-time {
  color: rgba(245,240,224,0.3); font-size: 0.82rem;
}
.tribute-msg-text {
  color: rgba(245,240,224,0.7); font-size: 0.98rem;
  line-height: 1.8;
}
.tribute-msg-icons {
  margin-top: 0.4rem;
  font-size: 0.9rem; opacity: 0.7;
}
.tribute-empty {
  color: rgba(245,240,224,0.3); font-size: 0.88rem;
  text-align: center; padding: 2rem; font-style: italic;
}

/* ===== 触摸优化 - 确保最小触摸目标 44px ===== */
.nav-links li a,
button,
.filter-btn,
.album-item,
.tribute-btn,
.lightbox-close,
.lightbox-prev,
.lightbox-next,
.hamburger {
  min-height: 44px;
  min-width: 44px;
}

/* 按钮和链接的触摸反馈 */
button:active,
.filter-btn:active,
.tribute-btn:active,
.nav-links li a:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* 禁用文本选择（提升触摸体验） */
.vinyl-player,
.hamburger,
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  user-select: none;
  -webkit-user-select: none;
}

/* ===== 响应式 - 平板端 (768px - 1024px) ===== */
@media (max-width: 1024px) {
  .nav-inner { padding: 0 1.5rem; }
  .hero-content { padding: 0 1.5rem; }
  .profiles-container { gap: 2rem; }
  .album-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 响应式 - 大手机端 (481px - 767px) ===== */
@media (max-width: 767px) {
  body { font-size: 16px; }
  #navbar { z-index: 1005; }
  .nav-inner { height: 64px; padding: 0 1rem; gap: 0.75rem; }
  .nav-logo {
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
  }
  .nav-logo span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-links {
    top: 64px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  #hero { width: 100%; }
  .hero-content {
    width: 100%;
    max-width: 100%;
    padding: 2rem 1rem 0;
  }
  .hero-badge {
    display: block;
    width: min(100%, 28rem);
    margin: 0 auto 1.5rem;
    padding: 0.55rem 1rem;
    line-height: 1.5;
    letter-spacing: 0.08em;
  }
  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    white-space: normal;
    flex-wrap: wrap;
    gap: 0.1em 0.22em;
    padding: 0 0.25rem;
  }
  .divider-dot { margin: 0 0.2em; }
  .hero-subtitle {
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 0 0.5rem;
  }
  .section-title { font-size: 1.8rem; }
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .profiles-container { padding: 0 1rem; width: 100%; box-sizing: border-box; }
  .profile-card { width: 100%; box-sizing: border-box; padding: 1.4rem 1rem; }
  .family-tree-wrap { padding: 0 1rem; }
  .family-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-page-topbar {
    padding: 0.9rem 1rem;
    align-items: flex-start;
    flex-direction: column;
  }
  .family-page-links { width: 100%; }
  .family-page-link { flex: 1; }
  .family-access-shell { padding: 0 1rem 3rem; }
  .family-gate-card,
  .family-detail-shell { padding: 1.2rem; }
  .family-gate-form {
    flex-direction: column;
    align-items: stretch;
  }
  .family-gate-input,
  .family-gate-btn,
  .family-lock-btn { width: 100%; }
  .family-grandchildren-wrap { margin-top: 1.65rem; }
  .generation-panel {
    padding-top: 0.95rem;
    padding-inline: 0.1rem;
  }
  .generation-panel::before {
    width: min(100%, 18rem);
    margin-bottom: 1rem;
  }
  .grandchildren-title {
    font-size: 0.96rem;
    margin: 0 0 1.05rem;
    letter-spacing: 0.09em;
    line-height: 1.6;
    padding: 0 0.35rem;
  }
  .grandchildren-grid {
    grid-template-columns: repeat(auto-fit, minmax(10.9rem, 10.9rem));
    gap: 0.82rem 0.7rem;
  }
  .grandchild-card {
    width: 10.9rem;
    min-height: 7.15rem;
    padding: 0.86rem 0.88rem 0.8rem;
    border-radius: 0.42rem;
  }
  .grandchild-card .grandchild-info:first-of-type { min-height: 2.55em; }
  .grandchild-name {
    font-size: 1rem;
    line-height: 1.38;
  }
  .grandchild-info {
    font-size: 0.775rem;
    line-height: 1.6;
  }
  .tribute-form-wrap { padding: 0 1rem; }


  .resume-content { padding: 0 1rem; }
  .resume-tabs { flex-wrap: wrap; gap: 0.5rem; }
  .resume-tabs button { flex: 1; min-width: 120px; }
  .huangpu-table-wrap { overflow-x: hidden; }
  .huangpu-table-wrap table { min-width: 0; table-layout: fixed; }
  .huangpu-info-table { font-size: 0.92rem; }
  .huangpu-info-table th,
  .huangpu-info-table td {
    padding: 0.6rem 0.65rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}




/* ===== 响应式 - 小手机端 (≤480px) ===== */
@media (max-width: 480px) {
  body { font-size: 15px; line-height: 1.6; }
  .nav-inner { height: 56px; padding: 0 0.8rem; gap: 0.55rem; }
  .family-summary-grid { grid-template-columns: 1fr; }
  .family-access-hero { padding: 4rem 1rem 2.2rem; }
  .family-page-links {
    flex-direction: column;
    width: 100%;
  }
  .nav-logo {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    gap: 0.25rem;
  }
  .nav-logo span:nth-child(2) { max-width: 11.5rem; }
  .nav-links { top: 56px; max-height: calc(100vh - 56px); }
  .hero-content { padding: 1.6rem 0.8rem 0; }
  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    gap: 0.08em 0.18em;
  }
  .hero-badge {
    width: min(100%, 20rem);
    font-size: 0.72rem;
    padding: 0.45rem 0.75rem;
    letter-spacing: 0.06em;
  }
  .divider-dot { margin: 0 0.12em; }
  .hero-subtitle {
    font-size: 0.88rem;
    letter-spacing: 0.05em;
    padding: 0 0.35rem;
  }
  .hero-quote { font-size: 1rem; padding: 0 0.5rem; }
  .hero-btn { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
  .section-title { font-size: 1.5rem; }
  .section-badge { font-size: 0.7rem; }
  /* 主页展柜 - 小屏两列 */
  .gallery-showcase { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
  .gallery-showcase-wrap { padding: 0 1.5rem 1.5rem; }
  /* 进入全部按钮小屏 */
  .album-enter-btn { flex-wrap: wrap; justify-content: center; gap: 0.8rem; padding: 1rem 1.5rem; }
  .album-enter-sub { width: 100%; text-align: center; }
  /* 二级页保留 */
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .album-filter { flex-wrap: wrap; gap: 0.5rem; }
  .filter-btn { padding: 0.5rem 0.8rem; font-size: 0.8rem; }
  .tribute-actions { flex-wrap: wrap; gap: 0.8rem; }
  .tribute-btn { min-width: 80px; padding: 0.6rem 0.8rem; font-size: 0.8rem; }
  .tribute-form { padding: 1rem; }
  .form-row { flex-direction: column; gap: 0.8rem; }
  .resume-content { padding: 0 0.8rem; }
  .profile-table { font-size: 0.85rem; }
  .profile-table td { padding: 0.4rem; }
  .profile-card { padding: 1.2rem 0.85rem; }
  .family-grandchildren-wrap { margin-top: 1.35rem; }
  .generation-panel {
    padding-top: 0.78rem;
    padding-inline: 0;
  }
  .generation-panel::before {
    width: min(100%, 14rem);
    margin-bottom: 0.82rem;
  }
  .grandchildren-title {
    font-size: 0.9rem;
    margin-bottom: 0.88rem;
    letter-spacing: 0.06em;
    line-height: 1.58;
    padding: 0 0.3rem;
  }
  .grandchildren-grid {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 10rem));
    gap: 0.66rem;
  }
  .grandchild-card {
    width: 10rem;
    min-height: 6.85rem;
    padding: 0.78rem 0.78rem 0.74rem;
  }
  .grandchild-card .grandchild-info:first-of-type { min-height: 2.45em; }
  .grandchild-name { font-size: 0.97rem; }
  .grandchild-info {
    font-size: 0.76rem;
    line-height: 1.58;
  }

  .huangpu-info-table { font-size: 0.84rem; }


  .huangpu-info-table th,
  .huangpu-info-table td { padding: 0.5rem 0.55rem; }
  .lightbox-prev, .lightbox-next { 
    font-size: 1.5rem; 
    padding: 0.3rem 0.6rem;
    background: rgba(212,160,23,0.4);
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  footer { padding: 2rem 1rem; }
}




@media (max-width: 389px) {
  .grandchildren-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.68rem;
  }
  .grandchild-card {
    width: min(100%, 17rem);
    min-height: auto;
    margin: 0 auto;
  }
}

/* ===== 响应式 - 横屏模式 ===== */
@media (max-height: 500px) and (orientation: landscape) {

  #hero { min-height: auto; padding: 5rem 0 3rem; }
  .hero-content { padding-top: 2rem; }
  .hero-scroll-indicator { display: none; }
}

/* ===== 响应式 - 原900px断点 ===== */
@media (max-width: 900px) {
  .profiles-container {
    grid-template-columns: 1fr;
    /* 手机端容器本身居中，并限制最大宽度防止内容贴边 */
    width: 100%;
    max-width: 100%;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    box-sizing: border-box;
  }
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* 确保卡片不超出容器，撑满可用宽度 */
    width: 100%;
    box-sizing: border-box;
  }
  /* 时间轴移动端：单列显示 */
  .timeline-container::before { left: 20px; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 3rem; }
  .tl-left, .tl-right { grid-column: 1; padding: 0; }
  .tl-left .tl-content { text-align: left; border-right: none; border-left: 3px solid var(--army-olive); }
  .tl-center { display: none; }
  .timeline-header-row { display: none; }
  .tl-both-wrap { grid-column: 1; }
  .nav-links { display: none; flex-direction: column; gap: 0; position: absolute; top: 64px; left: 0; right: 0; background: rgba(15,15,8,0.98); padding: 1rem; z-index: 999; }
  .nav-links.open { display: flex; }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .family-parents { flex-direction: column; gap: 0.5rem; align-items: stretch; }
  .family-connector {
    align-self: center;
    width: auto;
    margin: 0.1rem auto;
    display: block;
    text-align: center;
  }
  /* 移动端两张卡片竖排：等宽等高，爱心保持居中，member-role 贴底位置完全一致 */
  .patriarch, .matriarch { width: 100%; height: 290px; min-height: unset; }
  .member-info-line {
    white-space: normal;
  }
}

/* ===== 响应式 - 原600px断点 ===== */
@media (max-width: 600px) {
  .hero-title { font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
  /* 主页展柜超小屏单列 */
  .gallery-showcase { grid-template-columns: 1fr; gap: 1.8rem; }
  .gallery-showcase-wrap { padding: 0 1rem 1rem; }
  .memoir-grid { grid-template-columns: 1fr; }
  .tribute-actions { gap: 1rem; }
  .tribute-btn { min-width: 75px; padding: 0.7rem 1rem; }
  /* 黄埔档案表：手机端取消固定宽和nowrap，允许换行 */
  .huangpu-info-table th { width: auto; white-space: normal; min-width: 80px; }
}

/* =====  prefers-reduced-motion 减少动画 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .particle { display: none; }
}

/* ===== 三端兼容性补丁 ===== */

/* 表格溢出横向滚动（手机端防止布局撑破） */
.profile-table,
.huangpu-table,
.huangpu-table-wrap { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
/* profile-table：桌面端最小宽度保持可读，手机端放开允许自适应 */
.profile-table { min-width: 360px; }
@media (max-width: 767px) {
  .profile-table { min-width: 0; width: 100%; }
}
.huangpu-table table,
.huangpu-table-wrap table { width: 100%; }


/* 弹窗在极小屏幕下的优化 */
@media (max-width: 480px) {
  .modal-overlay { padding: 0.5rem; align-items: flex-end; }
  .modal-box {
    max-height: 92vh;
    border-radius: 8px 8px 0 0; /* 底部弹出卡片风格 */
    width: 100%;
  }
  .modal-inner { padding: 1rem; }
}

/* profile-card 移动端文字居左（居中在竖排时阅读不友好） */
@media (max-width: 900px) {
  .profile-card { text-align: left !important; }
  .profile-photo-wrap { align-self: center; }
}

/* 导航菜单项在移动端增大点击区域 */
@media (max-width: 900px) {
  .nav-links li a { padding: 0.9rem 1.2rem; display: block; border-bottom: 1px solid rgba(212,160,23,0.08); }
}

/* 时间轴移动端文字不溢出 */
@media (max-width: 900px) {
  .tl-content { word-break: break-all; }
  .tl-year { font-size: 1rem; }
}


/* 确保音量滑块在iOS上可用（通用兜底） */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--army-gold);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px; /* track 4px，thumb 16px → 上偏 (16-4)/2=6px */
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}
#backToTop {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;   /* 右下角独立，唱片在右上角，互不干扰 */
  width: 46px;
  height: 46px;
  background: rgba(45,74,30,0.85);
  border: 1px solid var(--army-gold);
  color: var(--army-gold);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
  backdrop-filter: blur(6px);
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
#backToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backToTop:hover {
  background: var(--army-olive);
  box-shadow: 0 6px 20px rgba(212,160,23,0.35);
}
#backToTop:active { transform: scale(0.93); }
@media (max-width: 900px) {
  #backToTop { right: 1rem; bottom: 1.5rem; }
}
@media (max-width: 480px) {
  #backToTop { right: 0.7rem; bottom: 1rem; width: 40px; height: 40px; font-size: 1.1rem; }
}
