/* ============================================================
   云境 · 数字道馆 — 界面样式
   视觉方向：素绢 / 淡墨 / 朱砂印。纸上留白，墨线做结构，朱砂只用在
   印章与当前选中；所有圆角克制在 2px 以内，不做卡片套件。
   ============================================================ */
:root {
  --paper: #f0ece0;
  --paper-deep: #e4dfd0;
  --ink: #1d2321;
  --ink-70: #47524d;
  --ink-45: #77837c;
  --ink-25: #b0b8b2;
  --qing: #9fb2ac;
  --zhu: #a2352a;
  --zhu-soft: #c0654f;
  --gold: #b8904e;
  --night: #0e1614;

  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", "宋体", Georgia, serif;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

/* 打坐时出现的「起身」大按钮：手机上比双击可靠，热区 ≥ 44px */
.rise-btn {
  position: fixed;
  left: 50%;
  bottom: 152px;
  transform: translate(-50%, 10px);
  z-index: 24;
  padding: 13px 42px;
  min-width: 152px;
  min-height: 50px;
  font: 500 17px/1.2 var(--font-serif);
  letter-spacing: .22em;
  color: var(--paper);
  background: rgba(30, 34, 33, .82);
  border: 1px solid rgba(233, 226, 211, .42);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.rise-btn.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.rise-btn:active { background: rgba(140, 46, 34, .86); }

/* 同境交谈：平时只留右下角一个小圆球，点开才展开一条窄栏，发完自动收回 */
.chat-dock {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 22;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 8px;
}
.chat-dock.hidden { display: none; }
.chat-dot {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  font: 500 17px/1 var(--font-serif);
  letter-spacing: .10em;
  color: rgba(240, 236, 224, .88);
  background: rgba(24, 28, 27, .66);
  border: 1px solid rgba(233, 226, 211, .30);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.chat-dot:hover { background: rgba(30, 36, 34, .8); }
.chat-dock.open .chat-dot { background: rgba(140, 46, 34, .78); color: #f4efe4; }
.chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  width: min(430px, 74vw);
  background: rgba(24, 28, 27, .80);
  border: 1px solid rgba(233, 226, 211, .26);
  border-radius: 3px;
  backdrop-filter: blur(2px);
}
.chat-bar.hidden { display: none; }
.chat-bar input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 9px;
  font: 400 16px/1.3 var(--font-serif);   /* ≥16px：手机上不触发缩放 */
  color: var(--paper);
  background: rgba(246, 242, 232, .07);
  border: 1px solid rgba(233, 226, 211, .18);
  border-radius: 2px;
  outline: none;
}
.chat-bar input::placeholder { color: rgba(233, 226, 211, .42); }
.chat-bar input:focus { border-color: rgba(196, 96, 68, .62); background: rgba(246, 242, 232, .11); }
.chat-bar button {
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 38px;
  padding: 0 12px;
  font: 500 14px/1 var(--font-serif);
  letter-spacing: .10em;
  color: var(--paper);
  background: rgba(140, 46, 34, .62);
  border: 1px solid rgba(233, 226, 211, .34);
  border-radius: 2px;
  cursor: pointer;
}
.chat-bar button:active { background: rgba(140, 46, 34, .88); }

/* 纸纹与暗角：独立装饰层，不参与布局，也不裁正文 */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  opacity: .16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 45%, rgba(14,22,20,0) 42%, rgba(14,22,20,.38) 100%);
}

/* ============================ HUD ============================ */
.hud-top {
  position: fixed; z-index: 10; inset: 0 0 auto 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 0;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b {
  font-family: var(--font-serif); font-size: 19px; letter-spacing: .22em;
  color: var(--paper); font-weight: 600;
  text-shadow: 0 1px 12px rgba(6,12,10,.55);
}
.brand-text i {
  font-style: normal; font-size: 11px; letter-spacing: .16em;
  color: rgba(240,236,224,.72);
  text-shadow: 0 1px 8px rgba(6,12,10,.6);
}

.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  background: var(--zhu); color: #f7f2e6;
  font-family: var(--font-serif); font-size: 13px; letter-spacing: .04em;
  line-height: 1; text-align: center;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 2px 10px rgba(90,20,12,.32);
}
.seal.big { width: 56px; height: 56px; font-size: 22px; letter-spacing: .12em; }

