
/* =========================================================
   竞赛楼夜间守则 · NO.314
   风格：深色机房 / 终端绿 / 像素立绘 / 雾
   布局：顶栏 58px + 左立绘 46% + 右终端 54%（按 1366×768 设计）
   ========================================================= */

:root {
  --bg: #05080b;
  --ink: #cfe0e6;
  --dim: #75909b;
  --faint: #45595f;
  --green: #5ff0b5;
  --amber: #ffcf6e;
  --blue: #a9c6ff;
  --red: #ff8b6b;
  --violet: #b58cff;
  --line: rgba(95, 240, 181, .2);
  /* 字号三档：F 键 / 顶栏「字号」按钮切换，JS 在 body 上加 font-1 / font-2 */
  --text-size: 15.5px;
  --choice-size: 14px;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "Sarasa Mono SC",
          "Noto Sans Mono CJK SC", "Microsoft YaHei", monospace;
}

body.font-1 { --text-size: 17.5px; --choice-size: 15px; }
body.font-2 { --text-size: 20px;   --choice-size: 16.5px; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  overscroll-behavior: none;
  /* 手机：禁掉双击缩放和长按选中，点哪都是「继续」 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  /* 旧机房：暗、偏冷、轻微发青 */
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* ---------- 背景 / 雾 / 扫描线 ---------- */

#bg {
  position: fixed;
  inset: -3%;
  background-color: #05080b;
  background-size: cover;
  background-position: center 40%;
  filter: brightness(var(--bg-b, .4)) contrast(1.08) saturate(.82);
  transform: scale(1.03);
  animation: bgbreath 26s ease-in-out infinite;
}

/* --bg-b：每个场景自己的底亮度（公告栏那张白纸多，要压更暗；JS 在 setScene 里改） */
@keyframes bgbreath {
  0%, 100% { transform: scale(1.03); filter: brightness(var(--bg-b, .4)) contrast(1.08) saturate(.82); }
  50%      { transform: scale(1.06); filter: brightness(calc(var(--bg-b, .4) * 1.17)) contrast(1.05) saturate(.9); }
}

/* 雾：随 alert 变浓，JS 改 --fog */
#fog {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--fog, .16);
  background:
    radial-gradient(60% 45% at 18% 78%, rgba(150, 190, 200, .18), transparent 70%),
    radial-gradient(50% 40% at 78% 62%, rgba(160, 200, 210, .14), transparent 70%),
    radial-gradient(70% 55% at 50% 108%, rgba(190, 220, 225, .2), transparent 72%);
  mix-blend-mode: screen;
  filter: blur(6px);
  animation: fogdrift 18s ease-in-out infinite alternate;
  transition: opacity .8s;
}

@keyframes fogdrift {
  0%   { transform: translate3d(-1.5%, 0, 0) scale(1.02); }
  50%  { transform: translate3d(1.5%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.03); }
}

#scan {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, .22) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(120% 90% at 50% 42%, transparent 40%, rgba(0, 0, 0, .55) 100%);
  opacity: .55;
  animation: flick 7s steps(1) infinite;
}

@keyframes flick {
  0%, 96%, 100% { opacity: .55; }
  97%           { opacity: .42; }
  98%           { opacity: .62; }
}

/* ---------- 骨架 ---------- */

#app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 46% 54%;
  grid-template-rows: 58px 1fr;
}

/* 标题页还没点「开始游戏」时，游戏界面先藏着（否则会从标题卡后面透出来）。
   注意 #title / #ending 都挂在 #app 里面，所以只能藏这三个子块，不能藏整个 #app。 */
body:not(.started) #topbar,
body:not(.started) #stage,
body:not(.started) #panel { visibility: hidden; }
/* 结局卡铺满屏幕时同理：卡片后面不要有游戏界面的残影 */
body.ending-on #topbar,
body.ending-on #stage,
body.ending-on #panel { visibility: hidden; }

/* ---------- 顶栏 ---------- */

#topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  background: linear-gradient(180deg, rgba(4, 8, 10, .92), rgba(4, 8, 10, .35));
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-main {
  font-size: 14px;
  letter-spacing: .16em;
  color: #b8ccd4;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--green);
  border: 1px solid rgba(95, 240, 181, .35);
  padding: 1px 6px;
}

.tools { display: flex; gap: 8px; }

.tool {
  background: transparent;
  border: 1px solid rgba(95, 240, 181, .22);
  color: #8fe0c2;
  font-size: 12px;
  letter-spacing: .06em;
  padding: 5px 10px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.tool kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--faint);
  margin-left: 5px;
}

.tool:hover {
  background: rgba(95, 240, 181, .1);
  border-color: rgba(95, 240, 181, .5);
  color: #c8ffe9;
}

.tool.off { color: var(--faint); border-color: rgba(255, 255, 255, .12); }

/* 快进进行中：按钮亮一下，让人知道「已经在跳了」（手机上尤其需要这个反馈） */
.tool.on {
  background: rgba(95, 240, 181, .18);
  border-color: rgba(95, 240, 181, .75);
  color: #d8fff0;
}

/* ---------- 左：立绘 ---------- */

#stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(95, 240, 181, .07);
}

/* 地面反光 */
#stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 120%;
  height: 34%;
  transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 100%, rgba(110, 190, 200, .18), transparent 70%);
  pointer-events: none;
}

