/* 问仙录 · 刻本 · 拓片
   夜（默认）＝碑拓：墨底拓白；昼＝刻本：纸底墨字。
   不用圆角、阴影和卡片；以版框、界栏、版心、鱼尾分区。朱砂只给决断。 */
:root {
  --bg: #12110f;
  --bg-2: #1a1916;
  --bg-3: #23211d;
  --ink: #ece4d2;
  --ink-2: #b6ad9b;
  --ink-3: #7d7669;
  --rule: #5a5348;
  --rule-2: #34302a;
  --zhu: #b8402f;
  --zhu-text: #d9674f;
  --zhu-hover: #c9503c;
  --zhu-press: #8e2d21;
  --jin: #c6a55c;
  --seal-ink: #f4ead6;
  --veil: rgba(6, 5, 4, 0.74);
  /* 封面布面 */
  --cloth: #191d26;
  --spine: #141820;
  --spine-line: #2a303c;
  --thread: #cfc6b2;
  --hole: #07080b;
  --label: #e8dfc8;
  --cloth-rule: #2f3542;
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #eee5cf;
  --bg-2: #f5eedd;
  --bg-3: #e5dac0;
  --ink: #1c1915;
  --ink-2: #4b4438;
  --ink-3: #857964;
  --rule: #a79673;
  --rule-2: #cdbf9f;
  --zhu: #a8352a;
  --zhu-text: #a8352a;
  --zhu-hover: #b9463a;
  --zhu-press: #7d2219;
  --jin: #8f702c;
  --veil: rgba(40, 32, 20, 0.45);
  --cloth: #cdbf9e;
  --spine: #bdae8a;
  --spine-line: #a8996f;
  --thread: #5c4f33;
  --hole: #3a3222;
  --label: #f5efe0;
  --cloth-rule: #a8996f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
small { font-size: 13px; color: var(--ink-2); }
:focus-visible { outline: 1px solid var(--zhu-text); outline-offset: 3px; }
::selection { background: var(--zhu); color: var(--seal-ink); }

/* ── 字 ── */
.t-label { font-weight: 600; font-size: 12px; letter-spacing: 0.35em; color: var(--ink-3); line-height: 1.6; }
.dim { color: var(--ink-3); }
.zhu { color: var(--zhu-text); }
.jin { color: var(--jin); }
.v { writing-mode: vertical-rl; text-orientation: mixed; }

/* ── 界栏 ── */
.jie { border-top: 1px solid var(--rule-2); }
.jie-2 { height: 4px; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* ── 印章 ── */
.seal {
  display: inline-flex; align-items: center; justify-content: center; background: var(--zhu); color: var(--seal-ink);
  font-weight: 900; line-height: 1.05; text-align: center; letter-spacing: 0; transition: background 0.12s, box-shadow 0.12s;
}
button.seal:hover:not(:disabled) { background: var(--zhu-hover); box-shadow: inset 0 0 0 4px var(--zhu-hover), inset 0 0 0 5px rgba(244, 234, 214, 0.55); }
button.seal:active:not(:disabled) { background: var(--zhu-press); box-shadow: none; }
.seal:disabled { opacity: 0.35; }
.seal-o {
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--zhu); color: var(--zhu-text);
  font-weight: 900; line-height: 1.05; text-align: center;
}
button.seal-o:hover { background: var(--bg-3); }
.seal-wide { height: 48px; padding: 0 22px 0 calc(22px + 0.3em); font-size: 19px; letter-spacing: 0.3em; }
.seal-mini { width: 46px; height: 46px; font-size: 17px; }

/* ── 文字按钮 ── */
.tbtn { position: relative; font-size: 15px; color: var(--ink-2); letter-spacing: 0.1em; padding: 4px 0; transition: color 0.12s; white-space: nowrap; }
.tbtn:hover:not(:disabled) { color: var(--ink); }
.tbtn:hover:not(:disabled)::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--zhu-text);
}
.tbtn.on { color: var(--ink); font-weight: 600; }
.tbtn:disabled { color: var(--ink-3); opacity: 0.5; }
.tsep { display: inline-block; width: 1px; height: 14px; background: var(--rule); flex: none; }
.quan {
  display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%;
  color: var(--ink-2); font-size: 15px; border: 1.5px solid transparent; flex: none;
}
.quan:hover { color: var(--ink); }
.quan.on { border-color: var(--zhu-text); color: var(--ink); font-weight: 700; }
.quan2 { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 11px; border-radius: 50%; color: var(--ink-2); border: 1.5px solid transparent; font-size: 16px; }
.quan2:hover { color: var(--ink); }
.quan2.on { border-color: var(--zhu-text); color: var(--ink); font-weight: 700; }

/* ── 圈点 ── */
.dots { display: inline-flex; gap: 5px; align-items: center; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink-3); }
.dots i.on { background: var(--ink); border-color: var(--ink); }
.dots i.half { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); border-color: var(--ink); }

/* ── 刻度尺（修为） ── */
.ruler { position: relative; height: 18px; }
.ruler .base { position: absolute; left: 0; right: 0; top: 12px; height: 1px; background: var(--rule); }
.ruler .ticks {
  position: absolute; left: 0; right: 0; top: 6px; height: 7px; border-right: 1px solid var(--ink-3);
  background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px calc(100% / var(--stages, 4)));
}
.ruler .ticks::before { content: ''; position: absolute; left: 0; top: -4px; width: 1px; height: 11px; background: var(--ink-3); }
.ruler .fill { position: absolute; left: 0; top: 11px; height: 3px; background: var(--jin); width: calc(var(--fill, 0) * 100%); transition: width 0.5s; }
.ruler.ready .fill { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ── 香（寿元、随缘倒计时） ── */
.xiang { position: relative; height: 10px; --used: 0; }
.xiang .stick { position: absolute; left: 0; top: 4px; height: 2px; background: var(--ink-3); width: calc((1 - var(--used)) * 100%); }
.xiang .ash {
  position: absolute; top: 4px; right: 0; height: 2px; left: calc((1 - var(--used)) * 100%);
  background: repeating-linear-gradient(90deg, var(--rule-2) 0 3px, transparent 3px 6px);
}
.xiang .ember {
  position: absolute; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--zhu-text);
  left: calc((1 - var(--used)) * 100% - 3px); box-shadow: 0 0 8px 2px rgba(217, 103, 79, 0.55);
}
.xiang.late .stick { background: var(--zhu-text); }

/* ── 竖签 ── */
.slips { display: flex; flex-direction: row-reverse; gap: 10px; }
.slip {
  position: relative; width: 44px; height: 132px; border: 1px solid var(--rule); padding-top: 16px; font-size: 16px; color: var(--ink-2);
  writing-mode: vertical-rl; text-orientation: upright; display: flex; align-items: center; letter-spacing: 0.06em; flex: none;
  transition: border-color 0.12s, color 0.12s;
}
.slip:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); }
.slip.on { border-color: var(--ink); color: var(--ink); font-weight: 700; background: var(--bg-3); }
.slip:disabled { border-style: dashed; color: var(--ink-3); opacity: 0.55; }
.slip .mark {
  position: absolute; top: -10px; left: 50%; margin-left: -10px; width: 20px; height: 20px; background: var(--zhu); color: var(--seal-ink);
  font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; writing-mode: horizontal-tb; line-height: 1;
}
.slip .mark.tian { background: var(--jin); color: var(--bg); }

