/* ============================================================
 * 《孙子兵法》交互式学习网站 · 全局样式
 * 极简国风 + 暗金主色调，深色沉浸 + 浅色阅读双主题
 * ============================================================ */
:root {
  --gold: #c9a227;
  --gold-light: #e6c45c;
  --gold-dark: #8b6914;
  --ink: #1a1710;
  --paper: #f5f0e3;
  --paper-2: #ece4cf;
  --red: #8c2f2f;
  --bg: #12100b;
  --bg-2: #1a1712;
  --card: rgba(255, 248, 230, 0.04);
  --border: rgba(201, 162, 39, 0.25);
  --text: #ece4cf;
  --text-dim: #a99f86;
  --text-mut: #7d7560;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* 浅色主题 */
[data-theme="light"] {
  --bg: #f5f0e3;
  --bg-2: #ece4cf;
  --card: rgba(90, 70, 20, 0.05);
  --border: rgba(139, 105, 20, 0.3);
  --text: #3a3321;
  --text-dim: #6b6046;
  --text-mut: #948a6d;
  --shadow: 0 8px 24px rgba(90, 70, 20, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .4s, color .4s;
  min-height: 100vh;
}
/* 水墨山水动态背景 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(201,162,39,.10), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(140,47,47,.08), transparent 50%);
}
.ink-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(ellipse at 70% 20%, rgba(201,162,39,.06) 0, transparent 45%),
    repeating-linear-gradient(180deg, transparent 0 2px, rgba(255,255,255,.012) 2px 3px);
}

h1,h2,h3,h4 { font-family: var(--font-serif); font-weight: 600; }
a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.section { padding: 42px 0; }
.section-title {
  font-size: 1.65rem; text-align: center; margin-bottom: 6px;
  letter-spacing: .12em;
}
.section-sub { text-align: center; color: var(--text-dim); font-size: .92rem; margin-bottom: 28px; }
.divider {
  width: 120px; height: 2px; margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.gold-text { color: var(--gold); }

/* ================= 顶部导航 ================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 6px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; margin-right: 10px; flex-shrink: 0; }
.logo-seal {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #1a1710; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(201,162,39,.4);
}
.logo-name { font-family: var(--font-serif); font-size: 1.12rem; letter-spacing: .1em; color: var(--text); }
.logo-name small { display: block; font-size: .62rem; color: var(--text-mut); letter-spacing: .2em; }
.nav-links { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav-links a {
  padding: 8px 13px; border-radius: 8px; color: var(--text-dim);
  font-size: .92rem; white-space: nowrap; transition: .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: var(--card); }
.nav-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--gold); font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; transition: .25s;
}
.icon-btn:hover { background: rgba(201,162,39,.12); }
.hamburger { display: none; }

/* 移动端抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; opacity: 0; pointer-events: none; transition: .3s; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 200;
  background: var(--bg-2); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: .3s; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.drawer.open { transform: translateX(0); }
.drawer a { padding: 11px 14px; border-radius: 8px; color: var(--text-dim); }
.drawer a.active, .drawer a:hover { background: var(--card); color: var(--gold); }

/* ================= 页面切换 ================= */
.page { display: none; animation: fadeIn .45s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= 首页 ================= */
.hero {
  position: relative; text-align: center; padding: 72px 20px 58px;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,162,39,.16), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(140,47,47,.10), transparent 55%);
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 100px; font-size: .8rem; color: var(--gold);
  letter-spacing: .2em; margin-bottom: 20px; background: var(--card);
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.25; letter-spacing: .08em;
  margin-bottom: 12px;
}
.hero .sub { font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--text-dim); margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 12px 26px; border-radius: 100px; border: 1px solid var(--gold);
  font-size: .95rem; letter-spacing: .06em; transition: .3s; display: inline-flex;
  align-items: center; gap: 8px;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #1a1710; font-weight: 600; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,162,39,.4); }
.btn-ghost { color: var(--gold); background: transparent; }
.btn-ghost:hover { background: rgba(201,162,39,.1); }

/* 今日金句 */
.quote-card {
  max-width: 720px; margin: 0 auto 40px; padding: 26px 30px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); text-align: center; position: relative;
}
.quote-card::before {
  content: "「"; position: absolute; left: 14px; top: 6px; font-size: 3rem; color: var(--gold); opacity: .5;
}
.quote-card::after {
  content: "」"; position: absolute; right: 14px; bottom: -8px; font-size: 3rem; color: var(--gold); opacity: .5;
}
.quote-text { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.8; }
.quote-src { color: var(--gold); font-size: .85rem; margin-top: 8px; letter-spacing: .1em; }
.quote-dots { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.quote-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mut); cursor: pointer; transition: .3s; }
.quote-dots span.on { background: var(--gold); transform: scale(1.3); }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); padding: 24px 18px; text-align: center;
  transition: .3s; cursor: pointer; position: relative; overflow: hidden;
}
.quick-card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: var(--shadow); }
.quick-icon { font-size: 2rem; margin-bottom: 10px; display: block; }
.quick-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.quick-card p { font-size: .8rem; color: var(--text-mut); }

