/* ==========================================================
   五维全息生命系统 · 样式系统
   宣纸 / 玄墨 / 朱砂 三色体系，手机 PC 通用
   ========================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --bg:        #F4F0E6;
  --bg-soft:   #FBF8F1;
  --surface:   #FFFDF8;
  --surface-2: #F2EDE2;
  --surface-3: #E9E2D4;
  --ink:       #2A2521;
  --ink-2:     #5B534A;
  --ink-3:     #8C8377;
  --line:      #E2D9C8;
  --line-2:    #D3C8B4;

  --cinnabar:  #B03A2E;
  --cinnabar-2:#D9604F;
  --cinnabar-s:#F0DFDB;
  --jade:      #3E7C6E;
  --jade-s:    #DCEAE6;
  --gold:      #B8893B;
  --gold-s:    #F2E7D2;
  --indigo:    #5A5AA8;
  --indigo-s:  #E4E4F2;
  --wood:      #4E8A4E;
  --water:     #3D6B8C;

  --shadow-s: 0 1px 2px rgba(60,48,32,.06), 0 2px 8px rgba(60,48,32,.05);
  --shadow-m: 0 2px 6px rgba(60,48,32,.07), 0 10px 28px rgba(60,48,32,.08);
  --shadow-l: 0 8px 40px rgba(60,48,32,.14);

  --r-s: 8px; --r-m: 14px; --r-l: 20px; --r-xl: 28px;
  --sidebar-w: 232px;
  --header-h: 60px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html[data-theme="dark"] {
  --bg:        #14161A;
  --bg-soft:   #191C21;
  --surface:   #1F232A;
  --surface-2: #252A32;
  --surface-3: #2E343D;
  --ink:       #EAE5DA;
  --ink-2:     #BDB5A8;
  --ink-3:     #8A8377;
  --line:      #2E343D;
  --line-2:    #3A424C;

  --cinnabar:  #D96A5B;
  --cinnabar-2:#E88C7E;
  --cinnabar-s:#3A2A28;
  --jade:      #6FAFA0;
  --jade-s:    #223230;
  --gold:      #D0A55A;
  --gold-s:    #332B1D;
  --indigo:    #8A8ADC;
  --indigo-s:  #262640;
  --wood:      #7FB07F;
  --water:     #6B9CC4;

  --shadow-s: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.24);
  --shadow-m: 0 2px 6px rgba(0,0,0,.34), 0 10px 28px rgba(0,0,0,.34);
  --shadow-l: 0 8px 40px rgba(0,0,0,.5);
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(900px 480px at 12% -8%, rgba(176,58,46,.06), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, rgba(62,124,110,.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(900px 480px at 12% -8%, rgba(217,106,91,.10), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, rgba(111,175,160,.09), transparent 60%);
}
h1,h2,h3,h4 { font-family: var(--font-serif); font-weight: 700; margin: 0 0 .5em; line-height: 1.35; letter-spacing: .02em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; }
p { margin: 0 0 .9em; }
a { color: var(--cinnabar); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
ul { margin: 0; padding-left: 1.2em; }
::selection { background: var(--cinnabar-s); color: var(--ink); }

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

/* ---------- 3. 布局骨架 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-seal {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  background: linear-gradient(140deg, var(--cinnabar), #8E2C22);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 20px; font-weight: 700;
  box-shadow: var(--shadow-s);
}
.brand-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-label { font-size: 11px; color: var(--ink-3); letter-spacing: .16em; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px; border-radius: var(--r-s);
  color: var(--ink-2); font-size: 14px; transition: all .18s var(--ease);
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--cinnabar-s); color: var(--cinnabar);
  border-color: rgba(176,58,46,.2); font-weight: 600;
}
.nav-item .ic { width: 20px; text-align: center; font-size: 15px; }
.nav-item .badge { margin-left: auto; font-size: 11px; background: var(--surface-3); color: var(--ink-3); border-radius: 20px; padding: 0 7px; }

.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg-soft) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { font-family: var(--font-serif); font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }

.content { flex: 1; padding: 22px 20px 80px; }
.wrap { max-width: var(--maxw); margin: 0 auto; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); display: grid; place-items: center; font-size: 16px;
  transition: all .18s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-1px); }

.menu-btn { display: none; }

/* 移动端底部导航 */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
}
.tabbar .row { display: flex; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 2px; color: var(--ink-3); font-size: 10.5px; border: 0; background: none;
}
.tab .ic { font-size: 18px; line-height: 1; }
.tab.active { color: var(--cinnabar); font-weight: 600; }

