/* 思维陷阱探员 · 手绘侦探档案风 v3
   实现手法：不规则圆角描边（手绘感）+ 纸纹背景 + 硬阴影 + 胶带/图钉/印章，全部纯 CSS/SVG，无外部依赖 */

:root {
  /* 牛皮纸档案室 · 日间 */
  --paper: #f7f0de;
  --paper-2: #fffaf0;
  --paper-3: #efe4ca;
  --ink: #2c2117;
  --ink-soft: #6d5b46;
  --line: #cdbca0;
  --brand: #1f6f5c;          /* 侦探墨绿 */
  --brand-2: #2d8f76;
  --brand-soft: #e2f0e9;
  --accent: #b23a32;         /* 印章红 */
  --accent-soft: #fbe9e3;
  --gold: #d8a33f;
  --ok: #2f7d5d;
  --warn: #b23a32;
  --shadow-ink: rgba(44, 33, 23, .18);
  --radius-hd: 255px 12px 225px 15px / 15px 225px 15px 255px;
  --radius-hd2: 15px 235px 15px 255px / 255px 15px 225px 15px;
  --radius-hd3: 225px 15px 255px 15px / 15px 255px 15px 235px;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-hand: "STKaiti", "KaiTi", "楷体", "Xingkai SC", "Comic Sans MS", cursive;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
  /* 夜间档案室 */
  --paper: #1d2430;
  --paper-2: #232c3a;
  --paper-3: #171e28;
  --ink: #eadfcb;
  --ink-soft: #a99a80;
  --line: #3b4759;
  --brand: #7fd8b8;
  --brand-2: #9ee7cd;
  --brand-soft: #1b332c;
  --accent: #e0796d;
  --accent-soft: #33201d;
  --gold: #e0b968;
  --ok: #79d3a8;
  --warn: #e0796d;
  --shadow-ink: rgba(0, 0, 0, .45);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    var(--noise),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(120, 95, 60, .07) 28px 29px),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(120, 95, 60, .07) 28px 29px),
    radial-gradient(900px 520px at 10% -8%, rgba(216, 163, 63, .16) 0%, transparent 60%);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }
.ico { width: 1em; height: 1em; vertical-align: -.12em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ─────────── 手绘基元 ─────────── */
.hd {
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-hd);
  background: var(--paper-2);
  box-shadow: 3px 4px 0 var(--shadow-ink);
}
.hd2 { border-radius: var(--radius-hd2); }
.hd3 { border-radius: var(--radius-hd3); }
.hand { font-family: var(--font-hand); }

/* 胶带 */
.tape {
  position: absolute; width: 78px; height: 24px; top: -11px; left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(216, 163, 63, .38);
  border-left: 1px dashed rgba(255, 255, 255, .6);
  border-right: 1px dashed rgba(255, 255, 255, .6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
/* 图钉 */
.pin {
  position: absolute; top: 8px; right: 10px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 3px rgba(0, 0, 0, .3), inset -2px -2px 0 rgba(255, 255, 255, .35);
}
/* 印章 */
.stamp {
  display: inline-block; font-family: var(--font-hand); font-weight: 700;
  color: var(--accent); border: 2.5px double var(--accent); border-radius: 6px;
  padding: 2px 9px; transform: rotate(-7deg); opacity: .88; font-size: 13px; letter-spacing: 1px;
}
/* 手绘波浪分隔线 */
.squiggle {
  height: 12px; margin: 14px 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M0 8 Q10 2 20 8 T40 8 T60 8 T80 8 T100 8 T120 8' fill='none' stroke='%23cdbca0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
}

/* ─────────── 通用组件 ─────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-hand);
  font-size: 13px; font-weight: 700; padding: 4px 12px;
  border: 2px solid var(--ink); border-radius: var(--radius-hd2);
  background: var(--paper-2); color: var(--ink); box-shadow: 2px 2px 0 var(--shadow-ink);
}
.pill.live { background: var(--brand-soft); color: var(--brand); }
.pill.off { background: var(--accent-soft); color: var(--accent); }

.btn {
  font-family: var(--font-hand); font-weight: 700; font-size: 18px; letter-spacing: 1px;
  padding: 13px 34px; color: var(--paper-2); background: var(--brand);
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  box-shadow: 4px 5px 0 var(--shadow-ink);
  transition: transform .1s, box-shadow .1s, filter .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--shadow-ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--paper-2); color: var(--ink); }
.btn.ghost:hover { color: var(--brand); }
.btn.orange { background: var(--accent); }

/* ─────────── ① 接案大厅 ─────────── */
#screen-select { max-width: 1000px; margin: 0 auto; padding: 20px 20px 60px; }
/* 顶部信息栏：标题 + 吉祥物气泡 + 守则进度 + 功能入口，弹性换行，保证卷宗一屏可见 */
.hall-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 10px 16px 10px 12px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  background: var(--paper-2); box-shadow: 3px 4px 0 var(--shadow-ink);
}
/* 卷宗感装饰：封口胶带 + 机密章 */
.hall-top .tape { width: 64px; height: 20px; top: -10px; }
.hall-stamp {
  position: absolute; top: -11px; right: 16px; z-index: 2;
  transform: rotate(8deg); font-size: 14px; padding: 2px 10px;
  background: var(--paper-2); box-shadow: 1px 2px 0 var(--shadow-ink);
}
.hall-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hall-badge { color: var(--brand); line-height: 1; filter: drop-shadow(2px 3px 2px rgba(44, 33, 23, .25)); }
.hall-badge .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.hall-title h1 {
  font-family: var(--font-hand); font-size: 22px; letter-spacing: 2px; line-height: 1.25;
  text-shadow: 2px 2px 0 rgba(216, 163, 63, .35); white-space: nowrap;
}
.hall-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* 顶栏里的小吉祥物 + 气泡问候 + 守则进度（紧凑版） */
.hall-top .mascot { width: 46px; flex: none; align-self: center; }
.speech {
  position: relative; flex: 1 1 230px; min-width: 0;
  padding: 7px 14px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  background: var(--paper-2);
  font-family: var(--font-hand); font-size: 14.5px; font-weight: 700; letter-spacing: .5px;
  box-shadow: 2px 3px 0 var(--shadow-ink);
}
.speech::before {
  content: ""; position: absolute; left: -8px; top: 50%;
  width: 12px; height: 12px; transform: translateY(-50%) rotate(45deg);
  background: var(--paper-2); border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
}
.hall-progress { flex: 0 1 225px; min-width: 185px; font-size: 12px; color: var(--ink-soft); }
.hp-head { display: flex; align-items: center; gap: 6px; font-family: var(--font-hand); font-size: 13.5px; color: var(--ink); letter-spacing: .5px; }
.hp-head b { margin-left: auto; color: var(--brand); font-size: 14px; }
.hp-bar { margin: 6px 0 0; height: 10px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.hp-fill { height: 100%; width: 0; border-radius: 99px; background: repeating-linear-gradient(-45deg, var(--brand) 0 8px, var(--brand-2) 8px 16px); transition: width .6s ease; }
.hp-tip { display: none; }
/* 还没收集到守则时：显示邀请语而不是空的 0/10 */
.hall-progress.tease { flex: 0 1 300px; }
.hall-progress.tease .hp-head { color: var(--ink-soft); font-size: 12.5px; letter-spacing: .3px; }
.hall-progress.tease .hp-head .ico { color: var(--gold); flex: none; }

/* ── 卷宗柜：内嵌容器，卷宗增多时在柜内滚动，页面保持一屏 ── */
.case-drawer {
  position: relative;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd);
  background:
    linear-gradient(rgba(120, 95, 60, .05), rgba(120, 95, 60, .05)),
    var(--paper-3);
  box-shadow: inset 2px 3px 6px rgba(44, 33, 23, .12), 3px 4px 0 var(--shadow-ink);
  padding: 14px;
  max-height: calc(100vh - 190px); min-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.case-drawer::-webkit-scrollbar { width: 9px; }
.case-drawer::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid var(--paper-3); }

/* ── 氛围装饰：浅印漂浮的探案元素 ── */
.hall-deco { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hall-deco .ico {
  position: absolute; left: var(--dx); top: var(--dy);
  width: var(--ds); height: var(--ds); stroke-width: 1.5;
  color: var(--ink); opacity: .06;
  animation: decoFloat 7s ease-in-out infinite; animation-delay: var(--dd);
}
@keyframes decoFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(5deg); } }

