* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0e1a;
  --surface: #151a2e;
  --surface-2: #1d2440;
  --border: #262e4e;
  --border-strong: #38426e;
  --text: #eceef8;
  --text-2: #9aa3c2;
  --text-3: #626b8c;
  --accent: #7c6cff;
  --accent-glow: rgba(124, 108, 255, 0.35);
  --accent-dim: #251f52;
  --up: #00d09c;
  --up-glow: rgba(0, 208, 156, 0.3);
  --up-dim: #0d3329;
  --down: #ff5d5d;
  --down-glow: rgba(255, 93, 93, 0.3);
  --down-dim: #3d1a1e;
  --amber: #ffb224;
  --amber-dim: #3a2c10;
  --blue: #58a6ff;
  --blue-dim: #14263f;
  --radius: 14px;
}

html { -webkit-text-size-adjust: 100%; }
/* 触屏：按钮点按不触发双击缩放，也不选中文字 */
button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }

body {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #182048 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124,108,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,108,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

#app {
  max-width: 560px; margin: 0 auto; position: relative;
  /* 刘海屏安全区：左右下都让开 */
  padding: 0 max(16px, env(safe-area-inset-left)) max(56px, env(safe-area-inset-bottom));
}
#app.shake { animation: shake 0.5s; }
@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-7px, 2px) rotate(-0.5deg); }
  30% { transform: translate(6px, -2px) rotate(0.4deg); }
  45% { transform: translate(-5px, 1px); }
  60% { transform: translate(4px, -1px); }
  75% { transform: translate(-2px, 0); }
}

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.flash-red {
  position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: var(--down);
  animation: flashout 0.55s ease-out forwards;
}
@keyframes flashout { from { opacity: 0.35; } to { opacity: 0; } }

/* ── 头部 HUD ── */
/* ── 站点栏 ──
   游戏自己的 #header 只在游戏内部逐层返回(地图根层 back-btn 是隐藏的),
   没有这条栏,进了游戏就只能靠浏览器后退键离开。做得比 /game/ 那条更矮,
   窄屏只留 logo + 学院,不跟游戏抢竖向空间。 */
