/* ============================================================
   HERMES 市场作战室 — 屏风 (folding-screen lacquer) theme
   Anti-Bloomberg: warm lacquer ground, gold seams, seal markers.
   Data language inverts to the Chinese convention 红涨 / 绿跌.
   ============================================================ */

:root {
  /* lacquer palette */
  --lacquer:    #14100c;   /* deep warm ground */
  --lacquer-2:  #1c1711;   /* raised panel */
  --lacquer-3:  #241d15;   /* inset / hover */
  --gold:       #c8a45c;   /* structural seams, eyebrows */
  --gold-dim:   #8a7338;   /* hairlines */
  --gold-bright:#edd49a;   /* heading highlight */
  --rise:       #e34b3f;   /* 涨 — vermilion (UP) */
  --rise-soft:  #5a2722;
  --fall:       #43b083;   /* 跌 — jade (DOWN) */
  --fall-soft:  #1f4338;
  --ink:        #ece3d2;   /* warm parchment text */
  --ink-dim:    #9c917d;   /* secondary */
  --ink-faint:  #6b6353;   /* tertiary / captions */
  --seal:       #b5402f;   /* seal-stamp red */

  --r: 3px;
  --seam: 1px solid var(--gold-dim);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans:  "Noto Sans SC", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, #1e1810 0%, transparent 60%),
    radial-gradient(900px 400px at 0% 0%, #1a140d 0%, transparent 55%),
    var(--lacquer);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* faint lacquer-grain texture via repeating hairlines */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg, rgba(200,164,92,.025) 0 1px, transparent 1px 3px);
  opacity: .5;
}

.wrap { position: relative; z-index: 1; max-width: 1500px; margin: 0 auto;
  padding: 0 18px 64px; }

/* ---------- command header ---------- */
.masthead {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 4px 16px; border-bottom: 2px solid var(--gold-dim);
  position: relative;
}
.masthead::after { /* gold seam glow under the rule */
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  opacity: .5;
}
.seal {
  flex: none; width: 50px; height: 50px; border-radius: 6px;
  border: 1.5px solid var(--seal);
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2a140f, #1a0d0a);
  color: var(--seal); font-family: var(--serif); font-weight: 700;
  box-shadow: inset 0 0 0 3px rgba(181,64,47,.18);
}
.seal b { font-size: 20px; line-height: 1; letter-spacing: 1px; }
.masthead .title { display: flex; flex-direction: column; gap: 2px; }
.masthead h1 {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: 26px; letter-spacing: 6px; color: var(--gold-bright);
}
.masthead .sub {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 3px;
  color: var(--ink-faint); text-transform: uppercase;
}
.masthead .spacer { flex: 1; }
.masthead .clock { text-align: right; font-family: var(--mono);
  color: var(--ink-dim); font-size: 11px; line-height: 1.7; }
.masthead .clock b { color: var(--ink); font-weight: 500; }

.badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }
.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  padding: 3px 8px; border: 1px solid var(--gold-dim); border-radius: 2px;
  color: var(--ink-dim); display: inline-flex; align-items: center; gap: 5px;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.badge.live i { background: var(--fall); box-shadow: 0 0 6px var(--fall); }
.badge.fixture i { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.badge.partial i { background: var(--rise); }

/* ---------- section heading: seal marker + brushed label ---------- */
.sec-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 30px 0 12px; padding-bottom: 6px;
  border-bottom: var(--seam);
}
.sec-head .mark {
  font-family: var(--serif); font-weight: 700; font-size: 13px;
  color: var(--lacquer); background: var(--seal); padding: 2px 7px;
  border-radius: 2px; letter-spacing: 2px; flex: none;
}
.sec-head h2 { margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: 17px; letter-spacing: 3px; color: var(--gold-bright); }
.sec-head .en { font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--ink-faint); text-transform: uppercase; }
.sec-head .note { margin-left: auto; font-size: 11px; color: var(--ink-dim); }