/* 小吉祥物微动（顶栏内） */
.hall-top .mascot {
  filter: drop-shadow(2px 3px 2px rgba(44, 33, 23, .22));
  animation: mascotBob 3.6s ease-in-out infinite; transform-origin: 50% 90%;
}
@keyframes mascotBob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1.4deg); } }
.hall-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hall-badge { color: var(--brand); line-height: 1; filter: drop-shadow(2px 3px 2px rgba(44, 33, 23, .25)); }
.hall-badge .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.hall-title h1 {
  font-family: var(--font-hand); font-size: 22px; letter-spacing: 2px; line-height: 1.25;
  text-shadow: 2px 2px 0 rgba(216, 163, 63, .35); white-space: nowrap;
}
.hall-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

#case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 20px 18px; }
.case-card {
  position: relative; text-align: left; padding: 22px 19px 16px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd);
  background: var(--paper-2); box-shadow: 3px 4px 0 var(--shadow-ink);
  transition: transform .16s ease, box-shadow .16s ease;
}
.case-card:nth-child(even) { border-radius: var(--radius-hd2); }
.case-card:nth-child(3n) { border-radius: var(--radius-hd3); }
.case-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 6px 8px 0 var(--shadow-ink); }
.case-card:focus-visible { outline: 3px dashed var(--brand); outline-offset: 3px; }
.case-card .no {
  position: absolute; top: -14px; left: 16px; z-index: 1;
  font-family: var(--font-hand); font-size: 12px; font-weight: 700; color: #3a2c12;
  letter-spacing: 2px; line-height: 1; padding: 4px 12px 7px;
  background: var(--gold); border: 2.5px solid var(--ink); border-bottom: none;
  border-radius: 9px 12px 0 0;
  transform: rotate(-2deg);
  box-shadow: 1px -2px 0 var(--shadow-ink);
}
.case-card:nth-child(even) .no { left: auto; right: 16px; transform: rotate(2deg); }
.case-card .cover { font-size: 38px; margin-bottom: 8px; color: var(--brand); }
.case-card .cover .ico { width: 38px; height: 38px; stroke-width: 1.5; }
.case-card h3 { font-family: var(--font-hand); font-size: 21px; margin-bottom: 10px; letter-spacing: 1px; }
.case-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: var(--radius-hd3);
  background: var(--paper-3); color: var(--ink-soft); border: 1.5px solid var(--line);
}
.chip.trap { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip.d-tutorial { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.chip.d-easy { background: #e6eef7; color: #2c5282; border-color: #7f9fc4; }
.chip.d-normal { background: #fbf0d8; color: #8a6116; border-color: var(--gold); }
.chip.d-hard { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.case-card .go { font-family: var(--font-hand); color: var(--brand); font-weight: 700; font-size: 15px; }
.case-card .stamp { position: absolute; right: 12px; bottom: 12px; }

/* ─────────── ② 简报（卷宗） ─────────── */
#screen-brief { max-width: 780px; margin: 0 auto; padding: 36px 20px; }
.brief-card { position: relative; padding: 38px 36px 30px; }
.brief-card h1 { font-family: var(--font-hand); font-size: 28px; margin: 14px 0 18px; letter-spacing: 1px; }
.brief-text {
  white-space: pre-wrap; line-height: 2.05; font-size: 15.5px;
  background: var(--paper-3); border: 2px dashed var(--line);
  padding: 18px 20px; border-radius: var(--radius-hd3); margin-bottom: 22px;
}
.brief-tips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }

/* ─────────── ③ 调查现场 ─────────── */
#screen-game { max-width: 1320px; margin: 0 auto; padding: 12px 16px 14px; height: 100vh; display: flex; flex-direction: column; gap: 12px; }
.topbar {
  position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 18px; border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  background: var(--paper-2); box-shadow: 3px 4px 0 var(--shadow-ink);
}
.topbar .badge-mini { color: var(--brand); font-size: 24px; }
.topbar .badge-mini .ico { width: 24px; height: 24px; stroke-width: 1.8; }
.topbar .case { font-family: var(--font-hand); font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.topbar .spacer { flex: 1; }
.ap-box { display: flex; align-items: center; gap: 8px; font-family: var(--font-hand); font-size: 14px; color: var(--ink-soft); }
.ap-box .ico { color: var(--accent); }
.ap-bar { width: 128px; height: 12px; background: var(--paper-3); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.ap-fill { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--brand) 0 6px, var(--brand-2) 6px 12px); transition: width .5s ease; }
.ap-fill.low { background: repeating-linear-gradient(45deg, var(--warn) 0 6px, var(--accent) 6px 12px); }
.ap-num { font-size: 18px; font-weight: 800; color: var(--brand); }

.layout { flex: 1; display: grid; grid-template-columns: 250px 1fr 310px; gap: 14px; min-height: 0; }
.pane {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd);
  background: var(--paper-2); box-shadow: 3px 4px 0 var(--shadow-ink);
}
#pane-chat { border-radius: var(--radius-hd2); }
#pane-right { border-radius: var(--radius-hd3); }
.pane-head {
  padding: 12px 16px 10px; font-family: var(--font-hand); font-size: 14px; font-weight: 700;
  letter-spacing: 1.5px; border-bottom: 2px dashed var(--line); flex: none;
  display: flex; align-items: center; gap: 7px;
}
.pane-head .ico { color: var(--brand); }
.pane-body { padding: 12px; overflow-y: auto; flex: 1; }

/* 嫌疑人档案卡 */
.npc-card {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; margin-bottom: 8px;
  border: 2px solid var(--line); border-radius: var(--radius-hd3); background: var(--paper-2);
  transition: background .15s, border-color .15s, transform .1s;
}
.npc-card:hover { border-color: var(--ink); transform: rotate(-.4deg); }
.npc-card.active { border-color: var(--brand); border-width: 2.5px; background: var(--brand-soft); }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; background: var(--paper-3); border: 2px solid var(--ink); color: var(--ink);
}
.npc-card.active .avatar { background: var(--paper-2); border-color: var(--brand); }
.avatar .ico { width: 22px; height: 22px; stroke-width: 1.7; }
.npc-main { flex: 1; min-width: 0; }
.npc-name { font-family: var(--font-hand); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 5px; }
.bp-dot { font-size: 12px; color: var(--accent); }
.trust-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.trust-bar { flex: 1; height: 7px; background: var(--paper-3); border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.trust-fill { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width .45s ease; }
.trust-fill.mid { background: var(--gold); }
.trust-fill.low { background: var(--warn); }
.trust-num { font-size: 11px; color: var(--ink-soft); font-family: var(--font-hand); }
.trust-pop { position: fixed; font-family: var(--font-hand); font-size: 14px; font-weight: 800; color: var(--ok); pointer-events: none; animation: floatUp 1.1s ease forwards; z-index: 99; }
.trust-pop.minus { color: var(--warn); }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(4px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

/* 搜查令 */
.loc-card {
  position: relative; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 9px;
  border: 2px solid var(--line); border-radius: var(--radius-hd2); background: var(--paper-2);
  transition: border-color .15s, background .15s;
}
.loc-card:hover:not(.done) { border-color: var(--ink); background: var(--paper-3); }
.loc-card.done { opacity: .5; border-style: dashed; cursor: default; }
.loc-card .t { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-hand); font-size: 14.5px; font-weight: 700; }
.loc-card .t .ico { color: var(--brand); }
.loc-card .d { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.55; }
.loc-card.locked { border-style: dashed; opacity: .55; cursor: default; }
.loc-card.locked:hover { border-color: var(--line); background: var(--paper-2); }
.loc-card.locked .t .ico { color: var(--ink-soft); }
.loc-card.locked .d { color: var(--ink-soft); font-style: italic; }

/* 讯问记录 */
#chat-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg {
  max-width: 78%; padding: 11px 15px; line-height: 1.8; font-size: 15px; white-space: pre-wrap;
  border: 2.5px solid var(--ink); animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) rotate(-.5deg); } to { opacity: 1; transform: none; } }
