/* ============================================================
   华夏历史长卷 · 中国风样式
   宣纸底 + 朱砂红 + 黛青 + 鎏金；毛笔感标题字体，正文宋体感
   ============================================================ */
:root {
  --paper: #f6efdd;
  --paper-2: #efe5cb;
  --card: #fffdf6;
  --ink: #33291f;
  --ink-2: #6f6353;
  --ink-3: #9a8d7a;
  --red: #a63a2b;          /* 朱砂 */
  --red-deep: #822b1f;
  --gold: #b8923d;         /* 鎏金 */
  --gold-soft: #d9c08a;
  --cyan: #3f5566;         /* 黛青 */
  --green: #52705c;
  --line: #e3d5b4;
  --shadow: 0 6px 22px rgba(90, 70, 40, .10);
  --shadow-lift: 0 12px 30px rgba(90, 70, 40, .16);
  --font-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "DFKai-SB", serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", "NSimSun", serif;
  --font-ui: "ZCOOL XiaoWei", "Noto Serif SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
/* 宣纸纹理 */
.paper-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(184,146,61,.10), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(166,58,43,.06), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120,95,50,.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120,95,50,.022) 0 1px, transparent 1px 3px);
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-brush); font-weight: 400; line-height: 1.3; margin: 0; }
button { font-family: inherit; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px;
  background: rgba(246, 239, 221, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand-seal {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--red); color: #fff; border-radius: 8px;
  font-family: var(--font-brush); font-size: 24px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 3px 8px rgba(130,43,31,.35);
  transform: rotate(-3deg);
}
.brand-name { font-family: var(--font-brush); font-size: 24px; color: var(--ink); letter-spacing: 2px; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--ink-2);
  font-family: var(--font-ui); font-size: 15px; text-decoration: none !important;
  transition: all .2s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { background: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(130,43,31,.28); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-chip {
  font-size: 13px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
#navToggle { display: none; }

/* ---------------- 通用 ---------------- */
.app { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 26px 22px 60px; min-height: 60vh; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  border-radius: 10px; padding: 10px 20px; font-size: 15px; font-family: var(--font-ui);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(130,43,31,.3); }
.btn-primary:hover { background: var(--red-deep); box-shadow: 0 6px 18px rgba(130,43,31,.4); }
.btn-gold { background: linear-gradient(135deg, #c9a24b, #b8923d); color: #fff; box-shadow: 0 4px 14px rgba(184,146,61,.35); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.src {
  font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px;
}
.src::before { content: "❋"; color: var(--gold); font-size: 11px; }
.divider {
  height: 26px; margin: 34px 0; position: relative;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  mask: linear-gradient(#fff 0 0) top/100% 2px no-repeat;
}
.divider::after {
  content: "❖"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%);
  color: var(--gold); background: var(--paper); padding: 0 14px; font-size: 14px;
}
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 18px; }
.section-title h2 { font-size: 30px; color: var(--ink); }
.section-title .sub { color: var(--ink-3); font-size: 14px; font-family: var(--font-ui); }
.section-title .tail { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* 滚动浮现 */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- 首页 ---------------- */
.hero {
  position: relative; border-radius: 16px; overflow: hidden; min-height: 320px;
  display: flex; align-items: flex-end; box-shadow: var(--shadow-lift); border: 1px solid var(--line);
}
.hero .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30,22,12,.05) 30%, rgba(30,22,12,.72) 82%);
}
.hero-inner { position: relative; padding: 34px 34px 30px; color: #fff; width: 100%; }
.hero-kicker { font-family: var(--font-ui); letter-spacing: 6px; font-size: 14px; opacity: .9; }
.hero-title { font-size: clamp(34px, 6vw, 56px); letter-spacing: 6px; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.hero-sub { max-width: 640px; opacity: .95; margin: 8px 0 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.progress-strip {
  display: flex; align-items: center; gap: 20px; margin-top: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 20px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.ring { width: 74px; height: 74px; flex: none; }
.ring text { font-family: var(--font-ui); }
.strip-stats { display: flex; gap: 26px; flex-wrap: wrap; flex: 1; }
.strip-stat b { font-size: 22px; font-family: var(--font-ui); color: var(--red); display: block; line-height: 1.2; }
.strip-stat span { font-size: 13px; color: var(--ink-3); }
.strip-badge-preview { display: flex; gap: 6px; align-items: center; }
.mini-seal {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: var(--red); color: #fff; font-family: var(--font-brush); font-size: 17px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); transform: rotate(-4deg);
}
.mini-seal.locked { background: #cfc4ae; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }

/* 长卷导航 */
.scroll-wrap { position: relative; }
.scroll-track {
  display: flex; gap: 16px; overflow-x: auto; padding: 10px 4px 18px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gold-soft) transparent;
}
.scroll-track::-webkit-scrollbar { height: 8px; }
.scroll-track::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 99px; }
.dyn-card {
  scroll-snap-align: start; flex: 0 0 218px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); overflow: hidden; cursor: pointer; text-decoration: none !important;
  transition: transform .25s, box-shadow .25s; position: relative; box-shadow: var(--shadow);
  display: block;
}
.dyn-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.dyn-card .dyn-img { height: 130px; position: relative; overflow: hidden; background: var(--paper-2); }
.dyn-card .dyn-img img, .dyn-card .dyn-img .fb-art { width: 100%; height: 100%; object-fit: cover; }
.dyn-card .dyn-tag {
  position: absolute; left: 10px; top: 10px; background: rgba(166,58,43,.92); color: #fff;
  font-size: 12px; padding: 2px 10px; border-radius: 999px; font-family: var(--font-ui);
}
.dyn-body { padding: 12px 14px 14px; }
.dyn-name { font-family: var(--font-brush); font-size: 26px; color: var(--ink); line-height: 1.15; }
.dyn-name em { font-style: normal; font-size: 14px; color: var(--gold); margin-left: 6px; }
.dyn-range { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dyn-meta { font-size: 13px; color: var(--ink-2); margin-top: 6px; min-height: 38px; }
.dyn-progress { height: 6px; background: var(--paper-2); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.dyn-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 99px; transition: width .5s; }

/* 游戏入口 */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  text-decoration: none !important; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s; position: relative; overflow: hidden;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.game-card .g-icon { font-size: 30px; }
.game-card h3 { font-size: 24px; margin: 6px 0 4px; }
.game-card p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.game-card .g-best { margin-top: 10px; font-size: 12.5px; color: var(--gold); }

/* ---------------- 章节页 ---------------- */
.ch-hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.ch-hero img, .ch-hero .fb-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-hero .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,22,12,.08) 20%, rgba(30,22,12,.78) 85%); }
.ch-hero-inner { position: relative; padding: 28px 30px; color: #fff; width: 100%; }
.ch-title { font-size: clamp(30px, 5vw, 48px); letter-spacing: 4px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ch-title .tagline { font-size: 18px; color: #f3d9a4; letter-spacing: 2px; }
.ch-range { font-family: var(--font-ui); letter-spacing: 2px; opacity: .92; }
.back-link { font-family: var(--font-ui); font-size: 14px; display: inline-block; margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.stat-cell b { color: var(--red); font-family: var(--font-ui); font-weight: 400; display: block; font-size: 15px; }
.stat-cell span { font-size: 14.5px; color: var(--ink); }
.ch-intro {
  margin-top: 18px; background: linear-gradient(135deg, #fffdf6, #fbf4e2);
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 16px 20px; font-size: 16.5px; box-shadow: var(--shadow);
}

/* 人物卡（翻转） */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pcard { perspective: 1000px; height: 250px; cursor: pointer; }
.pcard-inner {
  position: relative; width: 100%; height: 100%; transition: transform .6s;
  transform-style: preserve-3d;
}
.pcard.flip .pcard-inner { transform: rotateY(180deg); }
.pcard-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--card);
}
.pcard-front .pimg { height: 172px; background: var(--paper-2); position: relative; overflow: hidden; }
.pcard-front .pimg img, .pcard-front .pimg .fb-art { width: 100%; height: 100%; object-fit: cover; }
.pcard-front .pname { padding: 10px 14px 12px; display: flex; align-items: baseline; gap: 8px; }
.pcard-front .pname h3 { font-size: 24px; }
.pcard-front .pname span { font-size: 12px; color: var(--ink-3); }
.pcard-back {
  transform: rotateY(180deg); background: linear-gradient(160deg, #fffdf6, #f7ecd4);
  padding: 16px 18px; display: flex; flex-direction: column;
}
.pcard-back .pbio { font-size: 13.8px; color: var(--ink-2); flex: 1; overflow: hidden; }
.pcard-back .pstamp {
  margin-top: 8px; align-self: flex-end; background: var(--red); color: #fff;
  font-family: var(--font-brush); font-size: 16px; padding: 3px 10px; border-radius: 6px;
  transform: rotate(-2deg); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4);
}
.hint-tap { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* 时间轴 */
.timeline { position: relative; margin: 8px 0 0; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--gold-soft), var(--red));
}
.tl-item { position: relative; padding: 0 0 18px 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 9px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--red);
  box-shadow: 0 0 0 3px rgba(166,58,43,.15);
}
.tl-item b { font-family: var(--font-ui); color: var(--red); font-weight: 400; margin-right: 8px; font-size: 15.5px; }
.tl-item .src { margin-left: 10px; }

/* 文化成就 */
.culture-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ccard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
}
.ccard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.ccard .cimg { height: 140px; background: var(--paper-2); position: relative; overflow: hidden; }
.ccard .cimg img, .ccard .cimg .fb-art { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ccard:hover .cimg img { transform: scale(1.05); }
.ccard .cbody { padding: 12px 14px 14px; }
.ccard h3 { font-size: 20px; margin-bottom: 4px; }
.ccard p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.ccard .src { margin-top: 8px; display: flex; }
.ccredit { position: absolute; right: 8px; bottom: 6px; font-size: 10.5px; color: rgba(255,255,255,.85); background: rgba(40,30,15,.45); padding: 1px 8px; border-radius: 99px; }

/* 冷知识 */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
details.fact {
  background: var(--card); border: 1px dashed var(--gold-soft); border-radius: 12px; padding: 12px 16px;
}
details.fact summary {
  cursor: pointer; font-family: var(--font-ui); color: var(--red); font-size: 15px; list-style: none;
}
details.fact summary::-webkit-details-marker { display: none; }
details.fact summary::before { content: "❓ "; }
details.fact[open] summary::before { content: "💡 "; }
details.fact p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

/* 章节底部操作 */
.ch-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.ch-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.read-done { background: var(--green); box-shadow: 0 4px 14px rgba(82,112,92,.3); }

/* ---------------- 答题 ---------------- */
.quiz-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 26px; box-shadow: var(--shadow-lift); position: relative; overflow: hidden;
}
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.quiz-count { font-family: var(--font-ui); color: var(--ink-2); font-size: 14px; }
.quiz-bar { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.quiz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .4s; }
.q-text { font-size: 19px; margin: 0 0 18px; line-height: 1.7; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 10px; cursor: pointer; font-size: 15.5px;
  transition: all .18s; color: var(--ink); font-family: var(--font-serif);
}
.opt:hover:not(:disabled) { border-color: var(--gold); background: #fffdf3; transform: translateX(4px); }
.opt .opt-key {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper-2); color: var(--ink-2); font-family: var(--font-ui); font-size: 14px;
}
.opt.correct { border-color: var(--green); background: #f2f8f2; }
.opt.correct .opt-key { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: #fbf1ee; }
.opt.wrong .opt-key { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; opacity: .88; }
.opt.correct:disabled, .opt.wrong:disabled { opacity: 1; }
.explain-box {
  margin-top: 14px; border-radius: 12px; border: 1px solid var(--gold-soft);
  background: #fdf8ea; padding: 14px 18px; animation: fadeUp .4s ease;
}
.explain-box h4 { color: var(--red); font-size: 18px; margin-bottom: 6px; }
.explain-box .exp-row { margin: 4px 0; font-size: 14.5px; }
.explain-box .exp-row b { color: var(--cyan); font-family: var(--font-ui); font-weight: 400; }
.quiz-next { margin-top: 16px; text-align: right; }
/* 印章动画 */
.seal-stamp {
  position: absolute; right: 26px; top: 64px; width: 76px; height: 76px; z-index: 5;
  background: rgba(166,58,43,.94); color: #fff; border-radius: 10px;
  display: grid; place-items: center; font-family: var(--font-brush); font-size: 40px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.5), 0 6px 18px rgba(130,43,31,.4);
  animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1) both; transform: rotate(-8deg);
}
.seal-stamp.bad { background: rgba(63,85,102,.94); box-shadow: inset 0 0 0 3px rgba(255,255,255,.5), 0 6px 18px rgba(40,55,70,.4); }
@keyframes stampIn {
  0% { transform: scale(2.4) rotate(14deg); opacity: 0; }
  60% { transform: scale(.92) rotate(-10deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 成绩单 */
.score-hero { text-align: center; padding: 26px 0 8px; }
.score-big { font-family: var(--font-brush); font-size: 58px; color: var(--red); line-height: 1.1; }
.score-sub { color: var(--ink-2); margin: 6px 0 18px; }
.recap { margin-top: 18px; }
.recap-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; background: #fff; }
.recap-item .r-head { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.recap-item .r-head b { font-family: var(--font-ui); font-weight: 400; flex: 1; font-size: 14.5px; }
.recap-item .r-ok { color: var(--green); } .recap-item .r-no { color: var(--red); }
.recap-item .r-body { display: none; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; font-size: 14px; color: var(--ink-2); }
.recap-item.open .r-body { display: block; }

/* ---------------- 游戏页 ---------------- */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 36px; letter-spacing: 3px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; }
.gate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  text-align: center; cursor: pointer; transition: transform .2s, box-shadow .2s; box-shadow: var(--shadow);
  position: relative; text-decoration: none !important; color: var(--ink);
}
.gate-card:hover:not(.locked) { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.gate-card.locked { opacity: .62; cursor: not-allowed; filter: grayscale(.4); }
.gate-card.passed { border-color: var(--green); }
.gate-card .g-state { font-size: 24px; }
.gate-card h3 { font-size: 22px; margin: 6px 0 2px; }
.gate-card p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

/* 时间排序 */
.tl-game .pool, .tl-game .slots { display: flex; flex-wrap: wrap; gap: 10px; min-height: 64px; }
.ev-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px;
  cursor: pointer; font-size: 14.5px; max-width: 320px; transition: all .18s; box-shadow: 0 2px 8px rgba(90,70,40,.08);
}
.ev-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.ev-card.placed { opacity: .35; pointer-events: none; }
.slot {
  border: 1.5px dashed var(--gold-soft); border-radius: 10px; padding: 8px 12px; min-width: 170px;
  min-height: 52px; cursor: pointer; font-size: 14px; background: rgba(255,255,255,.6);
  display: flex; flex-direction: column; gap: 2px; flex: 1;
}
.slot .slot-idx { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-ui); }
.slot.filled { border-style: solid; background: #fff; }
.slot.right { border-color: var(--green); background: #f2f8f2; }
.slot.wrongmark { border-color: var(--red); background: #fbf1ee; }
.tl-result { margin-top: 14px; }
.tl-result .tl-item { padding-bottom: 10px; }

/* 连连看 */
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-item {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 16px;
  cursor: pointer; text-align: center; font-size: 15px; transition: all .18s; font-family: var(--font-ui);
}
.match-item:hover { border-color: var(--gold); }
.match-item.sel { border-color: var(--red); background: #fdf3ee; box-shadow: 0 0 0 3px rgba(166,58,43,.14); }
.match-item.done { border-color: var(--green); background: #f2f8f2; pointer-events: none; }
.match-item.done small { display: block; color: var(--ink-3); font-size: 12px; font-family: var(--font-serif); }
.match-item.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------------- 进度页 ---------------- */
.prog-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.panel h3 { font-size: 22px; margin-bottom: 12px; }
.prog-row { margin-bottom: 14px; }
.prog-row .pr-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.prog-row .pr-bar { height: 9px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.prog-row .pr-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .6s; }
.badge-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.badge-cell { text-align: center; padding: 14px 8px; border-radius: 12px; border: 1px dashed var(--line); background: #fff; }
.badge-cell .mini-seal { width: 46px; height: 46px; font-size: 26px; margin: 0 auto 8px; border-radius: 10px; }
.badge-cell b { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 15px; }
.badge-cell span { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }
.badge-cell.locked { opacity: .55; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.stat-table td { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.stat-table td:last-child { text-align: right; font-family: var(--font-ui); color: var(--red); }

/* ---------------- 参考资料 ---------------- */
.ref-list { columns: 2; column-gap: 34px; font-size: 14.5px; }
.ref-list li { margin-bottom: 8px; break-inside: avoid; }

/* ---------------- 弹层 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 30, 15, .5); z-index: 90;
  display: grid; place-items: center; padding: 20px; animation: fadeUp .25s;
}
.modal {
  background: var(--card); border-radius: 16px; max-width: 460px; width: 100%;
  padding: 26px 28px; box-shadow: var(--shadow-lift); border: 1px solid var(--gold-soft);
  text-align: center; position: relative;
}
.modal .m-seal { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 12px; background: var(--red); color: #fff; display: grid; place-items: center; font-family: var(--font-brush); font-size: 34px; transform: rotate(-6deg); box-shadow: inset 0 0 0 2.5px rgba(255,255,255,.45); }
.modal h3 { font-size: 26px; margin-bottom: 6px; }
.modal p { color: var(--ink-2); margin: 6px 0 16px; font-size: 14.5px; }
.modal .m-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scroll-anim { animation: scrollOpen .6s cubic-bezier(.2, 1.2, .3, 1) both; }
@keyframes scrollOpen { from { transform: scaleX(.1); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* toast */
#toastRoot { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(51, 41, 31, .92); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; animation: fadeUp .3s; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 86vw;
}

/* confetti */
#confettiRoot { position: fixed; inset: 0; pointer-events: none; z-index: 98; overflow: hidden; }
.confetti-bit {
  position: absolute; width: 9px; height: 14px; top: -20px; animation: confFall linear both;
}
@keyframes confFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .6; }
}

/* SVG 兜底插画 */
.fb-box { width: 100%; height: 100%; }
.hero .fb-box, .ch-hero .fb-box { position: absolute; inset: 0; }
.fb-art { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(150deg, #f3e9cf, #e8d9b5); position: relative; }
.fb-art svg { width: 100%; height: 100%; }
.fb-label {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 12px;
  color: var(--ink-2); font-family: var(--font-ui); letter-spacing: 2px;
}
.fb-seal {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; background: var(--red);
  color: #fff; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-brush);
  font-size: 20px; transform: rotate(-5deg); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4);
}

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); position: relative; z-index: 1; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 26px 22px 34px; text-align: center; }
.footer-brand { font-family: var(--font-brush); font-size: 20px; margin: 0 0 8px; }
.seal-inline { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--red); color: #fff; border-radius: 6px; font-size: 16px; margin-right: 6px; }
.footer-note { font-size: 12.5px; color: var(--ink-3); margin: 4px 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .gate-grid { grid-template-columns: repeat(2, 1fr); }
  .culture-grid { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .prog-grid { grid-template-columns: 1fr; }
  .badge-wall { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .app { padding: 16px 14px 46px; }
  .brand-name { font-size: 19px; white-space: nowrap; letter-spacing: 1px; }
  .brand-seal { width: 32px; height: 32px; font-size: 20px; }
  .nav {
    display: none; position: absolute; top: 58px; right: 14px; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
    box-shadow: var(--shadow-lift); min-width: 150px;
  }
  .nav.open { display: flex; }
  #navToggle { display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; font-size: 17px; color: var(--ink-2); }
  .hero-inner { padding: 22px 18px; }
  .game-grid, .gate-grid, .culture-grid, .people-grid, .facts { grid-template-columns: 1fr; }
  .badge-wall { grid-template-columns: repeat(2, 1fr); }
  .match-board { gap: 12px; }
  .quiz-card { padding: 18px 16px; }
  .ref-list { columns: 1; }
  .seal-stamp { width: 60px; height: 60px; font-size: 30px; right: 14px; top: 50px; }
  .dyn-card { flex-basis: 190px; }
  .strip-stats { gap: 16px; }
}