.game-sitebar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11,14,26,0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin: 0 calc(-1 * max(20px, env(safe-area-inset-left)));
  padding: 0 max(20px, env(safe-area-inset-left));
}
.game-sitebar-inner {
  max-width: 560px; margin: 0 auto; height: 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.game-sitebar a { color: var(--text-2); text-decoration: none; font-size: 12px; white-space: nowrap; transition: color .15s; }
.game-sitebar a:hover { color: var(--text); }
.game-sitebar .gsb-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.game-sitebar .gsb-links { display: flex; align-items: center; gap: 14px; }
@media (max-width: 480px) { .game-sitebar .gsb-sm { display: none; } }

#header { display: flex; align-items: center; gap: 12px; padding: 14px 0 16px; }
.back-btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.back-btn:active { transform: scale(0.92); }
.header-title { flex: 1; min-width: 0; }
#header h1 {
  font-size: 19px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(100deg, #fff 20%, #a89bff 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.header-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud { text-align: right; flex-shrink: 0; }
.hud-rank { font-size: 12px; font-weight: 700; color: var(--amber); letter-spacing: 0.5px; }
.hud-xp-bar {
  width: 92px; height: 5px; background: var(--surface-2);
  border-radius: 3px; overflow: hidden; margin-top: 4px; margin-left: auto;
}
.hud-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #a89bff); border-radius: 3px; transition: width 0.6s ease; }
.hud-xp-num { font-size: 10px; color: var(--text-3); margin-top: 2px; font-family: ui-monospace, Menlo, monospace; }
.mute-btn {
  background: none; border: none; font-size: 17px; cursor: pointer;
  opacity: 0.75; flex-shrink: 0; padding: 4px;
}

/* ── 主页 ── */
.intro-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px;
  font-size: 13px; color: var(--text-2);
  animation: fadeup 0.4s ease backwards;
}
.intro-box b { color: var(--amber); }

.level-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px;
  cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  animation: deal 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.level-card:not(.locked):hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 6px 24px -8px var(--accent-glow);
}
.level-card:not(.locked):active { transform: scale(0.98); }
.level-card.locked { opacity: 0.4; cursor: default; filter: saturate(0.3); }
.level-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 23px;
}
.level-info { flex: 1; min-width: 0; }
.level-tag { font-size: 10.5px; color: var(--accent); letter-spacing: 2px; font-weight: 700; }
.level-name { font-size: 16.5px; font-weight: 700; }
.level-goal { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.level-badge {
  font-size: 16px; font-weight: 800; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 2px solid var(--border); color: var(--text-3);
}
/* 策略术语签：外号记性格，术语对实盘 */
.term-chip {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px;
}
.strat-term { font-size: 10.5px; color: var(--accent); font-weight: 700; margin-top: 2px; letter-spacing: 0.3px; }

/* 试炼塔：世界规则与结算单 */
.floor-card.lit { border-color: var(--amber); box-shadow: 0 0 22px -12px var(--amber); }
.rules-card {
  background: linear-gradient(120deg, var(--amber-dim), var(--surface));
  border: 1px solid var(--amber); border-radius: var(--radius);
  padding: 11px 15px; margin-bottom: 14px;
}
.rules-head { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--amber); margin-bottom: 5px; }
.rule-row { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-2); margin: 3px 0; }
.rule-floor { flex-shrink: 0; width: 92px; color: var(--text-3); font-size: 11.5px; }
.toll-box {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 11px 14px; margin: 10px 0;
}
.toll-head { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--text-3); margin-bottom: 6px; }
.toll-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--text-2); padding: 4px 0;
}
.toll-row b { font-family: ui-monospace, Menlo, monospace; color: var(--text); }
.toll-row.neg b { color: var(--down); }
.toll-row.total { border-top: 1px dashed var(--border-strong); margin-top: 3px; padding-top: 7px; }
.toll-row.total b { font-size: 16px; font-weight: 800; }
.toll-note { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 7px; }
.toll-note b { color: var(--amber); }
.rule-event {
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  background: var(--surface); border-left: 3px solid var(--amber);
  border-radius: 0 12px 12px 0; padding: 10px 14px; margin: 8px 0;
}
.rule-event.bad { border-left-color: var(--down); background: var(--down-dim); }
.rule-event b { color: var(--text); }
.trade-bar.margin-call {
  border-color: var(--down) !important;
  animation: jitter 0.5s 4;
  background: var(--down-dim);
}

/* IV 仪表：现在的期权贵不贵 */
.iv-gauge {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px 10px; margin-bottom: 14px;
}
.iv-head { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.iv-side { font-size: 10.5px; font-weight: 800; padding: 1px 8px; border-radius: 20px; }
.iv-side.sell { background: var(--down-dim); color: var(--down); border: 1px solid var(--down); }
.iv-side.buy { background: var(--up-dim); color: var(--up); border: 1px solid var(--up); }
.iv-side.mid { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.iv-track {
  position: relative; height: 10px; margin: 14px 0 4px; border-radius: 6px;
  background: linear-gradient(90deg, var(--up-dim), var(--surface-2) 45%, var(--amber-dim) 75%, var(--down-dim));
  border: 1px solid var(--border);
}
.iv-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, transparent, rgba(255,178,36,0.35)); }
.iv-pin { position: absolute; top: -5px; transform: translateX(-50%); }
.iv-pin b {
  display: block; font-size: 11px; font-family: ui-monospace, Menlo, monospace;
  background: var(--amber); color: #1a1300; border-radius: 5px; padding: 1px 5px;
}
.iv-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); }
.iv-note { font-size: 12px; color: var(--text-2); margin-top: 7px; line-height: 1.6; }
.iv-note b { color: var(--amber); }