/* ---------- 4. 通用组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 18px;
  box-shadow: var(--shadow-s);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
}
.card.hoverable:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); border-color: var(--line-2); }
.card-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.card-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cinnabar); }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g4 { grid-template-columns: repeat(4,1fr); }
.g-auto { grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; transition: all .18s var(--ease);
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; box-shadow: 0 2px 10px rgba(176,58,46,.24); }
.btn.primary:hover { background: var(--cinnabar-2); border-color: var(--cinnabar-2); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 13px 30px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.cin { background: var(--cinnabar-s); color: var(--cinnabar); border-color: transparent; }
.chip.jade { background: var(--jade-s); color: var(--jade); border-color: transparent; }
.chip.gold { background: var(--gold-s); color: var(--gold); border-color: transparent; }
.chip.indigo { background: var(--indigo-s); color: var(--indigo); border-color: transparent; }
.chip.click { cursor: pointer; transition: all .16s var(--ease); }
.chip.click:hover { filter: brightness(.96); transform: translateY(-1px); }
.chip.click.on { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }

.tag { font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }

.kv { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { flex: 0 0 76px; color: var(--ink-3); font-size: 13px; }

.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt0{margin-top:0}.mt1{margin-top:8px}.mt2{margin-top:16px}.mt3{margin-top:24px}.mt4{margin-top:34px}
.mb1{margin-bottom:8px}.mb2{margin-bottom:16px}.mb3{margin-bottom:24px}
.rowflex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* ---------- 5. 首页 ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-m);
  min-height: 260px;
  display: flex; align-items: stretch;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 40%;
  opacity: .3;
}
html[data-theme="dark"] .hero-bg { opacity: .18; filter: saturate(.7); }
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--surface) 6%, color-mix(in srgb, var(--surface) 78%, transparent) 46%, transparent 88%);
}
.hero-inner { position: relative; padding: 30px 30px; max-width: 640px; }
.hero-eyebrow { font-size: 12px; letter-spacing: .3em; color: var(--cinnabar); margin-bottom: 10px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 12px; letter-spacing: .06em; }
.hero .lead { color: var(--ink-2); font-size: 14.5px; max-width: 480px; }
.hero-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; right: 0; top: 0; bottom: 0; width: 42%;
  background-size: cover; background-position: center;
  opacity: .5; mask-image: linear-gradient(90deg, transparent, #000 40%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
}
@media (max-width: 820px) { .hero-scroll { display: none; } }

.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 14px; text-align: center;
}
.stat .v { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; letter-spacing: .08em; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }
.quick {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 16px 14px; text-align: center; transition: all .2s var(--ease); cursor: pointer;
}
.quick:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--line-2); }
.quick .ic { font-size: 24px; line-height: 1; margin-bottom: 8px; }
.quick .t { font-family: var(--font-serif); font-size: 14.5px; font-weight: 700; }
.quick .d { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }

/* ---------- 6. 3D 舞台 ---------- */
.stage {
  position: relative; border-radius: var(--r-m); overflow: hidden;
  border: 1px solid var(--line); background:
    radial-gradient(circle at 50% 45%, var(--surface-2), var(--bg-soft) 70%);
  min-height: 340px;
}
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-hint {
  position: absolute; left: 12px; bottom: 10px; font-size: 11.5px; color: var(--ink-3);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: 3px 9px; border-radius: 20px; pointer-events: none;
}
.stage-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.stage-legend {
  position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 5px;
  pointer-events: none;
}
.stage-legend .li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.stage-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.stage-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 24px; color: var(--ink-3); font-size: 13px;
}

