/* ============================================================
   《长生》·「夜观星盘」主题样式表
   深墨蓝黑底 · 鎏金 --gold · 丹砂 --cinnabar · 宣纸白 --paper
   层序契约：#fx-canvas(0) < #app(1) < #modal-root(60) < #toast-root(80)
   ============================================================ */

/* ---------- 一、变量系统 ---------- */
:root {
  --ink: #0b0e14;
  --ink-2: #10141f;
  --ink-3: #161b29;
  --paper: #e8dfc8;
  --paper-dim: rgba(232, 223, 200, 0.66);
  --paper-faint: rgba(232, 223, 200, 0.36);
  --gold: #c9a86a;
  --gold-bright: #e8cf9a;
  --gold-deep: #8f6f3a;
  --gold-dim: rgba(201, 168, 106, 0.35);
  --cinnabar: #c03434;
  --cinnabar-bright: #e05a52;
  --celadon: #7fb8a4;
  --line: rgba(201, 168, 106, 0.22);
  --line-soft: rgba(201, 168, 106, 0.14);
  --shadow-deep: 0 10px 36px rgba(0, 0, 0, 0.55);
  --font-kai: 'Kaiti SC', 'KaiTi', 'STKaiti', 'Noto Serif SC', serif;
  --font-song: 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  --radius: 10px;
  --speed: 0.28s;
  /* 五行辅色 */
  --el-jin: #d9c788;
  --el-mu: #6fae72;
  --el-shui: #5f8fc9;
  --el-huo: #c05a4a;
  --el-tu: #b0814f;
}

/* ---------- 二、基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-song);
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
  background:
    radial-gradient(ellipse 120% 70% at 50% -12%, #141b2c 0%, rgba(20, 27, 44, 0) 58%),
    radial-gradient(ellipse 110% 55% at 50% 112%, #0e1522 0%, rgba(14, 21, 34, 0) 62%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: var(--font-kai);
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  line-height: 1.3;
}
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 6px 0; color: var(--paper-dim); }
a { color: var(--gold); text-decoration: none; transition: color var(--speed); }
a:hover { color: var(--gold-bright); text-shadow: 0 0 8px rgba(201, 168, 106, 0.5); }
button { font: inherit; color: inherit; }
::selection { background: rgba(201, 168, 106, 0.35); color: #fff8ea; }

/* ---------- 三、全局层序 ---------- */
#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}
#app { position: relative; z-index: 1; min-height: 100vh; }
#modal-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* ---------- 滚动条：6px 鎏金 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(16, 20, 31, 0.6); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
* { scrollbar-width: thin; scrollbar-color: var(--gold-dim) rgba(16, 20, 31, 0.6); }

/* ---------- 四、屏幕路由 .screen ---------- */
.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 30px;
  animation: screen-in 0.5s ease both;
}