#bust {
  position: relative;
  max-height: 92%;
  max-width: 96%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .8)) saturate(.96) contrast(1.02);
  opacity: 0;
  transform: translateY(14px) scale(.99);
  transition: opacity .35s ease, transform .45s ease;
  animation: breathe 6.5s ease-in-out infinite;
}

#bust.on { opacity: 1; transform: translateY(0) scale(1); }

@keyframes breathe {
  0%, 100% { margin-bottom: 0; }
  50%      { margin-bottom: 6px; }
}

#bustTag {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(180, 205, 212, .5);
  border-left: 2px solid rgba(180, 205, 212, .3);
  padding-left: 8px;
  opacity: 0;
  transition: opacity .3s;
}

#bustTag.on { opacity: 1; }

/* 旁白 / 系统 / 守则：换成「雾里的那个人」——半透明、颜色抽掉一点、
   底部用遮罩化进雾里，看着像从雾里浮出来，不抢台词的注意力 */
#bust.ghost {
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .8)) saturate(.55) brightness(.84);
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, .18) 100%);
  mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, .18) 100%);
}

#bust.ghost.on { opacity: .58; }

#bustTag.narr {
  color: rgba(181, 140, 255, .72);
  border-left-color: rgba(181, 140, 255, .42);
}

/* 换景：左上角「时间 · 地点」条，2.8 秒后自己淡出 */
#sceneBar {
  position: absolute;
  left: 18px;
  top: 14px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: rgba(180, 205, 212, .78);
  background: rgba(4, 9, 12, .66);
  border-left: 2px solid rgba(95, 240, 181, .55);
  padding: 5px 12px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .32s, transform .38s;
  pointer-events: none;
}

#sceneBar.on { opacity: 1; transform: none; }
#sceneBar b { color: var(--green); font-weight: 500; letter-spacing: .1em; }

/* 换景黑场：整屏压黑一下，遮住背景图切换 */
#fade {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: #03060a;
  opacity: 0;
  pointer-events: none;
  transition: opacity .19s linear;
}

#fade.on { opacity: 1; }

/* ---------- 右：终端面板 ---------- */

#panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 26px 14px;
  background:
    linear-gradient(180deg, rgba(6, 11, 14, .5), rgba(6, 11, 14, .88) 26%, rgba(4, 8, 11, .96));
  overflow: hidden;
}

#panel::before {
  /* 面板左侧的「屏幕」亮线 */
  content: "";
  position: absolute;
  left: 0; top: 12%; bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(95, 240, 181, .5), transparent);
}

#panelTop { display: flex; flex-direction: column; gap: 7px; }

#chapter {
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--faint);
}

#stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .05em;
}

.stat-name { min-width: 26px; }

.bar {
  width: 64px;
  height: 4px;
  background: rgba(255, 255, 255, .07);
  position: relative;
  overflow: hidden;
}

.bar i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

[data-k="evidence"] .bar i { background: var(--green); box-shadow: 0 0 8px rgba(95, 240, 181, .7); }
[data-k="courage"]  .bar i { background: var(--amber); box-shadow: 0 0 8px rgba(255, 207, 110, .7); }
[data-k="trust"]    .bar i { background: var(--blue);  box-shadow: 0 0 8px rgba(169, 198, 255, .7); }
[data-k="alert"]    .bar i { background: var(--violet); box-shadow: 0 0 10px rgba(181, 140, 255, .8); }

.stat-num {
  min-width: 12px;
  text-align: right;
  color: var(--ink);
  font-weight: 600;
}

#fogStat .stat-num { color: var(--faint); }

/* 变量变化的小浮字 */
#deltas {
  display: flex;
  gap: 8px;
  height: 12px;
  font-size: 10px;
  letter-spacing: .08em;
}

.delta { animation: deltaOut 1.8s ease forwards; }
.delta.up   { color: var(--green); }
.delta.down { color: var(--red); }
.delta.cap  { color: var(--dim); border-color: rgba(150,170,190,.35); }
@keyframes deltaOut {
  0%   { opacity: 0; transform: translateY(4px); }
  15%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

#speaker {
  font-size: 12px;
  letter-spacing: .16em;
  padding-left: 9px;
  border-left: 2px solid currentColor;
  color: var(--dim);
  min-height: 16px;
}

#speaker.narr  { color: #7e949c; }
#speaker.hero  { color: #cfe6ef; }
#speaker.hao   { color: var(--amber); }
#speaker.zero  { color: var(--blue); }
#speaker.z     { color: var(--red); }
#speaker.insp  { color: #cfd8ff; }
#speaker.rule  { color: var(--green); }
#speaker.sys   { color: #7fa08c; }

#text {
  flex: 1 1 auto;
  min-height: 90px;
  overflow-y: auto;
  padding-right: 8px;
  font-size: var(--text-size);
  line-height: 1.95;
  letter-spacing: .01em;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

#text.rule {
  color: #a9f3d3;
  text-shadow: 0 0 12px rgba(95, 240, 181, .25);
}

/* 最后一行红字：只在这一处用，别扩散成常规强调色 */
#text.red {
  color: #d6473c;
  text-shadow: 0 0 22px rgba(214, 71, 60, .38);
}

#text.sys { color: #86c0a6; letter-spacing: .08em; }