/* 集市：报价台裁决 + 期权链货架 */
.quote-verdict {
  font-size: 15px; font-weight: 800; padding: 11px 14px; border-radius: 12px; margin-bottom: 10px;
}
.quote-verdict.ok { background: var(--up-dim); color: var(--up); border: 1px solid var(--up); }
.quote-verdict.low { background: var(--down-dim); color: var(--down); border: 1px solid var(--down); }
.quote-verdict.high { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong); }
.chain-wrap { overflow-x: auto; margin-bottom: 14px; }
table.chain { width: 100%; border-collapse: collapse; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
table.chain th {
  font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: 1px;
  padding: 5px 4px; border-bottom: 1px solid var(--border); font-family: -apple-system, sans-serif;
}
.chain-sub th { font-size: 9.5px; color: var(--text-3); opacity: 0.8; }
table.chain td { padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--border); color: var(--text-2); }
.chain-cell, .chain-oi { cursor: pointer; transition: background 0.15s, color 0.15s; border-radius: 6px; }
.chain-cell:hover, .chain-oi:hover { background: var(--accent-dim); color: var(--text); }
.chain-cell.ask { color: var(--text); }
.chain-cell.hit, .chain-oi.hit { background: var(--up-dim) !important; color: var(--up) !important; font-weight: 800; }
.chain-cell.miss, .chain-oi.miss { background: var(--down-dim) !important; color: var(--down) !important; }
.chain-k { font-weight: 800; color: var(--text) !important; background: var(--surface); }
.chain-k.atm { color: var(--amber) !important; }
.chain-oi { font-size: 11.5px; color: var(--text-3) !important; }

/* 希腊字母 = 装备属性，永远配账本翻译 */
.greeks { margin-top: 11px; border-top: 1px dashed var(--border-strong); padding-top: 9px; }
.greeks summary { cursor: pointer; list-style: none; -webkit-user-select: none; user-select: none; }
.greeks summary::-webkit-details-marker { display: none; }
.greeks-arrow {
  float: right; font-size: 11px; color: var(--text-3);
  transition: transform .2s;
}
.greeks[open] .greeks-arrow { transform: rotate(180deg); }
.greeks summary:hover .greeks-arrow { color: var(--text-2); }
.greeks-head {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-3);
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.greek-row { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; font-size: 12.5px; color: var(--text-2); }
.greek-sym {
  width: 18px; flex-shrink: 0; text-align: center; font-weight: 800; font-size: 13px;
  color: var(--accent); font-family: ui-monospace, Menlo, monospace;
}
.greek-name { width: 42px; flex-shrink: 0; font-size: 11px; color: var(--text-3); }
.greek-text { flex: 1; line-height: 1.5; }
.greek-text b { color: var(--text); font-family: ui-monospace, Menlo, monospace; }
.jitter-chip {
  font-size: 10px; font-weight: 800; color: var(--down);
  background: var(--down-dim); border: 1px solid var(--down);
  border-radius: 20px; padding: 1px 8px; animation: jitter 0.9s infinite;
}
@keyframes jitter {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(1px, -1px) rotate(-1.5deg); }
  50% { transform: translate(-1px, 1px) rotate(1.5deg); }
  75% { transform: translate(1px, 1px) rotate(-1deg); }
}
.craft-attr {
  font-size: 10px; color: var(--text-3); margin-top: 4px;
  font-family: ui-monospace, Menlo, monospace; line-height: 1.4;
}