/* ---------- 五、顶栏 .hud ---------- */
.hud {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background: rgba(11, 14, 20, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hud .hud-brand { font-family: var(--font-kai); font-size: 19px; letter-spacing: 0.3em; color: var(--gold-bright); }
.hud .hud-sep { width: 1px; height: 18px; background: var(--line); }
.hud .spacer { flex: 1; }
.hud .hud-stat { font-size: 13px; letter-spacing: 0.05em; color: var(--paper-dim); }
.hud .hud-stat b { margin-left: 4px; font-family: var(--font-kai); font-weight: 400; color: var(--gold-bright); }

/* ---------- 六、三栏主界面 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) minmax(230px, 290px);
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 20px 0;
  flex: 1;
}
.panel-l, .panel-c, .panel-r {
  background: rgba(16, 20, 31, 0.62);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 150px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.panel-c { background: rgba(19, 24, 37, 0.55); border-color: var(--line); }
.panel-title {
  padding-bottom: 8px;
  margin-bottom: 10px;
  font-family: var(--font-kai);
  font-size: 15px;
  letter-spacing: 0.25em;
  color: var(--gold);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- 七、卡片 .card ---------- */
.card {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: rgba(22, 27, 41, 0.66);
  border: 1px solid rgba(201, 168, 106, 0.24);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.card:hover { border-color: var(--gold-dim); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45); }
.card h3, .card h4 { margin-bottom: 6px; }
.card .card-sub { font-size: 12px; letter-spacing: 0.08em; color: var(--paper-faint); }

/* ---------- 八、按钮 .btn ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  font-family: var(--font-kai);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: #1a1408;
  background: linear-gradient(180deg, #e3c68f 0%, var(--gold) 52%, #a9864e 100%);
  border: 1px solid #8a6a38;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(201, 168, 106, 0.16);
  transition: box-shadow var(--speed), transform var(--speed), filter var(--speed);
}
.btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 0 16px rgba(201, 168, 106, 0.45);
}
.btn:active { transform: translateY(0); filter: brightness(0.94); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; filter: grayscale(0.5); box-shadow: none; transform: none; }
.btn.ghost { background: transparent; color: var(--gold); border-color: rgba(201, 168, 106, 0.45); box-shadow: none; }
.btn.ghost:hover { background: rgba(201, 168, 106, 0.1); box-shadow: 0 0 12px rgba(201, 168, 106, 0.3); }
.btn.danger {
  color: #ffeae2;
  background: linear-gradient(180deg, #d45a54 0%, var(--cinnabar) 58%, #8e2222 100%);
  border-color: #7e1f1f;
  box-shadow: 0 2px 10px rgba(192, 52, 52, 0.22);
}
.btn.danger:hover { box-shadow: 0 0 0 1px var(--cinnabar-bright), 0 0 16px rgba(192, 52, 52, 0.5); }
.btn:focus-visible, .choice-btn:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 2px; }

/* ---------- 九、事件选项 .choice-btn ---------- */
.choice-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-song);
  font-size: 14px;
  line-height: 1.55;
  color: var(--paper);
  background: rgba(201, 168, 106, 0.07);
  border: 1px solid rgba(201, 168, 106, 0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.choice-btn:hover {
  background: rgba(201, 168, 106, 0.15);
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(201, 168, 106, 0.28);
  transform: translateX(3px);
}
.choice-btn .hint { display: block; margin-top: 3px; font-size: 12px; color: var(--paper-faint); }

/* ---------- 十、模态与轻提示 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 11, 0.58);
  backdrop-filter: blur(7px) saturate(0.9);
  -webkit-backdrop-filter: blur(7px) saturate(0.9);
  animation: modal-in 0.32s ease both;
  pointer-events: auto;
}
.modal .modal-box {
  width: min(92vw, 720px);
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px 28px;
  background: linear-gradient(180deg, #151a29 0%, #0f1320 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), inset 0 0 0 1px rgba(201, 168, 106, 0.1);
}
.toast {
  max-width: 78vw;
  padding: 9px 20px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: rgba(16, 20, 31, 0.92);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(201, 168, 106, 0.08);
  animation: toast-in 0.28s ease both, toast-out 0.4s ease 2.6s forwards;
}

/* ---------- 十一、进度条与五行 ---------- */
.bar {
  position: relative;
  height: 14px;
  margin: 6px 0;
  background: rgba(232, 223, 200, 0.07);
  border: 1px solid rgba(201, 168, 106, 0.3);
  border-radius: 7px;
  overflow: hidden;
}
.bar .fill, .rootbar .root .fill { display: block; height: 100%; width: 0%; transition: width 0.5s ease; }
.bar .fill {
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold) 62%, var(--gold-bright) 100%);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.5);
}
.bar .fill.cinnabar { background: linear-gradient(90deg, #7e2020 0%, var(--cinnabar) 60%, var(--cinnabar-bright) 100%); box-shadow: 0 0 8px rgba(192, 52, 52, 0.5); }
.bar .fill.celadon { background: linear-gradient(90deg, #3f6e5e 0%, var(--celadon) 62%, #a5dcc8 100%); box-shadow: 0 0 8px rgba(127, 184, 164, 0.5); }
.bar .bar-lbl, .rootbar .root .lbl {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--paper-dim);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.rootbar .root .lbl { font-family: var(--font-kai); }
.rootbar { display: flex; gap: 6px; margin: 6px 0; }
.rootbar .root {
  position: relative;
  flex: 1;
  height: 18px;
  background: rgba(232, 223, 200, 0.06);
  border: 1px solid rgba(201, 168, 106, 0.25);
  border-radius: 4px;
  overflow: hidden;
}
.fill.el-jin { background: linear-gradient(90deg, #8f7f45, var(--el-jin)); }
.fill.el-mu { background: linear-gradient(90deg, #38603c, var(--el-mu)); }
.fill.el-shui { background: linear-gradient(90deg, #2f4f78, var(--el-shui)); }
.fill.el-huo { background: linear-gradient(90deg, #74281e, var(--el-huo)); }
.fill.el-tu { background: linear-gradient(90deg, #6b4a2a, var(--el-tu)); }

/* ---------- 十二、NPC、日志、因果记忆 ---------- */
.npc-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(22, 27, 41, 0.6);
  border: 1px solid rgba(201, 168, 106, 0.2);
  border-left: 3px solid var(--gold-dim);
  border-radius: 8px;
  transition: border-color var(--speed), background var(--speed);
}
.npc-card:hover { border-left-color: var(--gold-bright); background: rgba(28, 34, 52, 0.72); }
.npc-card .npc-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kai);
  font-size: 16px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1d2334 0%, #0e1220 75%);
}
.npc-card .npc-name { font-family: var(--font-kai); letter-spacing: 0.06em; color: var(--gold-bright); }
.npc-card .npc-meta { font-size: 12px; color: var(--paper-dim); }
.log-line {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--paper-dim);
  border-bottom: 1px dashed var(--line-soft);
}
.log-line::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-dim);
  box-shadow: 0 0 6px rgba(201, 168, 106, 0.4);
}
.log-line b { font-weight: 400; color: var(--gold-bright); }
.karma-line {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--paper-dim);
}
.karma-line::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: rgba(192, 52, 52, 0.75);
  box-shadow: 0 0 8px rgba(192, 52, 52, 0.45);
}
.karma-line .k-year { margin-right: 6px; font-family: var(--font-kai); color: var(--gold); }
.tag-cinnabar, .tag-gold {
  display: inline-block;
  padding: 2px 10px;
  font-family: var(--font-kai);
  font-size: 11px;
  letter-spacing: 0.15em;
  line-height: 1.7;
  border-radius: 3px;
  vertical-align: middle;
}
.tag-cinnabar { color: #f2c7c0; background: rgba(192, 52, 52, 0.16); border: 1px solid rgba(192, 52, 52, 0.55); }
.tag-gold { color: var(--gold-bright); background: rgba(201, 168, 106, 0.1); border: 1px solid rgba(201, 168, 106, 0.42); }

/* ---------- 十三、竖排、大标题、云纹分隔 ---------- */
.vert {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.35em;
  line-height: 1.4;
}
.title-hero {
  font-family: var(--font-kai);
  font-weight: 700;
  font-size: clamp(46px, 8vw, 88px);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-align: center;
  background: linear-gradient(178deg, #f7ecc9 0%, var(--gold-bright) 26%, var(--gold) 52%, var(--gold-deep) 74%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 16px rgba(201, 168, 106, 0.32));
}
.divider-cloud {
  height: 20px;
  margin: 16px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20' viewBox='0 0 120 20'%3E%3Cg fill='none' stroke='%23c9a86a' stroke-opacity='.45'%3E%3Cpath d='M0 10h42M78 10h42'/%3E%3Ccircle cx='55' cy='10' r='5'/%3E%3Ccircle cx='65' cy='10' r='5'/%3E%3Ccircle cx='60' cy='10' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  background-size: 120px 20px;
  border: none;
}

/* ---------- 十四、朱砂印与境界徽章 ---------- */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-kai);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff6ea;
  background: radial-gradient(circle at 32% 28%, #d04c42 0%, var(--cinnabar) 55%, #8e2020 100%);
  border-radius: 50%;
  transform: rotate(-3deg);
  user-select: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 220, 0.3),
    inset 1px 1px 0 rgba(255, 236, 220, 0.18),
    inset -1px -1px 0 rgba(90, 8, 8, 0.5),
    2px 3px 8px rgba(0, 0, 0, 0.45);
}
.seal.square { border-radius: 4px; }
.seal.sm { width: 30px; height: 30px; font-size: 11px; }
.seal.lg { width: 64px; height: 64px; font-size: 20px; }
.seal.vert-s { writing-mode: vertical-rl; text-orientation: upright; font-size: 11px; letter-spacing: 0.1em; }
.realm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 54px;
  padding: 0 6px;
  text-align: center;
  font-family: var(--font-kai);
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(201, 168, 106, 0.22) 0%, rgba(11, 14, 20, 0.92) 72%);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.28), 0 0 14px rgba(201, 168, 106, 0.28), 0 3px 10px rgba(0, 0, 0, 0.4);
  animation: badge-glow 3.6s ease-in-out infinite;
}

/* ---------- 十五、寿元警戒与突破序列 ---------- */
.lifespan-warn {
  color: #ef9d86;
  text-shadow: 0 0 8px rgba(192, 82, 52, 0.55);
  animation: warn-pulse 2.2s ease-in-out infinite;
}
.break-seq { display: flex; flex-direction: column; gap: 10px; counter-reset: bstage; }
.break-stage {
  position: relative;
  counter-increment: bstage;
  padding: 12px 16px 12px 48px;
  background: rgba(22, 27, 41, 0.62);
  border: 1px solid rgba(201, 168, 106, 0.25);
  border-radius: 8px;
  opacity: 0.45;
  transition: opacity 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.break-stage::before {
  content: counter(bstage);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kai);
  font-size: 12px;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: rgba(201, 168, 106, 0.08);
}
.break-stage.active { opacity: 1; border-color: var(--gold-bright); box-shadow: 0 0 14px rgba(201, 168, 106, 0.25); }
.break-stage.done { opacity: 0.85; border-color: rgba(127, 184, 164, 0.5); }
.break-stage.done::before { content: '\2713'; color: var(--celadon); border-color: rgba(127, 184, 164, 0.6); }
.break-stage.fail { border-color: rgba(192, 52, 52, 0.6); }
.break-stage.fail::before { content: '\00d7'; color: var(--cinnabar-bright); border-color: rgba(192, 52, 52, 0.6); }

/* ---------- 十六、斗法盘 .duel-board ---------- */
.duel-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin: 12px 0; }
.duel-board .duel-side {
  padding: 14px;
  text-align: center;
  background: rgba(22, 27, 41, 0.7);
  border: 1px solid rgba(201, 168, 106, 0.28);
  border-radius: 8px;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.duel-board .duel-side .duel-name { font-family: var(--font-kai); font-size: 17px; letter-spacing: 0.08em; color: var(--gold-bright); }
.duel-board .duel-side .duel-meta { margin-top: 4px; font-size: 12px; color: var(--paper-dim); }
.duel-board .duel-vs {
  align-self: center;
  padding: 0 2px;
  font-family: var(--font-kai);
  font-size: 26px;
  color: var(--cinnabar-bright);
  text-shadow: 0 0 12px rgba(192, 52, 52, 0.5);
}
.duel-board .duel-side.win { border-color: var(--gold); box-shadow: 0 0 14px rgba(201, 168, 106, 0.3); }
.duel-board .duel-side.lose { opacity: 0.82; border-color: rgba(192, 52, 52, 0.55); }
.duel-round {
  margin: 8px 0;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--paper-dim);
  background: rgba(201, 168, 106, 0.05);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0 6px 6px 0;
}

/* ---------- 十七、入场动画与震屏 ---------- */
.die-fade { animation: die-fade 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.die-fade.d1 { animation-delay: 0.08s; }
.die-fade.d2 { animation-delay: 0.16s; }
.die-fade.d3 { animation-delay: 0.24s; }
.die-fade.d4 { animation-delay: 0.32s; }
body.shake { animation: shake-hard 0.5s linear 3; }

/* ---------- 十八、关键帧 ---------- */
@keyframes die-fade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes warn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes badge-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.28), 0 0 10px rgba(201, 168, 106, 0.22), 0 3px 10px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.28), 0 0 18px rgba(201, 168, 106, 0.4), 0 3px 10px rgba(0, 0, 0, 0.4); }
}
@keyframes shake-hard {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-10px, 3px); }
  30% { transform: translate(9px, -4px); }
  45% { transform: translate(-7px, -3px); }
  60% { transform: translate(8px, 4px); }
  75% { transform: translate(-5px, 2px); }
  90% { transform: translate(4px, -2px); }
}