#text::-webkit-scrollbar { width: 5px; }
#text::-webkit-scrollbar-thumb { background: rgba(95, 240, 181, .22); }

/* 闪烁光标 */
.caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  background: var(--green);
  vertical-align: -2px;
  animation: caret .9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- 选项 ---------- */

#choices { display: flex; flex-direction: column; gap: 7px; }

#choices:empty { display: none; }

.choice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  padding: 9px 12px;
  font-size: var(--choice-size);
  line-height: 1.55;
  color: var(--ink);
  background: rgba(95, 240, 181, .035);
  border: 1px solid rgba(95, 240, 181, .2);
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}

.choice .k {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--green);
  border: 1px solid rgba(95, 240, 181, .3);
  padding: 1px 5px;
  opacity: .85;
}

.choice .ct { flex: 1 1 auto; }

.choice .fx {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: .02em;
  white-space: nowrap;
}
.choice .fx .up { color: #7fe3b8; }
.choice .fx .down { color: #e6a3a3; }

.choice:hover:not(:disabled),
.choice:focus-visible:not(:disabled) {
  background: rgba(95, 240, 181, .13);
  border-color: rgba(95, 240, 181, .55);
  transform: translateX(4px);
  outline: none;
}

.choice:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.choice.cont {
  justify-content: center;
  color: #8fe0c2;
  border-style: dashed;
}

.choice.cont .k { display: none; }

#hint {
  height: 13px;
  font-size: 10px;
  letter-spacing: .14em;
  color: #46606a;
}

/* 等待继续的提示：桌面是 ⏎，手机是 ▼，轻轻闪 */
#tapcue {
  position: absolute;
  right: 22px;
  bottom: 44px;
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

#tapcue.on {
  opacity: .75;
  animation: cuebob 1.3s ease-in-out infinite;
}

@keyframes cuebob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

/* ---------- 抽屉（守则 / 日志） ---------- */

#drawer {
  position: fixed;
  top: 58px;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  background: rgba(4, 8, 11, .97);
  border-left: 1px solid rgba(95, 240, 181, .18);
  box-shadow: -18px 0 48px rgba(0, 0, 0, .6);
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.3, .8, .2, 1);
  /* 层级必须高过结局卡(60)：结局卡上点「翻看守则」，抽屉是开在它上面的，
     压到 60 以下就会被那层几乎不透明的遮罩盖住 → 玩家「点了看不到规则」。
     与 #gallery / .author-note 统一用 80（标题页 70，开场就退场，不冲突）。 */
  z-index: 80;
}

#drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--green);
}

.drawer-head .x {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

#drawerBody {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  font-size: 13.5px;
  line-height: 1.9;
  color: #b6c8ce;
  white-space: pre-wrap;
}

#drawerBody::-webkit-scrollbar { width: 5px; }
#drawerBody::-webkit-scrollbar-thumb { background: rgba(95, 240, 181, .22); }

.rule-block {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 2px solid rgba(95, 240, 181, .35);
  background: rgba(95, 240, 181, .04);
}

.rule-block b {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: .1em;
}

.rule-block.locked { border-left-color: rgba(255, 255, 255, .1); color: var(--faint); }
.rule-block.locked b { color: var(--faint); }

/* ---- 分层守则：印刷 / 手写 / 被划掉 / 撕页 / 缺页 / 空白页 ---- */
.rule-block .r-no {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: .1em;
}

.rule-block .r-body { color: #cfe0e4; }
.rule-block.locked .r-no { color: var(--faint); }
.rule-block.locked .r-body { color: var(--faint); }

.rule-block .r-crossed {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 139, 107, .9);
  text-decoration-thickness: 2px;
  color: #7f939b;
}

.rule-block .r-note {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--amber);
}

