/* ============================================================
   中华民族大家庭 · 全站样式
   纯原生 CSS3，零依赖，手机 / PC 通用
   视觉语言：宣纸米白 + 中国红 + 鎏金
   ============================================================ */

:root {
  --red: #C8202C;
  --red-2: #A3121F;
  --red-3: #E8455A;
  --red-soft: #FBE9EA;
  --gold: #B98B2E;
  --gold-2: #D9AE55;
  --gold-3: #F0DCA8;
  --gold-soft: #FBF4E4;
  --ink: #221E1B;
  --ink-2: #574F47;
  --ink-3: #8C8478;
  --paper: #FAF6EF;
  --paper-2: #F4EDE1;
  --paper-3: #EDE4D5;
  --card: #FFFFFF;
  --line: #E9E0D2;
  --line-2: #DED2BF;
  --shadow-xs: 0 1px 2px rgba(34, 30, 27, .05);
  --shadow-sm: 0 1px 3px rgba(34, 30, 27, .06), 0 4px 12px rgba(34, 30, 27, .04);
  --shadow-md: 0 2px 6px rgba(34, 30, 27, .07), 0 12px 28px rgba(34, 30, 27, .07);
  --shadow-lg: 0 8px 24px rgba(34, 30, 27, .1), 0 24px 60px rgba(34, 30, 27, .12);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --maxw: 1180px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "Noto Serif SC", serif;
  --nav-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.75;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(200, 32, 44, .045), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(185, 139, 46, .06), transparent 40%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; border: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }

::selection { background: var(--red); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1360px; margin: 0 auto; padding: 0 20px; }
.section { padding: 62px 0; }
.section-sm { padding: 42px 0; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 900;
  height: var(--nav-h);
  background: rgba(250, 246, 239, .88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(233, 224, 210, .9);
  transition: box-shadow .25s;
}
.nav.scrolled { box-shadow: 0 4px 20px rgba(34, 30, 27, .07); }
.nav-in { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .5px; white-space: nowrap; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--red), var(--red-2) 60%, #8E0E1A);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 900;
  box-shadow: 0 3px 10px rgba(200, 32, 44, .3);
  font-family: var(--serif);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 16px; letter-spacing: .8px; }
.brand-txt span { font-size: 10px; color: var(--ink-3); letter-spacing: 2.4px; font-weight: 500; }
.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-menu a {
  padding: 8px 13px; border-radius: 9px; font-size: 14px; color: var(--ink-2);
  font-weight: 500; transition: .18s; white-space: nowrap;
}
.nav-menu a:hover { background: rgba(200, 32, 44, .07); color: var(--red); }
.nav-menu a.on { color: var(--red); font-weight: 700; background: var(--red-soft); }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; place-items: center; }
.nav-toggle span { display: block; width: 19px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: .25s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 19px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav.open .nav-toggle span { background: transparent; }
.nav.open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: grid; }
  .nav-menu {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); padding: 12px 16px 22px; border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(34, 30, 27, .12);
    transform: translateY(-115%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    margin-left: 0; max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav.open .nav-menu { transform: translateY(0); }
  .nav-menu a { padding: 12px 14px; font-size: 15px; }
}