.msg .who { font-family: var(--font-hand); font-size: 13px; font-weight: 700; margin-bottom: 4px; opacity: .8; }
.msg.npc {
  align-self: flex-start; background: var(--paper-3);
  border-radius: 22px 22px 22px 6px; box-shadow: 2px 3px 0 var(--shadow-ink);
}
.msg.player {
  align-self: flex-end; background: var(--brand); color: var(--paper-2);
  border-radius: 22px 22px 6px 22px; box-shadow: 2px 3px 0 var(--shadow-ink);
}
.msg.sys {
  align-self: center; max-width: 92%; text-align: center; font-family: var(--font-hand);
  background: var(--paper-2); border: 2px dashed var(--gold); color: var(--ink-soft);
  border-radius: var(--radius-hd3); font-size: 14px;
}
.msg.thinking { display: flex; align-items: center; gap: 8px; }
.thinking .mag { font-size: 19px; color: var(--brand); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(4px) rotate(12deg); } }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.th-hint { font-size: 12px; color: var(--ink-soft); font-family: var(--font-hand); }
.bp-flash {
  display: inline-block; background: var(--accent); color: #fff; font-family: var(--font-hand);
  font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 9px; margin-left: 6px;
  transform: rotate(-4deg);
}
.bp-flash.lead {
  background: #2e6e4e; transform: rotate(3deg);
}