.rule-block .r-note.hand-a { font-style: italic; transform: rotate(-.5deg); color: #ffd79a; }
.rule-block .r-note.hand-b { font-style: italic; transform: rotate(.6deg); color: #f0a3c8; letter-spacing: .04em; }

/* 玩家的选择写进守则：这一条你做过 / 犯过 */
.rule-block .r-note.r-flag {
  font-style: normal;
  color: #9fd3c7;
  opacity: .92;
  letter-spacing: .02em;
}
.rule-block .r-note.r-flag::before { content: '▸ '; opacity: .7; }

.rule-block .r-torn {
  display: block;
  margin-top: 4px;
  color: rgba(255, 139, 107, .72);
  border-bottom: 1px dashed rgba(255, 139, 107, .35);
  padding-bottom: 2px;
}

.rule-block.hand { border-left-color: rgba(255, 207, 110, .42); background: rgba(255, 207, 110, .05); }
.rule-block.hand .r-body { font-style: italic; color: #ffe1b0; }
.rule-block.missing { border-left-color: rgba(255, 139, 107, .4); background: rgba(255, 139, 107, .06); }
.rule-block.blank { border-left-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .02); }
.rule-block.blank .r-no { color: var(--dim); }

.log-ch { margin: 18px 0 6px; color: var(--faint); letter-spacing: .2em; font-size: 11px; }
.log-line { margin: 0 0 6px; }
.log-line .who { color: var(--dim); margin-right: 6px; }
.log-line.narr .txt { color: #9fb2ba; }
.log-line.hao .who { color: var(--amber); }
.log-line.zero .who { color: var(--blue); }
.log-line.z .who { color: var(--red); }
.log-line.hero .who { color: #cfe6ef; }
.log-line.insp .who { color: #cfd8ff; }
.log-line.rule .txt { color: #a9f3d3; }
.log-line.sys .txt { color: #86c0a6; }
.log-line .txt { color: #a8bcc4; }

/* ---------- 标题页 ---------- */

#title {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background:
    radial-gradient(75% 75% at 50% 42%, rgba(6, 14, 18, .58), rgba(3, 6, 8, .9)),
    linear-gradient(0deg, rgba(3, 6, 8, .5), rgba(3, 6, 8, .18));
  backdrop-filter: blur(1.5px);
  transition: opacity .5s;
}

#title.gone { opacity: 0; pointer-events: none; }

.title-card {
  width: min(620px, 88vw);
  padding: 34px 38px;
  border: 1px solid rgba(95, 240, 181, .18);
  background: rgba(5, 10, 13, .78);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: cardIn .8s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.title-kicker {
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--faint);
  margin-bottom: 14px;
}

.title-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: .16em;
  font-weight: 600;
  color: #e2f1f6;
}

.title-en {
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--green);
  opacity: .8;
  margin-bottom: 18px;
}

.title-desc {
  font-size: 13px;
  line-height: 2;
  color: #93aab2;
  margin-bottom: 20px;
}

.title-desc em { color: var(--green); font-style: normal; }

.title-meta {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--faint);
  border-top: 1px dashed rgba(255, 255, 255, .1);
  padding-top: 12px;
  margin-bottom: 18px;
  line-height: 1.9;
}

.start-btn {
  font-size: 14px;
  letter-spacing: .2em;
  color: #05100c;
  background: var(--green);
  border: none;
  padding: 11px 26px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}

.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(95, 240, 181, .35);
  background: #7bf8c6;
}

.start-tip {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--faint);
}

/* 标题页底部的「更新日志」：一条文字链接，不跟主按钮抢位置 */
.title-log-link {
  margin-top: 10px;
  padding: 2px 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.title-log-link:hover { color: #8fe0c2; }

/* 更新日志面板：复用作者的话那层遮罩 */
.changelog-card { width: min(560px, 92vw); }
.cl-list {
  list-style: none;
  margin: 0;
  padding: 13px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-list li {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
}
.cl-list b {
  flex: 0 0 58px;
  font-weight: normal;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--green);
  padding-top: 2px;
}
@media (max-width: 700px) {
  .cl-list li { font-size: 12px; line-height: 1.65; }
  .cl-list b { flex-basis: 52px; font-size: 10.5px; }
}

.title-collect {
  margin: 14px 0 2px;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--dim);
}
.title-collect.all { color: var(--green); }

.title-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gallery-btn {
  font-size: 12px;
  letter-spacing: .12em;
  color: #8fe0c2;
  background: transparent;
  border: 1px solid rgba(95, 240, 181, .26);
  padding: 11px 16px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.gallery-btn:hover {
  background: rgba(95, 240, 181, .1);
  border-color: rgba(95, 240, 181, .55);
}

/* 启动失败时的可见提示：正常永远不显示。
   以前启动阶段一旦抛错，标题页还在、点「开始游戏」毫无反应，玩家只能报「进不去」；
   现在把错因直接摆在标题卡上，下次再出问题能一眼拿到真实原因。 */
#startErr {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 120, 120, .45);
  background: rgba(64, 12, 12, .5);
  color: #ffb9b9;
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: .02em;
  word-break: break-word;
}

#startErr[hidden] { display: none; }

/* ---------- 结局 ---------- */

#ending {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 26px;
  background: radial-gradient(80% 80% at 50% 40%, rgba(5, 12, 16, .86), rgba(2, 4, 6, .98));
  overflow-y: auto;
}

/* 关键：hidden 属性必须真的隐藏 ——
   否则上面这条 display:grid 会盖掉浏览器默认的 [hidden]{display:none}，
   这层几乎不透明的遮罩就会从游戏一开始就压在画面上（整屏发暗）。 */
#ending[hidden] { display: none !important; }

/* 回顾模式（图鉴点开的结局卡）：要盖过标题页（70），但低于图鉴 / 作者的话（80） */
#ending.review { z-index: 78; }

.ending-card {
  width: min(780px, 96vw);
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(6, 11, 14, .92);
  padding: 26px 32px 24px;
  animation: cardIn .7s ease;
}

.ending-kicker {
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--faint);
  margin-bottom: 6px;
}

.ending-letter {
  font-size: 46px;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--green);
  margin-bottom: 4px;
}

.ending-title {
  font-size: 20px;
  letter-spacing: .16em;
  color: #e2f1f6;
  margin-bottom: 4px;
}

.ending-sub {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--red);
  margin-bottom: 16px;
  min-height: 14px;
}

.ending-body {
  font-size: 13.5px;
  line-height: 2;
  color: #a8bcc4;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.ending-body p { margin: 0 0 9px; }

.ending-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  border-top: 1px dashed rgba(255, 255, 255, .12);
  border-bottom: 1px dashed rgba(255, 255, 255, .12);
  padding: 12px 0;
  margin-bottom: 16px;
}