/* 数据可视化 */
.stats-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.stat-box {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 22px;
}
.stat-box h4 { color: var(--text-dim); font-size: .9rem; margin-bottom: 14px; letter-spacing: .1em; }
.stat-nums { display: flex; gap: 22px; margin-bottom: 16px; }
.stat-num b { font-size: 1.6rem; color: var(--gold); font-family: var(--font-serif); }
.stat-num span { display: block; font-size: .75rem; color: var(--text-mut); }
.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.bar-row .label { width: 74px; flex-shrink: 0; color: var(--text-dim); }
.bar-track { flex: 1; height: 14px; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); width: 0; transition: width 1s ease; }
.bar-row .val { width: 34px; text-align: right; color: var(--gold); font-size: .8rem; }
.trend-chart { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.trend-chart .col {
  flex: 1; background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 4px 4px 0 0; opacity: .85; transition: .3s; min-width: 8px;
}
.trend-chart .col:hover { opacity: 1; }
.trend-chart .col span { display: none; }

/* 新手引导 */
.guide-banner {
  margin-top: 30px; padding: 24px 28px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(201,162,39,.14), rgba(140,47,47,.08));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.guide-banner h3 { margin-bottom: 4px; }
.guide-banner p { color: var(--text-dim); font-size: .9rem; }

/* ================= 通用卡片/列表 ================= */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); padding: 20px;
}
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: .72rem;
  border: 1px solid var(--border); color: var(--gold); margin-right: 6px; margin-bottom: 6px;
}
.tag-gold { background: rgba(201,162,39,.12); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ================= 原著精读 ================= */
.reader-layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.chapter-nav {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  padding: 14px; position: sticky; top: 74px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.chapter-nav h4 { color: var(--text-dim); font-size: .85rem; margin-bottom: 10px; letter-spacing: .1em; }
.chapter-nav a {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-dim);
  font-size: .9rem; margin-bottom: 2px; transition: .2s;
}
.chapter-nav a:hover { background: var(--card); color: var(--gold); }
.chapter-nav a.active { background: rgba(201,162,39,.14); color: var(--gold); }
.chapter-nav a small { display: block; font-size: .68rem; color: var(--text-mut); }

.reader-main { min-width: 0; }
.reader-head {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  padding: 22px 24px; margin-bottom: 18px;
}
.reader-head h2 { font-size: 1.6rem; margin-bottom: 4px; }
.reader-head .theme { color: var(--gold); font-size: .92rem; letter-spacing: .05em; }
.reader-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; }
.reader-toolbar .icon-btn { width: 34px; height: 34px; font-size: .9rem; }
.tool-label { font-size: .75rem; color: var(--text-mut); margin-right: 2px; }