/* ---------- 7. 五维环形 / 传导链 ---------- */
.chain { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.chain-node {
  flex: 1; min-width: 110px; text-align: center; padding: 12px 8px;
  border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface);
  position: relative; cursor: pointer; transition: all .2s var(--ease);
}
.chain-node:hover { transform: translateY(-2px); box-shadow: var(--shadow-s); }
.chain-node .nm { font-family: var(--font-serif); font-size: 17px; font-weight: 700; }
.chain-node .lv { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.chain-arrow { display: grid; place-items: center; color: var(--ink-3); font-size: 16px; flex: 0 0 26px; }

.dim-card {
  border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface);
  overflow: hidden; transition: all .22s var(--ease);
}
.dim-card:hover { box-shadow: var(--shadow-m); }
.dim-card .hd { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.dim-card .seal {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #fff;
}
.dim-card .bd { padding: 14px 16px; font-size: 13.5px; color: var(--ink-2); }
.dim-card .list { margin: 0; padding-left: 1.1em; }
.dim-card .list li { margin-bottom: 4px; }

.facet { margin-bottom: 12px; }
.facet .fh { font-size: 12px; color: var(--ink-3); letter-spacing: .1em; margin-bottom: 5px; }

/* ---------- 8. 九宫格 ---------- */
.luoshu {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
  max-width: 420px; margin: 0 auto; aspect-ratio: 1;
}
.cell {
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s var(--ease); position: relative; overflow: hidden;
  padding: 6px;
}
.cell:hover { transform: scale(1.03); box-shadow: var(--shadow-m); z-index: 2; }
.cell.on { border-color: var(--cinnabar); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cinnabar) 30%, transparent); }
.cell .gua { font-size: 30px; line-height: 1; }
.cell .nm { font-family: var(--font-serif); font-size: 13px; font-weight: 700; margin-top: 2px; }
.cell .num { position: absolute; top: 5px; right: 7px; font-size: 11px; color: var(--ink-3); }
.cell .el { font-size: 10.5px; color: var(--ink-3); }
.cell .score { position: absolute; bottom: 4px; left: 0; right: 0; font-size: 11px; font-weight: 700; }

.wuxing-ring { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.wx-el {
  width: 96px; text-align: center; padding: 12px 6px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: all .2s var(--ease);
}
.wx-el:hover { transform: translateY(-2px); box-shadow: var(--shadow-s); }
.wx-el .ch { font-family: var(--font-serif); font-size: 26px; font-weight: 700; }
.wx-el .sb { font-size: 11px; color: var(--ink-3); }

/* ---------- 9. 卦象 ---------- */
.hex-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(96px,1fr)); gap: 8px; }
.hex-item {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 10px 6px; text-align: center; cursor: pointer; transition: all .18s var(--ease);
}
.hex-item:hover { background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-s); }
.hex-item .sym { font-size: 26px; line-height: 1.1; }
.hex-item .nm { font-family: var(--font-serif); font-size: 13.5px; font-weight: 700; }
.hex-item .no { font-size: 10.5px; color: var(--ink-3); }
.hex-big { font-size: 78px; line-height: 1; text-align: center; }