.presence {
  pointer-events: auto;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  color: rgba(240,236,224,.9);
  font-size: 12px; letter-spacing: .08em;
  background: rgba(12,22,20,.42);
  border: 1px solid rgba(240,236,224,.16);
  border-radius: 2px;
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.presence b { font-weight: 600; }
.presence em { font-style: normal; opacity: .55; margin: 0 1px; }
.presence .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7fbf9a; box-shadow: 0 0 8px rgba(127,191,154,.8);
}

/* 场景导航：左侧竖列，细线分隔，不用胶囊 */
.hud-nav {
  position: fixed; z-index: 10; left: 18px; top: 50%; transform: translateY(-46%);
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: auto;
}
.hud-nav button {
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: var(--font-serif); font-size: 15px; letter-spacing: .18em;
  color: rgba(240,236,224,.66);
  padding: 7px 2px 7px 14px; text-align: left; position: relative;
  transition: color .25s var(--ease), padding-left .25s var(--ease);
}
.hud-nav button::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 0; background: var(--zhu-soft);
  transition: height .25s var(--ease);
}
.hud-nav button:hover, .hud-nav button:focus-visible { color: var(--paper); padding-left: 18px; outline: none; }
.hud-nav button.on { color: var(--paper); }
.hud-nav button.on::before { height: 62%; }

/* 底部：时辰 + 工具 */
.hud-bottom {
  position: fixed; z-index: 10; inset: auto 0 0 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 18px 16px; pointer-events: none;
}
.time-switch, .tool-row { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; }
.time-switch button, .tool-row .tool {
  appearance: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; letter-spacing: .12em;
  color: rgba(240,236,224,.78);
  background: rgba(12,22,20,.34);
  border: 1px solid rgba(240,236,224,.14);
  border-radius: 2px; padding: 7px 13px;
  backdrop-filter: blur(6px);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.time-switch button:hover, .tool-row .tool:hover { color: #fff; border-color: rgba(240,236,224,.4); }
.time-switch button.on {
  color: #f7f2e6; background: rgba(162,53,42,.72); border-color: rgba(192,101,79,.9);
}
/* 「自动」：跟随服务器时间。用描边区分，不与当前时段抢色 */
.time-switch button.auto {
  letter-spacing: .18em;
  border-color: rgba(192,101,79,.5);
  color: rgba(240,236,224,.88);
}
.time-switch button.auto.on {
  background: rgba(12,22,20,.58);
  border-color: rgba(192,101,79,.95);
  box-shadow: inset 0 0 0 1px rgba(192,101,79,.24);
}

.hud-help {
  position: fixed; z-index: 10; left: 18px; bottom: 74px;
  max-width: 300px; pointer-events: none;
  font-size: 12px; line-height: 1.9; letter-spacing: .04em;
  color: rgba(240,236,224,.62);
  transition: opacity .3s var(--ease);
}
.hud-help.hide { opacity: 0; }
.hud-help .muted { color: rgba(240,236,224,.35); }
kbd {
  display: inline-block; padding: 0 4px; margin: 0 1px;
  border: 1px solid rgba(240,236,224,.3); border-radius: 2px;
  font-family: var(--font-sans); font-size: 11px; line-height: 1.5;
}

/* ============================ 提示 ============================ */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 120px; transform: translate(-50%, 12px);
  padding: 9px 16px; border-radius: 2px;
  background: rgba(12,22,20,.82); color: rgba(240,236,224,.92);
  border: 1px solid rgba(240,236,224,.18);
  font-size: 13px; letter-spacing: .06em; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================ 遮罩通用 ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,20,18,.55);
  backdrop-filter: blur(10px) saturate(.9);
  padding: 20px;
  opacity: 1; transition: opacity .35s var(--ease);
}
.overlay.hidden { display: none; }