/* 对照层切换 */
.layer-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.layer-tab {
  padding: 7px 16px; border-radius: 100px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: .85rem; transition: .25s;
}
.layer-tab.active { background: var(--gold); color: #1a1710; font-weight: 600; border-color: var(--gold); }

.reader-content {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  padding: 30px 30px 24px; min-height: 360px;
}
.reader-para { margin-bottom: 18px; position: relative; }
.reader-para .idx { color: var(--text-mut); font-size: .78rem; margin-right: 6px; }
.reader-text { font-family: var(--font-serif); font-size: 1.06rem; line-height: 2; }
.reader-trans { color: var(--text-dim); font-size: .96rem; line-height: 1.9; }
.reader-note { color: var(--text-dim); font-size: .9rem; border-left: 2px solid var(--gold); padding-left: 12px; margin-top: 6px; }
mark.hl { background: rgba(201,162,39,.28); color: var(--text); border-radius: 3px; padding: 0 2px; cursor: help; }
mark.hl:hover { background: rgba(201,162,39,.4); }

/* 思维导图 */
.mind-wrap { margin-top: 18px; }
.mind-node {
  border: 1px solid var(--gold); border-radius: 10px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(201,162,39,.12), transparent);
  margin-bottom: 12px;
}
.mind-node .core { color: var(--gold); font-family: var(--font-serif); font-size: 1.08rem; margin-bottom: 8px; }
.mind-branches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mind-branch { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mind-branch b { color: var(--gold); font-size: .9rem; display: block; margin-bottom: 2px; }
.mind-branch span { font-size: .8rem; color: var(--text-dim); }
.mind-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mind-foot .box { background: var(--card); border-radius: 8px; padding: 10px 12px; font-size: .82rem; }
.mind-foot .box b { color: var(--gold); margin-right: 6px; }

/* 划词弹窗 */
.popover {
  position: absolute; z-index: 300; max-width: 280px;
  background: var(--bg-2); border: 1px solid var(--gold); border-radius: 10px;
  padding: 10px 14px; font-size: .84rem; box-shadow: var(--shadow); display: none;
}
.popover.show { display: block; }
.popover b { color: var(--gold); }

/* ================= 沙盘推演 ================= */
.sandbox-tabs { display: flex; gap: 10px; margin-bottom: 22px; justify-content: center; flex-wrap: wrap; }
.sandbox-tab { padding: 9px 22px; border-radius: 100px; border: 1px solid var(--border); background: var(--card); color: var(--text-dim); font-size: .92rem; }
.sandbox-tab.active { background: var(--gold); color: #1a1710; font-weight: 600; }
.scene-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.scene-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 22px; cursor: pointer; transition: .3s; }
.scene-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow); }
.scene-card .badge { font-size: .72rem; padding: 3px 10px; border-radius: 100px; background: rgba(201,162,39,.14); color: var(--gold); display: inline-block; margin-bottom: 10px; }
.scene-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.scene-card .meta { font-size: .78rem; color: var(--text-mut); margin-bottom: 10px; }
.scene-card .setup { font-size: .86rem; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 推演过程 */
.sim-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 24px; }
.sim-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sim-head h2 { font-size: 1.4rem; }
.sim-back { color: var(--text-dim); font-size: .85rem; cursor: pointer; }
.sim-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.sim-info .box { background: var(--bg-2); border-radius: 8px; padding: 10px 14px; font-size: .84rem; }
.sim-info .box b { color: var(--gold); display: block; margin-bottom: 2px; font-size: .8rem; }
.sim-question { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.8; margin-bottom: 20px; }
.sim-options { display: flex; flex-direction: column; gap: 12px; }
.sim-opt {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: 14px 16px; text-align: left; color: var(--text); font-size: .94rem; transition: .25s;
}
.sim-opt:hover { border-color: var(--gold); background: rgba(201,162,39,.08); }
.sim-result {
  border-radius: 10px; padding: 18px 20px; margin-top: 18px; border: 1px solid var(--gold);
  background: linear-gradient(120deg, rgba(201,162,39,.12), rgba(140,47,47,.06));
}
.sim-result .result-tag { font-size: .8rem; letter-spacing: .1em; color: var(--gold); margin-bottom: 6px; display: block; }
.sim-result p { font-size: .92rem; }
.sim-result .origin { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-family: var(--font-serif); color: var(--text-dim); font-size: .9rem; }
.sim-next { margin-top: 16px; }

