/* 第十三人 · 港币保卫战 — 视觉皮:CRT金融战终端(B) + 谍报机密档案(C)
   黑底磷光交易室主舞台,中文衬线卷宗+红章做谍报层。唯一警示红=港币防线。 */

:root {
  --bg: #07090c;
  --bg-panel: #0c1116;
  --bg-file: #0e1419;
  --edge: #1c2630;
  --edge-bright: #2b3a47;
  --txt: #c4d0d9;
  --txt-dim: #7a8893;
  --txt-faint: #4c5763;

  --phos: #39d98a;          /* 磷光绿:恒指涨 / 真情报 / 己方 */
  --phos-dim: #1f7a4d;
  --amber: #e8a13a;         /* 琥珀:HKD远期 / 中性 / 摇摆 */
  --alert: #e23b2e;         /* 告警红:港币防线 / 谎言 / 危险 */
  --alert-glow: rgba(226, 59, 46, .55);
  --stamp: #d23a2c;

  --mono: "Cascadia Mono", "DejaVu Sans Mono", "Consolas", ui-monospace, monospace;
  --serif: "Songti SC", "SimSun", "Noto Serif CJK SC", "STSong", serif;   /* 卷宗中文衬线 */
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  --r: 2px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html, body { overflow-x: hidden; max-width: 100vw; }

body {
  margin: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, #0c1218 0%, var(--bg) 60%, #04050700 100%),
    var(--bg);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* CRT 氛围:扫描线 + 暗角,覆盖全屏不挡交互 */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background: repeating-linear-gradient(
    0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,.16) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 9001;
  box-shadow: inset 0 0 180px 40px rgba(0,0,0,.65);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 16px 20px 40px; position: relative; }

/* ── 状态条 ───────────────────────────────────────── */
.statusbar {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--edge); padding-bottom: 10px;
}
.brand { font-weight: 700; letter-spacing: .22em; color: #e7eef3; font-size: 15px; }
.brand .num { color: var(--alert); text-shadow: 0 0 8px var(--alert-glow); }
.dateline { color: var(--txt-dim); font-size: 12px; letter-spacing: .08em; }

.gauges { display: flex; gap: 40px; align-items: flex-end; margin: 14px 0 6px; }
.gauge .label { color: var(--txt-faint); font-size: 11px; letter-spacing: .16em; }
.gauge .val { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.defense .val {
  color: var(--alert);
  text-shadow: 0 0 12px var(--alert-glow);
  animation: flicker 4s infinite steps(1);
}
.defense.safe .val { color: var(--phos); text-shadow: 0 0 14px rgba(57,217,138,.5); }
.fund .val { color: var(--amber); font-size: 22px; }
@keyframes flicker {
  0%, 97%, 100% { opacity: 1; } 98% { opacity: .72; } 99% { opacity: .9; }
}
.bar { height: 6px; width: min(280px, 60vw); background: #161d24; margin-top: 6px; position: relative; overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 60%;
  background: var(--alert); box-shadow: 0 0 10px var(--alert-glow);
  transition: width .9s cubic-bezier(.2,.7,.2,1), background .6s;
}
.bar.safe > i { background: var(--phos); box-shadow: 0 0 10px rgba(57,217,138,.6); }

/* ── K线区 ────────────────────────────────────────── */
.kline {
  border: 1px solid var(--edge); background: var(--bg-panel);
  padding: 12px 14px; margin: 12px 0;
}
.kline .hd {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--txt-dim); font-size: 11px; letter-spacing: .14em; margin-bottom: 8px;
}
.kline .verdict { color: var(--alert); }
.candles { display: flex; align-items: center; gap: 6px; height: 96px; }
.candle { width: 11px; position: relative; align-self: center; }
.candle .body {
  position: absolute; left: 0; right: 0;
  background: var(--phos); box-shadow: 0 0 7px rgba(57,217,138,.5);
  animation: candleIn .35s ease both;
}
.candle.dn .body { background: var(--alert); box-shadow: 0 0 7px var(--alert-glow); }
.candle .wick {
  position: absolute; left: 50%; width: 1px; transform: translateX(-50%);
  background: inherit;
}
.candle.dn .wick { background: var(--alert); }
.candle:not(.dn) .wick { background: var(--phos); }
@keyframes candleIn { from { transform: scaleY(.1); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* ── 主体两栏 ─────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1.08fr 1fr; border-top: 1px solid var(--edge); }
.col { padding: 14px 16px; }
.col + .col { border-left: 1px solid var(--edge); }
h2 {
  font-size: 11px; letter-spacing: .2em; color: var(--txt-faint);
  margin: 0 0 12px; font-weight: 700; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
h2::before { content: "▍"; color: var(--phos); }
.col.dossier h2::before { content: "▍"; color: var(--amber); }

/* 会议区 — 终端情报行 */
.npc { padding: 8px 0; border-bottom: 1px dotted var(--edge); }
.npc .who { font-weight: 700; color: #e7eef3; }
.npc .tag { font-size: 10px; padding: 1px 6px; border: 1px solid var(--edge-bright); color: var(--txt-dim); margin-left: 8px; letter-spacing: .06em; }
.npc .tag.ally { color: var(--phos); border-color: var(--phos-dim); }
.npc .says { display: block; color: #9fb0bb; margin-top: 3px; }

/* 档案区 — 谍报机密卷宗(中文衬线) */
.col.dossier { background: linear-gradient(180deg, #0d1217, #0b0f14); }
.file {
  position: relative; border: 1px solid var(--edge); background: var(--bg-file);
  padding: 9px 12px; margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.012);
}
.file .clip { position: absolute; top: -6px; left: 14px; width: 26px; height: 10px; border: 1px solid var(--edge-bright); border-bottom: none; opacity: .5; }
.file .name { font-weight: 700; color: #e7eef3; display: flex; justify-content: space-between; align-items: baseline; }
.file .trust { font-size: 11px; color: var(--txt-dim); letter-spacing: .04em; }
.file .trust b { color: var(--txt); font-variant-numeric: tabular-nums; transition: color .3s; }
.file .trust b.up { color: var(--phos); } .file .trust b.dn { color: var(--alert); }
.file .flipbtn {
  font-family: var(--mono); font-size: 10px; margin-left: 8px;
  background: transparent; border: 1px dashed var(--amber); color: var(--amber);
  padding: 1px 6px; cursor: pointer; letter-spacing: .06em;
}
.file .claim { font-family: var(--serif); font-size: 13.5px; margin-top: 5px; color: #aeb9c2; }
.file .claim .verdict { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.v-true { color: var(--phos); } .v-false { color: var(--alert); } .v-hidden { color: var(--txt-faint); }

/* 揭露红章 */
.stamp {
  position: absolute; right: 12px; top: 28px;
  border: 2.5px solid var(--stamp); color: var(--stamp);
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .14em;
  padding: 2px 8px; transform: rotate(-13deg) scale(2.6); opacity: 0;
  text-shadow: 0 0 4px rgba(210,58,44,.5);
  border-radius: 1px;
}
.stamp.struck { animation: stampDown .42s cubic-bezier(.3,1.4,.5,1) forwards; }
@keyframes stampDown {
  0% { transform: rotate(-13deg) scale(2.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-13deg) scale(1); opacity: .92; }
}
.file.flash { animation: rowFlash .6s ease; }
@keyframes rowFlash {
  0%, 100% { background: var(--bg-file); }
  30% { background: #1a2128; }
}

/* ── 操盘区 ───────────────────────────────────────── */
.trade { border-top: 1px solid var(--edge); margin-top: 10px; padding-top: 14px; }
.trade .hint { color: var(--txt-faint); font-size: 11px; letter-spacing: .14em; }
.optrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 7px 0 14px; }
.opt {
  font-family: var(--mono); font-size: 13px;
  min-height: 44px; padding: 6px 16px; cursor: pointer;
  background: transparent; border: 1px solid var(--edge-bright); color: var(--txt);
  transition: all .15s;
}
.opt:hover { border-color: var(--phos-dim); color: #e7eef3; }
.opt:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }
.opt.sel { background: var(--phos); color: #051710; border-color: var(--phos); font-weight: 700; box-shadow: 0 0 12px rgba(57,217,138,.35); }
.opt.allin.sel { background: var(--alert); color: #fff; border-color: var(--alert); box-shadow: 0 0 14px var(--alert-glow); animation: allinPulse 1.4s infinite; }
@keyframes allinPulse { 0%,100% { box-shadow: 0 0 14px var(--alert-glow); } 50% { box-shadow: 0 0 22px var(--alert-glow); } }

.commit {
  font-family: var(--mono); font-weight: 700; letter-spacing: .06em; font-size: 14px;
  min-height: 48px; margin-top: 4px; padding: 10px 26px; cursor: pointer;
  background: transparent; border: 2px solid var(--alert); color: var(--alert);
  text-shadow: 0 0 6px var(--alert-glow); transition: all .15s;
}
.commit:hover { background: var(--alert); color: #fff; text-shadow: none; }
.commit:disabled { border-color: var(--edge); color: var(--txt-faint); text-shadow: none; cursor: not-allowed; }
.note { color: var(--txt-faint); font-size: 11.5px; margin-top: 16px; border-top: 1px dotted var(--edge); padding-top: 9px; }

/* ── 全屏覆盖:INTRO / 胜 / 败 ─────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 9100; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(4,5,7,.93); backdrop-filter: blur(3px);
}
.overlay.show { display: flex; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panel { max-width: 560px; width: 100%; border: 1px solid var(--edge-bright); background: var(--bg-panel); padding: 30px 34px; }
.panel h1 { font-size: 22px; letter-spacing: .14em; margin: 0 0 4px; color: #e7eef3; }
.panel .sub { color: var(--amber); letter-spacing: .1em; font-size: 13px; margin-bottom: 18px; }
.panel p { color: #a9b6c0; font-family: var(--serif); font-size: 15px; line-height: 1.8; }
.panel .start {
  font-family: var(--mono); font-weight: 700; letter-spacing: .1em; font-size: 15px;
  min-height: 48px; margin-top: 22px; padding: 12px 30px; cursor: pointer;
  background: var(--phos); color: #051710; border: none; box-shadow: 0 0 16px rgba(57,217,138,.4);
}
.panel .start.danger { background: transparent; border: 2px solid var(--amber); color: var(--amber); box-shadow: none; }

/* 战报卡(胜利,可截图分享) */
.report { border: 1px solid var(--phos-dim); }
.report h1 { color: var(--phos); text-shadow: 0 0 14px rgba(57,217,138,.5); }
.report .crest { font-size: 11px; letter-spacing: .3em; color: var(--txt-dim); margin-bottom: 14px; }
.replay { list-style: none; padding: 0; margin: 16px 0; }
.replay li { font-family: var(--mono); font-size: 12.5px; padding: 5px 0; border-bottom: 1px dotted var(--edge); color: #aeb9c2; display: flex; gap: 10px; }
.replay li .t { color: var(--txt-faint); }
.replay li .d.good { color: var(--phos); } .replay li .d.bad { color: var(--alert); }
.report .final { font-size: 16px; margin-top: 10px; }
.report .final b { color: var(--phos); font-size: 26px; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(57,217,138,.5); }
.report.lose { border-color: var(--alert); }
.report.lose h1 { color: var(--alert); text-shadow: 0 0 14px var(--alert-glow); }
.report.lose .final b { color: var(--alert); text-shadow: 0 0 12px var(--alert-glow); }
.sharehint { color: var(--txt-faint); font-size: 11px; margin-top: 8px; letter-spacing: .06em; }

/* ── 响应式 ───────────────────────────────────────── */
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .col + .col { border-left: none; border-top: 1px solid var(--edge); }
  .gauges { gap: 24px; }
  .wrap { padding-bottom: 220px; } /* 给固定操盘栏留位 */
  .trade {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--bg-panel); border-top: 1px solid var(--edge-bright);
    padding: 10px 16px 14px; margin: 0; max-height: 50vh; overflow-y: auto;
  }
  .trade .hint { margin-top: 2px; }
  .trade .optrow { margin: 5px 0 8px; gap: 6px; }
  .opt { padding: 6px 12px; font-size: 12.5px; }
}

/* 无障碍:尊重 reduce-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .defense .val { animation: none; }
}

/* ── agent UI 追加 ───────────────────────────────── */
/* 怀疑度表 */
.gauge.suspicion .val { color: var(--amber); font-size: 22px; }
.gauge.suspicion.danger .val { color: var(--alert); text-shadow: 0 0 12px var(--alert-glow); }
.bar.sus > i { width: 0%; background: var(--amber); box-shadow: 0 0 8px rgba(232,161,58,.5); transition: width .8s, background .4s; }
.suspicion.danger .bar.sus > i { background: var(--alert); box-shadow: 0 0 10px var(--alert-glow); }

/* 名册 | 盘问 两栏 */
.agentgrid { grid-template-columns: 1fr 1.05fr; }
.col.roster { max-height: 460px; overflow-y: auto; }
h2 .asks { margin-left: auto; font-size: 10px; color: var(--amber); border: 1px solid var(--edge-bright); padding: 1px 7px; letter-spacing: .08em; }

.npcrow {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-file); border: 1px solid var(--edge); color: var(--txt);
  padding: 8px 11px; margin-bottom: 7px; font-family: var(--mono); transition: all .12s;
}
.npcrow:hover { border-color: var(--edge-bright); }
.npcrow.sel { border-color: var(--phos); box-shadow: inset 2px 0 0 var(--phos); }
.npcrow.ally { border-left: 2px solid var(--phos); }
.rhead { display: flex; align-items: baseline; gap: 8px; }
.rname { font-weight: 700; color: #e7eef3; }
.rtag { font-size: 9px; padding: 0 5px; letter-spacing: .08em; }
.rtag.ally { color: var(--phos); border: 1px solid var(--phos-dim); }
.rtag.mon { color: var(--alert); border: 1px solid var(--alert); }
.rrole { font-size: 11px; color: var(--txt-dim); margin: 2px 0 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 10px; padding: 1px 6px; border: 1px solid var(--edge-bright); letter-spacing: .04em; }
.chip.good { color: var(--phos); border-color: var(--phos-dim); }
.chip.bad { color: var(--alert); border-color: var(--alert); }
.chip.none { color: var(--txt-faint); }

/* 盘问聊天 */
.col.interro { display: flex; flex-direction: column; }
#interroHd { display: flex; align-items: baseline; gap: 10px; }
.chat { flex: 1; min-height: 240px; max-height: 360px; overflow-y: auto; border: 1px solid var(--edge); background: #0a0f14; padding: 12px; margin-bottom: 10px; }
.chat-empty { color: var(--txt-faint); font-size: 12px; }
.chat .q { color: var(--txt-dim); margin: 8px 0 3px; font-size: 12.5px; }
.chat .a { font-family: var(--serif); color: #cdd6de; font-size: 14px; line-height: 1.7; padding-left: 10px; border-left: 2px solid var(--edge-bright); }
.chat .a.typing { color: var(--amber); font-family: var(--mono); font-size: 12px; animation: flicker 1.2s infinite steps(1); border-color: var(--amber); }
.askbar { display: flex; gap: 8px; }
#askInput { flex: 1; min-height: 44px; background: #0a0f14; border: 1px solid var(--edge-bright); color: var(--txt); font-family: var(--mono); font-size: 13px; padding: 8px 12px; }
#askInput:focus { outline: 2px solid var(--phos); outline-offset: 1px; }
#askInput:disabled { opacity: .5; }
.askbtn { min-height: 44px; padding: 8px 18px; background: var(--phos); color: #051710; border: none; font-family: var(--mono); font-weight: 700; cursor: pointer; }
.askbtn:disabled { background: var(--edge); color: var(--txt-faint); cursor: not-allowed; }
.flipbtn-inline { width: 100%; margin: 4px 0 10px; min-height: 40px; background: transparent; border: 1px dashed var(--amber); color: var(--amber); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.flipbtn-inline:hover { background: rgba(232,161,58,.08); }

@media (max-width: 768px) {
  .agentgrid { grid-template-columns: 1fr; }
  .col.roster { max-height: 300px; }
}