/* ============================ 入场门 ============================ */
.gate {
  background:
    radial-gradient(circle at 26% 22%, rgba(159,178,172,.30), transparent 58%),
    linear-gradient(160deg, #16211e 0%, #1b2723 46%, #101816 100%);
  backdrop-filter: none;
}
.gate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .18; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .05' numOctaves='4'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
}
.gate-inner {
  position: relative; width: 100%; max-width: 560px;
  text-align: center; color: var(--paper);
}
.gate-title { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate-title h1 {
  margin: 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(34px, 9vw, 56px); letter-spacing: .34em; text-indent: .34em;
  color: #f4efe3;
}
.gate-sub {
  margin: 0; font-family: var(--font-serif); font-size: 13px;
  letter-spacing: .3em; color: rgba(240,236,224,.6); text-indent: .3em;
}
.gate-copy {
  margin: 26px auto 0; max-width: 460px;
  font-family: var(--font-serif); font-size: 15px; line-height: 2.05;
  color: rgba(240,236,224,.82); letter-spacing: .04em;
}
.gate-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin: 26px auto 0; max-width: 460px;
  border-top: 1px solid rgba(240,236,224,.16);
  border-bottom: 1px solid rgba(240,236,224,.16);
}
.gate-meta > div {
  padding: 14px 6px; display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid rgba(240,236,224,.1);
}
.gate-meta > div:first-child { border-left: 0; }
.gate-meta span { font-size: 11px; letter-spacing: .16em; color: rgba(240,236,224,.5); }
.gate-meta b {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  letter-spacing: .08em; color: rgba(240,236,224,.95);
  font-variant-numeric: tabular-nums;
}