.ending-stat { font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.ending-stat b {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: .04em;
}

.ending-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  font-size: 12px;
  letter-spacing: .14em;
  color: #8fe0c2;
  background: transparent;
  border: 1px solid rgba(95, 240, 181, .3);
  padding: 9px 16px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.btn:hover { background: rgba(95, 240, 181, .12); border-color: rgba(95, 240, 181, .6); }

.btn.primary {
  color: #05100c;
  background: var(--green);
  border-color: var(--green);
}

.btn.primary:hover { background: #7bf8c6; }

.ending-note {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--faint);
}

/* ---------- 结局图鉴 ---------- */

#gallery {
  position: fixed;
  inset: 0;
  z-index: 80;              /* 要盖过标题页(70)和结局页(60) */
  display: grid;
  place-items: center;
  padding: 26px;
  background: radial-gradient(80% 80% at 50% 40%, rgba(5, 12, 16, .96), rgba(2, 4, 6, .995));
  overflow-y: auto;
}

/* 同 #ending：display:grid 会盖掉 [hidden] 默认样式，必须显式隐藏 */
#gallery[hidden] { display: none !important; }

.gallery-card {
  width: min(880px, 96vw);
  border: 1px solid rgba(181, 140, 255, .18);
  background: rgba(6, 11, 14, .97);
  padding: 24px 30px 20px;
  animation: cardIn .6s ease;
}

.g-kicker {
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--faint);
  margin-bottom: 6px;
}

.g-head {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: .18em;
  font-weight: 600;
  color: #e2f1f6;
}

.g-progress {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--violet);
  opacity: .85;
  margin-bottom: 14px;
}

.g-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.g-card {
  border: 1px dashed rgba(255, 255, 255, .1);
  padding: 10px 10px 12px;
  min-height: 120px;
  opacity: .5;
}

.g-card.got {
  opacity: 1;
  border-style: solid;
  border-color: rgba(95, 240, 181, .32);
  background: rgba(95, 240, 181, .04);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}

.g-card.got:hover,
.g-card.got:focus-visible {
  border-color: rgba(95, 240, 181, .6);
  background: rgba(95, 240, 181, .09);
  outline: none;
}

/* 已解锁的卡多一行「▸ 点开看结尾」，让「能点」这件事看得见 */
.g-open {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #8fe0c2;
}

.g-letter {
  font-size: 22px;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--faint);
  margin-bottom: 6px;
}

.g-card.got .g-letter { color: var(--green); }

.g-title {
  font-size: 12.5px;
  line-height: 1.5;
  color: #dceaf0;
  margin-bottom: 4px;
}

.g-card:not(.got) .g-title { color: var(--faint); letter-spacing: .2em; }

.g-sub {
  font-size: 10px;
  min-height: 12px;
  color: var(--red);
  opacity: .85;
  margin-bottom: 6px;
}

.g-card:not(.got) .g-sub { color: var(--faint); }

.g-hint {
  font-size: 10.5px;
  line-height: 1.6;
  color: #8298a0;
}

.g-note {
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: .06em;
  color: var(--faint);
  margin-bottom: 14px;
}

.g-actions { display: flex; justify-content: flex-end; }

/* =========================================================
   适配：电脑（1366×768 起）+ 手机竖屏 + 手机横屏 + 平板
   思路：电脑保持左右分栏；手机改成「上立绘 / 下终端」的竖排，
        所有可点区域按 44px 以上做，键盘提示换成触摸提示（JS 里切换）
   ========================================================= */

/* ---------- 触屏公共：按钮更大、去掉键盘提示 ---------- */

@media (hover: none), (pointer: coarse) {
  .tool kbd { display: none; }              /* 触屏没有键盘，键位角标没意义 */
  .tool { padding: 9px 14px; font-size: 13px; }
  .start-tip { letter-spacing: .06em; }
  #tapcue { display: block; }

  .choice { min-height: 46px; align-items: center; }
#prop { height: min(30vh, 200px); left: 3vw; bottom: 22vh; max-width: 40vw; }
  .choice:hover:not(:disabled) { transform: none; }  /* 手机没有 hover，避免点完还停在放大态 */
}

/* ---------- 平板 / 窄窗口（纵向空间还够） ---------- */

@media (max-width: 1024px) and (min-width: 701px) {
  #app { grid-template-columns: 42% 58%; }
  #panel { padding: 14px 18px 12px; }
  #text { font-size: calc(var(--text-size) - .5px); }
}

/* ---------- 手机竖屏：上立绘 下终端 ---------- */