/* 对照栏：同一条行情、只差到期日 */
.trade-cmp { font-size: 11.5px; color: var(--text-3); margin-left: 10px; }
.trade-cmp b { font-family: ui-monospace, Menlo, monospace; }
.compare-box {
  background: var(--surface); border: 1px solid var(--blue);
  border-radius: 12px; padding: 12px 14px; margin: 10px 0;
}
.compare-head { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--blue); margin-bottom: 8px; }
.compare-grid { display: flex; gap: 10px; }
.compare-cell { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }
.compare-cell.mine { border-color: var(--accent); background: var(--accent-dim); }
.compare-tag { font-size: 10.5px; color: var(--text-3); }
.compare-val { font-size: 19px; font-weight: 800; font-family: ui-monospace, Menlo, monospace; margin-top: 2px; }
.compare-pct { font-size: 12px; color: var(--text-2); font-family: ui-monospace, Menlo, monospace; }
.compare-note { font-size: 12.5px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.compare-note b { color: var(--amber); }

/* 剧情持仓卡：被指派后真的收到 100 股 */
.holdings-card {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  background: linear-gradient(120deg, var(--up-dim), var(--surface));
  border: 1px solid var(--up); border-radius: var(--radius); padding: 12px 16px;
  animation: fadeup 0.4s ease backwards;
}
.holdings-icon { font-size: 22px; }
.holdings-text { font-size: 13px; color: var(--text-2); }
.holdings-text b { color: var(--up); }
.holdings-sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* 合成台 */
.craft {
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px 12px; margin-bottom: 16px;
  box-shadow: 0 6px 26px -14px var(--accent-glow);
}
.craft-row { display: flex; align-items: stretch; gap: 8px; margin: 10px 0 6px; }
.craft-card {
  flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 10px; text-align: center;
}
.craft-card.craft-result { border-color: var(--accent); background: var(--accent-dim); }
.craft-icon { font-size: 20px; }
.craft-label { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.craft-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.craft-plus { display: flex; align-items: center; font-size: 15px; color: var(--text-3); font-weight: 800; }
.craft-canvas { display: block; width: 100%; margin-top: 4px; }
.craft-note { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.6; }
.craft-note b { color: var(--amber); }

/* 仓位滑杆：结构用卡牌，数量用滑杆 */
.sizer {
  background: var(--surface); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 16px;
}
.sizer-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.sizer-row input[type=range] { flex: 1; accent-color: var(--amber); height: 22px; }
.sizer-val { font-size: 15px; color: var(--text-2); white-space: nowrap; }
.sizer-val b { font-size: 22px; color: var(--amber); font-family: ui-monospace, Menlo, monospace; }
.sizer-note { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.sizer-note b { color: var(--text); }
.sizing-note {
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
  background: var(--amber-dim); border: 1px solid var(--amber);
  border-radius: 12px; padding: 10px 14px; margin: 10px 0;
}
.sizing-note b { color: var(--text); }
.sizing-note b.neg { color: var(--down); }

/* 训练场地图的空间卡：比关卡卡更"建筑物"一点 */
.space-card { padding: 18px 16px; }
.space-card .level-icon {
  width: 54px; height: 54px; font-size: 28px;
  background: linear-gradient(135deg, var(--surface-2), var(--accent-dim));
}
.space-card.locked .level-icon { background: var(--surface-2); }
.space-card .level-badge { border-radius: 12px; width: auto; min-width: 36px; padding: 0 8px; font-size: 13px; }

.grade-A { color: var(--up) !important; border-color: var(--up) !important; background: var(--up-dim); box-shadow: 0 0 12px var(--up-glow); }
.grade-B { color: var(--blue) !important; border-color: var(--blue) !important; background: var(--blue-dim); }
.grade-C { color: var(--amber) !important; border-color: var(--amber) !important; background: var(--amber-dim); }
.grade-D { color: var(--down) !important; border-color: var(--down) !important; background: var(--down-dim); }

/* ── 名场面图鉴 ── */
.collect-entry {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  animation: fadeup 0.4s ease 0.05s backwards;
}
.collect-entry:hover { border-color: var(--amber); box-shadow: 0 4px 18px -6px rgba(240, 178, 41, 0.3); }
.collect-entry:active { transform: scale(0.99); }
.collect-icon { font-size: 20px; }
.collect-text { flex: 1; font-size: 14.5px; font-weight: 600; }
.collect-text b { color: var(--amber); }
.collect-arrow { color: var(--text-3); }

.moment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.moment-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  animation: deal 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.moment-card.locked { opacity: 0.55; }
.moment-card.locked .moment-desc { font-style: italic; }
.moment-icon { font-size: 26px; }
.moment-name { font-size: 14.5px; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.moment-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.moment-count { font-size: 11px; color: var(--amber); margin-top: 6px; font-weight: 700; }

.rarity-chip {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
  letter-spacing: 1px; flex-shrink: 0;
}
.r-common { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong); }
.r-uncommon { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue); }
.r-rare { background: var(--accent-dim); color: #a89bff; border: 1px solid var(--accent); }

.moment-toast {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, var(--accent-dim), var(--surface));
  border: 1px solid var(--accent); border-radius: 11px;
  padding: 10px 14px; margin-bottom: 12px;
  font-size: 13.5px; color: var(--text-2);
  animation: xppop 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) 0.25s backwards;
  box-shadow: 0 0 24px -6px var(--accent-glow);
}
.moment-toast b { color: var(--text); }
.moment-toast-icon { font-size: 22px; }
.moment-toast .rarity-chip { margin: 0 6px; }

/* ── 关卡页 ── */
.scenario {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  animation: fadeup 0.35s ease backwards;
}
.scenario-tag { font-size: 11.5px; color: var(--accent); margin-bottom: 4px; font-weight: 700; letter-spacing: 1px; }
.scenario-text { font-size: 14.5px; }
.scenario-text .hl { color: var(--amber); font-weight: 700; }
.scenario-text .num { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #c8cdfa; }

.chapter-title {
  font-size: 13px; font-weight: 800; color: var(--text-3);
  letter-spacing: 3px; margin: 26px 2px 12px;
  display: flex; align-items: center; gap: 10px;
}
.chapter-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.greek-chip {
  display: inline-block; font-size: 10.5px; padding: 0 7px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); margin: 2px 3px 0 0;
}

.strategy-box {
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  animation: fadeup 0.35s ease 0.05s backwards;
}
.strategy-text { font-size: 13.5px; color: var(--text-2); }
.requires-chip {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong);
  margin-left: 8px; letter-spacing: 0.5px; vertical-align: 1px;
}
.quests-title { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.quest-hint { color: var(--text-3); font-size: 12px; }

.quests {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
  animation: fadeup 0.35s ease 0.08s backwards;
}
.quest { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.quest.done .quest-text { color: var(--text-3); text-decoration: line-through; }
.quest-text { flex: 1; }
.quest-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700; font-size: 12.5px; color: var(--amber);
}
.quest.done .quest-num { color: var(--up); }

.quest-nudge {
  font-size: 13px; color: var(--text-2);
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 11px; padding: 9px 14px; margin-top: 12px;
}
.quest-nudge b { color: var(--amber); }

.cards-hint { font-size: 12.5px; color: var(--text-3); margin: 0 2px 8px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.strat-card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px; cursor: pointer;
  transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s, opacity 0.25s;
  position: relative;
  animation: deal 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
@keyframes deal {
  from { opacity: 0; transform: translateY(36px) rotate(2.5deg) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.strat-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 28px -10px var(--accent-glow);
}
.strat-card:active { transform: scale(0.96); }
.strat-card.picked {
  border-color: var(--accent); background: var(--accent-dim);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px -8px var(--accent-glow);
}
.strat-card.faded { opacity: 0.22; transform: scale(0.95); pointer-events: none; filter: saturate(0.4); }
.strat-card.done { pointer-events: none; }
.strat-icon { font-size: 22px; }
.strat-name { font-size: 15px; font-weight: 700; margin-top: 4px; }
.strat-desc { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.strat-card.hidden-locked {
  opacity: 0.45; cursor: default; pointer-events: none;
  border-style: dashed; filter: saturate(0.4);
}
.hidden-chip {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
  background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber);
  letter-spacing: 1px; vertical-align: 2px;
}
.strat-grade {
  position: absolute; top: 10px; right: 10px;
  font-size: 12px; font-weight: 800; width: 25px; height: 25px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); color: var(--text-3);
}

/* ── 图表 + 实时行情 ── */
.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 12px 8px; margin-bottom: 14px;
  position: relative; overflow: hidden;
  animation: fadeup 0.3s ease;
}
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; padding: 0 2px; }
.chart-title { font-size: 12px; color: var(--text-3); }
.live-val {
  font-size: 17px; font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  transition: color 0.1s;
}
canvas.chart { display: block; width: 100%; }

