/* ============================================================
   SCFI 订舱助手 — 浅色极简技术风
   原则：无渐变 / 无阴影(仅弹层) / 发丝级描边 / 等宽数字 / 单一钢蓝强调色
   ============================================================ */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #0f1720;
  --ink-2: #59616c;
  --ink-3: #8a929c;
  --line: #ebedf1;      /* 发丝分割线 */
  --line-2: #dcdfe4;    /* 常规边框 */
  --accent: #2350a8;    /* 唯一强调色：钢蓝 */
  --accent-2: #1b3f86;
  --accent-soft: #eef2fa;
  --good: #157f52;      /* 便宜 / 低位 */
  --bad: #b23122;       /* 贵 / 高位 */
  --warn: #9a6a12;      /* 提示 */
  --mute: #6b7480;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 600; letter-spacing: -0.01em; }
code {
  background: #f1f3f6; padding: 1px 5px; border-radius: 3px;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
}
button { font-family: inherit; cursor: pointer; }
b, strong { font-weight: 600; }

/* 微标签：小号、字距、大写(拉丁) */
.micro { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

/* ---------- Topbar（页面导航）---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--panel);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);   /* 压住下方内容，增加分量 */
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 24px; min-height: 66px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 38px; height: 38px; border-radius: 10px; display: block; flex: none; }
.brand-txt { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-title { font-weight: 700; font-size: 17px; letter-spacing: .01em; color: var(--ink); line-height: 1; }
.brand-mark { font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-family: var(--mono); line-height: 1; }
.brand-sub { color: var(--ink-3); font-size: 12px; }
.tabs { display: flex; gap: 2px; margin-left: auto; align-self: stretch; }
.tab {
  display: flex; align-items: center;
  border: none; background: transparent; color: var(--ink-2);
  padding: 0 14px; font-size: 13.5px; font-weight: 600; border-radius: 0;
  box-shadow: inset 0 -2px 0 transparent; transition: color .12s, box-shadow .12s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Honesty bar（诚实边界条：通栏底纹 + 内容居中对齐）---------- */
.honesty-bar { background: #fbfcfe; border-bottom: 1px solid var(--line); }
.honesty-inner {
  max-width: 1440px; margin: 0 auto; padding: 8px 22px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-size: 12px; line-height: 1.5;
}
.hb-icon {
  color: var(--accent); font-weight: 700; font-size: 10px;
  width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #c9d6ee; border-radius: 50%; background: var(--accent-soft);
}
.honesty-bar b { color: var(--ink); font-weight: 600; }
.hb-fetched { margin-left: auto; color: var(--ink-3); white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }

/* ---------- Layout（单页：左=盯盘主区，右=行情侧栏）---------- */
.layout { max-width: 1440px; margin: 0 auto; padding: 22px; display: flex; gap: 20px; align-items: flex-start; }
main { flex: 1 1 auto; min-width: 0; }
.loading, .load-error { text-align: center; color: var(--ink-2); padding: 60px 20px; }
.load-error code { background: #f1f3f6; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.top-tag { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: .01em; }
.top-fetched { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 行情侧栏 ---------- */
.market-side { flex: none; width: 372px; position: sticky; top: 72px; display: flex; align-items: stretch; }
.ms-panel {
  flex: 1 1 auto; min-width: 0; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 12px;
  max-height: calc(100vh - 92px); display: flex; flex-direction: column; overflow: hidden;
}
.ms-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); flex: none; }
.ms-title { font-weight: 600; font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.ms-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.ms-collapse { margin-left: auto; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 12px; padding: 3px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ms-collapse:hover { color: var(--accent); border-color: #c9d6ee; }
.ms-body { padding: 12px 14px; overflow-y: auto; }

.ms-hero { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.msh-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.msh-label { font-size: 11px; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.msh-date { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.msh-val { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 2px 0 6px; }
.msh-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.msh-spark { display: block; }

/* 走势范围（全局）：置顶，控制综合指数 + 各航线曲线 */
.ms-range-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ms-range-lab { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }
.ms-range-row .range-toggle { margin-left: auto; flex: none; }
.ms-range-row .range-toggle button { padding: 3px 8px; font-size: 11px; }

.ms-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ms-clabel { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }

.ms-list { display: flex; flex-direction: column; }
/* 三段式：上=航线/分位 · 中=价格曲线(主体,占满) · 下=最新/周环比；宽松、易读 */
.ms-row { padding: 14px 10px; display: flex; flex-direction: column; gap: 9px; }
.ms-row + .ms-row { border-top: 1px solid var(--line); }
.ms-row:hover { background: #f8f9fb; }
.ml { font-size: 10px; color: var(--ink-3); font-weight: 500; }   /* 内联小标签 */
.msr-top { display: flex; align-items: baseline; gap: 6px; }
.msr-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.msr-unit { font-size: 10px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; }
.msr-pctwrap { margin-left: auto; display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.msr-pctwrap .chip { font-size: 10.5px; padding: 2px 7px; }
.msr-spark { width: 100%; display: block; }
.msr-spark svg { width: 100%; height: 40px; display: block; }
.msr-bottom { display: flex; align-items: baseline; gap: 28px; }
.msr-kv { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.msr-price { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); }
.msr-punit { font-size: 9.5px; color: var(--ink-3); font-weight: 600; }
.msr-bottom .mom { font-size: 12.5px; }
.msr-note { font-size: 10px; color: var(--warn); line-height: 1.4; }
.ms-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-3); line-height: 1.4; }

/* 收起态：面板隐藏，只留竖排「行情总览」展开条 */
.ms-expand { display: none; }
.market-side.collapsed { width: auto; }
.market-side.collapsed .ms-panel { display: none; }
.market-side.collapsed .ms-expand {
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: .14em;
  padding: 16px 9px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.market-side.collapsed .ms-expand:hover { color: var(--accent); border-color: #c9d6ee; }

.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.section-head h2 { font-size: 18px; }
.section-head .sub { color: var(--ink-3); font-size: 12.5px; }

/* ---------- Meta banner ---------- */
.meta-banner {
  display: flex; gap: 0; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; margin-bottom: 16px; font-size: 12px; color: var(--ink-2);
  overflow: hidden;
}
.meta-banner .mb-item { padding: 10px 16px; border-right: 1px solid var(--line); }
.meta-banner .mb-item:last-child { border-right: none; }
.meta-banner .mb-item b { color: var(--ink); font-family: var(--mono); font-weight: 600; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px,1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 15px; position: relative;
}
.card.wide { grid-column: 1 / -1; }

/* composite hero —— 报价面板式，不再是蓝色渐变卡 */
.hero {
  display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 16px;
}
.hero .h-main { min-width: 220px; }
.hero .h-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.hero .h-value { font-family: var(--mono); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin-top: 2px; }
.hero .h-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.hero .h-spark { flex: 1; min-width: 240px; align-self: stretch; display: flex; align-items: center; }

/* route card */
.route-card .rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.route-card .rc-name { font-weight: 600; font-size: 14px; }
.route-card .rc-unit { font-size: 10.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; margin-top: 1px; }
.route-card .rc-price { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin: 8px 0 2px; }
.route-card .rc-spark { margin: 8px -2px 6px; }
.pct-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* chips / badges —— 发丝边框 + 语义色文字，不用彩色药丸 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip.green { color: var(--good); border-color: #cbe4d7; background: #f4faf6; }
.chip.olive { color: #5f7d3f; border-color: #d9e4cb; background: #f7faf1; }
.chip.gray  { color: var(--mute); border-color: var(--line-2); }
.chip.orange{ color: var(--warn); border-color: #e7d9bd; background: #fbf7ee; }
.chip.red   { color: var(--bad); border-color: #e7cdc8; background: #fbf3f2; }
.chip.up    { color: var(--bad); border-color: #e7cdc8; }
.chip.down  { color: var(--good); border-color: #cbe4d7; }
.chip.flat  { color: var(--mute); border-color: var(--line-2); }
.chip.warn  { color: var(--warn); border-color: #e7d9bd; background: #fbf7ee; }
.chip.info  { color: var(--accent); border-color: #c9d6ee; background: var(--accent-soft); }

.mom { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.mom.up { color: var(--bad); }
.mom.down { color: var(--good); }
.mom.flat { color: var(--mute); }

/* range toggle —— 分段控件 */
.range-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.range-toggle button {
  border: none; border-left: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2);
  padding: 5px 12px; font-size: 12px; font-weight: 600;
}
.range-toggle button:first-child { border-left: none; }
.range-toggle button:hover { background: #f7f8fa; }
.range-toggle button.active { background: var(--accent-soft); color: var(--accent); }

/* sparkline svg —— 细线，无填充，非缩放描边保持锐利 */
.spark svg { display: block; width: 100%; height: auto; }
.spark-area { fill: none; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--accent); }

/* low-vol note */
.lowvol-note { font-size: 10.5px; color: var(--warn); margin-top: 5px; }

/* 看依据按钮 —— 极简 */
.why-btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2);
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px;
}
.why-btn:hover { color: var(--accent); border-color: #c9d6ee; }

/* ---------- Forms ---------- */
.form-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field { min-width: 0; }
.field label { font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; min-height: 15px; line-height: 1.35; white-space: nowrap; }
.field .hint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
/* 表单一行内各控件顶端对齐：说明文字统一放在输入框下方，标签保持单行等高 */
.form-grid { align-items: start; }

/* 盯盘表单：航线 · 目标价 · 预计订舱时间 · 按钮同一行，留白充足 */
.plan-row { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 14px 20px; }
.plan-row .field-route { flex: 0 1 300px; }
.plan-row .field-target { flex: 0 1 220px; }
.plan-row .field-horizon { flex: 0 1 170px; }
.plan-row .plan-submit { flex: none; display: flex; align-items: center; gap: 10px; padding-top: 20px; }
#demandForm .form-err { display: block; margin-top: 10px; }
@media (max-width: 820px) {
  .plan-row { flex-wrap: wrap; }
  .plan-row .field-route, .plan-row .field-target, .plan-row .field-horizon { flex: 1 1 100%; max-width: none; }
  .plan-row .plan-submit { padding-top: 0; }
}
.field input, .field select, textarea {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  width: 100%; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel);
  transition: border-color .12s, box-shadow .12s;
}
.field input::placeholder, textarea::placeholder { color: var(--ink-3); }
.field input:hover, .field select:hover, textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 0; line-height: 1.6; resize: vertical; }

/* 数字/日期用等宽；去掉数字上下小箭头 */
.field input[type="number"], .field input[type="date"], .field input[type="month"] {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.field input[type="number"] { -moz-appearance: textfield; }
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 下拉：自定义箭头，去系统三角 */
.field select {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%235b6673' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.field select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%232350a8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
}
/* 锁定态（该航线仅一种箱型，不可改）：去掉下拉箭头与手型，弱化底色 */
.field select:disabled {
  cursor: default; color: var(--ink-2); background-color: #f4f6f8;
  border-color: var(--line); background-image: none; padding-right: 12px; opacity: 1;
}
.field select:disabled:hover { border-color: var(--line); }

/* 日期：自定义日历图标，克制着色 */
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: .5; cursor: pointer; filter: grayscale(1);
}
.field input[type="date"]::-webkit-calendar-picker-indicator:hover,
.field input[type="month"]::-webkit-calendar-picker-indicator:hover { opacity: .9; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; background: var(--panel); color: var(--ink);
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f7f8fa; border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: var(--panel); color: var(--accent); border-color: #c9d6ee; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger-ghost { background: var(--panel); color: var(--bad); border-color: #e7cdc8; }
.btn.danger-ghost:hover { background: #fbf3f2; }
.btn.tiny { padding: 4px 10px; font-size: 12px; }
.unit-tag { font-size: 12px; color: var(--accent); font-weight: 600; font-family: var(--mono); }
.form-err { color: var(--bad); font-size: 12px; }

/* ---------- Empty states ---------- */
.empty-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.guide-card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  border-top: 2px solid var(--accent);
  padding: 22px; text-align: center;
}
.guide-card .g-emoji { display: none; }
.guide-card h3 { margin-top: 2px; font-size: 15px; }
.guide-card p { color: var(--ink-2); font-size: 12.5px; min-height: 38px; }

/* ---------- Watch / order items ---------- */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.watch-card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  overflow: hidden;
}
.watch-card.flag { border-color: #bcdcc9; box-shadow: inset 3px 0 0 var(--good); }
.wc-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbfbfc;
}
.wc-head .wc-route { font-weight: 600; font-size: 14.5px; }
.wc-head .wc-actions { margin-left: auto; display: flex; gap: 6px; }
.wc-body { padding: 14px 16px; }
.signal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; }
.signal { background: #fbfbfc; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.signal .s-label { font-size: 10px; color: var(--ink-3); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.signal .s-value { font-family: var(--mono); font-size: 16px; font-weight: 600; margin-top: 3px; letter-spacing: -0.01em; }
.signal .s-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.advice {
  margin-top: 14px; padding: 12px 14px; border-radius: 0 6px 6px 0;
  background: #fbfbfc; border: 1px solid var(--line-2); border-left: 2px solid var(--accent); font-size: 13px;
}
.advice.good { border-left-color: var(--good); }
.advice.warn { border-left-color: var(--warn); }
.advice .a-title { font-weight: 600; margin-bottom: 3px; }
.advice .a-basis { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Tables (benchmark) ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 720px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fbfbfc; color: var(--ink-3); font-weight: 600; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.verdict-cheap { color: var(--good); font-weight: 600; }
.verdict-exp { color: var(--bad); font-weight: 600; }
.verdict-flat { color: var(--mute); font-weight: 600; }
.mini-note { font-size: 10.5px; color: var(--warn); }

/* summary cards */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; margin: 6px 0 18px; }

/* 场景二：复盘汇总（两张紧凑面板并排）+ 明细表合并列 */
.sum2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.sum-panel { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.sum-h { padding: 9px 14px; font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.sum-panel table { min-width: 0; }
.sum-sep { color: var(--ink-3); }
td .u { display: block; font-family: var(--sans); font-size: 10px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.row-actions { display: flex; gap: 4px; }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
/* hidden 属性必须真正隐藏遮罩，否则它会一直铺满全屏、吞掉页面所有点击 */
.modal-mask[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; max-width: 560px; width: 100%; max-height: 82vh; overflow: hidden; box-shadow: 0 16px 48px rgba(15,23,42,.16); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.modal-close { margin-left: auto; border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; width: 28px; height: 28px; font-size: 13px; color: var(--ink-2); }
.modal-close:hover { background: #f7f8fa; }
.modal-body { padding: 16px 18px; overflow-y: auto; font-size: 13px; }
.modal-body h4 { margin-top: 14px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.modal-body ul { padding-left: 18px; margin: 6px 0; }
.modal-body li { margin: 3px 0; }
.modal-body b { font-family: var(--mono); font-weight: 600; }
.modal-body .kv { color: var(--ink-2); }
.modal-body .formula { background: #f7f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 11.5px; margin: 6px 0; color: var(--ink); }

/* 盯盘依据弹层：可视化证据块 */
.ev-lead { font-size: 14px; color: var(--ink); }
.ev-sub { font-size: 11.5px; color: var(--ink-3); margin: 3px 0 16px; }
.ev-block { margin-bottom: 18px; }
.ev-h { font-size: 11px; color: var(--ink-2); font-weight: 600; margin-bottom: 9px; }
.ev-svg { width: 100%; height: auto; display: block; }
.ev-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 3px; font-family: var(--mono); }
.ev-take { font-size: 12.5px; color: var(--ink-2); margin-top: 9px; line-height: 1.55; }
.ev-take b { color: var(--ink); }
.ev-legend { display: flex; gap: 16px; font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }
.ev-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.ev-legend .dot.g { background: var(--good); }
.ev-legend .dot.a { background: var(--accent); }
.ev-legend .tick { width: 2px; height: 11px; background: #c2c7cf; display: inline-block; margin-right: 5px; vertical-align: middle; }
.ev-legend .mark { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.ev-mon { font-size: 11px; fill: var(--ink-2); font-family: var(--sans); }
.ev-mon.cur { fill: var(--accent); font-weight: 600; }
.ev-foot { font-size: 11px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 11px; margin: 4px 0 0; }

/* ---------- About ---------- */
.about-block { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.about-block h3 { color: var(--ink); font-size: 14px; }
.about-block ul { padding-left: 20px; }
.about-block li { margin: 4px 0; color: var(--ink-2); }

.foot { text-align: center; color: var(--ink-3); font-size: 11.5px; padding: 28px 20px 44px; }
.foot-link { color: var(--ink-3); text-decoration: none; border-bottom: 1px dotted var(--ink-3); margin-left: 6px; cursor: pointer; }
.foot-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* tooltip */
.tip { border-bottom: 1px dotted var(--ink-3); cursor: help; }

/* 编辑态表单高亮 + 提示条 */
.form-card.editing { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.edit-banner {
  background: var(--accent-soft); color: var(--accent-2); font-size: 12px; font-weight: 600;
  border: 1px solid #c9d6ee; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px;
}

/* 空状态引导按钮组 */
.guide-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* 市场上下文提示 */
.ctx-note {
  background: #fbfbfc; border: 1px solid var(--line-2); border-left: 2px solid var(--warn); color: var(--ink-2);
  border-radius: 0 6px 6px 0; padding: 10px 14px; font-size: 12px; line-height: 1.6; margin-bottom: 14px;
}

/* 操作反馈 toast */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(15,23,42,.24);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 场景一：我的需求列表（紧凑 + 比对为主）---------- */
.list-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 20px 2px 12px; }
.list-head h3 { font-size: 14px; }
.list-head .list-sub { font-size: 11.5px; color: var(--ink-3); }

/* 卡片左侧状态色条：一眼看哪些需要行动 */
.watch-card.lv-good  { box-shadow: inset 3px 0 0 var(--good); }
.watch-card.lv-warn  { box-shadow: inset 3px 0 0 var(--warn); }
.watch-card.lv-watch { box-shadow: inset 3px 0 0 var(--accent); }

/* 顶部操作建议条（最醒目：当下要不要动手） */
.wc-action { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.wc-act-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wc-act-badge { font-weight: 600; font-size: 13.5px; padding: 4px 12px; border-radius: 6px; border: 1px solid; }
.lv-good  .wc-act-badge { color: var(--good);   background: #eaf6ef; border-color: #cbe4d7; }
.lv-warn  .wc-act-badge { color: var(--warn);   background: #fbf3e5; border-color: #e7d9bd; }
.lv-watch .wc-act-badge { color: var(--accent); background: var(--accent-soft); border-color: #c9d6ee; }
.wc-act-hint { font-size: 12px; color: var(--ink-3); }
.lv-good .wc-act-hint { color: var(--good); }
.wc-act-route { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.wc-action .wc-actions { margin-left: auto; display: flex; gap: 6px; }
.wc-act-desc { margin-top: 8px; font-size: 13px; color: var(--ink); line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.wc-desc-line { display: flex; align-items: baseline; gap: 8px; }
.wc-desc-tag { flex: none; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 4px; line-height: 1.6; }
.wc-desc-tag.now { background: #eef1f5; color: var(--ink-2); }
.wc-desc-tag.fc { background: #efeafa; color: #6d55c7; }

/* 左右分栏：左=我的需求，右=当前情况·解读 */
.wc-cols { display: grid; grid-template-columns: 220px 1fr; }
.wc-left { padding: 14px 16px; border-right: 1px solid var(--line); background: #fcfcfd; }
.wc-right { padding: 14px 16px; }
.col-h { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 11px; }
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 12.5px; }
.kv-list dt { color: var(--ink-3); white-space: nowrap; }
.kv-list dd { margin: 0; color: var(--ink); font-weight: 500; }

.cmp-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.cmp-lab { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: 5px; }
.cmp-now b, .cmp-tgt b { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.cmp-tgt b { color: var(--accent); }
.cmp-unit { font-size: 11px; color: var(--ink-3); }
.cmp-arrow { color: var(--ink-3); font-size: 14px; }
.cmp-status { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cmp-status.ok { color: var(--good); }
.cmp-status.wait { color: var(--warn); }
.cmp-status.muted { color: var(--ink-3); font-weight: 500; }
.cmp-track { position: relative; height: 6px; border-radius: 3px; background: #eef0f3; margin: 16px 0 7px; }
.cmp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); opacity: .3; border-radius: 3px; }
.cmp-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); }
.cmp-tick::after { content: '目标'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--accent); white-space: nowrap; }
.cmp-foot { font-size: 11px; color: var(--ink-3); }

.sig-strip { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 0 0; }

/* 图表 hover 浮层（日期 + 数值） */
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: #222b38; color: #fff; border-radius: 6px; padding: 5px 8px;
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15,23,42,.26);
}
.chart-tip .ct-date { color: #b9c4d4; font-family: var(--mono); font-size: 10.5px; }
.chart-tip .ct-val { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.hv-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 2; opacity: .55; pointer-events: none; }
.hv-dot { fill: var(--accent); stroke: #fff; stroke-width: 1.2; pointer-events: none; }
svg[data-hover] { cursor: crosshair; }
.msr-spark svg[data-hover] { cursor: crosshair; }

/* 右栏整合折线图 */
.yc-svg { width: 100%; height: auto; display: block; margin-top: 10px; }
.yc-lab { font-size: 9.5px; font-family: var(--mono); }
.yc-lab.hi { fill: var(--bad); }
.yc-lab.lo { fill: var(--good); }
.yc-lab.tgt { fill: var(--accent); }
.yc-cur { font-size: 10.5px; font-family: var(--mono); fill: var(--accent); font-weight: 600; }
.yc-mon { font-size: 9px; fill: var(--ink-3); font-family: var(--sans); }
.yc-ref { fill: none; }
.yc-ref.hi { stroke: var(--bad); }
.yc-ref.lo { stroke: var(--good); }
.yc-ref.tgt { stroke: var(--accent); }
.yc-ref.rc { stroke-opacity: .5; }          /* 近期线：更轻 */
.yc-lab.rc { fill-opacity: .75; }            /* 近期标签：稍轻 */
.yc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.yc-legend i.d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.yc-legend i.ln { width: 15px; height: 0; border-top: 2px solid var(--ink-3); display: inline-block; margin-right: 5px; vertical-align: middle; }
.yc-legend i.ln.hi { border-top-color: var(--bad); }
.yc-legend i.ln.lo { border-top-color: var(--good); }
.yc-legend i.ln.tgt { border-top-color: var(--accent); border-top-style: dashed; }
.yc-legend i.ln.yr { border-top-width: 2.5px; }              /* 年内：粗、重 */
.yc-legend i.ln.rc { border-top-width: 1px; opacity: .55; }  /* 近期：细、轻 */
.yc-legend i.sw { width: 13px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.yc-legend i.sw.warn { background: #f5e2c0; }
.yc-legend i.sw.info { background: #dbe8f6; }
.yc-tgt-arrow { fill: var(--accent); }
.yc-legend i.tgt-mark { width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 6px solid var(--accent); display: inline-block; margin-right: 5px; vertical-align: middle; }
.yc-legend i.ln.fc { border-top: 0; height: 0; border-top: 2px dotted #6d55c7; }
.yc-legend i.sw.fc { background: #8b6fd4; opacity: .35; }

/* 未来推演锥（示意，非真实预测） */
.yc-fzone { fill: #f2f0f9; }                 /* 推演区整体浅底：与左侧实际区（白底）明显区分 */
.yc-zonelab { fill: #7a68b8; font-size: 8.5px; font-family: var(--sans); font-weight: 600; letter-spacing: .05em; }
.yc-fc-band { fill: #8b6fd4; opacity: .16; }
.yc-fc-line { stroke: #6d55c7; stroke-width: 1.6; stroke-dasharray: 2 3; stroke-linejoin: round; stroke-linecap: round; }
.yc-fc-dot { fill: #6d55c7; }
.yc-fc-lab { fill: #6d55c7; font-size: 9.5px; font-family: var(--mono); font-weight: 600; }
.yc-now { stroke: #7a68b8; stroke-width: 1.3; opacity: .85; }
.yc-nowpill { fill: #6d55c7; }
.yc-nowlab { fill: #fff; font-size: 8.5px; font-weight: 600; font-family: var(--sans); }
.yc-mon.fut { fill: #7a68b8; font-weight: 600; }
.yc-hz { stroke: #6d55c7; stroke-width: 1; stroke-dasharray: 4 2; opacity: .6; }
.yc-hzlab { fill: #6d55c7; font-size: 8.5px; font-family: var(--sans); }
.fc-note { margin-top: 8px; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); background: #f6f4fb; border: 1px solid #e4def0; border-radius: 6px; padding: 6px 9px; }
.fc-note b { color: #5a45b0; font-weight: 600; }

/* ---------- Responsive ---------- */
/* 窄屏：行情侧栏落到主区下方，通栏显示 */
@media (max-width: 1040px) {
  .layout { flex-direction: column; }
  .market-side { width: 100%; position: static; }
  .ms-panel { max-height: none; }
  .market-side.collapsed .ms-expand {
    writing-mode: horizontal-tb; letter-spacing: .04em;
    width: 100%; padding: 10px; justify-content: center;
  }
}
@media (max-width: 640px) {
  .empty-guide { grid-template-columns: 1fr; }
  .sum2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; min-height: 0; gap: 10px 24px; padding: 10px 14px; }
  .honesty-inner { padding: 8px 14px; flex-wrap: wrap; }
  .hb-fetched { margin-left: 0; }
  .wc-cols { grid-template-columns: 1fr; }
  .wc-left { border-right: none; border-bottom: 1px solid var(--line); }
  .top-tag { display: none; }
  .brand-sub { display: none; }
  .layout { padding: 16px 14px; }
  .hero .h-value { font-size: 28px; }
  .meta-banner .mb-item { border-right: none; border-bottom: 1px solid var(--line); }
}