/* ---------- 10. 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-soft); color: var(--ink);
  font-family: inherit; font-size: 14px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: 0; border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cinnabar) 14%, transparent);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

/* 评分区 */
.score-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.score-row:last-child { border-bottom: 0; }
.score-row .q { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.scale { display: flex; gap: 4px; }
.scale button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--bg-soft); color: var(--ink-2); font-size: 13px; font-weight: 600;
  transition: all .14s var(--ease); padding: 0;
}
.scale button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.scale button.on { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
@media (max-width: 560px) {
  .score-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .scale { justify-content: space-between; }
  .scale button { flex: 1; }
}

/* ---------- 11. 计时器 ---------- */
.timer-wrap { text-align: center; padding: 10px 0; }
.timer-ring { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  flex-direction: column;
}
.timer-num .t { font-family: var(--font-serif); font-size: 3rem; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.timer-num .s { font-size: 12px; color: var(--ink-3); margin-top: 6px; letter-spacing: .14em; }
.timer-cue {
  margin: 16px auto 0; max-width: 520px; font-family: var(--font-serif);
  font-size: 1.05rem; color: var(--ink-2); min-height: 2.6em; line-height: 1.7;
}
.breath {
  width: 130px; height: 130px; border-radius: 50%; margin: 0 auto;
  background: radial-gradient(circle, color-mix(in srgb, var(--jade) 30%, transparent), transparent 70%);
  transition: transform 4s cubic-bezier(.37,0,.63,1);
}
.breath.in { transform: scale(1.28); }
.breath.out { transform: scale(.82); }

/* ---------- 12. 图表 ---------- */
.chart-box { width: 100%; position: relative; }
.chart-box canvas { width: 100%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend .li { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- 13. 列表 / 时间线 ---------- */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--cinnabar); box-shadow: 0 0 0 3px var(--cinnabar-s);
}
.tl-item .t { font-family: var(--font-serif); font-weight: 700; font-size: 14.5px; }
.tl-item .d { font-size: 13px; color: var(--ink-2); }

.rec-item {
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center;
  transition: all .18s var(--ease);
}
.rec-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-s); }
.rec-item .main { flex: 1; min-width: 0; }
.rec-item .t1 { font-weight: 600; font-size: 14px; }
.rec-item .t2 { font-size: 12px; color: var(--ink-3); }

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

/* ---------- 14. 弹窗 / 抽屉 / 提示 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,24,18,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .2s var(--ease);
}
.mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line);
  box-shadow: var(--shadow-l); width: 100%; max-width: 620px; max-height: 86vh;
  display: flex; flex-direction: column; animation: popIn .24s var(--ease);
}
.modal .mh {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.modal .mh h3 { margin: 0; flex: 1; font-size: 1.12rem; }
.modal .mb { padding: 18px 20px; overflow-y: auto; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
.rise { animation: riseIn .38s var(--ease) both; }

.toast-host { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg-soft); padding: 9px 18px; border-radius: 22px;
  font-size: 13.5px; box-shadow: var(--shadow-m); animation: popIn .2s var(--ease);
}
html[data-theme="dark"] .toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); }

/* ---------- 15. 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--ink-3); font-weight: 600; font-size: 12.5px; letter-spacing: .06em; }
.table tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 16. 页脚 ---------- */
.foot {
  padding: 26px 20px 30px; text-align: center; font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line); margin-top: 30px;
}
.foot .disclaimer {
  max-width: 720px; margin: 0 auto 10px; padding: 10px 14px;
  background: var(--cinnabar-s); border-radius: 10px; color: var(--cinnabar); font-size: 12px;
}

/* ---------- 17. 响应式 ---------- */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
  .g3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-l);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .content { padding: 16px 14px 92px; }
  .tabbar { display: block; }
  .hero-inner { padding: 24px 20px; }
  .hero h1 { font-size: 1.65rem; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .topbar { padding: 0 14px; }
  .toast-host { bottom: 96px; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.55rem; }
  .card { padding: 15px; }
  .timer-ring { width: 200px; height: 200px; }
  .timer-num .t { font-size: 2.4rem; }
  .hex-grid { grid-template-columns: repeat(auto-fill,minmax(78px,1fr)); }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
}
@media print {
  .sidebar, .topbar, .tabbar, .foot { display: none !important; }
  .content { padding: 0; }
}