.composer { flex: none; padding: 10px 12px 12px; border-top: 2px dashed var(--line); }
.evidence-strip {
  display: flex; align-items: center; gap: 8px; background: var(--accent-soft);
  border: 2px dashed var(--accent); border-radius: var(--radius-hd3); padding: 7px 11px;
  margin-bottom: 9px; font-size: 13px; font-family: var(--font-hand);
}
.evidence-strip .x { margin-left: auto; font-weight: 800; color: var(--accent); }
.input-row { display: flex; gap: 8px; }
#input-text {
  flex: 1; border: 2.5px solid var(--ink); border-radius: var(--radius-hd3); padding: 11px 14px;
  font-size: 15px; font-family: var(--font); outline: none; background: var(--paper-2); color: var(--ink);
}
#input-text:focus { box-shadow: 2px 2px 0 var(--shadow-ink); }
.btn-send {
  font-family: var(--font-hand); font-weight: 700; font-size: 16px; padding: 0 22px; color: var(--paper-2);
  background: var(--brand); border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}
.btn-send:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-send:disabled { opacity: .55; cursor: not-allowed; }
/* 语音输入按钮（Web Speech API 可用时才显示） */
.btn-mic {
  flex: none; width: 46px; display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  background: var(--paper-3); color: var(--ink); box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: background .15s ease, color .15s ease;
}
.btn-mic .ico { width: 21px; height: 21px; stroke-width: 2; }
.btn-mic:hover { background: var(--gold); }
.btn-mic.rec {
  background: #e05a4e; color: #fff;
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 90, 78, .5), 2px 2px 0 var(--shadow-ink); }
  55% { box-shadow: 0 0 0 9px rgba(224, 90, 78, 0), 2px 2px 0 var(--shadow-ink); }
}
/* 听写中：输入框呼吸提示 */
#input-text.listening { border-color: #e05a4e; animation: listenGlow 1.4s ease-in-out infinite; }
@keyframes listenGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 90, 78, 0); } 50% { box-shadow: 0 0 0 5px rgba(224, 90, 78, .16); } }
#quick-qs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.quick-q {
  font-family: var(--font-hand); font-size: 13px; padding: 5px 13px; background: var(--paper-3);
  border: 2px solid var(--line); border-radius: var(--radius-hd2); color: var(--ink-soft);
}
.quick-q:hover { border-color: var(--brand); color: var(--brand); }

/* 证物袋 */
.clue-item {
  position: relative; padding: 12px 13px; margin-bottom: 11px;
  border: 2px solid var(--ink); border-radius: var(--radius-hd3); background: var(--paper-2);
  box-shadow: 2px 3px 0 var(--shadow-ink);
}
.clue-item:nth-child(even) { border-radius: var(--radius-hd); }
.clue-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.clue-item .cn { font-family: var(--font-hand); font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.clue-item .cn .ico { color: var(--accent); }
.clue-item .cc { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.65; white-space: pre-wrap; }
.clue-item .use { margin-top: 8px; font-family: var(--font-hand); font-size: 13px; font-weight: 700; color: var(--accent); }
.empty { color: var(--ink-soft); font-family: var(--font-hand); font-size: 14px; text-align: center; padding: 26px 10px; }

/* ─────────── ④ 结案陈词 & 报告 ─────────── */
#screen-finish, #screen-report { max-width: 800px; margin: 0 auto; padding: 32px 20px 60px; }
.card {
  position: relative; padding: 34px 36px; margin-bottom: 24px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd);
  background: var(--paper-2); box-shadow: 4px 5px 0 var(--shadow-ink);
}
.card > h2 { font-family: var(--font-hand); font-size: 24px; margin-bottom: 18px; letter-spacing: 1px; }
.fq { margin-bottom: 24px; }
.fq .q { font-family: var(--font-hand); font-weight: 700; font-size: 16px; margin-bottom: 11px; line-height: 1.7; }
.fq label {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; margin-bottom: 8px; font-size: 15px;
  border: 2px solid var(--line); border-radius: var(--radius-hd3); background: var(--paper-2);
  transition: border-color .15s, background .15s;
}
.fq label:hover { border-color: var(--ink); }
.fq label.on { border-color: var(--brand); background: var(--brand-soft); }
.fq textarea {
  width: 100%; border: 2.5px solid var(--ink); border-radius: var(--radius-hd3); padding: 11px 14px;
  font-family: var(--font); font-size: 14px; min-height: 76px; resize: vertical;
  background: var(--paper-3); color: var(--ink);
}
.fq textarea:focus { outline: none; box-shadow: 2px 2px 0 var(--shadow-ink); }