/* ---------- 十九、小工具类 ---------- */
.muted { color: var(--paper-faint); }
.gold-text { color: var(--gold-bright); }
.cinnabar-text { color: var(--cinnabar-bright); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.tac { text-align: center; }

/* ---------- 二十、打印样式：纸白底黑字 ---------- */
@media print {
  #fx-canvas, .hud, .btn, .choice-btn, .toast, #toast-root, #modal-root { display: none !important; }
  body { background: #ffffff !important; color: #000000 !important; }
  .screen, .panel-l, .panel-c, .panel-r, .card, .npc-card, .log-line,
  .karma-line, .duel-board .duel-side, .break-stage {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #aaaaaa !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .title-hero {
    background: none !important;
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
    filter: none !important;
  }
  .seal, .realm-badge {
    box-shadow: none !important;
    filter: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .panel-l, .panel-c, .panel-r { max-height: none !important; overflow: visible !important; }
}

/* ---------- 二十一、移动端单栏降级 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 10px; padding: 12px 10px 0; }
  .panel-l, .panel-c, .panel-r { max-height: none; overflow: visible; }
  .hud { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .title-hero { font-size: clamp(34px, 11vw, 56px); letter-spacing: 0.14em; }
  .duel-board { grid-template-columns: 1fr; }
  .duel-board .duel-vs { justify-self: center; }
  .modal .modal-box { width: 94vw; padding: 18px 16px; }
  .vert { writing-mode: horizontal-tb; letter-spacing: 0.12em; }
}