@media (max-width: 700px) {

  html, body { height: 100%; }
  #app {
    height: 100vh;
    height: 100dvh;                        /* 手机浏览器地址栏收放也不跳 */
    grid-template-columns: 1fr;
    /* 行高把刘海屏的顶部安全区一起算进去，避免顶栏压住状态栏 */
    grid-template-rows: calc(46px + env(safe-area-inset-top)) 34dvh minmax(0, 1fr);
  }

  /* 顶栏：紧凑，按钮仍可单手点 */
  #topbar {
    grid-row: 1;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(46px + env(safe-area-inset-top));
  }
  .brand-main { font-size: 12px; letter-spacing: .06em; }
  .brand-sub { display: none; }           /* NO.314 徽标在手机上省掉，给按钮让位 */
  .tools { gap: 5px; height: 100%; }
  /* 六个按钮：竖着吃满顶栏（46px），手指好按；字数收一档给宽度让位 */
  .tool { height: 100%; padding: 0 8px; font-size: 11px; letter-spacing: 0; }
  .tool kbd { display: none; }            /* 手机没有键盘，不显示 R / L / M */

  /* 立绘：占上面三分之一，人物贴底 */
  #stage {
    grid-row: 2;
    border-right: none;
    border-bottom: 1px solid rgba(95, 240, 181, .08);
  }
  #bust { max-height: 100%; max-width: 88%; }
  #bustTag { left: 12px; bottom: 8px; font-size: 10px; }
  #sceneBar { left: 10px; top: 8px; font-size: 10px; padding: 4px 9px; }

  /* 终端：下面一大块，文字可滚，选项常驻底部 */
  #panel {
    grid-row: 3;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
    background:
      linear-gradient(180deg, rgba(6, 11, 14, .55), rgba(4, 8, 11, .97) 24%, rgba(3, 6, 8, .99));
  }
  #panel::before { display: none; }

  #panelTop { gap: 5px; }
  #chapter { font-size: 10px; letter-spacing: .14em; }
  #stats { gap: 4px 10px; }
  .stat { font-size: 10px; gap: 4px; }
  .stat-name { min-width: 22px; }
  .bar { width: 40px; }
  #deltas { height: 11px; font-size: 9px; }

  #speaker { font-size: 11px; min-height: 14px; }

  #text {
    flex: 1 1 auto;
    min-height: 0;                          /* 关键：让它成为滚动区，选项不被挤走 */
    font-size: calc(var(--text-size) - 1px);
    line-height: 1.85;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  #choices { gap: 8px; }
  .choice {
    padding: 12px 12px;
    font-size: 14.5px;
    line-height: 1.5;
    min-height: 48px;
    background: rgba(95, 240, 181, .05);
  }
  .choice .k { display: none; }             /* 手机不显示 1-4 键位 */
  .choice .lock { font-size: 9.5px; }
  .choice.cont { min-height: 50px; font-size: 15px; }

  #hint { display: none; }                  /* 触摸提示改由 #tapcue 表达 */
  #tapcue { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); font-size: 15px; }

  /* 抽屉占满整屏 */
  #drawer {
    top: calc(46px + env(safe-area-inset-top));
    width: 100%;
    border-left: none;
  }
  #drawerBody { padding: 14px 16px calc(30px + env(safe-area-inset-bottom)); font-size: 14px; line-height: 1.85; }
  .drawer-head { padding: 10px 14px; }
  .drawer-head .x { font-size: 22px; padding: 0 6px; }

  /* 标题页 */
  #title { padding: 16px; }
  .title-card { width: 100%; padding: 22px 20px; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .title-card h1 { font-size: 24px; letter-spacing: .1em; }
  .title-en { font-size: 9px; letter-spacing: .16em; margin-bottom: 14px; }
  .title-desc { font-size: 12.5px; line-height: 1.85; margin-bottom: 14px; }
  .title-kicker { font-size: 10px; letter-spacing: .16em; margin-bottom: 10px; }
  .title-meta { font-size: 10.5px; line-height: 1.8; margin-bottom: 14px; }
  .start-btn { width: 100%; padding: 15px 20px; font-size: 15px; letter-spacing: .14em; }
  .start-tip { font-size: 10.5px; line-height: 1.7; }
  .title-actions { display: block; }
  .gallery-btn { width: 100%; margin-top: 8px; padding: 13px 16px; font-size: 12.5px; }

  /* 结局图鉴：整屏、两列 */
  #gallery { padding: 0; align-content: start; }
  .gallery-card {
    width: 100%;
    min-height: 100%;
    border: none;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  }
  .g-grid { grid-template-columns: 1fr 1fr; }
  .g-card { min-height: 104px; }

  /* 结局卡 */
  #ending { padding: 0; align-content: start; }
  .ending-card {
    width: 100%;
    min-height: 100%;
    border: none;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  }
  .ending-letter { font-size: 38px; }
  .ending-title { font-size: 18px; }
  .ending-body { font-size: 13.5px; line-height: 1.9; }
  .ending-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ending-stat b { font-size: 18px; padding: 2px 0; }
  .ending-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .btn { padding: 13px 16px; font-size: 14px; text-align: center; }
  .ending-note { margin-left: 0; text-align: center; margin-top: 4px; line-height: 1.7; }
}

/* ---------- 手机横屏（高度紧张）：回到左右分栏 ---------- */