/* 证据链：勾选线索 + 论证 */
.chain-pick { display: grid; gap: 7px; margin-bottom: 10px; }
.clue-pick { display: block !important; align-items: flex-start !important; gap: 8px !important; }
.clue-pick input { margin-top: 3px; flex: none; }
.clue-pick .cp-name { font-family: var(--font-hand); font-weight: 700; }
.clue-pick .cp-desc { display: block; font-size: 12.5px; color: var(--sub); line-height: 1.6; margin-top: 2px; }
.chain-empty { padding: 13px; border: 2px dashed var(--line); border-radius: var(--radius-hd3); color: var(--sub); font-size: 14px; }
.chain-ask {
  display: flex; align-items: center; gap: 7px; margin: 12px 0 8px;
  font-family: var(--font-hand); font-size: 15px; color: var(--brand);
}
.chain-bar { height: 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-3); overflow: hidden; margin-bottom: 10px; }
.chain-bar i { display: block; height: 100%; background: var(--brand); }
.chain-ok, .chain-miss { font-size: 13.5px; line-height: 1.85; margin-top: 3px; }
.chain-ok { color: var(--ok); }
.chain-miss { color: var(--warn); }

.ending-title { font-family: var(--font-hand); font-size: 27px; margin-bottom: 12px; letter-spacing: 1px; }
.ending-desc { white-space: pre-wrap; line-height: 2; font-size: 15px; background: var(--paper-3); border: 2px dashed var(--line); padding: 17px 19px; border-radius: var(--radius-hd3); margin-bottom: 8px; }
.rep-section { margin-bottom: 28px; }
.rep-section > h4 {
  font-family: var(--font-hand); font-size: 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.rep-section > h4 .ico { color: var(--brand); }
.trap-card {
  position: relative; padding: 14px 17px; margin-bottom: 11px; font-size: 14px; line-height: 1.8;
  border: 2px solid var(--warn); border-left-width: 5px; border-radius: var(--radius-hd3);
  background: var(--accent-soft);
}
.trap-card.ok { border-color: var(--ok); background: var(--brand-soft); }
.trap-card b { display: block; margin-bottom: 4px; font-family: var(--font-hand); font-size: 15px; }
.attr-row { display: flex; gap: 9px; flex-wrap: wrap; }
.attr-chip {
  font-family: var(--font-hand); font-weight: 700; font-size: 14px; padding: 6px 15px;
  background: var(--paper-3); border: 2px solid var(--gold); border-radius: var(--radius-hd2);
  color: var(--ink); box-shadow: 2px 2px 0 var(--shadow-ink);
}
#path-replay { font-size: 13.5px; color: var(--ink-soft); }
#path-replay .step { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); line-height: 1.7; }
#path-replay .step .n { color: var(--accent); font-weight: 800; flex: none; font-family: var(--font-hand); }

/* 教练便签 */
#coach-note {
  position: relative; padding: 24px 20px 18px; font-size: 14.5px; line-height: 1.9;
  background: #fdf3d0; color: #3a2f1c;
  border: 2.5px solid var(--ink); border-radius: 4px 4px var(--radius-hd3) var(--radius-hd3);
  box-shadow: 3px 4px 0 var(--shadow-ink);
}
[data-theme="dark"] #coach-note { background: #2a2718; color: #f0e6c8; }
#coach-note h3, #coach-note h4, #coach-note h5 { font-family: var(--font-hand); font-size: 16px; margin: 16px 0 7px; }
#coach-note h3:first-child, #coach-note h4:first-child, #coach-note h5:first-child { margin-top: 0; }
#coach-note ul { padding-left: 21px; margin: 7px 0; }
#coach-note li { margin: 5px 0; }
#coach-note p { margin: 8px 0; }
#coach-note p.md-num { margin: 4px 0 4px 6px; }
#coach-note code { background: rgba(0, 0, 0, .07); border-radius: 4px; padding: 1px 6px; font-size: 13px; }
#coach-note table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
#coach-note th, #coach-note td { border: 1.5px solid rgba(58, 47, 28, .35); padding: 8px 12px; text-align: left; line-height: 1.6; }
#coach-note th { background: rgba(216, 163, 63, .3); font-family: var(--font-hand); }
#coach-note tbody tr:nth-child(even) td { background: rgba(216, 163, 63, .12); }