/* ================= 闯关学习 ================= */
.quiz-dashboard { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.rank-card { text-align: center; padding: 26px 18px; }
.rank-badge { width: 90px; height: 90px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; border: 2px solid var(--gold); box-shadow: 0 0 24px rgba(201,162,39,.3); }
.rank-card h3 { font-size: 1.25rem; margin-bottom: 4px; }
.rank-card .rank-sub { font-size: .8rem; color: var(--text-mut); margin-bottom: 14px; }
.rank-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.rank-stats .box { background: var(--bg-2); border-radius: 8px; padding: 8px; }
.rank-stats b { display: block; color: var(--gold); font-size: 1.1rem; }
.rank-stats span { font-size: .68rem; color: var(--text-mut); }
.progress-track { height: 8px; background: var(--bg-2); border-radius: 8px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); width: 0; transition: width .8s; border-radius: 8px; }
.badges-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.badge-item { width: 52px; text-align: center; font-size: .62rem; color: var(--text-mut); }
.badge-item .b { font-size: 1.6rem; display: block; filter: grayscale(1); opacity: .45; }
.badge-item.locked .b { filter: grayscale(1); opacity: .35; }
.badge-item.unlocked .b { filter: none; opacity: 1; }
.badge-item.unlocked { color: var(--gold); }

.chapter-progress { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.chapter-progress .row { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.chapter-progress .row .c { width: 54px; color: var(--text-dim); flex-shrink: 0; }
.chapter-progress .bar { flex: 1; height: 8px; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.chapter-progress .bar i { display: block; height: 100%; background: var(--gold); border-radius: 8px; }

.quiz-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 26px; }
.chapter-select { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chapter-select button { padding: 7px 14px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font-size: .82rem; transition: .25s; }
.chapter-select button.active { background: var(--gold); color: #1a1710; border-color: var(--gold); font-weight: 600; }
.question-box { max-width: 680px; margin: 0 auto; }
.q-type { font-size: .72rem; color: var(--gold); border: 1px solid var(--border); padding: 2px 10px; border-radius: 100px; }
.q-diff { font-size: .7rem; color: var(--text-mut); margin-left: 8px; }
.q-text { font-family: var(--font-serif); font-size: 1.14rem; line-height: 1.9; margin: 14px 0 20px; }
.q-opts { display: flex; flex-direction: column; gap: 10px; }
.q-opt {
  border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px;
  background: var(--card); color: var(--text); text-align: left; font-size: .93rem; transition: .25s;
}
.q-opt:hover { border-color: var(--gold); }
.q-opt.correct { border-color: #3a8c3f; background: rgba(58,140,63,.12); }
.q-opt.wrong { border-color: var(--red); background: rgba(140,47,47,.12); }
.q-opt .mark { margin-right: 8px; }
.q-feedback { margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-size: .88rem; border: 1px solid var(--border); display: none; }
.q-feedback.show { display: block; }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 10px; flex-wrap: wrap; }
.q-counter { font-size: .84rem; color: var(--text-mut); }
.quiz-done { text-align: center; padding: 30px 0; }
.quiz-done .big { font-size: 3rem; margin-bottom: 10px; }
.quiz-done h3 { margin-bottom: 8px; }

/* ================= 案例智库 ================= */
.case-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; justify-content: center; }
.case-filter button { padding: 8px 18px; border-radius: 100px; border: 1px solid var(--border); background: var(--card); color: var(--text-dim); font-size: .86rem; transition: .25s; }
.case-filter button.active { background: var(--gold); color: #1a1710; border-color: var(--gold); font-weight: 600; }
.case-search { max-width: 420px; margin: 0 auto 20px; position: relative; }
.case-search input {
  width: 100%; padding: 12px 18px; border-radius: 100px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: .92rem; outline: none; transition: .25s;
}
.case-search input:focus { border-color: var(--gold); }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.case-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 20px; cursor: pointer; transition: .3s; display: flex; flex-direction: column; }
.case-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--shadow); }
.case-type { font-size: .72rem; padding: 3px 10px; border-radius: 100px; align-self: flex-start; margin-bottom: 10px; }
.case-type.ancient { background: rgba(140,47,47,.14); color: #d98a8a; }
.case-type.business { background: rgba(201,162,39,.14); color: var(--gold); }
.case-type.life { background: rgba(90,120,180,.14); color: #8aa7d6; }
.case-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.case-card .meta { font-size: .76rem; color: var(--text-mut); margin-bottom: 10px; }
.case-card .story { font-size: .86rem; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.case-card .link-ch { margin-top: auto; padding-top: 10px; font-size: .78rem; color: var(--gold); }

/* 案例详情弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal {
  max-width: 720px; width: 100%; max-height: 86vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 28px; position: relative; box-shadow: var(--shadow);
}
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 1.3rem; }
.modal h2 { font-size: 1.5rem; margin-bottom: 6px; }
.modal .meta { color: var(--text-mut); font-size: .84rem; margin-bottom: 16px; }
.modal h4 { color: var(--gold); margin: 16px 0 6px; font-size: 1rem; }
.modal p { font-size: .94rem; color: var(--text-dim); }
.modal .story-full { font-size: .96rem; color: var(--text); line-height: 1.9; }

/* ================= 谋略图谱 ================= */
.map-flow { display: flex; gap: 12px; align-items: stretch; overflow-x: auto; padding-bottom: 10px; }
.map-stage { min-width: 200px; flex: 1; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px; position: relative; }
.map-stage .stage-name { color: var(--gold); font-family: var(--font-serif); font-size: 1.02rem; margin-bottom: 8px; }
.map-stage .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.map-stage .chip { font-size: .76rem; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); color: var(--text-dim); cursor: pointer; transition: .2s; }
.map-stage .chip:hover { color: var(--gold); background: rgba(201,162,39,.14); }
.map-stage .stage-desc { font-size: .78rem; color: var(--text-mut); }
.map-arrow { display: flex; align-items: center; color: var(--gold); font-size: 1.3rem; flex-shrink: 0; }

.dict-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dict-card { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 16px; transition: .25s; }
.dict-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.dict-card h4 { color: var(--gold); font-family: var(--font-serif); font-size: 1.02rem; margin-bottom: 4px; }
.dict-card .exp { font-size: .8rem; color: var(--text-dim); margin-bottom: 8px; }
.dict-card .use { font-size: .76rem; color: var(--text-mut); border-top: 1px dashed var(--border); padding-top: 8px; }
.dict-card .use b { color: var(--gold); font-weight: 500; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--gold), var(--gold-dark), transparent); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,39,.15); }
.tl-item .era { font-size: .76rem; color: var(--gold); letter-spacing: .06em; }
.tl-item h4 { font-size: 1.02rem; margin: 2px 0; }
.tl-item p { font-size: .86rem; color: var(--text-dim); }