button.primary {
  appearance: none; cursor: pointer; margin-top: 26px;
  min-width: 168px; padding: 13px 30px;
  font-family: var(--font-serif); font-size: 16px; letter-spacing: .3em; text-indent: .3em;
  color: #f7f2e6; background: var(--zhu);
  border: 1px solid rgba(255,225,210,.28); border-radius: 2px;
  transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: 0 6px 24px rgba(120,32,22,.34);
}
button.primary:hover { background: #b13d2f; transform: translateY(-1px); box-shadow: 0 10px 30px rgba(120,32,22,.42); }
button.primary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.disclaimer {
  margin: 26px auto 0; max-width: 480px;
  font-size: 11px; line-height: 1.9; letter-spacing: .03em;
  color: rgba(240,236,224,.46);
}

/* ============================ 排队 ============================ */
.queue { background: linear-gradient(160deg, #16211e, #101816); backdrop-filter: none; }
.queue-inner {
  width: 100%; max-width: 520px; text-align: center; color: var(--paper);
}
.queue-inner h2 {
  margin: 18px 0 0; font-family: var(--font-serif); font-weight: 500;
  font-size: 24px; letter-spacing: .2em; text-indent: .2em;
}
.queue-inner > p {
  margin: 14px auto 0; max-width: 410px;
  font-family: var(--font-serif); font-size: 14px; line-height: 2; color: rgba(240,236,224,.7);
}
.queue-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin: 24px auto 0; max-width: 420px;
  border-top: 1px solid rgba(240,236,224,.16); border-bottom: 1px solid rgba(240,236,224,.16);
}
.queue-stats > div { padding: 13px 4px; display: flex; flex-direction: column; gap: 6px; border-left: 1px solid rgba(240,236,224,.1); }
.queue-stats > div:first-child { border-left: 0; }
.queue-stats span { font-size: 11px; letter-spacing: .14em; color: rgba(240,236,224,.45); }
.queue-stats b { font-family: var(--font-serif); font-size: 17px; font-variant-numeric: tabular-nums; }
.queue-line {
  margin: 22px 0 0; font-family: var(--font-serif); font-size: 14px;
  letter-spacing: .18em; color: var(--gold);
}
.queue-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

button.ghost {
  appearance: none; cursor: pointer;
  padding: 9px 18px; border-radius: 2px;
  font-size: 12px; letter-spacing: .12em; color: inherit;
  background: transparent; border: 1px solid currentColor;
  opacity: .8; transition: opacity .2s var(--ease), background .2s var(--ease);
}
button.ghost:hover { opacity: 1; background: rgba(240,236,224,.08); }
button.ghost:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ============================ 典籍阅读 ============================ */
.reader { background: rgba(9,16,14,.72); padding: 0; align-items: stretch; z-index: 26; }
.reader-shell {
  display: grid; grid-template-rows: auto 1fr;
  width: 100%; height: 100%;
  background: var(--paper);
  color: var(--ink);
}
.reader-nav {
  display: none;
  background: var(--paper-deep);
  border-right: 1px solid rgba(29,35,33,.14);
  overflow-y: auto;
  padding: 18px 14px 26px;
}
.reader-nav-head { display: flex; align-items: flex-start; gap: 10px; }
.reader-nav-head h2 {
  margin: 0; font-family: var(--font-serif); font-size: 20px; font-weight: 600;
  letter-spacing: .1em; line-height: 1.3;
}
.reader-nav-head p { margin: 4px 0 0; font-size: 11px; letter-spacing: .06em; color: var(--ink-45); }

.reader-tools { margin: 16px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.reader-tools input {
  width: 100%; padding: 8px 10px; font-size: 16px;
  font-family: var(--font-sans); color: var(--ink);
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(29,35,33,.18); border-radius: 2px;
}
.reader-tools input:focus { outline: none; border-color: var(--zhu); }
.size-row { display: flex; gap: 6px; }
.size-row button {
  flex: 1; appearance: none; cursor: pointer; padding: 6px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-70);
  background: transparent; border: 1px solid rgba(29,35,33,.2); border-radius: 2px;
}
.size-row button:hover { color: var(--zhu); border-color: var(--zhu); }

.reader-toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.reader-toc li {
  counter-increment: toc;
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 2px; border-bottom: 1px solid rgba(29,35,33,.08);
  cursor: pointer; font-family: var(--font-serif); font-size: 14px; line-height: 1.6;
  color: var(--ink-70); transition: color .18s var(--ease);
}
.reader-toc li::before {
  content: counter(toc, cjk-ideographic); flex: 0 0 20px;
  font-size: 11px; color: var(--ink-45); letter-spacing: .04em;
}
.reader-toc li:hover { color: var(--zhu); }
.reader-toc li.on { color: var(--zhu); font-weight: 600; }
.reader-toc li.empty { cursor: default; color: var(--ink-45); }
.reader-toc li.empty::before { content: "·"; }

.reader-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.reader-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid rgba(29,35,33,.12);
  background: rgba(228,223,208,.6); flex-wrap: wrap;
}
.reader-topbar .ghost { color: var(--ink-70); border-color: rgba(29,35,33,.28); }
.reader-topbar .ghost:hover { background: rgba(29,35,33,.05); }
.reader-switch { display: flex; gap: 4px; flex: 1 1 220px; justify-content: center; flex-wrap: wrap; }
.reader-switch button {
  appearance: none; cursor: pointer; padding: 5px 10px;
  font-family: var(--font-serif); font-size: 12px; letter-spacing: .08em;
  color: var(--ink-70); background: transparent;
  border: 1px solid rgba(29,35,33,.16); border-radius: 2px;
}
.reader-switch button:hover { color: var(--zhu); border-color: var(--zhu); }
.reader-switch button.on { color: #f7f2e6; background: var(--zhu); border-color: var(--zhu); }
.reader-act { display: flex; gap: 6px; }
.reader-act .tool {
  appearance: none; cursor: pointer; padding: 6px 12px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-70);
  background: transparent; border: 1px solid rgba(29,35,33,.24); border-radius: 2px;
}
.reader-act .tool:hover { color: var(--zhu); border-color: var(--zhu); }

.reader-body {
  flex: 1 1 auto; overflow-y: auto; padding: 26px 20px 40px;
  font-family: var(--font-serif);
  font-size: 17px; line-height: 2.15; letter-spacing: .03em;
  color: var(--ink);
  scroll-behavior: smooth;
}
.reader-body .chapter { max-width: 40em; margin: 0 auto; }
.reader-body h3 {
  margin: 0 0 18px; font-size: 19px; font-weight: 600; letter-spacing: .12em;
  padding-bottom: 10px; border-bottom: 1px solid rgba(29,35,33,.16);
  display: flex; align-items: baseline; gap: 10px;
}
.reader-body h3 em {
  font-style: normal; font-size: 11px; letter-spacing: .1em;
  color: var(--ink-45); font-family: var(--font-sans);
}
.reader-body p { margin: 0 0 1.1em; text-indent: 2em; }
.reader-body p.src { color: var(--ink); }
.reader-body p.note {
  font-family: var(--font-sans); font-size: 13.5px; line-height: 1.95;
  color: var(--ink-70); text-indent: 0;
  padding: 10px 12px; margin: 14px 0 4px;
  background: rgba(159,178,172,.16);
  border-left: 2px solid var(--qing);
}
.reader-body mark { background: rgba(184,144,78,.34); color: inherit; padding: 0 1px; }
.reader-body .passage { margin-bottom: 2em; }
.reader-foot {
  margin: 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  font-size: 11px; letter-spacing: .04em; color: var(--ink-45);
  border-top: 1px solid rgba(29,35,33,.12); background: rgba(228,223,208,.5);
}

/* ============================ 信息面板 / 静心 ============================ */
.panel { background: rgba(9,16,14,.5); }
.panel-shell {
  width: 100%; max-width: 620px; max-height: 82vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  overflow: hidden;
}
.panel-shell.narrow { max-width: 420px; }
.panel-shell header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid rgba(29,35,33,.14);
  background: rgba(228,223,208,.65);
}
.panel-shell header h2 {
  flex: 1; margin: 0; font-family: var(--font-serif); font-size: 19px;
  font-weight: 600; letter-spacing: .12em;
}
.panel-shell header .ghost { color: var(--ink-70); border-color: rgba(29,35,33,.28); }
.panel-body {
  padding: 20px 22px 26px; overflow-y: auto;
  font-family: var(--font-serif); font-size: 15px; line-height: 2; letter-spacing: .02em;
}
.panel-body h3 {
  margin: 22px 0 8px; font-size: 15px; letter-spacing: .1em; font-weight: 600;
  color: var(--ink-70); padding-bottom: 6px; border-bottom: 1px solid rgba(29,35,33,.12);
}
.panel-body h3:first-child { margin-top: 0; }
.panel-body p { margin: 0 0 .9em; text-indent: 2em; }
.panel-body p.noindent { text-indent: 0; }
.panel-body ul { margin: 0 0 1em; padding-left: 1.2em; }
.panel-body li { margin-bottom: .35em; }
.panel-body .muted { color: var(--ink-45); font-size: 13px; font-family: var(--font-sans); text-indent: 0; }
.panel-body kbd {
  border-color: rgba(29,35,33,.28); color: var(--ink-70); background: rgba(29,35,33,.04);
}
.panel-body .quote {
  font-family: var(--font-serif); font-size: 17px; line-height: 2.1;
  text-indent: 0; color: var(--zhu); letter-spacing: .1em;
  margin: 16px 0; padding-left: 14px; border-left: 2px solid rgba(162,53,42,.4);
}
.panel-body .link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.panel-body .link-row button {
  appearance: none; cursor: pointer; padding: 9px 16px;
  font-size: 12px; letter-spacing: .1em; color: var(--ink-70);
  background: transparent; border: 1px solid rgba(29,35,33,.26); border-radius: 2px;
}
.panel-body .link-row button:hover { color: var(--zhu); border-color: var(--zhu); }