/* ─────────── 移动端 ─────────── */
#mobile-tabs { display: none; }
.sheet-close { display: none; }
@media (max-width: 940px) {
  #screen-game { height: 100dvh; min-height: 100vh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .layout { grid-template-columns: 1fr; }

  /* 讯问面板常驻主屏 */
  #pane-chat { display: flex; }

  /* 档案/证物改为底部抽屉式浮层（聊天保持在底下，不丢上下文） */
  #pane-left, #pane-right {
    position: fixed; z-index: 60; left: 0; right: 0; top: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    display: flex; border-radius: 0; border-left: none; border-right: none;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .3);
    transform: translateY(103%); transition: transform .26s ease;
    visibility: hidden;
  }
  #pane-left.show, #pane-right.show { transform: none; visibility: visible; }
  #pane-left { border-top: 3px solid var(--brand); }
  #pane-right { border-top: 3px solid var(--gold); }
  .pane-head { position: sticky; top: 0; background: var(--paper-2); z-index: 2; }

  /* 抽屉关闭按钮 */
  .sheet-close {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 34px; height: 34px; font-size: 17px; font-weight: 800; color: var(--ink-soft);
    border: 2px solid var(--line); border-radius: 50%; background: var(--paper-3);
  }
  .sheet-close:active { background: var(--paper-3); }

  /* 底部导航 */
  #mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--paper-2); border-top: 2.5px solid var(--ink);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #mobile-tabs button {
    flex: 1; padding: 15px 0 13px; font-family: var(--font-hand); font-size: 15px;
    font-weight: 700; color: var(--ink-soft);
  }
  #mobile-tabs button.on { color: var(--brand); border-top: 3px solid var(--brand); }

  /* 触控目标与 iOS 防缩放 */
  #input-text { font-size: 16px; padding: 12px 14px; }
  .btn-send { font-size: 17px; min-height: 46px; }
  .quick-q { padding: 9px 15px; font-size: 14px; }
  .npc-card, .loc-card { padding: 12px 13px; }
  .msg { max-width: 88%; }

  .card { padding: 24px 20px; }
  #case-grid { grid-template-columns: 1fr; }
  #screen-select { overflow-x: clip; } /* 窄屏防纸叠/装饰撑出横向滚动 */
  .hall-top { padding: 9px 12px; }
  .hall-badge .ico { width: 28px; height: 28px; }
  .hall-title h1 { font-size: 19px; }
  .hall-meta { width: 100%; }
  .hall-meta .pill { font-size: 12px; padding: 3px 9px; white-space: nowrap; }
  .hall-stamp { font-size: 12px; padding: 2px 8px; top: -9px; right: 10px; }
  .case-card .no { top: -12px; }
  .hall-top { gap: 8px 10px; }
  .hall-top .mascot { width: 36px; margin-right: 42px; } /* 给右上"机密"章让位 */
  .speech { font-size: 13.5px; padding: 6px 10px; }
  .hall-progress, .hall-progress.tease { flex: 1 1 100%; min-width: 0; }
  /* 档案柜在窄屏自然展开，跟随页面滚动 */
  .case-drawer { max-height: none; overflow: visible; padding: 12px 10px 12px; }
  .hall-deco .ico { opacity: .045; }
  #screen-select, #screen-finish, #screen-report { padding-left: 14px; padding-right: 14px; }
}

/* ─────────── 立体（3D）增强层 ─────────── */
#case-grid { perspective: 1300px; }
.case-card, .clue-item, .card, .npc-card, .loc-card, .brief-card { transform-style: preserve-3d; }
.tilt { transition: transform .14s ease-out; will-change: transform; }

/* 纸叠：卡片下方两层错位的纸，形成厚度 */
.case-card::before, .case-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border: 2.5px solid var(--ink); border-radius: inherit; background: var(--paper-2);
}
.case-card::before { transform: rotate(-1.8deg) translate(4px, 5px); opacity: .5; }
.case-card::after { transform: rotate(1.4deg) translate(9px, 10px); opacity: .26; }
.case-card:hover::before { transform: rotate(-2.6deg) translate(7px, 9px); }
.case-card:hover::after { transform: rotate(2deg) translate(15px, 17px); }

/* 卡片悬停 3D 抬起 */
.case-card:hover { box-shadow: 8px 12px 18px rgba(44, 33, 23, .22); }
.card:hover { box-shadow: 6px 9px 16px rgba(44, 33, 23, .18); }
.clue-item:hover { transform: translateY(-2px); box-shadow: 3px 5px 0 var(--shadow-ink); }

/* 挤出式按钮（厚度 + 投影） */
.btn { box-shadow: 3px 4px 0 var(--shadow-ink), 6px 9px 14px rgba(44, 33, 23, .18); }
.btn:active { box-shadow: 1px 1px 0 var(--shadow-ink), 2px 3px 5px rgba(44, 33, 23, .16); }
.btn-send, .quick-q, .pill { box-shadow: 2px 3px 0 var(--shadow-ink), 4px 6px 9px rgba(44, 33, 23, .12); }
.btn-send:active, .quick-q:active { box-shadow: none; }

/* 立体图钉：高光 + 投影 */
.pin {
  background: radial-gradient(circle at 32% 28%, #ff9b90 0%, var(--accent) 52%, #74201a 100%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .42), inset -2px -3px 4px rgba(0, 0, 0, .3), inset 2px 2px 3px rgba(255, 255, 255, .4);
}
/* 立体胶带：斜向高光 */
.tape {
  background: linear-gradient(100deg, rgba(216, 163, 63, .3) 0%, rgba(216, 163, 63, .5) 45%, rgba(216, 163, 63, .28) 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .5);
}
/* 金属徽章（SVG 渐变填充） */
.ico-badge { fill: url(#g-badge); stroke: var(--ink); stroke-width: 1.6; }
[data-theme="dark"] .ico-badge { fill: url(#g-badge-dark); }
/* 徽章悬浮微动 */
.hall-badge { animation: badgeFloat 4.5s ease-in-out infinite; }
@keyframes badgeFloat { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-3px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .hall-badge { animation: none; }
  .mascot, .hall-deco .ico { animation: none; }
  .tilt { transition: none; }
}

/* ─────────── Toast ─────────── */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  font-family: var(--font-hand); background: var(--ink); color: var(--paper-2); font-size: 15px;
  padding: 10px 20px; border: 2.5px solid var(--ink); border-radius: var(--radius-hd2);
  box-shadow: 3px 4px 0 var(--shadow-ink); animation: toastIn .22s ease; max-width: 84vw;
}
.toast.err { background: var(--accent); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) rotate(-1deg); } to { opacity: 1; transform: none; } }

@media print {
  body { background: #fff; }
  .btn, #mobile-tabs { display: none !important; }
}

/* ── 调查目标卡（常驻便签） ── */
.mission-card {
  position: relative;
  margin: 0 0 12px; padding: 10px 12px 8px;
  border: 2px solid var(--brand);
  border-radius: var(--radius-hd2);
  background: var(--brand-soft);
  box-shadow: 2px 3px 0 var(--shadow-ink);
  transform: rotate(-.5deg);
}
.mission-card .mission-head {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-hand); font-size: 14px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--brand);
  border-bottom: 2px dashed var(--brand-2); padding-bottom: 6px; margin-bottom: 7px;
}
.mission-card ul { list-style: none; margin: 0; padding: 0; }
.mission-card li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink);
  padding: 3px 0;
}
.mission-card li .ico { flex: none; margin-top: 2px; color: var(--brand); }
.mission-card li span { font-weight: 600; }