/* ================= 底部 ================= */
.footer { border-top: 1px solid var(--border); padding: 28px 0 90px; margin-top: 30px; text-align: center; color: var(--text-mut); font-size: .8rem; }
.footer .links { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

/* ================= 底部Tab（移动端） ================= */
.bottom-tab {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; display: none;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-tab a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-mut); font-size: .62rem; padding: 5px 0; border-radius: 8px; }
.bottom-tab a .ic { font-size: 1.2rem; }
.bottom-tab a.active { color: var(--gold); }

/* ================= 响应式 ================= */
@media (max-width: 980px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-wrap { grid-template-columns: 1fr; }
  .grid-3, .case-grid, .dict-grid { grid-template-columns: repeat(2, 1fr); }
  .scene-list { grid-template-columns: 1fr; }
  .reader-layout { grid-template-columns: 1fr; }
  .chapter-nav { position: static; max-height: none; }
  .quiz-dashboard { grid-template-columns: 1fr; }
  .map-flow { flex-direction: column; }
  .map-arrow { transform: rotate(90deg); justify-content: center; }
  .mind-branches { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .case-grid, .dict-grid { grid-template-columns: 1fr; }
  .grid-2, .sim-info { grid-template-columns: 1fr; }
  .section { padding: 28px 0; }
  .hero { padding: 46px 14px 36px; }
  .bottom-tab { display: grid; }
  body { padding-bottom: 64px; }
  .footer { padding-bottom: 30px; }
  .sim-head h2 { font-size: 1.15rem; }
  .mind-foot { grid-template-columns: 1fr; }
}

/* ================= 动画 ================= */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.floaty { animation: floaty 3s ease-in-out infinite; }
@keyframes pulse-gold { 0%,100% { box-shadow: 0 0 0 0 rgba(201,162,39,.4); } 50% { box-shadow: 0 0 0 8px rgba(201,162,39,0); } }
.pulse { animation: pulse-gold 2s infinite; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