.still-time {
  font-family: var(--font-serif); font-size: 44px; letter-spacing: .14em;
  text-align: center; margin: 12px 0 4px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.still-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0 18px; }
.still-options button {
  appearance: none; cursor: pointer; padding: 10px;
  font-family: var(--font-serif); font-size: 14px; letter-spacing: .1em; color: var(--ink-70);
  background: transparent; border: 1px solid rgba(29,35,33,.2); border-radius: 2px;
}
.still-options button.on { color: var(--zhu); border-color: var(--zhu); background: rgba(162,53,42,.06); }
#stillPanel .primary { width: 100%; margin-top: 0; }

/* ============================ 响应式（375 起） ============================ */
@media (max-width: 640px) {
  .hud-top { padding: 12px 12px 0; }
  .brand-text b { font-size: 16px; letter-spacing: .16em; }
  .brand-text i { display: none; }
  .seal { width: 30px; height: 30px; font-size: 12px; }

  .hud-nav {
    left: 0; right: 0; top: auto; bottom: 96px; transform: none;
    flex-direction: row; justify-content: center; gap: 4px; padding: 0 10px;
  }
  .hud-nav button {
    font-size: 13px; letter-spacing: .08em; padding: 8px 10px;
    background: rgba(12,22,20,.34); border: 1px solid rgba(240,236,224,.12);
    border-radius: 2px;
  }
  .hud-nav button::before { display: none; }
  .hud-nav button.on { background: rgba(162,53,42,.6); }

  .hud-bottom { padding: 0 12px 12px; gap: 8px; }
  .time-switch, .tool-row { justify-content: center; }
  .time-switch button, .tool-row .tool { padding: 7px 10px; font-size: 11.5px; letter-spacing: .06em; }
  .hud-help { display: none; }

  /* 手机上：交谈栏让到导航之上，别压住底部按钮 */
  .chat-dock { right: 12px; bottom: 140px; }
  .chat-bar { width: auto; max-width: 76vw; }
  .chat-bar input { padding: 8px 8px; font-size: 16px; }
  .chat-bar button { min-width: 46px; min-height: 40px; padding: 0 9px; font-size: 14px; }

  .gate-copy { font-size: 14px; margin-top: 20px; }
  .gate-meta { margin-top: 20px; }
  .gate-meta b { font-size: 14px; }

  .reader-shell { grid-template-rows: auto auto 1fr; }
  .reader-nav {
    display: block; border-right: 0; border-bottom: 1px solid rgba(29,35,33,.14);
    max-height: 168px; padding: 12px 12px 14px;
  }
  .reader-nav-head h2 { font-size: 17px; }
  .reader-tools { flex-direction: row; align-items: center; margin: 10px 0 8px; }
  .reader-tools input { flex: 1; padding: 6px 8px; font-size: 16px; }
  .reader-toc { display: flex; flex-wrap: wrap; gap: 2px; }
  .reader-toc li {
    border: 1px solid rgba(29,35,33,.14); border-radius: 2px;
    padding: 5px 8px; font-size: 12px; flex: 0 0 auto;
  }
  .reader-toc li::before { content: none; }
  .reader-toc li span { display: none; }
  .reader-topbar { padding: 10px 12px; }
  .reader-switch { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .reader-body { padding: 20px 16px 32px; font-size: 16px; line-height: 2; }
  .panel-body { padding: 16px 16px 22px; }
  .toast { bottom: 150px; }
}

@media (min-width: 900px) {
  .reader-shell { grid-template-rows: 1fr; grid-template-columns: 300px 1fr; }
  .reader-nav { display: block; }
  .reader-main { border-left: 1px solid rgba(29,35,33,.1); }
  .reader-topbar { padding: 14px 22px; }
  .reader-body { padding: 34px 40px 48px; font-size: 18px; }
  .reader-body .chapter { max-width: 36em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