@media (max-height: 560px) and (orientation: landscape) {
  #app {
    height: 100vh;
    height: 100dvh;
    grid-template-columns: 36% 64%;
    grid-template-rows: 40px minmax(0, 1fr);
  }
  #topbar { grid-row: 1; padding: 0 10px; height: 40px; }
  .brand-main { font-size: 11px; }
  .brand-sub { display: none; }
  .tool { padding: 6px 10px; font-size: 11px; }

  #stage { grid-row: 2; grid-column: 1; border-right: 1px solid rgba(95, 240, 181, .08); border-bottom: none; }
  #bust { max-height: 100%; max-width: 100%; }
  #bustTag { left: 10px; bottom: 6px; font-size: 9px; }

  #panel {
    grid-row: 2; grid-column: 2;
    padding: 8px 14px 8px;
    gap: 6px;
  }
  #panel::before { display: block; }
  #panelTop { gap: 4px; }
  #stats { gap: 3px 10px; }
  .stat { font-size: 10px; }
  .bar { width: 42px; }
  #speaker { font-size: 10.5px; min-height: 12px; }
  #text { font-size: calc(var(--text-size) - 2px); line-height: 1.7; min-height: 40px; }
  .choice { padding: 8px 10px; font-size: calc(var(--choice-size) - 1.5px); min-height: 40px; }
  .choice .k { display: none; }
  #hint { display: none; }
  #tapcue { bottom: 10px; right: 14px; }
  #drawer { top: 40px; width: min(560px, 92vw); }
  #ending { padding: 10px; align-content: center; }
  .ending-card { padding: 16px 20px; max-height: calc(100dvh - 20px); overflow-y: auto; }
  .ending-body { font-size: 12.5px; line-height: 1.8; }
  .title-card { padding: 18px 22px; max-height: calc(100dvh - 20px); overflow-y: auto; }
  .title-card h1 { font-size: 22px; }
  .title-desc { font-size: 12px; line-height: 1.8; }
}

/* ---------- 很矮的桌面窗口（老机房 1280×720 之类） ---------- */

@media (max-width: 1366px) and (max-height: 700px) and (orientation: landscape) and (hover: hover) {
  #panel { padding: 12px 20px 10px; gap: 8px; }
  #text { font-size: calc(var(--text-size) - 1px); line-height: 1.8; }
  .choice { padding: 8px 11px; font-size: calc(var(--choice-size) - .5px); }
}

@media (prefers-reduced-motion: reduce) {
  #bg, #fog, #bust, #scan, #tapcue { animation: none !important; }
  #bust { transition: none; }
}


/* ===== 新版追加：道具特写 / 章末卡 ===== */
#prop {
  position: fixed;
  left: 4vw;
  bottom: 8vh;
  height: min(44vh, 340px);
  width: auto;
  max-width: 30vw;
  border-radius: 4px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .72));
  transform: rotate(-3deg) scale(.94);
  transform-origin: 50% 100%;
  opacity: 0;
  transition: opacity .5s ease, transform .55s ease;
  pointer-events: none;
  z-index: 6;
}
#prop.on { opacity: 1; transform: rotate(-3deg) scale(1); }

.final-card {
  border: 1px solid rgba(190, 214, 255, .22);
  background: rgba(8, 14, 20, .72);
  padding: 22px 20px 18px;
  margin: 6px 0 12px;
  text-align: center;
}
.final-k { font-size: 13px; letter-spacing: .32em; opacity: .62; }
.final-t { font-size: 22px; margin: 10px 0 8px; letter-spacing: .06em; }
.final-d { font-size: 13px; opacity: .7; }

/* ---- 黑雾视觉（主角「看见」之后才出现的悬念暗影，不挡字） ---- */
body.misty #stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(42vw 34vh at 18% 70%, rgba(0, 0, 0, .55), transparent 72%),
    radial-gradient(30vw 26vh at 12% 42%, rgba(0, 0, 0, .38), transparent 70%),
    radial-gradient(24vw 20vh at 30% 86%, rgba(0, 0, 0, .45), transparent 72%);
  animation: mistDrift 9s ease-in-out infinite alternate;
}
@keyframes mistDrift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .9; }
  to   { transform: translate3d(1.6vw, -1.2vh, 0) scale(1.06); opacity: 1; }
}
@media (max-width: 700px) {
  body.misty #stage::before { background: radial-gradient(60vw 30vh at 30% 80%, rgba(0,0,0,.5), transparent 72%); }
}


/* ===== R31：状态条浮字（挂在对应 .stat 上，颜色按好坏）/ 窄屏册子特写 ===== */
.stat { position: relative; }
.stat .delta {
  position: absolute;
  right: 0;
  bottom: -13px;
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
  pointer-events: none;
  animation: deltaOut 1.8s ease forwards;
  z-index: 7;
}
.stat .delta.up   { color: var(--green); }
.stat .delta.down { color: var(--red); }
.stat .delta.cap  { color: var(--dim); }
#deltas { display: none; }              /* 旧容器停用：浮字已挂到各条状态上 */

@media (max-width: 700px) {
  #prop {
    left: auto;
    right: 3vw;
    top: auto;
    bottom: calc(100dvh - 46px - env(safe-area-inset-top) - 34dvh + 6px);
    height: min(15dvh, 104px);
    max-width: 24vw;
    transform: rotate(-3deg) scale(.96);
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .6));
  }
  #prop.on { opacity: .95; transform: rotate(-3deg) scale(1); }
}