/* ---------- 通用标题 ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.sec-title { font-size: 26px; font-weight: 800; letter-spacing: .5px; margin: 0; display: flex; align-items: center; gap: 11px; }
.sec-title::before { content: ""; width: 5px; height: 24px; border-radius: 3px; background: linear-gradient(180deg, var(--red), var(--gold-2)); flex: none; }
.sec-desc { color: var(--ink-2); font-size: 14.5px; margin: 8px 0 0; max-width: 66ch; }
.sec-more { color: var(--red); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; transition: gap .2s; }
.sec-more:hover { gap: 9px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 3px;
  color: var(--gold); font-weight: 700; text-transform: uppercase; margin-bottom: 14px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 22px; height: 1px; background: var(--gold-2); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 76px 0 62px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .5;
  background:
    radial-gradient(ellipse 60% 60% at 50% 0%, rgba(200, 32, 44, .1), transparent 70%),
    radial-gradient(ellipse 42% 50% at 12% 92%, rgba(185, 139, 46, .13), transparent 72%),
    radial-gradient(ellipse 42% 50% at 88% 92%, rgba(200, 32, 44, .07), transparent 72%);
}
.hero-in { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(30px, 6.2vw, 56px); line-height: 1.22; margin: 0 0 6px; font-weight: 900;
  letter-spacing: 2px; font-family: var(--serif);
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--red) 10%, var(--red-3) 45%, var(--gold) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(14px, 2.4vw, 17px); color: var(--ink-2); letter-spacing: 4px; margin: 14px 0 0; font-weight: 400; }
.hero-poem { margin: 22px auto 0; max-width: 560px; color: var(--ink-3); font-family: var(--serif); font-size: 14.5px; line-height: 2.1; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 11px;
  font-size: 15px; font-weight: 600; transition: .22s; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #fff; box-shadow: 0 5px 18px rgba(200, 32, 44, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(200, 32, 44, .36); }
.btn-ghost { background: rgba(255, 255, 255, .8); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); background: #fff; transform: translateY(-2px); }

.belt { margin-top: 40px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.belt-track { display: flex; gap: 9px; width: max-content; animation: belt 68s linear infinite; }
.belt:hover .belt-track { animation-play-state: paused; }
@keyframes belt { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.belt-item {
  padding: 7px 15px; border-radius: 100px; background: rgba(255, 255, 255, .82); border: 1px solid var(--line);
  font-size: 13.5px; white-space: nowrap; color: var(--ink-2); transition: .2s; cursor: default;
}
.belt-item:hover { border-color: var(--red); color: var(--red); background: #fff; }

/* ---------- 数据看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px;
  position: relative; overflow: hidden; transition: .25s;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: linear-gradient(180deg, var(--red), var(--gold-2)); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.stat-num { font-size: 27px; font-weight: 800; letter-spacing: -.5px; color: var(--red); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 14px; font-weight: 700; margin-left: 2px; color: var(--ink-2); }
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 5px; letter-spacing: .3px; }

/* ---------- 卡片通用 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: .25s; }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }

/* 族群体系 */
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.group-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 26px 24px; color: #fff;
  background: linear-gradient(140deg, #2A2420, #3C322B); transition: .3s; display: block;
}
.group-card:nth-child(1) { background: linear-gradient(140deg, #A3131F, #C8202C 60%, #8E0E1A); }
.group-card:nth-child(2) { background: linear-gradient(140deg, #1F4E5A, #2C6B7A 60%, #17414B); }
.group-card:nth-child(3) { background: linear-gradient(140deg, #6A4A16, #906818 60%, #553A0F); }
.group-card:nth-child(4) { background: linear-gradient(140deg, #2E4A2A, #3E6438 60%, #243B21); }
.group-card:nth-child(5) { background: linear-gradient(140deg, #4B2E5E, #67407F 60%, #3A2349); }
.group-card:nth-child(6) { background: linear-gradient(140deg, #1E4368, #285A8C 60%, #16324E); }
.group-card::before {
  content: ""; position: absolute; right: -46px; top: -46px; width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255, 255, 255, .07); transition: .45s;
}
.group-card:hover::before { transform: scale(1.35); background: rgba(255, 255, 255, .11); }
.group-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.group-no { font-size: 12px; letter-spacing: 3px; opacity: .72; font-weight: 700; font-family: var(--serif); }
.group-card h3 { margin: 9px 0 10px; font-size: 19.5px; font-weight: 800; letter-spacing: .6px; position: relative; }
.group-card p { margin: 0; font-size: 13.5px; line-height: 1.8; opacity: .86; position: relative; }
.group-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; position: relative; }
.group-count { font-size: 12.5px; background: rgba(255, 255, 255, .16); padding: 4px 12px; border-radius: 100px; font-weight: 600; }
.group-arrow { font-size: 17px; opacity: .8; transition: .25s; }
.group-card:hover .group-arrow { transform: translateX(5px); opacity: 1; }

/* ---------- 民族卡片 ---------- */
.nation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.nation-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; transition: .25s; position: relative;
}
.nation-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--red); }
.nation-card .thumb { aspect-ratio: 4 / 3; background: linear-gradient(150deg, var(--paper-2), var(--paper-3)); overflow: hidden; position: relative; }
.nation-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .45s ease; }
.nation-card:hover .thumb img { transform: scale(1.07); }
.nation-card .rank {
  position: absolute; left: 8px; top: 8px; background: rgba(34, 30, 27, .72); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 100px; font-weight: 600; backdrop-filter: blur(4px);
}
.nation-card .badge-g {
  position: absolute; right: 8px; top: 8px; font-size: 10.5px; padding: 3px 9px; border-radius: 100px;
  font-weight: 600; color: #fff; backdrop-filter: blur(4px);
}
.nation-card .body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nation-card h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; }
.nation-card h3 em { font-style: normal; font-size: 10.5px; color: var(--ink-3); letter-spacing: .3px; }
.nation-card .pop { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nation-card .pop b { color: var(--red); font-weight: 700; }
.nation-card .sig { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); }

/* ---------- 图库 ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery-grid.gg-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gitem {
  position: relative; border-radius: var(--r); overflow: hidden; background: var(--paper-2);
  cursor: zoom-in; border: 1px solid var(--line); aspect-ratio: 1 / 1;
}
.gitem img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.gitem:hover img { transform: scale(1.06); }
.gitem .cap {
  position: absolute; inset: auto 0 0 0; padding: 26px 12px 10px; font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(20, 16, 14, .78)); transition: .28s;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.gitem .cap span { font-size: 10.5px; font-weight: 400; opacity: .78; }
/* 仅在支持悬停的桌面设备上做「悬停才显示」；触屏设备始终显示，避免看不到民族名 */
@media (hover: hover) and (pointer: fine) {
  .gitem .cap { opacity: 0; }
  .gitem:hover .cap { opacity: 1; }
}

.totem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.totem-grid .gitem { aspect-ratio: 5 / 6; }
.totem-grid .gitem img { object-fit: contain; background: #fff; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tab {
  padding: 11px 19px; font-size: 14.5px; color: var(--ink-2); font-weight: 600; border-radius: 10px 10px 0 0;
  position: relative; transition: .2s;
}
.tab:hover { color: var(--red); background: rgba(200, 32, 44, .05); }
.tab.on { color: var(--red); }
.tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; background: var(--red); border-radius: 3px; }
.tab-n { font-size: 11px; opacity: .6; margin-left: 4px; }

/* ---------- 筛选 / 工具条 ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.search { flex: 1; min-width: 200px; max-width: 340px; position: relative; }
.search input {
  width: 100%; padding: 11px 15px 11px 40px; border-radius: 11px; border: 1px solid var(--line-2);
  background: #fff; outline: none; transition: .2s; font-size: 14.5px;
}
.search input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 32, 44, .1); }
.search::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 100px; border: 1px solid var(--line-2); background: #fff;
  font-size: 13px; color: var(--ink-2); transition: .2s; white-space: nowrap;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(200, 32, 44, .22); }
.chip-g.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 3px 10px rgba(185, 139, 46, .25); }

.result-bar { font-size: 13.5px; color: var(--ink-3); margin-bottom: 16px; }
.result-bar b { color: var(--red); font-weight: 700; }

/* ---------- 详情页 ---------- */
.crumb { font-size: 13px; color: var(--ink-3); padding: 18px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb a:hover { color: var(--red); }

.detail-hero { display: grid; grid-template-columns: 300px 1fr; gap: 34px; align-items: start; padding: 30px 0 34px; }
.detail-figure {
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2);
  box-shadow: var(--shadow-sm); cursor: zoom-in; position: relative;
}
.detail-figure img { width: 100%; }
.detail-figure::after {
  content: "点击放大"; position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: #fff;
  background: rgba(34, 30, 27, .6); padding: 4px 10px; border-radius: 100px; opacity: 0; transition: .2s;
  backdrop-filter: blur(4px);
}
.detail-figure:hover::after { opacity: 1; }
.detail-name { font-size: clamp(30px, 5vw, 44px); font-weight: 900; margin: 0; letter-spacing: 3px; font-family: var(--serif); }
.detail-py { color: var(--gold); font-size: 14px; letter-spacing: 2px; margin: 6px 0 0; font-weight: 600; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.pill { padding: 6px 14px; border-radius: 100px; font-size: 12.5px; font-weight: 600; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill-red { background: var(--red-soft); color: var(--red); border-color: #F2D2D5; }
.pill-gold { background: var(--gold-soft); color: var(--gold); border-color: #EDDEBB; }

.pop-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 11px; margin-top: 22px; }
.pop-cell { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 13px; }
.pop-cell .k { font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; line-height: 1.5; }
.pop-cell .v { font-size: 19px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.pop-cell .v.up { color: #C8202C; }
.pop-cell .v small { font-size: 11px; font-weight: 600; color: var(--ink-3); }

@media (max-width: 780px) {
  .detail-hero { grid-template-columns: 1fr; gap: 20px; }
  .detail-figure { max-width: 340px; margin: 0 auto; }
}

/* 溯源章节 */
.chapters { display: grid; gap: 16px; }
.chapter { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; position: relative; overflow: hidden; }
.chapter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold-2); opacity: .5; }
.chapter h3 { margin: 0 0 12px; font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.chapter h3 i { font-style: normal; font-size: 18px; }
.chapter p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 2.05; text-align: justify; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; }
.panel h3 { margin: 0 0 12px; font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel p { margin: 0; font-size: 14px; line-height: 1.95; color: var(--ink-2); text-align: justify; }
.panel-taboo { border-color: #F1D5D7; background: linear-gradient(180deg, #FFFBFB, #fff); }
.panel-taboo h3 { color: var(--red); }
.panel-belief { border-color: #EDDFC0; background: linear-gradient(180deg, #FFFDF7, #fff); }
.panel-belief h3 { color: var(--gold); }

/* 表格 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 420px; }
table.tbl th, table.tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { background: var(--paper-2); font-weight: 700; color: var(--ink-2); font-size: 12.5px; letter-spacing: .3px; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #FCFAF6; }
table.tbl td.num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
table.tbl td.idx { color: var(--ink-3); width: 34px; font-size: 12px; }

/* 条形图 */
.chart { display: flex; flex-direction: column; gap: 11px; }
.chart-row { display: grid; grid-template-columns: 84px 1fr 96px; gap: 12px; align-items: center; font-size: 13px; }
.chart-row .nm { font-weight: 600; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-row .track { height: 20px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.chart-row .fill {
  height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--red), var(--red-3));
  transition: width 1s cubic-bezier(.2, .8, .3, 1); width: 0; display: block;
}
.chart-row.han .fill { background: linear-gradient(90deg, var(--gold), var(--gold-3)); }
.chart-row .val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; text-align: right; font-weight: 600; }
@media (max-width: 600px) { .chart-row { grid-template-columns: 62px 1fr 76px; font-size: 12px; gap: 8px; } }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--red), var(--gold-2), var(--line)); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 26px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -27px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--red); box-shadow: 0 0 0 4px rgba(200, 32, 44, .1);
}
.tl-year { font-size: 13px; font-weight: 800; color: var(--red); letter-spacing: .5px; }
.tl-item h4 { margin: 3px 0 5px; font-size: 15.5px; font-weight: 700; }
.tl-item p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }

/* ---------- 答题 ---------- */
.quiz-shell { max-width: 780px; margin: 0 auto; }
.quiz-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 32px; box-shadow: var(--shadow-sm); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.quiz-prog { flex: 1; min-width: 160px; height: 7px; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.quiz-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold-2)); border-radius: 100px; transition: width .4s; }
.quiz-num { font-size: 13px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.quiz-q { font-size: 17.5px; line-height: 2; font-weight: 600; margin: 0 0 24px; }
.quiz-q u { text-decoration: none; color: var(--red); font-weight: 800; letter-spacing: 1px; border-bottom: 2px solid var(--red); padding: 0 4px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px;
  border: 1.5px solid var(--line-2); background: #fff; text-align: left; transition: .2s; font-size: 15px; width: 100%;
}
.opt:hover:not(:disabled) { border-color: var(--red); background: var(--red-soft); transform: translateX(3px); }
.opt .k {
  width: 26px; height: 26px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex: none; color: var(--ink-2); transition: .2s;
}
.opt:hover:not(:disabled) .k { background: var(--red); color: #fff; }
.opt.right { border-color: #1F8A4C; background: #EEFBF2; }
.opt.right .k { background: #1F8A4C; color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; }
.quiz-fb { margin-top: 18px; padding: 14px 18px; border-radius: 12px; font-size: 14px; line-height: 1.9; display: none; }
.quiz-fb.show { display: block; animation: fadeUp .3s; }
.quiz-fb.ok { background: #EEFBF2; border: 1px solid #C3E9D2; color: #14663A; }
.quiz-fb.no { background: var(--red-soft); border: 1px solid #F2D2D5; color: var(--red-2); }
.quiz-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.quiz-result { text-align: center; padding: 20px 0; }
.quiz-result .score { font-size: 58px; font-weight: 900; color: var(--red); line-height: 1; font-variant-numeric: tabular-nums; }
.quiz-result .score small { font-size: 20px; color: var(--ink-3); }
.quiz-result .rank-txt { font-size: 17px; font-weight: 700; margin: 12px 0 6px; }
.quiz-result .tip { color: var(--ink-2); font-size: 14px; }

/* 速览题卡 */
.q-list { display: grid; gap: 10px; }
.q-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 15px 18px;
  display: flex; gap: 13px; transition: .2s; font-size: 14.5px; line-height: 1.85;
}
.q-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-xs); }
.q-item .no {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.q-item.c1 .no { background: var(--red-soft); color: var(--red); }
.q-item.c2 .no { background: var(--gold-soft); color: var(--gold); }
.q-item.c3 .no { background: #E7F0F7; color: #1E5F8A; }
.q-item .txt { flex: 1; }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 2000; background: rgba(24, 20, 18, .93);
  display: none; align-items: center; justify-content: center; padding: 26px; backdrop-filter: blur(8px);
}
.lb.on { display: flex; animation: fadeIn .22s; }
.lb img { max-width: 94vw; max-height: 84vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); object-fit: contain; }
.lb-cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; padding: 0 20px; }
.lb-cap small { display: block; font-size: 12px; opacity: .6; font-weight: 400; margin-top: 3px; letter-spacing: 1px; }
.lb-x, .lb-prev, .lb-next {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .13);
  color: #fff; display: grid; place-items: center; font-size: 20px; transition: .2s; backdrop-filter: blur(6px);
}
.lb-x { right: 20px; top: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-x:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .26); }
.lb-prev span, .lb-next span { line-height: 1; }
@media (max-width: 600px) {
  .lb { padding: 12px; }
  .lb-prev, .lb-next { width: 38px; height: 38px; font-size: 17px; }
  .lb-x { width: 38px; height: 38px; font-size: 17px; right: 12px; top: 12px; }
}

/* ---------- 页脚 ---------- */
.footer { background: #262220; color: rgba(255, 255, 255, .68); margin-top: 60px; padding: 46px 0 26px; font-size: 13.5px; }
.footer a { color: rgba(255, 255, 255, .82); }
.footer a:hover { color: #fff; }
.f-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 34px; padding-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 13px; font-weight: 700; letter-spacing: .5px; }
.footer p { margin: 0 0 8px; line-height: 1.9; }
.f-links { display: flex; flex-direction: column; gap: 8px; }
.f-bottom { padding-top: 20px; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .45); line-height: 1.9; }
@media (max-width: 760px) { .f-top { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- 动效 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* 默认可见；仅由 JS 给「视口外」元素加 .pre 隐藏，滚动时淡入。JS 失效则内容始终可见。 */
.reveal { transition: opacity .7s cubic-bezier(.2, .8, .3, 1), transform .7s cubic-bezier(.2, .8, .3, 1); }
.reveal.pre { opacity: 0; transform: translateY(22px); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.pre { opacity: 1 !important; transform: none !important; transition: none !important; }
  .belt-track { animation: none !important; }
}

.totop {
  position: fixed; right: 20px; bottom: 24px; width: 44px; height: 44px; border-radius: 13px; z-index: 800;
  background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-md); display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: .28s; font-size: 16px; color: var(--ink-2);
}
.totop.on { opacity: 1; pointer-events: auto; }
.totop:hover { background: var(--red); color: #fff; border-color: var(--red); transform: translateY(-3px); }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .ic { font-size: 42px; margin-bottom: 12px; opacity: .5; }

.sk { background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--r); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.notice {
  background: linear-gradient(100deg, var(--gold-soft), #fff 70%); border: 1px solid #EDDEBB;
  border-radius: var(--r); padding: 15px 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.9;
  display: flex; gap: 12px; align-items: flex-start;
}
.notice b { color: var(--gold); }

@media (max-width: 620px) {
  .section { padding: 44px 0; }
  .hero { padding: 52px 0 42px; }
  .sec-title { font-size: 21px; }
  .sec-title::before { height: 20px; width: 4px; }
  .nation-grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
  .gallery-grid.gg-3 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .totem-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 9px; }
  .group-grid { grid-template-columns: 1fr; }
  .quiz-card { padding: 22px 18px; }
  .quiz-q { font-size: 16px; }
  .stat-num { font-size: 22px; }
  .chapter { padding: 19px 18px; }
  .panel { padding: 18px 17px; }
}