.trade-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px; padding: 10px 2px 6px;
}
.trade-info { display: flex; align-items: baseline; gap: 12px; }
.trade-day { font-size: 12px; color: var(--text-3); min-width: 52px; }
.trade-pnl { font-size: 17px; font-weight: 800; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.sell-btn {
  background: linear-gradient(135deg, var(--amber), #e09112);
  border-color: transparent; color: #1a1206; font-weight: 800;
  padding: 8px 18px; font-size: 14px;
  box-shadow: 0 4px 16px -4px rgba(240, 180, 41, 0.4);
}
.sell-btn:disabled {
  background: var(--surface-2); color: var(--text-2);
  box-shadow: none; cursor: default; transform: none;
}

.sell-compare {
  background: var(--amber-dim); border: 1px solid rgba(240, 178, 41, 0.4);
  border-radius: 11px; padding: 10px 14px;
  font-size: 13.5px; color: var(--text-2); margin-bottom: 12px;
  animation: fadeup 0.35s ease;
}

.tldr { font-size: 14.5px; font-weight: 700; color: var(--text); }
.debrief details { margin-top: 8px; }
.debrief summary {
  font-size: 12.5px; color: var(--accent); cursor: pointer;
  user-select: none; list-style: none;
}
.debrief summary::before { content: '▸ '; }
.debrief details[open] summary::before { content: '▾ '; }
.debrief-full { margin-top: 6px; font-size: 13.5px; }

.stamp {
  position: absolute; top: 34px; right: 16px;
  font-size: 34px; font-weight: 900; line-height: 1;
  padding: 6px 14px 4px; border: 3px solid currentColor; border-radius: 10px;
  transform: rotate(-8deg);
  animation: stampin 0.4s cubic-bezier(0.2, 2.4, 0.5, 1) backwards;
  background: rgba(11, 14, 26, 0.55); backdrop-filter: blur(2px);
  text-align: center;
}
.stamp small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 2px; margin-top: 2px; }
@keyframes stampin {
  from { opacity: 0; transform: rotate(-8deg) scale(2.6); }
  to { opacity: 1; transform: rotate(-8deg) scale(1); }
}

/* ── 结算 ── */
.result { animation: fadeup 0.35s ease; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 12px;
}
.stat-label { font-size: 11px; color: var(--text-3); }
.stat-value { font-size: 19px; font-weight: 800; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 2px; }
.stat-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.pos { color: var(--up); }
.neg { color: var(--down); }

.xp-toast {
  display: inline-block; font-size: 12.5px; font-weight: 800; color: var(--amber);
  animation: xppop 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) backwards;
  margin-left: 8px;
}
@keyframes xppop { from { opacity: 0; transform: translateY(8px) scale(0.6); } to { opacity: 1; transform: none; } }