/* 作者的话：一张可以滚的面板，盖在章末卡上面 */
.author-note {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(4, 8, 12, .86);
  backdrop-filter: blur(3px);
}
.author-note[hidden] { display: none; }
.author-card {
  width: min(680px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 18px;
  border: 1px solid rgba(150, 170, 190, .22);
  background: rgba(10, 16, 22, .96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.author-kicker {
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--green);
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(150, 170, 190, .22);
}
.author-body {
  overflow-y: auto;
  padding: 14px 4px 6px 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink);
}
.author-body p { margin: 0 0 .62em; }
.author-body p:first-child { color: var(--green); letter-spacing: .04em; }
.author-actions { padding-top: 10px; text-align: right; }
@media (max-width: 700px) {
  .author-card { padding: 18px 16px 12px; }
  .author-body { font-size: 13px; line-height: 1.9; }
}

/* ---------- 存档面板 ---------- */
/* 复用 .author-note 那层遮罩（z 80），但要盖过图鉴，所以再抬到 90 */
.save-note { z-index: 90; }
.save-card { width: min(620px, 92vw); }
.save-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0 4px;
  overflow-y: auto;
}
.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(150, 170, 190, .16);
  background: rgba(255, 255, 255, .02);
}
.save-row.empty { opacity: .55; }
.save-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.save-what b {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--green);
  font-weight: normal;
}
.save-what span {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.save-what em {
  font-size: 10.5px;
  color: var(--faint);
  font-style: normal;
  letter-spacing: .06em;
}
.save-btns { display: flex; gap: 6px; flex-shrink: 0; }
.save-btns button {
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .08em;
  cursor: pointer;
  padding: 6px 10px;
  background: transparent;
  color: #8fe0c2;
  border: 1px solid rgba(95, 240, 181, .26);
}
.save-btns button:hover:not(:disabled) {
  background: rgba(95, 240, 181, .1);
  border-color: rgba(95, 240, 181, .55);
}
.save-btns button:disabled {
  color: var(--faint);
  border-color: rgba(255, 255, 255, .08);
  cursor: default;
}
.save-btns button[data-act="del-slot"]:hover:not(:disabled) {
  color: #ffb9b9;
  border-color: rgba(255, 120, 120, .45);
}
.save-tip { font-size: 11px; color: var(--faint); line-height: 1.7; padding-top: 6px; }

/* 存档码：导出 / 导入（R57） */
.save-portable {
  display: flex;
  gap: 8px;
  margin: 12px 0 6px;
  flex-wrap: wrap;
}

.portable-box {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  margin-top: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.6;
  word-break: break-all;
  resize: vertical;
}

.portable-box:focus {
  outline: none;
  border-color: rgba(95, 240, 181, .5);
}

.portable-msg { color: #8fe0c2; min-height: 15px; }

/* ---------- 意见板（在线留言，SPEC §1.7） ---------- */
/* 盖过存档面板（90），因为它是玩家最后一个想关掉的东西 */
.fb-note { z-index: 95; }
.fb-card { width: min(600px, 94vw); }

.fb-list {
  max-height: 34vh;
  overflow-y: auto;
  padding: 12px 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fb-empty {
  padding: 10px 0;
  font-size: 13px;
  color: rgba(220, 232, 240, .5);
}
.fb-item {
  padding: 9px 11px;
  border-left: 2px solid rgba(95, 240, 181, .35);
  background: rgba(255, 255, 255, .03);
}
.fb-meta {
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(220, 232, 240, .52);
}
.fb-body {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-reply {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 3px;
  background: rgba(95, 240, 181, .09);
  font-size: 12px;
  line-height: 1.7;
  color: #9ce8c9;
  white-space: pre-wrap;
}

.fb-form { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; }
.fb-name, .fb-text {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
}
.fb-text { min-height: 76px; resize: vertical; }
.fb-name:focus, .fb-text:focus { outline: none; border-color: rgba(95, 240, 181, .5); }
.fb-count {
  align-self: flex-end;
  font-size: 11px;
  color: rgba(220, 232, 240, .45);
  margin-top: -2px;
}

.fb-tip { min-height: 17px; padding-top: 8px; font-size: 12px; line-height: 1.6; color: rgba(220, 232, 240, .6); }
.fb-tip.ok { color: #8fe0c2; }
.fb-tip.warn { color: #f0c674; }
.fb-tip.bad { color: #f08a8a; }

.fb-portable { padding-top: 6px; }
.fb-code {
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px dashed rgba(240, 198, 116, .45);
  border-radius: 4px;
  color: #f0c674;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.6;
  word-break: break-all;
  resize: vertical;
}
.fb-code:focus { outline: none; border-color: rgba(240, 198, 116, .8); }

/* 常驻入口：触屏没有 F 键 */
.fb-entry {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  padding: 9px 14px;
  min-width: 64px;
  min-height: 40px;
  border: 1px solid rgba(150, 170, 190, .3);
  border-radius: 4px;
  background: rgba(10, 16, 22, .82);
  color: rgba(220, 232, 240, .78);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  cursor: pointer;
}
.fb-entry:hover { border-color: rgba(95, 240, 181, .6); color: var(--green); }
@media (max-width: 700px) { .fb-entry { padding: 11px 16px; font-size: 14px; } }

@media (max-width: 700px) {
  .save-card { width: 100%; padding: 16px 14px calc(12px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  .save-row { padding: 9px 10px; gap: 8px; }
  .save-what span { font-size: 12.5px; }
  .save-btns button { padding: 9px 10px; min-height: 38px; }
}

/* 顶栏放六个按钮：极窄屏（≤380）再收一档，宁可字小也别把按钮挤出去 */
@media (max-width: 380px) {
  #topbar { padding: 0 8px; }
  .brand-main { font-size: 11px; letter-spacing: .04em; }
  .tools { gap: 4px; }
  .tool { padding: 5px 6px; font-size: 10.5px; }
}