/* ---------- hero band ---------- */
.hero {
  margin-top: 18px; padding: 18px 20px; border: var(--seam); border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(200,164,92,.05), transparent 40%),
    var(--lacquer-2);
  position: relative;
}
.hero .lede {
  font-family: var(--serif); font-size: 19px; line-height: 1.7;
  color: var(--ink); font-weight: 500; max-width: 70ch;
}
.hero .lede::first-letter { color: var(--gold-bright); }
.hero .conf { font-family: var(--mono); font-size: 11px; color: var(--ink-dim);
  margin-top: 10px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- ticker chip (colored, clickable) ---------- */
.chip {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  border: 1px solid var(--gold-dim); border-radius: 2px;
  padding: 5px 9px; display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--lacquer-3); transition: border-color .15s, transform .1s;
}
.chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.chip .sym { color: var(--ink); font-weight: 600; letter-spacing: .5px; }
.chip .val { font-weight: 600; }
.chip.big { font-size: 14px; padding: 8px 13px; }
.chip.big .sym { font-size: 15px; }
.up   { color: var(--rise); }
.down { color: var(--fall); }
.flat { color: var(--ink-dim); }
.chip.up   { box-shadow: inset 3px 0 0 var(--rise); }
.chip.down { box-shadow: inset 3px 0 0 var(--fall); }

/* ---------- panel grid (the folding screen) ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.panel {
  grid-column: span 4;
  border: var(--seam); border-radius: var(--r);
  background: var(--lacquer-2);
  padding: 12px 13px 13px; position: relative; min-width: 0;
  /* gold fold seam on the left edge */
  box-shadow: inset 2px 0 0 -1px var(--gold-dim);
}
.panel.s3 { grid-column: span 3; }
.panel.s6 { grid-column: span 6; }
.panel.s8 { grid-column: span 8; }
.panel.s12 { grid-column: span 12; }
.panel > h3 {
  margin: 0 0 9px; font-family: var(--serif); font-weight: 700;
  font-size: 13px; letter-spacing: 2px; color: var(--gold-bright);
  display: flex; align-items: baseline; gap: 8px;
}
.panel > h3 .en { font-family: var(--mono); font-weight: 400; font-size: 9px;
  letter-spacing: 1.5px; color: var(--ink-faint); text-transform: uppercase; }
.panel > h3 .tag { margin-left: auto; font-family: var(--mono); font-size: 9px;
  letter-spacing: 1px; padding: 1px 5px; border: 1px solid var(--gold-dim);
  border-radius: 2px; color: var(--ink-faint); }

/* ---------- mini metric rows ---------- */
.kv { display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 4px 0; border-bottom: 1px dashed rgba(138,115,56,.18); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-dim); font-size: 11.5px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .v { font-family: var(--mono); font-weight: 600; flex: none; }
.kv .v small { color: var(--ink-faint); font-weight: 400; margin-left: 5px; }

/* ---------- spark cards ---------- */
.sparkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sparkcard { border: var(--seam); border-radius: var(--r); padding: 9px 10px;
  background: var(--lacquer); cursor: pointer; transition: border-color .15s; }
.sparkcard:hover { border-color: var(--gold); }
.sparkcard .row1 { display: flex; justify-content: space-between; align-items: baseline; }
.sparkcard .sym { font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--ink); letter-spacing: .5px; }
.sparkcard .pct { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.sparkcard .px { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); margin-top: 1px; }
.sparkcard svg { display: block; width: 100%; height: 34px; margin-top: 5px; }

/* ---------- bars (sectors / themes / prediction mkt) ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 1fr; gap: 3px; }
.bar .lab { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.bar .lab .name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .lab .num { font-family: var(--mono); font-weight: 600; flex: none; }
.bar .track { height: 6px; background: var(--lacquer-3); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 3px; }
.bar .fill.up { background: linear-gradient(90deg, var(--rise-soft), var(--rise)); }
.bar .fill.down { background: linear-gradient(90deg, var(--fall-soft), var(--fall)); }
.bar .fill.neutral { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.bar .sub { font-size: 10.5px; color: var(--ink-faint); }

/* theme state pill */
.statepill { font-family: var(--mono); font-size: 9px; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 2px; border: 1px solid currentColor; flex: none; }
.st-增强, .st-改善 { color: var(--rise); }
.st-减弱, .st-走弱 { color: var(--fall); }
.st-未定, .st-分化, .st-新 { color: var(--gold); }

/* ---------- canvas viz ---------- */
.viz { width: 100%; display: block; border-radius: var(--r); }
.viz-cap { font-size: 10.5px; color: var(--ink-faint); margin-top: 6px; }

/* gauges (radial) */
.gauge-wrap { display: flex; align-items: center; gap: 14px; }
.gauge-read { font-family: var(--mono); }
.gauge-read .big { font-size: 26px; font-weight: 700; color: var(--ink); }
.gauge-read .lab { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }

/* ---------- news tape ---------- */
.news { display: flex; flex-direction: column; }
.news .item { padding: 8px 0; border-bottom: 1px dashed rgba(138,115,56,.18); }
.news .item:last-child { border-bottom: 0; }
.news .h { font-size: 12.5px; color: var(--ink); line-height: 1.45; }
.news .m { display: flex; gap: 8px; align-items: center; margin-top: 4px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint); flex-wrap: wrap; }
.news .mat { padding: 0 5px; border: 1px solid var(--gold-dim); border-radius: 2px; }
.news .mat.high { color: var(--rise); border-color: var(--rise); }
.news .mat.medium { color: var(--gold); }
.news .tk { display: inline-flex; gap: 5px; }
.news .tk a { color: var(--gold); }

/* ---------- intelligence (briefing) ---------- */
.brief { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.brief .block h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 13px;
  letter-spacing: 1px; color: var(--gold-bright); display: flex; gap: 8px; align-items: baseline; }
.brief .block h4 .en { font-family: var(--mono); font-size: 9px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 1px; }
.brief ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.brief li { font-size: 12.5px; line-height: 1.55; padding-left: 14px; position: relative; color: var(--ink); }
.brief li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }
.brief li .conf { font-family: var(--mono); font-size: 9px; margin-left: 6px;
  padding: 0 4px; border: 1px solid var(--gold-dim); border-radius: 2px; color: var(--ink-faint); }
.brief li .src { font-family: var(--mono); font-size: 10px; color: var(--gold); margin-left: 4px; }
.advisor { grid-column: 1 / -1; margin-top: 4px; padding: 11px 13px;
  border-left: 3px solid var(--seal); background: var(--lacquer-3); border-radius: 2px;
  font-size: 12.5px; color: var(--ink-dim); }
.advisor b { color: var(--ink); font-weight: 600; }

/* ---------- watchlist ---------- */
.watch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wcard { border: var(--seam); border-radius: var(--r); padding: 11px 12px;
  background: var(--lacquer); cursor: pointer; transition: border-color .15s, transform .1s;
  box-shadow: inset 2px 0 0 -1px var(--gold-dim); }