/* ── 侦探手册（招式图鉴） ── */
#screen-manual { max-width: 860px; margin: 0 auto; padding: 36px 20px 60px; }
.manual-head { text-align: center; margin-bottom: 26px; }
.manual-head h1 {
  font-family: var(--font-hand); font-size: 30px; letter-spacing: 2px; margin: 14px 0 8px;
  text-shadow: 2px 2px 0 rgba(216, 163, 63, .35);
}
.manual-head p { color: var(--ink-soft); font-size: 15px; }
.manual-head .btn { margin-bottom: 6px; }
#manual-grid { display: grid; gap: 15px; }
.manual-card {
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd);
  background: var(--paper-2); box-shadow: 3px 4px 0 var(--shadow-ink);
  overflow: hidden; transition: transform .15s ease;
  cursor: pointer;
}
.manual-card:nth-child(even) { border-radius: var(--radius-hd2); }
.manual-card:nth-child(3n) { border-radius: var(--radius-hd3); }
.manual-card:hover { transform: translateY(-2px) rotate(-.4deg); }
.manual-card:focus-visible { outline: 3px dashed var(--brand); outline-offset: 3px; }
.mc-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.mc-ico {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); border: 2px solid var(--brand); border-radius: 50%;
  color: var(--brand); font-size: 22px;
}
.mc-ico .ico { width: 24px; height: 24px; }
.mc-title { flex: 1; min-width: 0; }
.mc-title b { font-family: var(--font-hand); font-size: 19px; letter-spacing: 1px; display: block; }
.mc-title i {
  font-style: normal; font-size: 12px; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: var(--radius-hd3); padding: 1px 8px;
  background: var(--accent-soft);
}
.mc-arrow { color: var(--ink-soft); font-size: 16px; transition: transform .2s; }
.manual-card.open .mc-arrow { transform: rotate(180deg); }
.mc-body { display: none; padding: 2px 18px 16px 74px; }
.manual-card.open .mc-body { display: block; }
.mc-body p { font-size: 14.5px; line-height: 1.85; margin: 7px 0; }
.mc-body .mc-say {
  font-family: var(--font-hand); font-size: 16px; font-weight: 700; color: var(--brand);
  border-left: 4px solid var(--gold); padding-left: 10px;
}
.mc-example {
  white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; line-height: 1.8;
  background: var(--paper-3); border: 2px dashed var(--line); border-radius: var(--radius-hd3);
  padding: 12px 14px; margin-top: 9px;
}
.manual-tip {
  margin-top: 20px; text-align: center; font-family: var(--font-hand); font-size: 14.5px;
  color: var(--ink-soft); border-top: 2px dashed var(--line); padding-top: 16px; line-height: 1.9;
}
.manual-tip b { color: var(--accent); }

/* ── 招式栏（破绽后出现在讯问输入框上方） ── */
#move-strip {
  margin-bottom: 9px; padding: 9px 11px;
  border: 2px dashed var(--accent); border-radius: var(--radius-hd2);
  background: var(--accent-soft);
}
.ms-head {
  font-family: var(--font-hand); font-size: 13.5px; font-weight: 700; color: var(--accent);
  margin-bottom: 7px; display: flex; align-items: center; gap: 6px;
}
.ms-row { display: flex; flex-wrap: wrap; gap: 7px; }
.ms-btn {
  position: relative; font-family: var(--font-hand); font-size: 13.5px; font-weight: 700;
  padding: 8px 14px; background: var(--paper-2); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius-hd2); box-shadow: 2px 2px 0 var(--shadow-ink);
}
.ms-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.ms-btn.rec { border-color: var(--accent); color: var(--accent); background: var(--paper-2); }
.ms-btn.rec i {
  position: absolute; top: -9px; right: -6px; font-style: normal; font-size: 10px;
  background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 5px; transform: rotate(6deg);
}

/* ── 招式结果卡（命中=台账对照） ── */
.msg.move-card { max-width: 92%; text-align: left; padding: 12px 15px; }
.msg.move-card.hit { border-color: var(--ok); background: var(--brand-soft); }
.msg.move-card.miss { border-style: dashed; }
.mv-title { font-family: var(--font-hand); font-weight: 800; font-size: 15px; margin-bottom: 5px; }
.move-card.hit .mv-title { color: var(--ok); }
.mv-name { font-size: 13.5px; margin-bottom: 9px; }
.mv-name b { color: var(--accent); }
.mv-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 9px; }
.mv-col { background: var(--paper-2); border: 2px dashed var(--line); border-radius: var(--radius-hd3); padding: 8px 10px; }
.mv-col i {
  display: block; font-style: normal; font-family: var(--font-hand); font-size: 12px;
  font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; border-bottom: 1px dashed var(--line); padding-bottom: 4px;
}
.mv-col p { font-size: 12.5px; line-height: 1.7; margin: 4px 0; }
.mv-col.now { border-color: var(--accent); }
.mv-col.now i { color: var(--accent); }
.mv-lesson { font-size: 13px; line-height: 1.75; }
.move-card.hit .mv-lesson { font-family: var(--font-hand); font-weight: 700; color: var(--brand); }