.swan-note {
  background: linear-gradient(120deg, #1a1024, var(--surface));
  border: 1px solid var(--down); border-radius: 11px;
  padding: 10px 14px; margin-bottom: 12px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.7;
  box-shadow: 0 0 28px -6px var(--down-glow);
  animation: fadeup 0.4s ease;
}
.swan-note b { color: var(--down); }

.quiz-box {
  background: var(--surface); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  box-shadow: 0 0 24px -8px rgba(240, 178, 41, 0.35);
  animation: fadeup 0.35s ease;
}
.quiz-q { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.quiz-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-opt {
  flex: 1; min-width: 90px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 16px; font-weight: 700; padding: 12px 8px;
}
.quiz-feedback {
  border-radius: 11px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13.5px; line-height: 1.7; color: var(--text-2);
  animation: fadeup 0.35s ease;
}
.quiz-feedback.right { background: var(--up-dim); border: 1px solid var(--up); }
.quiz-feedback.wrong { background: var(--down-dim); border: 1px solid var(--down); }

.mc-note { font-size: 12.5px; color: var(--text-3); padding: 0 2px; margin-bottom: 10px; }
.mc-note b { color: var(--text-2); }

.debrief {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px; font-size: 14px; color: var(--text-2);
  margin-bottom: 16px; line-height: 1.75;
}
.debrief .luck { color: var(--amber); font-weight: 700; }
.debrief b { color: var(--text); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 11px;
  padding: 10px 16px; font-size: 14.5px; cursor: pointer;
  font-family: inherit; font-weight: 600;
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.95); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #5f4fe0);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px -4px var(--accent-glow);
}

.unlock-toast {
  background: var(--up-dim); border: 1px solid var(--up);
  color: var(--up); border-radius: 11px; padding: 10px 14px;
  font-size: 13.5px; font-weight: 700; margin-top: 14px;
  animation: xppop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) 0.3s backwards;
  box-shadow: 0 0 20px -4px var(--up-glow);
}