.wcard:hover { border-color: var(--gold); transform: translateY(-2px); }
.wcard .top { display: flex; justify-content: space-between; align-items: baseline; }
.wcard .sym { font-family: var(--mono); font-weight: 700; font-size: 16px; color: var(--ink); }
.wcard .pct { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.wcard .role { font-size: 10.5px; color: var(--ink-faint); margin: 5px 0 8px; line-height: 1.4;
  min-height: 28px; }
.wcard .thesis { font-size: 11.5px; color: var(--ink-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wcard .cta { margin-top: 9px; font-family: var(--mono); font-size: 10px; color: var(--gold);
  display: flex; align-items: center; gap: 6px; }
.wcard .cta::after { content: "▸ 启动 agent 研判"; }

/* ---------- status grid ---------- */
.statusgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.statusgrid .s { display: flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 10.5px; color: var(--ink-dim); padding: 3px 0; }
.statusgrid .s i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.statusgrid .s.ok i { background: var(--fall); box-shadow: 0 0 5px var(--fall); }
.statusgrid .s.bad i { background: var(--rise); }

/* ---------- calendar list ---------- */
.cal { display: flex; flex-direction: column; }
.cal .row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0;
  border-bottom: 1px dashed rgba(138,115,56,.18); }
.cal .row:last-child { border-bottom: 0; }
.cal .date { font-family: var(--mono); font-size: 10.5px; color: var(--gold); flex: none; width: 92px; }
.cal .ev { font-size: 12px; color: var(--ink); flex: 1; }
.cal .imp { font-family: var(--mono); font-size: 9px; padding: 1px 5px; border-radius: 2px;
  border: 1px solid var(--gold-dim); color: var(--ink-faint); flex: none; }
.cal .imp.高 { color: var(--rise); border-color: var(--rise); }
.cal .imp.中 { color: var(--gold); }

/* ---------- footer / compliance ---------- */
.compliance { margin-top: 28px; padding: 14px 16px; border: var(--seam);
  border-radius: var(--r); background: var(--lacquer-2); display: flex;
  gap: 14px; align-items: center; }
.compliance .icon { font-family: var(--serif); color: var(--seal); font-size: 18px;
  border: 1.5px solid var(--seal); border-radius: 4px; padding: 2px 8px; flex: none; }
.compliance .txt { font-size: 11.5px; color: var(--ink-dim); }
.compliance .txt b { color: var(--ink); }
.foot { margin-top: 14px; text-align: center; font-family: var(--mono);
  font-size: 10px; color: var(--ink-faint); letter-spacing: 1px; }

/* ============================================================
   drawer — per-ticker agent run
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(8,6,4,.6);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw);
  background:
    linear-gradient(180deg, rgba(200,164,92,.06), transparent 30%),
    var(--lacquer-2);
  border-left: 2px solid var(--gold); transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.7,.2,1); z-index: 51;
  display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0,0,0,.5);
}
.drawer.open { transform: translateX(0); }
.drawer .dhead { display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: var(--seam); }
.drawer .dhead .sym { font-family: var(--mono); font-weight: 700; font-size: 24px; color: var(--ink); }
.drawer .dhead .pct { font-family: var(--mono); font-weight: 600; font-size: 16px; }
.drawer .dhead .x { margin-left: auto; cursor: pointer; color: var(--ink-dim);
  font-size: 22px; line-height: 1; padding: 4px 8px; border: 1px solid var(--gold-dim); border-radius: 3px; }
.drawer .dhead .x:hover { color: var(--ink); border-color: var(--gold); }
.drawer .dbody { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* agent run console */
.agentrun { font-family: var(--mono); font-size: 11.5px; }
.agentrun .step { display: flex; gap: 9px; padding: 4px 0; color: var(--ink-faint);
  opacity: 0; transform: translateX(-6px); }
.agentrun .step.show { opacity: 1; transform: none; transition: opacity .25s, transform .25s; }
.agentrun .step .tick { color: var(--fall); }
.agentrun .step.run .tick { color: var(--gold); }
.agentrun .step.run { color: var(--ink-dim); }
.agentrun .cursor { display: inline-block; width: 7px; height: 13px;
  background: var(--gold); animation: blink 1s steps(2) infinite; vertical-align: -2px; }
@keyframes blink { 50% { opacity: 0; } }

/* analysis result (触发/证据/影响/置信度/接下来关注) */
.result { opacity: 0; }
.result.show { opacity: 1; transition: opacity .4s; }
.result .conf-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding: 8px 12px; border: var(--seam); border-radius: var(--r); background: var(--lacquer-3); }
.result .conf-banner .lab { font-size: 11px; color: var(--ink-dim); }
.result .conf-banner .v { font-family: var(--mono); font-weight: 700; font-size: 14px; margin-left: auto; }
.result .field { margin-bottom: 13px; }
.result .field .ftitle { font-family: var(--serif); font-weight: 700; font-size: 12px;
  color: var(--gold-bright); letter-spacing: 1px; display: flex; gap: 7px; align-items: baseline; margin-bottom: 4px; }
.result .field .ftitle .en { font-family: var(--mono); font-weight: 400; font-size: 9px;
  color: var(--ink-faint); text-transform: uppercase; }
.result .field p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.result .field ul { margin: 0; padding-left: 16px; }
.result .field li { font-size: 12.5px; line-height: 1.55; margin-bottom: 4px; }
.result .relnews { border-top: var(--seam); margin-top: 6px; padding-top: 10px; }
.result .relnews .h { font-size: 12px; color: var(--ink); padding: 5px 0; line-height: 1.4; }
.result .disclaimer { margin-top: 16px; font-size: 10.5px; color: var(--ink-faint);
  border-top: 1px dashed var(--gold-dim); padding-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .panel, .panel.s3 { grid-column: span 6; }
  .panel.s8 { grid-column: span 12; }
  .watch { grid-template-columns: repeat(2, 1fr); }
  .brief { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .panel, .panel.s3, .panel.s6, .panel.s8 { grid-column: span 12; }
  .masthead { flex-wrap: wrap; }
  .masthead h1 { font-size: 20px; letter-spacing: 3px; }
  .watch { grid-template-columns: 1fr; }
  .statusgrid { grid-template-columns: 1fr 1fr; }
}

/* load reveal — panels unfold like a screen */
@media (prefers-reduced-motion: no-preference) {
  .panel, .hero, .wcard { animation: unfold .5s both; }
  @keyframes unfold {
    from { opacity: 0; transform: perspective(800px) rotateY(-6deg) translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}