/* ── 批注 ── */
.note { color: var(--jin); font-size: 12px; letter-spacing: 0.05em; }
.note .bad { color: var(--zhu-text); }

/* ═════════════ 首页 · 线装书封面 ═════════════ */
.home { position: relative; min-height: 100vh; background: var(--cloth); overflow: hidden; }
.home::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px);
}
.spine { position: absolute; right: 0; top: 0; bottom: 0; width: 100px; background: var(--spine); border-left: 1px solid var(--spine-line); }
.spine .thread { position: absolute; left: 37px; top: 0; bottom: 0; width: 2px; background: var(--thread); opacity: 0.7; }
.spine b { position: absolute; left: 34px; width: 8px; height: 8px; border-radius: 50%; background: var(--hole); }
.spine b::after { content: ''; position: absolute; left: 3px; top: 3px; width: 63px; height: 2px; background: var(--thread); opacity: 0.7; }
.spine b:nth-of-type(1) { top: 16%; }
.spine b:nth-of-type(2) { top: 37%; }
.spine b:nth-of-type(3) { top: 63%; }
.spine b:nth-of-type(4) { top: 84%; }
.home-theme { position: absolute; right: 140px; top: 36px; z-index: 2; }
.home-inner {
  position: relative; max-width: 1240px; margin: 0 auto; padding: 84px 160px 90px 60px;
  display: grid; grid-template-columns: 136px minmax(0, 560px) 230px; gap: 0 88px; align-items: start; justify-content: center;
}
.tiqian {
  position: relative; height: 560px; background: var(--label); color: #1c1915; border: 2px solid #1c1915; outline: 8px solid var(--label);
  margin: 8px; display: flex; flex-direction: row-reverse; justify-content: center; gap: 12px; padding-top: 34px; width: 120px;
}
.tiqian::after { content: ''; position: absolute; inset: 3px; border: 1px solid #1c1915; pointer-events: none; }
.tq-title { writing-mode: vertical-rl; font-size: 70px; font-weight: 900; line-height: 1.08; letter-spacing: 0.06em; margin: 0; }
.tq-sub { writing-mode: vertical-rl; font-size: 13px; color: #4b4438; margin-top: 6px; letter-spacing: 0.1em; }
.tq-foot { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); writing-mode: vertical-rl; font-size: 13px; color: #4b4438; letter-spacing: 0.2em; }
.juanshou { padding-top: 12px; }
.js-lead { font-size: clamp(28px, 3.2vw, 40px); font-weight: 900; line-height: 1.35; letter-spacing: 0.06em; margin-top: 16px; }
.js-copy { font-size: 16px; line-height: 1.9; color: var(--ink-2); margin-top: 18px; }
.js-copy + .js-copy { margin-top: 8px; }
.past { margin-top: 64px; }
.past-item { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 14px; align-items: baseline; }
.past-item b { font-weight: 700; }
.past-item .meta { color: var(--ink-3); }
.past-item .ttl { color: var(--zhu-text); }
.home-side { padding-top: 12px; display: flex; flex-direction: column; gap: 64px; }
.census-row { margin-top: 14px; }
.census-row .top { display: flex; justify-content: space-between; font-size: 14px; }
.census-row b { font-weight: 700; }
.census-row span { color: var(--ink-3); }
.census-row i { display: block; height: 2px; background: var(--ink); margin-top: 6px; }
.census small { display: block; margin-top: 14px; font-size: 12px; }
.enter { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
/* 入世：两个金色大字，不做成印章 */
.ru-shi {
  font-size: 66px; font-weight: 900; line-height: 1.12; color: var(--jin); letter-spacing: 0; padding: 4px 18px;
  transition: text-shadow 0.25s, color 0.25s;
}
.ru-shi:hover { text-shadow: 0 0 22px rgba(198, 165, 92, 0.55); }
.ru-shi:active { opacity: 0.8; }
.resume { margin-top: 6px; border-top: 1px solid var(--cloth-rule); padding-top: 14px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.resume b { font-weight: 700; }
.home-foot { position: absolute; left: 0; right: 100px; bottom: 30px; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ═════════════ 轮回转盘 ═════════════ */
.wheel { position: fixed; inset: 0; background: #0b0a09; color: #ece4d2; z-index: 50; overflow: hidden; --r: min(300px, 36vmin); }
.wheel-ring {
  position: absolute; left: 50%; top: 49%; width: calc(var(--r) * 2 + 68px); height: calc(var(--r) * 2 + 68px); transform: translate(-50%, -50%);
  border: 1px solid #3b3631; border-radius: 50%;
}
.wheel-ring::before { content: ''; position: absolute; inset: 68px; border: 1px solid #3b3631; border-radius: 50%; }
.wheel-ring::after { content: ''; position: absolute; inset: 108px; border: 1px dashed rgba(184, 64, 47, 0.6); border-radius: 50%; }
.ring-chars { position: absolute; inset: 0; animation: spin 48s linear infinite; }
.ring-chars span {
  position: absolute; left: 50%; top: 50%; width: 22px; margin: -13px 0 0 -11px; text-align: center; font-size: 20px; color: #7d7669;
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1));
}
.wheel.lock .ring-chars { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.wheel-pointer {
  position: absolute; left: 50%; top: calc(49% - var(--r) - 66px); width: 0; height: 0; margin-left: -8px;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 14px solid #d9674f;
}
.wheel-text { position: absolute; left: 0; right: 0; top: 49%; transform: translateY(-50%); text-align: center; padding: 0 16px; }
.wheel-text .t-label { color: #8f887b; }
.wheel-main { font-size: clamp(54px, 9vmin, 88px); font-weight: 900; line-height: 1.2; margin-top: 14px; letter-spacing: 0.06em; color: #ece4d2; }
.wheel.lock .wheel-main { color: #d9674f; animation: stamp 0.35s ease-out; }
@keyframes stamp { from { transform: scale(1.3); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
.wheel-prob { font-size: 13px; color: #b6ad9b; margin-top: 16px; min-height: 1.7em; }
.wheel-done { position: absolute; left: 9vw; top: 22vh; display: flex; flex-direction: row-reverse; gap: 22px; writing-mode: horizontal-tb; }
.wheel-done p { writing-mode: vertical-rl; font-size: 18px; color: #b6ad9b; letter-spacing: 0.08em; }
.wheel-done .lbl { font-size: 12px; color: #d9674f; font-weight: 700; }
.wheel-steps { position: absolute; right: 9vw; top: 22vh; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 13px; color: #b6ad9b; }
.wheel-steps li { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wheel-steps li::after { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #7d7669; }
.wheel-steps li.done::after { background: #ece4d2; border-color: #ece4d2; }
.wheel-steps li.now { color: #d9674f; font-weight: 700; }
.wheel-steps li.now::after { border-color: #d9674f; }
.wheel-skip { position: absolute; right: 56px; top: 36px; color: #b6ad9b; }

/* ═════════════ 生辰帖 ═════════════ */
.birth { min-height: 100vh; padding: 56px 16px 48px; }
#birthCard { max-width: 1000px; margin: 0 auto; }
.birth-no { text-align: center; }
.gengtie {
  --gold: #e2c38a; --cream: #f1e2bf; --gold-2: #a8864e; --gold-3: #8c6a3c;
  position: relative; margin-top: 26px; width: 100%; min-height: 600px; background: #4f1610; color: var(--cream);
  border: 2px solid var(--gold-2); display: grid; grid-template-columns: 1fr 1px 1fr; animation: rise 0.5s ease-out;
}
.gengtie::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--gold-2); pointer-events: none; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.gt-fold { background: #2e0c08; margin: 5px 0; }
.gt-left { padding: 54px 52px 48px 56px; }
.gt-root { display: flex; gap: 26px; align-items: center; }
.gt-root .rn { font-size: 42px; font-weight: 900; letter-spacing: 0.06em; line-height: 1.1; }
.gt-root .rp { font-size: 14px; color: var(--gold); margin-top: 12px; letter-spacing: 0.1em; }
.gt-desc { font-size: 15px; line-height: 1.9; opacity: 0.85; margin-top: 18px; }
.gt-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; margin-top: 10px; }
.gt-stats span { color: var(--gold); margin-right: 6px; }
.gt-rule { height: 1px; background: #7a5634; margin-top: 24px; }
.gt-label { font-size: 12px; letter-spacing: 0.35em; color: var(--gold); margin-top: 18px; }
.gt-peers { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.gt-peer {
  width: 62px; height: 128px; border: 1px solid var(--gold-3); writing-mode: vertical-rl; padding: 12px 0 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px;
}
.gt-peer b { font-size: 16px; letter-spacing: 0.06em; }
.gt-peer small { font-size: 12px; color: var(--gold); }
.gt-right { position: relative; padding: 54px 56px 48px 40px; }
.gt-cols { writing-mode: vertical-rl; height: 480px; display: flex; flex-direction: column; gap: 30px; }
.gt-cols .qz { font-size: 66px; font-weight: 900; line-height: 1.1; color: var(--gold); letter-spacing: 0.06em; }
.gt-cols p { font-size: 21px; line-height: 1.3; letter-spacing: 0.08em; }
.gt-seal { position: absolute; left: 40px; bottom: 50px; width: 58px; height: 58px; font-size: 20px; transform: rotate(-6deg); border-color: var(--gold); color: var(--gold); }
.root-chart .rc-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.root-chart .rc-axis { stroke: var(--rule); stroke-width: 0.8; }
.root-chart .rc-label { font-size: 11px; fill: var(--ink-3); font-family: var(--serif); }
.root-chart .rc-label.on { fill: var(--zhu-text); font-weight: 700; }
.root-chart .rc-shape { fill: rgba(217, 103, 79, 0.18); stroke: var(--zhu-text); stroke-width: 1.4; }
.root-chart .rc-variant { fill: rgba(217, 103, 79, 0.18); stroke: var(--zhu-text); stroke-width: 1.4; stroke-dasharray: 3 2; }
.root-chart .rc-big { font-size: 20px; fill: var(--zhu-text); font-weight: 900; font-family: var(--serif); }
.root-chart .rc-none { font-size: 15px; fill: var(--ink-3); font-family: var(--serif); }
.gengtie .rc-grid, .gengtie .rc-axis { stroke: var(--gold-3); }
.gengtie .rc-label { fill: var(--gold-2); }
.gengtie .rc-label.on, .gengtie .rc-big { fill: var(--gold); }
.gengtie .rc-shape, .gengtie .rc-variant { fill: rgba(226, 195, 138, 0.2); stroke: var(--gold); }
.gengtie .rc-none { fill: var(--gold-2); }
.birth-foot { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 34px; }

/* ═════════════ 游戏 ═════════════ */
.game { min-height: 100vh; padding: 24px; }
.page {
  position: relative; min-height: calc(100vh - 48px); border: 2px solid var(--rule); padding: 0 32px 28px;
  display: flex; flex-direction: column;
}
.page::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.g-head { height: 86px; display: flex; align-items: center; gap: 28px; position: relative; z-index: 1; }
.g-title { display: flex; align-items: center; gap: 14px; width: 176px; flex: none; }
.g-title b { display: block; font-size: 18px; font-weight: 700; letter-spacing: 0.24em; line-height: 1.3; }
.g-title small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.3em; color: var(--ink-3); margin-top: 3px; }
.g-age { border-left: 1px solid var(--rule-2); padding-left: 28px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.g-age-main { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.g-age-main b { font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: 0.04em; }
.g-age-main b.long { font-size: 34px; }
.g-age-main span { font-size: 17px; }
.g-age-main em { font-style: normal; color: var(--jin); font-size: 18px; font-weight: 700; letter-spacing: 0.12em; margin-left: 14px; }
.g-age-life { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.g-age-life .xiang { width: 200px; flex: none; }
.g-ctl { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.speeds { display: inline-flex; gap: 6px; }
#btnAuto.on { color: var(--ink); font-weight: 700; border: 1.5px solid var(--zhu-text); border-radius: 50%; padding: 3px 10px; }
.g-rule { margin: 0 -26px 22px; }

.g-body {
  flex: 1; min-height: calc(100vh - 48px - 86px - 26px - 28px - 4px);
  display: grid; grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr); column-gap: 28px;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    'log bx scene'
    'log bx token'
    'log bx stats'
    'log bx .'
    'foot bx focus';
}
.pane-log { grid-area: log; contain: size; min-height: 320px; display: flex; gap: 18px; }
.pane-foot { grid-area: foot; border-top: 1px solid var(--rule-2); padding-top: 18px; display: flex; gap: 0; align-self: stretch; }
.banxin { grid-area: bx; margin: -22px 0 -28px; }
.pane-scene { grid-area: scene; margin: 0; }
.pane-token { grid-area: token; }
.pane-stats { grid-area: stats; }
.pane-focus { grid-area: focus; border-top: 1px solid var(--rule-2); padding-top: 22px; }
.pane-tabs { display: none; }

/* 修行录：真竖排，从右往左读，新事在右 */
.lu {
  flex: 1; min-width: 0; height: 100%; writing-mode: vertical-rl; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent; overscroll-behavior: contain; outline: none;
}
.lu::-webkit-scrollbar { height: 6px; }
.lu::-webkit-scrollbar-thumb { background: var(--rule-2); }
.lu-head { writing-mode: vertical-rl; display: flex; align-items: center; gap: 10px; flex: none; }
.lu-head h2 { font-size: 26px; font-weight: 900; letter-spacing: 0.1em; line-height: 1.15; }
.lu-head small { font-size: 12px; color: var(--zhu-text); letter-spacing: 0.1em; }
.entry { display: flex; flex-direction: column; gap: 6px; margin-block-end: 14px; max-block-size: none; }
.entry .ag { font-size: 12px; font-weight: 700; color: var(--zhu-text); letter-spacing: 0.02em; }
.entry .tx { font-size: 16px; line-height: 1.32; letter-spacing: 0.04em; color: var(--ink-2); }
.entry .note { font-size: 12px; line-height: 1.32; }
.entry .pi { font-size: 11px; font-weight: 700; color: var(--zhu-text); }
.entry.t-m .tx { color: var(--ink); font-weight: 700; }
.entry.t-g .tx { color: var(--ink); }
.entry.t-b .tx { color: var(--zhu-text); }
.entry.t-c .tx, .entry.t-p .tx { color: var(--ink-3); font-size: 14px; }
.entry.t-l .tx { color: var(--ink-3); font-size: 14px; }
.entry.t-l .tx::before { content: '典籍所载　'; color: var(--jin); font-weight: 600; }
.entry.new { animation: inkin 0.6s ease-out; }
@keyframes inkin { from { opacity: 0; } }

/* 地脚 */
.foot-col { flex: 1; min-width: 0; padding: 0 22px; border-left: 1px solid var(--rule-2); max-height: 150px; overflow-y: auto; scrollbar-width: none; }
.foot-col:first-child { padding-left: 0; border-left: 0; flex: 1.15; }
.foot-col:last-child { padding-right: 0; }
.foot-col .t-label { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.foot-col .t-label em { font-style: normal; letter-spacing: 0.1em; font-weight: 400; }
.foot-col ul { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.foot-col li { display: flex; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-col li .r { color: var(--ink-3); flex: none; }
.foot-col li.gone { color: var(--ink-3); }
.foot-col li.gone .n { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.items { font-size: 13px; line-height: 1.75; display: flex; flex-wrap: wrap; gap: 0 14px; }
.items .it { color: var(--ink); }
.items button.it { border-bottom: 1px dotted var(--rule); }
.items button.it:hover { color: var(--zhu-text); border-bottom-color: var(--zhu-text); }
.items .it.dim { color: var(--ink-3); }
.empty { color: var(--ink-3); font-size: 13px; }

/* 版心 */
.banxin { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.yuwei { width: 34px; height: 22px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 55%, 0 100%); opacity: 0.85; flex: none; }
.yuwei.down { clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 100%, 0 100%); }
.banxin b { writing-mode: vertical-rl; font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.banxin span { writing-mode: vertical-rl; font-size: 13px; color: var(--ink-2); letter-spacing: 0.04em; }
#bxJuan { margin-top: 18px; }
.banxin .bx-gap { flex: 1; }

/* 插图 */
.scene { height: clamp(140px, 22vh, 240px); border: 1px solid var(--rule); overflow: hidden; background: var(--bg-2); }
.scene svg { width: 100%; height: 100%; display: block; }
.pane-scene figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.pane-scene figcaption span:last-child { color: var(--ink-3); }

/* 命牌 */
.pane-token { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 14px; }
.mp-name { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.mp-name h2 { font-size: 40px; font-weight: 900; letter-spacing: 0.06em; line-height: 1.1; }
.mp-name small { font-size: 13px; }
.mp-rows { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 14px; margin-top: 12px; font-size: 14px; }
.mp-rows span { color: var(--ink-3); }
.mp-right { display: flex; gap: 14px; align-items: flex-start; flex: none; }
.mp-seal { width: 40px; height: 84px; font-size: 22px; }

/* 根骨 */
.pane-stats { border-top: 1px solid var(--rule-2); padding: 14px 0 14px; display: flex; gap: 40px; }
.stat-rows { display: flex; flex-direction: column; gap: 3px; flex: none; }
.stat-row { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }
.stat-row > span:first-child { width: 28px; color: var(--ink-3); }
.cult { flex: 1; min-width: 0; font-size: 14px; }
.cult-head { display: flex; justify-content: space-between; gap: 10px; }
.cult-head > span:first-child span { color: var(--ink-3); margin-right: 10px; }
.cult-head b { color: var(--jin); font-weight: 400; }
.cult-head b.ready { color: var(--zhu-text); font-weight: 700; letter-spacing: 0.2em; }
.cult .ruler { margin-top: 10px; max-width: 280px; }
.cult .mortal-line { margin-top: 17px; border-top: 1px dashed var(--rule); max-width: 280px; }
.cult-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.cult-note .bad { color: var(--zhu-text); margin-left: 1em; }
.money { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; gap: 10px; }
.money > span { color: var(--ink-3); }
.money b { font-weight: 400; margin-left: auto; }

/* 此年去向 */
.pane-focus { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.fc-text { width: 210px; flex: none; }
.fc-text .t-label .jin { letter-spacing: 0.2em; margin-left: 10px; }
.fc-text h3 { font-size: 20px; font-weight: 700; margin-top: 10px; letter-spacing: 0.06em; }
.fc-text p { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }
.pane-focus .slips { margin-top: 10px; flex-wrap: wrap; }

/* ═════════════ 弹窗 ═════════════ */
.modal-wrap { position: fixed; inset: 0; background: var(--veil); z-index: 40; display: grid; place-items: center; padding: 24px; animation: fadebg 0.2s; }
@keyframes fadebg { from { opacity: 0; } }
.modal-wrap.fail::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(184, 64, 47, 0.38));
}
.modal {
  position: relative; width: min(680px, 100%); max-height: calc(100vh - 48px); background: var(--bg-2); border: 2px solid var(--rule);
  display: flex; animation: unroll 0.28s ease-out;
}
.modal::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.modal-shop { width: min(780px, 100%); }
@keyframes unroll { from { transform: translateY(10px); opacity: 0; } }
.m-main { flex: 1; min-width: 0; padding: 36px 36px 28px 40px; overflow-y: auto; display: flex; flex-direction: column; }
.m-strip {
  flex: none; min-width: 104px; border-left: 1px solid var(--rule); margin: 5px 5px 5px 0; padding: 30px 16px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.m-strip .seal { width: 34px; height: 64px; font-size: 16px; }
.m-title { writing-mode: vertical-rl; font-size: 38px; font-weight: 900; line-height: 1.12; letter-spacing: 0.06em; max-height: 330px; }
.m-title.q { font-size: 22px; line-height: 1.35; max-height: 300px; }
.m-strip .tbtn { margin-top: auto; writing-mode: vertical-rl; font-size: 13px; letter-spacing: 0.2em; }
.m-desc { font-size: 16px; line-height: 1.9; margin-top: 14px; }
.m-lore { margin-top: 14px; border-left: 2px solid var(--jin); padding: 4px 0 4px 14px; font-size: 13px; color: var(--ink-2); }
.m-lore b { display: block; color: var(--jin); font-size: 12px; font-weight: 700; letter-spacing: 0.3em; }
.opts { margin-top: 14px; }
.opts .jie { margin: 0 2px; }
.opt { position: relative; display: flex; gap: 16px; padding: 14px 12px; align-items: flex-start; width: 100%; text-align: left; transition: background 0.12s; }
.opt::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--zhu); opacity: 0; }
.opt:hover:not(:disabled) { background: var(--bg-3); }
.opt:hover:not(:disabled)::before, .opt.auto::before { opacity: 1; }
.opt.auto { box-shadow: inset 0 0 0 1px var(--zhu); }
.opt:disabled { opacity: 0.4; }
.opt .k { font-size: 20px; font-weight: 900; color: var(--zhu-text); width: 22px; flex: none; line-height: 1.4; }
.opt .o-main { flex: 1; min-width: 0; }
.opt .o-main b { display: block; font-size: 17px; font-weight: 700; line-height: 1.45; }
.opt .o-main small { display: block; font-size: 13px; margin-top: 2px; }
.opt .o-odds { font-size: 13px; color: var(--zhu-text); padding-top: 3px; white-space: nowrap; flex: none; }
.m-foot { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 26px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.m-foot .xiang { width: 150px; flex: none; }
.m-foot .tbtn:last-child { margin-left: auto; }
.m-foot .seal:last-child { margin-left: auto; }
.m-chosen { font-size: 14px; color: var(--ink-3); margin-top: 22px; }
.m-chosen b { color: var(--ink-2); font-weight: 700; }
.m-result { font-size: 22px; line-height: 1.8; margin-top: 24px; }
.m-result.t-b { color: var(--zhu-text); }
.m-result.t-m { font-weight: 700; }
.m-fx { font-size: 15px; margin-top: 16px; letter-spacing: 0.15em; }
.m-after { font-size: 13px; color: var(--ink-2); margin-top: 34px; }
.m-fail-head { font-size: 32px; font-weight: 900; color: var(--zhu-text); letter-spacing: 0.1em; margin-top: 26px; }
.m-fail-text { font-size: 17px; line-height: 1.9; margin-top: 14px; }
.bai { position: absolute; right: 150px; top: 270px; width: 96px; height: 96px; font-size: 52px; border-width: 3px; transform: rotate(-10deg); opacity: 0.85; pointer-events: none; animation: stampIn 0.32s 0.15s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-10deg) scale(2); } }
.gao-tip { font-size: 13px; color: var(--ink-2); margin-top: 22px; }
/* 稿纸：每字一格，十二格一行。字宽 18 + 字距 16 = 格宽 34 */
.gao {
  display: block; width: 418px; height: 137px; margin-top: 18px; padding: 0 0 0 8px; resize: none; outline: none;
  border: 1px solid var(--rule-2); border-right: 0; color: var(--ink); font: 18px/34px var(--serif); letter-spacing: 16px;
  background-color: transparent; caret-color: var(--zhu-text); overflow: hidden;
  background-image: linear-gradient(90deg, var(--rule-2) 1px, transparent 1px), linear-gradient(var(--rule-2) 1px, transparent 1px);
  background-size: 34px 34px, 408px 34px; background-position: -1px -1px, -1px -1px; background-repeat: repeat, repeat-y;
}
.gao-count { font-size: 13px; color: var(--ink-2); text-align: right; width: 409px; max-width: 100%; margin-top: 8px; }
.dock { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 39; height: 44px; padding: 0 20px 0 calc(20px + 0.2em); font-size: 16px; letter-spacing: 0.2em; }

/* 坊市 */
.shop-money { display: flex; align-items: baseline; gap: 14px; margin-top: 16px; }
.shop-money span { color: var(--ink-3); font-size: 14px; }
.shop-money b { font-size: 36px; font-weight: 900; letter-spacing: 0.04em; line-height: 1.1; }
.shop-money + .jie-2 { margin-top: 16px; }
.shop-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 100px 96px; align-items: center; gap: 0 8px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; }
.shop-row.head { padding: 10px 0; }
.shop-row .nm { font-weight: 700; }
.shop-row .ds { font-size: 13px; color: var(--ink-2); }
.shop-row .buy { text-align: right; color: var(--zhu-text); letter-spacing: 0.1em; }
.shop-row .buy:disabled { color: var(--ink-3); opacity: 1; }
.shop-row.short { color: var(--ink-3); }
.shop-row.short .ds { color: var(--ink-3); }
.tag { display: inline-flex; margin-left: 8px; padding: 0 4px; border: 1px solid var(--zhu-text); color: var(--zhu-text); font-size: 11px; line-height: 1.5; vertical-align: 2px; font-weight: 700; }

/* 提示签条 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); background: var(--bg-2); color: var(--ink); border: 1px solid var(--rule);
  padding: 12px 22px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 60;
  max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px;
}
.toast::after { content: ''; position: absolute; inset: 3px; border: 1px solid var(--rule-2); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .seal { width: 24px; height: 24px; font-size: 13px; flex: none; }

/* ═════════════ 走马灯 ═════════════ */
.reel { position: fixed; inset: 0; background: #0b0a09; color: #ece4d2; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.reel-stage { width: min(760px, 100%); text-align: center; cursor: pointer; min-height: 470px; display: flex; align-items: center; justify-content: center; }
.reel-frame { width: 100%; animation: rise 0.6s ease-out; }
.reel-frame .pic { border: 1px solid #3b3631; overflow: hidden; height: min(285px, 37.5vw); }
.reel-frame .pic svg { display: block; width: 100%; height: 100%; }
.reel-frame .age { margin-top: 32px; color: #8f887b; font-size: 12px; font-weight: 600; letter-spacing: 0.35em; }
.reel-frame .txt { font-size: 22px; line-height: 1.8; margin-top: 14px; }
.reel-title { font-size: clamp(56px, 10vw, 88px); font-weight: 900; letter-spacing: 0.12em; line-height: 1.1; }
.reel-sub { color: #8f887b; margin-top: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.35em; }
.reel-lines { margin-top: 30px; font-size: 17px; line-height: 2.1; color: #cfc6b4; }
.reel-lines .zhu { color: #d9674f; }
.reel-frame .seal { margin-top: 44px; }
.reel-dots { display: flex; gap: 12px; margin-top: 36px; }
.reel-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #7d7669; }
.reel-dots i.on { background: #ece4d2; border-color: #ece4d2; }
.reel-hint { color: #5d584f; font-size: 12px; font-weight: 600; letter-spacing: 0.35em; margin-top: 18px; }
.reel-skip { position: absolute; top: 36px; right: 56px; color: #b6ad9b; }

/* ═════════════ 道碑 · 一生纪录 ═════════════ */
.end { min-height: 100vh; padding: 36px 80px 80px; }
.end-top { display: flex; justify-content: space-between; align-items: center; }
.record { display: grid; grid-template-columns: 380px minmax(0, 820px); gap: 60px; margin-top: 30px; justify-content: center; }
.stele-wrap { position: relative; padding: 0 30px; }
.stele {
  position: sticky; top: 30px; height: 860px; background: #2b2925; border: 1px solid #4a463f; border-radius: 160px 160px 0 0; color: #ece4d2;
  display: flex; flex-direction: column; align-items: center; padding-top: 40px;
}
.stele::after { content: ''; position: absolute; left: -30px; right: -30px; bottom: -44px; height: 44px; background: #211f1c; border: 1px solid #4a463f; }
.st-head { width: 160px; height: 110px; border: 1px solid #6a655b; display: grid; place-items: center; }
.st-head span { writing-mode: vertical-rl; font-size: 22px; font-weight: 900; color: #d8d0bf; letter-spacing: 0.1em; }
.st-cols { writing-mode: vertical-rl; display: flex; flex-direction: column; align-items: center; gap: 26px; margin-top: 40px; height: 420px; flex: none; }
.st-cols h2 { font-size: 46px; font-weight: 900; line-height: 1.12; letter-spacing: 0.06em; }
.st-cols p { font-size: 15px; color: #9d968a; margin-top: 30px; letter-spacing: 0.06em; align-self: flex-start; }
.st-epi { writing-mode: vertical-rl; font-size: 14px; color: #b6ad9b; margin-top: auto; margin-bottom: 40px; letter-spacing: 0.1em; max-height: 180px; }
.st-seal { position: absolute; left: calc(50% + 56px); top: 102px; width: 30px; height: 56px; font-size: 13px; }
.rec { min-width: 0; }
.rec-name { display: flex; align-items: baseline; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.rec-name h1 { font-size: 64px; font-weight: 900; letter-spacing: 0.06em; line-height: 1.1; }
.rec-yrs { font-size: 15px; color: var(--ink-2); margin-top: 10px; }
.rec-ttl { margin-top: 18px; height: 36px; padding: 0 16px 0 calc(16px + 0.2em); font-size: 17px; letter-spacing: 0.2em; }
.rec-summary { font-size: 17px; line-height: 1.9; margin-top: 22px; }
.rec-cause { font-size: 15px; margin-top: 14px; }
.rec-cause span + span { margin-left: 1em; }
.rec .jie-2 { margin-top: 34px; }
.rec-mid { display: flex; gap: 56px; margin-top: 30px; align-items: flex-start; }
.verse { writing-mode: vertical-rl; display: flex; flex-direction: column; gap: 22px; flex: none; }
.verse .lbl { font-size: 13px; font-weight: 700; color: var(--zhu-text); letter-spacing: 0.1em; }
.verse p { font-size: 30px; font-weight: 900; line-height: 1.15; letter-spacing: 0.06em; }
.verse.loading p { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.facts { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 28px; }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--rule-2); min-width: 0; }
.facts .t-label { display: block; }
.facts b { display: block; font-size: 16px; font-weight: 400; margin-top: 6px; }
.facts small { display: block; font-size: 12px; color: var(--ink-3); }
.ins { margin-top: 36px; border-left: 2px solid var(--zhu); padding: 4px 0 4px 16px; }
.ins + .ins { margin-top: 14px; }
.ins .q { font-size: 13px; color: var(--ink-2); }
.ins .a { font-size: 20px; margin-top: 4px; }
.rec .peers-lbl { margin-top: 36px; }
.cmp { margin-top: 10px; }
.cmp-row { display: grid; grid-template-columns: 180px 110px 140px minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; gap: 0 8px; }
.cmp-row span:nth-child(2), .cmp-row span:nth-child(4) { color: var(--ink-3); }
.cmp-row.me, .cmp-row.me span { color: var(--zhu-text); font-weight: 700; }
.end-actions { display: flex; align-items: center; gap: 26px; margin-top: 56px; flex-wrap: wrap; }
.end-actions .seal { height: 52px; padding: 0 24px 0 calc(24px + 0.3em); font-size: 20px; letter-spacing: 0.3em; }

/* ═════════════ 水墨插图 ═════════════ */
/* 夜：墨山层叠、月色、窗里亮灯 */
.sc { --sky: #1b1a17; --mist: #6d675d; }
.sc .sky { fill: var(--sky); }
.sc .sky.sky-night { fill: var(--sky); }
.sc .sky.sky-red { fill: color-mix(in srgb, var(--sky) 72%, #b8402f); }
.sc .sky.sky-gold { fill: color-mix(in srgb, var(--sky) 76%, #c6a55c); }
.sc .sky.sky-violet { fill: color-mix(in srgb, var(--sky) 76%, #5a4fb0); }
.sc .sky.sky-storm { fill: color-mix(in srgb, var(--sky) 70%, #2a2f38); }
.sc .sky.sky-sand { fill: color-mix(in srgb, var(--sky) 82%, #c6a55c); }
.sc .sun { fill: #b8402f; opacity: 0.9; }
.sc .sun-red { fill: #8e2a1f; }
.sc .moon { fill: #ece4d2; stroke: none; filter: drop-shadow(0 0 14px rgba(236, 228, 210, 0.45)); }
.sc .mtn.l0 { fill: #3d3a34; } .sc .mtn.l1 { fill: #2e2b27; } .sc .mtn.l2 { fill: #22201d; } .sc .mtn.l3 { fill: #141311; }
.sc .snow-layer.l0 { fill: #5d5a54; } .sc .snow-layer.l1 { fill: #4a4742; } .sc .snow-layer.l2 { fill: #383632; } .sc .snow-layer.l3 { fill: #2a2825; }
.sc .dune.l0 { fill: #4b4230; } .sc .dune.l1 { fill: #3a3326; } .sc .dune.l2 { fill: #2b261d; }
.sc .mist { opacity: 0.35; }
.sc .ink-solid { fill: #0c0b0a; }
.sc .ink-soft { fill: #000; opacity: 0.45; }
.sc .ink-line { fill: none; stroke: #8f887b; stroke-width: 1.4; opacity: 0.6; stroke-linecap: round; }
.sc .paper-fill { fill: #e0b45c; filter: drop-shadow(0 0 4px rgba(224, 180, 92, 0.85)); }
.sc .rock { fill: #0c0b0a; }
.sc .cliff { fill: #0e0d0c; }
.sc .cave-mouth { fill: #000; }
.sc .glow-jade { fill: #6f9a8a; opacity: 0.5; }
.sc .cinnabar { fill: #b8402f; }
.sc .cinnabar-line { fill: #b8402f; stroke: #0c0b0a; stroke-width: 1.2; opacity: 0.85; }
.sc .figure .ink-solid { fill: #d8d0bf; }
.sc .wave { opacity: 0.35; }
/* 昼：宣纸上的淡墨 */
:root[data-theme='light'] .sc, .sc.sc-day { --sky: #e7dcc2; --mist: #eee5cf; --ink: #1c1915; }
:root[data-theme='light'] .sc .sun, .sc.sc-day .sun { fill: #a8352a; opacity: 0.85; }
:root[data-theme='light'] .sc .sun-red, .sc.sc-day .sun-red { fill: #7d2219; }
:root[data-theme='light'] .sc .moon, .sc.sc-day .moon { fill: #f5eedd; stroke: #a79673; filter: none; }
:root[data-theme='light'] .sc .mtn, .sc.sc-day .mtn,
:root[data-theme='light'] .sc .snow-layer, .sc.sc-day .snow-layer { fill: #1c1915; }
:root[data-theme='light'] .sc .mtn.l0, .sc.sc-day .mtn.l0 { opacity: 0.1; }
:root[data-theme='light'] .sc .mtn.l1, .sc.sc-day .mtn.l1 { opacity: 0.18; }
:root[data-theme='light'] .sc .mtn.l2, .sc.sc-day .mtn.l2 { opacity: 0.3; }
:root[data-theme='light'] .sc .mtn.l3, .sc.sc-day .mtn.l3 { opacity: 0.55; }
:root[data-theme='light'] .sc .snow-layer.l0, .sc.sc-day .snow-layer.l0 { opacity: 0.06; }
:root[data-theme='light'] .sc .snow-layer.l1, .sc.sc-day .snow-layer.l1 { opacity: 0.1; }
:root[data-theme='light'] .sc .snow-layer.l2, .sc.sc-day .snow-layer.l2 { opacity: 0.16; }
:root[data-theme='light'] .sc .snow-layer.l3, .sc.sc-day .snow-layer.l3 { opacity: 0.26; }
:root[data-theme='light'] .sc .dune, .sc.sc-day .dune { fill: #8f702c; }
:root[data-theme='light'] .sc .dune.l0, .sc.sc-day .dune.l0 { opacity: 0.15; }
:root[data-theme='light'] .sc .dune.l1, .sc.sc-day .dune.l1 { opacity: 0.24; }
:root[data-theme='light'] .sc .dune.l2, .sc.sc-day .dune.l2 { opacity: 0.36; }
:root[data-theme='light'] .sc .mist, .sc.sc-day .mist { opacity: 1; }
:root[data-theme='light'] .sc .ink-solid, .sc.sc-day .ink-solid { fill: #1c1915; opacity: 0.82; }
:root[data-theme='light'] .sc .ink-soft, .sc.sc-day .ink-soft { fill: #1c1915; opacity: 0.2; }
:root[data-theme='light'] .sc .ink-line, .sc.sc-day .ink-line { stroke: #1c1915; opacity: 0.7; }
:root[data-theme='light'] .sc .paper-fill, .sc.sc-day .paper-fill { fill: #f5eedd; filter: none; }
:root[data-theme='light'] .sc .rock, .sc.sc-day .rock { fill: #1c1915; opacity: 0.72; }
:root[data-theme='light'] .sc .cliff, .sc.sc-day .cliff { fill: #1c1915; opacity: 0.6; }
:root[data-theme='light'] .sc .cave-mouth, .sc.sc-day .cave-mouth { fill: #0b0b0b; opacity: 0.85; }
:root[data-theme='light'] .sc .glow-jade, .sc.sc-day .glow-jade { fill: #3c7b6a; opacity: 0.55; }
:root[data-theme='light'] .sc .cinnabar, .sc.sc-day .cinnabar { fill: #a8352a; }
:root[data-theme='light'] .sc .figure .ink-solid, .sc.sc-day .figure .ink-solid { fill: #1c1915; }
.sc .mist { animation: drift 18s ease-in-out infinite alternate; }
.sc .mist.m1 { animation-duration: 24s; }
.sc .mist.m2 { animation-duration: 30s; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.sc .glow { filter: drop-shadow(0 0 6px #d9674f); }
.sc .storm ellipse { fill: #1a1d24; opacity: 0.55; }
.sc .smoke-dark ellipse { fill: #1c1915; opacity: 0.25; }
.sc .bolt { fill: none; stroke: #f2d27a; stroke-width: 3; filter: drop-shadow(0 0 6px #f2d27a); animation: flash 2.6s infinite; }
@keyframes flash { 0%, 86%, 100% { opacity: 0; } 88%, 92% { opacity: 1; } 90% { opacity: 0.3; } }
.sc .aura { animation: breathe 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.35; } }
.sc .float { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.sc .smoke { stroke-width: 1; opacity: 0.4; }

/* ═════════════ 破境 ═════════════ */
.fx-wrap { position: fixed; inset: 0; z-index: 80; background: #07070a; cursor: pointer; overflow: hidden; animation: fxIn 0.3s ease-out; user-select: none; color: #f4ecda; }
.fx-canvas { position: absolute; inset: 0; }
.fx-kicker { position: absolute; left: 0; right: 0; top: 13vh; text-align: center; font-size: 15px; letter-spacing: 0.9em; padding-left: 0.9em; color: #b9d2d0; opacity: 0; pointer-events: none; }
.fx-cols { position: absolute; left: 50%; top: 20vh; transform: translateX(-50%); display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 40px; pointer-events: none; }
.fx-title {
  writing-mode: vertical-rl; font-size: clamp(96px, 17vh, 160px); font-weight: 900; line-height: 1.05; letter-spacing: 0.06em; opacity: 0;
  text-shadow: 0 0 18px color-mix(in srgb, var(--fx-color) 60%, #fff), 0 0 60px var(--fx-color), 0 0 110px var(--fx-color);
}
.fx-side { writing-mode: vertical-rl; font-size: 17px; color: #b6ad9b; margin-top: 50px; letter-spacing: 0.12em; opacity: 0; }
.fx-seal {
  position: absolute; left: 50%; top: calc(20vh + 2.2 * clamp(96px, 17vh, 160px) + 40px); width: 88px; height: 88px; margin-left: -44px; font-size: 32px;
  opacity: 0; transform: rotate(-6deg) scale(2.2); pointer-events: none;
}
.fx-skip { position: absolute; left: 0; right: 0; bottom: 36px; text-align: center; color: #5d584f; font-size: 12px; font-weight: 600; letter-spacing: 0.35em; }
.fx-show .fx-kicker { animation: fxFade 0.6s 0.05s forwards; }
.fx-show .fx-title { animation: fxSlam 0.95s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
.fx-show .fx-side { animation: fxFade 0.7s 0.6s forwards; }
.fx-show .fx-seal { animation: fxStamp 0.32s 1.1s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
.fx-static .fx-kicker, .fx-static .fx-title, .fx-static .fx-side { animation: none; opacity: 1; }
.fx-static .fx-seal { animation: none; opacity: 1; transform: rotate(-6deg); }
.fx-shake .fx-canvas { animation: fxShake 0.55s; }
.fx-out { animation: fxOut 0.38s forwards; }
@keyframes fxIn { from { opacity: 0; } }
@keyframes fxOut { to { opacity: 0; } }
@keyframes fxFade { to { opacity: 1; } }
@keyframes fxSlam {
  0% { opacity: 0; transform: scale(1.8); filter: blur(16px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fxStamp { from { opacity: 0; transform: rotate(-6deg) scale(2.2); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
@keyframes fxShake {
  10%, 50% { transform: translate(-8px, 4px); }
  20%, 60% { transform: translate(7px, -4px); }
  30%, 70% { transform: translate(-5px, -2px); }
  40%, 80% { transform: translate(4px, 3px); }
  90% { transform: translate(-1px, 1px); }
}
.fx-fail { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(ellipse at center, transparent 35%, rgba(184, 64, 47, 0.6)); animation: fxFailFlash 0.9s forwards; }
@keyframes fxFailFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.fx-shake-body .modal-wrap, .fx-shake-body #screen-game { animation: fxShake 0.45s; }

/* ═════════════ 窄屏 ═════════════ */
@media (max-width: 1240px) {
  .home-inner { grid-template-columns: 120px minmax(0, 1fr) 210px; gap: 0 48px; padding-right: 140px; }
  .g-ctl { gap: 10px; }
  .g-age-life .xiang { width: 140px; }
}
@media (max-width: 1080px) {
  .game { padding: 12px; }
  .page { min-height: calc(100vh - 24px); padding: 0 18px 20px; }
  .page::after { inset: 4px; }
  .g-head { height: auto; flex-wrap: wrap; padding: 18px 0 12px; gap: 10px 16px; }
  .g-title { width: auto; }
  .g-title > div { display: none; }
  .g-age { border: 0; padding: 0; flex: 1; }
  .g-age-main b { font-size: 32px; }
  .g-age-main b.long { font-size: 26px; }
  .g-age-main em { font-size: 15px; margin-left: 6px; }
  .g-age-life { margin-top: 6px; }
  .g-age-life .xiang { width: auto; flex: 1; }
  .g-ctl { width: 100%; margin: 0; justify-content: space-between; gap: 4px; flex-wrap: nowrap; }
  .g-ctl .tsep { display: none; }
  .g-ctl .tbtn { font-size: 13px; letter-spacing: 0.04em; }
  .g-ctl .speeds { gap: 1px; }
  .g-ctl .quan { width: 26px; height: 26px; font-size: 14px; }
  #btnAuto.on { padding: 2px 7px; }
  .g-rule { margin: 0 -12px 16px; }
  .g-body { display: flex; flex-direction: column; min-height: 0; }
  .banxin { display: none; }
  .pane-scene { order: 1; }
  .pane-focus { order: 2; border-top: 0; padding-top: 18px; flex-direction: column; gap: 6px; }
  .pane-log { order: 3; contain: none; height: 300px; min-height: 0; border-top: 1px solid var(--rule-2); padding-top: 16px; margin-top: 18px; }
  .pane-tabs { order: 4; display: flex; justify-content: space-between; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); margin-top: 16px; padding: 8px 4px; }
  .pane-token, .pane-stats, .pane-foot { order: 5; }
  .g-body [data-pane] { display: none; }
  .g-body[data-tab='token'] [data-pane='token'], .g-body[data-tab='stats'] [data-pane='stats'] { display: flex; }
  .g-body[data-tab='bag'] [data-pane='bag'], .g-body[data-tab='kin'] [data-pane='kin'], .g-body[data-tab='peers'] [data-pane='peers'] { display: block; }
  .pane-foot { border: 0; padding: 16px 0 0; display: block; }
  .foot-col { padding: 0; border: 0; max-height: none; }
  .foot-col .t-label { display: none; }
  .pane-stats { border-top: 0; flex-direction: column; gap: 18px; }
  .scene { height: 150px; }
  .fc-text { width: auto; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  .fc-text h3 { margin: 0; font-size: 17px; }
  .fc-text p { display: none; }
  .pane-focus .slips { justify-content: flex-start; flex-direction: row; gap: 6px; }
  .pane-focus .slip { width: 40px; height: 108px; font-size: 14px; padding-top: 12px; }

  .modal-wrap { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 88vh; border-width: 2px 0 0; }
  .modal::after { inset: 5px 0 0; border-width: 1px 0 0; }
  .modal-shop { width: 100%; }
  .m-main { padding: 28px 18px 22px 22px; }
  .m-strip { min-width: 64px; padding: 26px 10px 16px; gap: 14px; border-left: 0; }
  .m-strip .seal { width: 28px; height: 52px; font-size: 13px; }
  .m-title { font-size: 30px; }
  .m-title.q { font-size: 18px; }
  .m-desc { font-size: 15px; }
  .opt { padding: 12px 8px; gap: 12px; }
  .opt .k { font-size: 18px; }
  .opt .o-main b { font-size: 16px; }
  .opt .o-main small { font-size: 12px; }
  .opt .o-odds { font-size: 12px; }
  .m-result { font-size: 19px; }
  .bai { right: 20px; top: 180px; width: 76px; height: 76px; font-size: 40px; }
  .gao {
    width: 274px; height: 131px; padding-left: 6px; font-size: 14px; line-height: 26px; letter-spacing: 12px;
    background-size: 26px 26px, 260px 26px;
  }
  .gao-count { width: 260px; }
  .shop-row { grid-template-columns: minmax(0, 1fr) 80px 76px; }
  .shop-row .ds { grid-column: 1 / -1; grid-row: 2; }
  .shop-row.head .ds { display: none; }

  .record { grid-template-columns: 1fr; gap: 80px; }
  .stele-wrap { max-width: 320px; margin: 0 auto; width: 100%; }
  .stele { position: relative; top: 0; height: 640px; }
  .st-cols { height: 300px; }
  .st-cols h2 { font-size: 36px; }
  .st-epi { max-height: 130px; margin-bottom: 30px; }
  .mp-rows { grid-template-columns: auto 1fr; }
  .end { padding: 24px 20px 60px; }
}
@media (max-width: 760px) {
  .home-inner { display: block; padding: 40px 54px 70px 24px; }
  .home-theme { right: 52px; top: 18px; }
  .spine { width: 30px; }
  .spine .thread { left: 12px; width: 1.5px; }
  .spine b { left: 10px; width: 5px; height: 5px; }
  .spine b::after { left: 2px; top: 1.5px; width: 18px; height: 1.5px; }
  .tiqian { float: left; width: 72px; height: 320px; margin: 4px 22px 16px 4px; outline-width: 4px; padding-top: 30px; }
  .tq-title { font-size: 42px; }
  .tq-sub { display: none; }
  .tq-foot { font-size: 11px; bottom: 20px; }
  .juanshou { padding-top: 0; }
  .js-lead { font-size: 24px; line-height: 1.45; margin-top: 12px; }
  .js-lead br { display: none; }
  .js-copy { font-size: 13px; line-height: 1.85; margin-top: 12px; }
  .js-copy + .js-copy { display: none; }
  .home-side { clear: both; padding-top: 34px; gap: 34px; }
  .census { display: none; }
  .ru-shi { font-size: 54px; }
  .past { margin-top: 36px; }
  .home-foot { right: 30px; bottom: 20px; }

  .wheel { --r: min(150px, 38vw); }
  .wheel-ring::before { inset: 40px; }
  .wheel-ring::after { inset: 64px; }
  .ring-chars span { font-size: 14px; }
  .wheel-done { left: 18px; top: auto; bottom: 56px; }
  .wheel-done p { font-size: 14px; }
  .wheel-steps { right: 18px; top: auto; bottom: 56px; }
  .wheel-skip { right: 20px; top: 18px; }

  .birth { padding: 26px 12px 32px; }
  .gengtie { grid-template-columns: 1fr; min-height: 0; }
  .gt-fold { height: 1px; margin: 0 5px; }
  .gt-right { order: -1; padding: 30px 26px 26px; }
  .gt-cols { height: 300px; gap: 18px; }
  .gt-cols .qz { font-size: 44px; }
  .gt-cols p { font-size: 16px; }
  .gt-seal { left: 26px; bottom: 26px; width: 44px; height: 44px; font-size: 15px; }
  .gt-left { padding: 24px 22px 26px; }
  .gt-root { gap: 16px; }
  .gt-root svg { width: 96px; height: 96px; }
  .gt-root .rn { font-size: 30px; }
  .gt-root .rp { font-size: 12px; margin-top: 8px; }
  .gt-desc { font-size: 13px; }
  .gt-peers { gap: 10px; }
  .gt-peer { width: calc(25% - 8px); height: 104px; }
  .gt-peer b { font-size: 14px; }

  .reel-stage { min-height: 420px; }
  .reel-frame .txt { font-size: 17px; }
  .reel-skip { top: 18px; right: 20px; }
  .fx-cols { gap: 22px; }
  .fx-side { font-size: 14px; }

  .rec-name h1 { font-size: 40px; }
  .rec-mid { flex-direction: column; gap: 26px; }
  .verse { align-self: center; }
  .verse p { font-size: 24px; }
  .facts { grid-template-columns: 1fr 1fr; column-gap: 20px; width: 100%; }
  .cmp-row { grid-template-columns: minmax(0, 1fr) 96px; font-size: 14px; }
  .cmp-row span:nth-child(2), .cmp-row span:nth-child(4) { display: none; }
  .cmp-row span:nth-child(3) { text-align: right; }
  .st-cols h2 { font-size: 28px; }
  .end-top .t-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