@media (max-width: 940px) {
  .mv-vs { grid-template-columns: 1fr; }
  .mc-body { padding-left: 18px; }
}

/* ── 侦探守则：介绍页预告 / 手册收藏 / 报告解锁（v10） ── */
.brief-rules {
  display: flex; align-items: center; gap: 7px; margin: 14px 0 8px;
  font-family: var(--font-hand); font-weight: 700; font-size: 14.5px; color: var(--brand);
}
.br-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.br-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 2px dashed var(--line); border-radius: var(--radius-hd3);
  background: var(--paper-3); color: var(--ink-soft);
  padding: 5px 11px; font-size: 12.5px; line-height: 1.5;
}
.br-pill.got { border-style: solid; border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.br-pill .ico { width: 13px; height: 13px; }

.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.rule-card {
  border: 2px solid var(--line); border-radius: var(--radius-hd3);
  background: var(--paper-2); padding: 12px 13px; opacity: .62;
  transform: rotate(-.4deg); position: relative;
}
.rule-card:nth-child(even) { transform: rotate(.5deg); }
.rule-card.got {
  opacity: 1; border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 2px 3px 0 var(--shadow-ink);
}
.rule-card.fresh { border-color: var(--gold); box-shadow: 3px 4px 0 var(--gold); }
.rc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.rc-head b { font-family: var(--font-hand); font-size: 15px; color: var(--brand); }
.rule-card:not(.got) .rc-head b { color: var(--ink-soft); }
.rc-badge { display: inline-flex; }
.rc-badge .ico { width: 15px; height: 15px; color: var(--brand); }
.rule-card:not(.got) .rc-badge .ico { color: var(--line); }
.rc-new {
  font-style: normal; font-size: 10px; background: var(--accent); color: #fff;
  border-radius: 4px; padding: 1px 6px; transform: rotate(5deg); margin-left: auto;
}
.rc-text { font-size: 13px; line-height: 1.7; font-weight: 600; }
.rc-hint { margin-top: 7px; font-size: 11.5px; line-height: 1.65; color: var(--ink-soft);
  border-top: 1px dashed var(--line); padding-top: 6px; }
.rc-hint.dim { border-top-style: dashed; }

@media print {
  .rules-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 通用弹窗 + 调查目标按钮化（v11） ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(58, 44, 20, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal-card {
  position: relative; width: min(560px, 94vw); max-height: 84vh;
  overflow: auto; overscroll-behavior: contain;
  background: var(--paper-2); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: var(--radius-hd3);
  box-shadow: 6px 8px 0 var(--shadow-ink);
  padding: 18px 20px 20px;
  transform: rotate(-.4deg);
  animation: modal-in .18s ease-out;
}
@keyframes modal-in {
  from { transform: rotate(-.4deg) scale(.92); opacity: 0; }
  to   { transform: rotate(-.4deg) scale(1);   opacity: 1; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 12px;
}
.modal-head h3 {
  margin: 0; font-family: var(--font-hand); font-size: 20px; color: var(--brand);
}
.modal-body { font-size: 14px; line-height: 1.75; }
.modal-lead { margin: 0 0 12px; font-weight: 600; color: var(--ink-soft); }
.modal-tip {
  margin-top: 14px; padding: 9px 12px;
  border: 2px dashed var(--line); border-radius: var(--radius-hd3);
  background: var(--paper-3); color: var(--ink-soft);
  font-size: 12.5px; display: flex; align-items: center; gap: 7px;
}
.modal-tip .ico { flex: none; width: 14px; height: 14px; color: var(--brand); }
.mission-modal-list { display: grid; gap: 10px; }
.mm-item {
  display: flex; align-items: flex-start; gap: 9px;
  border: 2px solid var(--line); border-radius: var(--radius-hd3);
  background: var(--paper-3); padding: 11px 13px;
  font-weight: 600; font-size: 14.5px; line-height: 1.7;
}
.mm-item:nth-child(even) { transform: rotate(.35deg); }
.mm-item:nth-child(odd) { transform: rotate(-.3deg); }
.mm-item .ico { flex: none; margin-top: 3px; color: var(--brand); width: 16px; height: 16px; }

/* 调查目标卡：可点击（按钮化） */
.mission-card.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.mission-card.clickable:hover { transform: translateY(-1px) rotate(-.3deg); box-shadow: 3px 4px 0 var(--shadow-ink); }
.mission-card.clickable:focus-visible { outline: 3px dashed var(--brand); outline-offset: 2px; }
.mission-more {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
  font-size: 11px; font-weight: 700; color: var(--brand);
  border: 1.5px dashed var(--brand); border-radius: 8px; padding: 1px 7px;
  background: var(--brand-soft); white-space: nowrap;
}
.mission-more .ico { width: 11px; height: 11px; }

/* 顶栏逻辑能力按钮 */
#btn-game-rules { cursor: pointer; }
#btn-game-rules .ico { width: 13px; height: 13px; }
@media (max-width: 700px) { #btn-game-rules { display: none; } }

/* 版权页脚（仅 release 正式域名显示）：固定视口底部淡色水印，一屏布局下也始终可见 */
.site-copy {
  position: fixed;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 11.5px;
  color: var(--ink-soft);
  opacity: 0.6;
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 5;
}

/* ── 大屏 / 高分屏自动放大（外接 1080p 显示器上内容偏小的适配） ── */
@media (min-width: 1440px) { html { zoom: 1.15; } }
@media (min-width: 1720px) { html { zoom: 1.3; } }
@media (min-width: 2200px) { html { zoom: 1.5; } }