.reset-row { text-align: center; margin-top: 28px; }
.reset-btn {
  font-size: 12.5px; color: var(--text-3);
  background: none; border: 1px dashed var(--border);
  padding: 8px 16px;
}
.reset-btn:hover { color: var(--down); border-color: var(--down); }
.reset-btn.armed {
  color: var(--down); border: 1px solid var(--down);
  background: var(--down-dim); font-weight: 700;
  animation: xppop 0.3s ease;
}

/* 平仓后的冻结盈亏：标签写明锁定在第几天，别和继续走的天数标签拼成错话 */
.trade-pnl .cut-tag {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  margin-right: 5px; letter-spacing: 0;
}

/* 机制演算块（第一/二课）：定义只说"权利"两个字不够，双向演算一遍它怎么变成钱 */
.mech-box {
  margin-top: 10px; padding: 10px 12px;
  background: var(--surface-2); border-radius: 10px;
  border-left: 2px solid var(--amber);
}
.mech-title { font-size: 12px; font-weight: 800; color: var(--amber); margin-bottom: 4px; }
.mech-text { font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.mech-text b { color: var(--text); }
.mech-unit { display: block; margin-top: 6px; font-size: 11px; color: var(--text-3); }

/* 平仓结算注：把平仓那口价拆成内在 + 时间价值 */
.cut-note { border-left: 2px solid var(--accent); color: var(--text-2); }
.cut-note b { color: var(--text); }

/* 测验的诚实出口：不会算就看拆解，不收录、不算答错 */
.quiz-skip {
  display: block; margin: 10px auto 0;
  font-size: 12px; color: var(--text-3);
  background: none; border: 1px dashed var(--border); border-radius: 20px;
  padding: 6px 16px; cursor: pointer;
}
.quiz-skip:hover { color: var(--text-2); border-color: var(--border-strong); }
.quiz-feedback.learn { background: var(--blue-dim); border: 1px solid var(--blue); color: var(--text-2); }
.quiz-feedback.learn b { color: var(--text); }

/* 战场的回炉引导 */
.armory-nudge { cursor: pointer; margin-bottom: 14px; }
.armory-nudge .nudge-link { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* 盘中转卖价旁注（第一章）：时间价值的困惑第一局就会撞上，旁注钉在浮盈旁边 */
.live-note {
  margin-top: 8px; padding: 8px 10px;
  font-size: 11.5px; line-height: 1.7; color: var(--text-3);
  background: var(--surface-2); border-radius: 8px;
}
.live-note b { color: var(--text-2); }

/* ── M6 行为镜子：开局立 flag ── */
.flag-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.flag-label { font-size: 12px; color: var(--text-2); }
.flag-label small { color: var(--text-3); margin-left: 4px; }
.flag-chips { display: flex; gap: 6px; }
.flag-chip {
  font-size: 12px; padding: 5px 10px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all .15s;
}
.flag-chip:hover { border-color: var(--border-strong); }
.flag-chip.on {
  background: var(--accent-dim); color: var(--text);
  border-color: var(--accent); font-weight: 700;
}
.flag-verdict {
  margin: 10px 0; padding: 9px 12px; font-size: 12.5px; line-height: 1.7;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
}
.flag-verdict.hit { border-color: var(--up); background: var(--up-dim); }
.flag-verdict.miss { border-color: var(--amber); background: var(--amber-dim); }
.flag-verdict b { color: var(--text); }
.flag-tally { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── M6 行为镜子：黑历史 ── */
.anti-toast { border-color: var(--down) !important; background: var(--down-dim) !important; }
.anti-head { margin: 26px 0 10px; }
.anti-title { font-size: 15px; font-weight: 800; color: var(--text); }
.anti-sub { font-size: 12px; color: var(--text-3); line-height: 1.7; margin-top: 3px; }
.anti-sub b { color: var(--text-2); }
.anti-card { border-color: #4a2530; }
.anti-card:not(.locked) { background: linear-gradient(160deg, var(--down-dim), var(--surface) 75%); }
.anti-card.locked { opacity: .8; }
.rarity-chip.r-anti { background: var(--down-dim); color: var(--down); border: 1px solid #4a2530; }
.moment-rule {
  margin-top: 6px; font-size: 10.5px; color: var(--text-3);
  border-top: 1px dashed var(--border); padding-top: 6px; line-height: 1.5;
}

/* ── 怪物图鉴矩阵（方向 × 波动）：摆法本身就是课程 ── */
.mx-legend { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-top: 6px; }
.mx-legend b { color: var(--text); }
.mx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px 4px; }
.mx-grid {
  display: grid; grid-template-columns: 76px repeat(3, minmax(96px, 1fr));
  gap: 6px; min-width: 380px;
}
.mx-corner {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  font-size: 10px; color: var(--text-3); padding: 0 0 6px 2px; line-height: 1.3;
}
.mx-col-head {
  text-align: center; font-size: 12px; font-weight: 800; color: var(--text-2);
  padding: 0 0 6px; letter-spacing: 1px;
}
.mx-row-head {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding-right: 6px; text-align: right;
}
.mx-row-head b { font-size: 12.5px; color: var(--text-2); letter-spacing: 1px; }
.mx-row-head span { font-size: 9.5px; color: var(--text-3); line-height: 1.35; }
.mx-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mx-cell[data-mi]:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 0 18px -6px var(--accent-glow);
}
.mx-cell.done { border-color: var(--up); background: linear-gradient(160deg, var(--up-dim), var(--surface) 70%); }
.mx-cell.empty, .mx-cell.locked {
  cursor: default; border-style: dashed; background: transparent;
  justify-content: center; opacity: .75;
}
.mx-q { font-size: 20px; color: var(--text-3); }
.mx-icon { font-size: 24px; line-height: 1.1; }
.mx-name { font-size: 13px; font-weight: 800; color: var(--text); }
.mx-hint { font-size: 9.5px; color: var(--text-3); line-height: 1.35; }
.mx-badge {
  margin-top: 2px; font-size: 10px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); border-radius: 20px; padding: 2px 8px;
}
.mx-badge.grade-A { background: var(--up-dim); color: var(--up); }

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .mx-grid { grid-template-columns: 56px repeat(3, minmax(88px, 1fr)); gap: 5px; }
  .mx-row-head span { display: none; }
  #hud { display: none; }
}
