/* 深色终端风。红涨绿跌（A 股习惯，与欧美相反，D21）。 */
:root {
  --bg: #0f1216;
  --panel: #161b22;
  --panel-2: #1c222b;
  --line: #262e38;
  --text: #e6e9ee;
  --muted: #8b96a5;
  --up: #ff4d4f;
  --down: #16c47f;
  --accent: #4c8dff;
  --warn: #f5a623;
  --radius: 10px;
  --workspace-width: 1560px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; }
h3 { font-size: 13px; margin-bottom: 6px; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.muted { color: var(--muted); }
.hidden { display: none !important; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.warn { color: var(--warn); }

.position-sync { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); min-width: 0; }
.position-sync .card-head { flex-wrap: wrap; }
.position-sync h3 { margin: 0; }
.sync-notice { padding: 12px; border: 1px solid rgba(245,166,35,.35); background: rgba(245,166,35,.06); border-radius: 8px; color: var(--warn); }
.sync-history { max-height: 320px; margin: 12px 0; }
.sync-history td:first-child { font: 11px/1.6 ui-monospace, monospace; }
.sync-confirm { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; }
.sync-confirm input { flex: 0 0 auto; width: auto; margin-top: 5px; }
.sync-ids { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .position-sync .row-actions { width: 100%; }
  .position-sync .row-actions button { flex: 1 1 145px; }
}

/* 可信度只用蓝/橙表达核验状态，不与红涨绿跌混用。 */
.quality-item { border-top: 1px solid var(--line); padding: 10px 0; min-width: 0; overflow-wrap: anywhere; }
.quality-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.quality-item p { margin: 4px 0; font-size: 12px; }
.quality-meta { color: var(--muted); font-size: 11px !important; }
.quality-impact { color: #bdcde3; }
.quality-context { margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--panel); }
.quality-context .quality-item { padding: 6px 0; }
.quality-scheduler { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.quality-scheduler summary { cursor: pointer; font-size: 12px; }
.journal-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.experiment-row { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.experiment-row p { margin: 4px 0; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(15, 18, 22, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--down); box-shadow: 0 0 8px var(--down); }
.meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12px; }
.session-meta, .topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-meta { gap: 12px; font-variant-numeric: tabular-nums; }
.topbar-actions .quiet { color: var(--muted); }
@media (min-width: 1600px) {
  .topbar { padding-inline: max(24px, calc((100% - var(--workspace-width)) / 2 + 24px)); }
}

.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.live { color: var(--down); border-color: rgba(22,196,127,.4); }
.badge.partial { color: var(--warn); border-color: rgba(245,166,35,.4); }
.badge.demo { color: var(--accent); border-color: rgba(76,141,255,.4); }

/* ---------------- 按钮 ---------------- */
button {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 6px 12px; transition: .15s;
}
button:hover { border-color: #3a4553; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex; align-items: center; gap: 4px; padding: 10px 24px 0;
  max-width: var(--workspace-width); margin: 0 auto; overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.nav-group { flex: 0 0 auto; color: #a1adbc; font-size: 10px; letter-spacing: .1em; padding: 0 6px; }
.nav-divider { border-left: 1px solid var(--line); margin-left: 8px; padding-left: 14px; }
.tab {
  flex: 0 0 auto; white-space: nowrap;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 12px; border-radius: 0;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); background: rgba(76,141,255,.07); }

main { padding: 22px 24px 40px; max-width: var(--workspace-width); margin: 0 auto; }
.tab-panel { display: none; min-width: 0; }
.tab-panel.active { display: block; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; color: #91a5bf; font-size: 10px; letter-spacing: .14em; }
.page-head h1 { font-size: 25px; letter-spacing: .02em; line-height: 1.4; }
.page-intro { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.page-tag { color: var(--muted); font-size: 11px; white-space: nowrap; }
.page-head > button { flex: 0 0 auto; font-size: 12px; }
.workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.workflow-step { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; background: transparent; min-width: 0; }
.step-no { color: #91b8ff; font: 12px ui-monospace, Consolas, monospace; }
.workflow-step strong { display: block; font-size: 13px; font-weight: 500; }
.workflow-step small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.step-arrow { margin-left: auto; color: var(--muted); }
.workflow-step:hover { background: var(--panel); border-color: var(--accent); }
@media (max-width: 1100px) {
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { position: relative; padding: 12px; gap: 8px; }
  .brand { font-size: 14px; }
  .meta { width: 100%; gap: 10px; }
  .session-meta { width: 100%; gap: 8px; }
  .topbar-actions { width: 100%; gap: 6px; }
  .topbar-actions button { padding: 6px 10px; }
  .topbar-actions .quiet { margin-left: auto; }
  .tabs { padding: 8px 12px 0; }
  .tab { padding: 10px; }
  .nav-group { font-size: 10px; }
  .nav-divider { margin-left: 4px; padding-left: 10px; }
  main { padding: 18px 12px 28px; }
  .page-head { align-items: flex-start; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
  .page-head h1 { font-size: 22px; }
  .page-tag { display: none; }
  .workflow { gap: 6px; margin-bottom: 14px; }
  .workflow-step { padding: 10px 8px; gap: 7px; align-items: flex-start; }
  .workflow-step small { font-size: 10px; }
  .step-arrow { display: none; }
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.card, .grid-2 > *, .grid-3 > *, .detail-wrap > * { min-width: 0; }
.card { overflow-wrap: anywhere; }
.card > h2 + .hint, .card-head + .hint { margin-bottom: 12px; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* ---------------- 指数卡 ---------------- */
.idx {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.idx .name { color: var(--muted); font-size: 12px; }
.idx .price { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.idx .pct { font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------------- 键值行 ---------------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed rgba(38,46,56,.7); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); flex: 0 0 auto; }
/* 数据源那一行可能是 "tencent×2 / eastmoney×2 / 失败:eastmoney×1" 这种长串，
   不换行会顶穿卡片，所以要允许在任意位置断行。 */
.kv .v { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; min-width: 0; }
/* 长文本行（降级说明这类）：左右两列挤在一行会把「缺了什么」和「影响什么」
   混成一段难读的流水账，改成上下块状。 */
.kv.block { display: block; padding: 9px 0 2px; border-bottom: none;
  border-top: 1px dashed rgba(38,46,56,.7); margin-top: 3px; }
.kv.block .k { display: block; margin-bottom: 2px; }
.kv.block .v { display: block; text-align: left; line-height: 1.5; }

/* 仓位条 */
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin: 8px 0 2px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar > i.over { background: var(--up); }

/* ---------------- 持仓表 ---------------- */
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; scrollbar-width: thin; scrollbar-color: #3a4553 var(--panel); }
.table-scroll:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel-2); }

.chip {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid transparent; white-space: nowrap;
}
.chip.Buy { color: #ff6b6d; background: rgba(255,77,79,.12); border-color: rgba(255,77,79,.3); }
.chip.Overweight { color: #ff9f6b; background: rgba(255,138,76,.12); border-color: rgba(255,138,76,.3); }
.chip.Hold { color: #c3ccd8; background: rgba(139,150,165,.12); border-color: rgba(139,150,165,.3); }
.chip.Underweight { color: #6fd3a5; background: rgba(76,195,138,.12); border-color: rgba(76,195,138,.3); }
.chip.Sell { color: #16c47f; background: rgba(22,196,127,.12); border-color: rgba(22,196,127,.35); }
.chip.REVIEW { color: var(--warn); background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.35); }
.chip.act { background: var(--panel-2); border-color: var(--line); color: var(--text); }

/* ---------------- 详情 ---------------- */
.detail-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .detail-wrap { grid-template-columns: 1fr; } }
.radar { width: 100%; height: 260px; }
.evidence { display: grid; gap: 10px; }
.notes { margin: 0; padding-left: 18px; color: #c9d1da; }
.notes li { margin: 3px 0; }
.order-hint {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; line-height: 1.7; white-space: pre-wrap;
  margin: 0; color: #c9d1da; font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------------- 编辑表 ---------------- */
.edit-table input {
  width: 100%; min-width: 72px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 5px 8px; font: inherit; font-variant-numeric: tabular-nums;
}
.edit-table input:focus { outline: none; border-color: var(--accent); }
.edit-table td { padding: 5px 4px; }
.icon-btn { padding: 4px 8px; color: var(--muted); }

/* ---------------- 设置表单 ---------------- */
.section { margin-bottom: 20px; }
/* 第一个分组紧贴卡片说明文字，需要一点上手距 */
.section:first-of-type { margin-top: 14px; }
.section > h3 {
  color: var(--text); font-size: 13px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field input, .field select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 6px 9px; font: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }

/* ---------------- 设置页行内控件（敏感性回放） ---------------- */
.inline-input {
  width: auto; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 6px 9px; font: inherit;
}
.inline-input:focus { outline: none; border-color: var(--accent); }

/* ---------------- 提示 ---------------- */
.banner {
  border: 1px solid rgba(76,141,255,.35); background: rgba(76,141,255,.08);
  color: #a9c6ff; border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 12px; font-size: 13px;
}
/* 停用判据已触发：用橙色而不是红色。红色留给「止损失守」这类必须立刻动作的事，
   停用判据是「别再开新仓」，语义不同，颜色也不该混 */
.banner.bad {
  border-color: rgba(196,123,58,.45); background: rgba(196,123,58,.10); color: #e0a86a;
}
.banner.warn {
  border-color: rgba(150,150,160,.30); background: rgba(150,150,160,.07); color: var(--muted);
}
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 18px; border-radius: 20px; z-index: 50; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: 90vw;
}
.toast.err { border-color: rgba(255,77,79,.5); color: #ffb3b4; }

/* ---------------- 登录 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9,11,14,.96);
}
.login-card {
  width: min(340px, 88vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px; text-align: center;
}
.login-card h1 { font-size: 18px; margin-bottom: 4px; }
.login-card p { margin: 10px 0 0; font-size: 12px; }
.login-card input {
  width: 100%; margin: 16px 0 12px; text-align: center; letter-spacing: .4em;
  font-size: 20px; padding: 10px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); border-radius: 8px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { width: 100%; }
#login-hint:not(:empty) { color: #ff9a9b; }

.foot {
  text-align: center; color: #5c6675; font-size: 11px;
  padding: 0 16px 24px; max-width: var(--workspace-width); margin: 0 auto;
}

/* ================================================================
   7 页看板新增组件
   注意：红绿（.up/.down）只表示涨跌，不表示好坏。
   系统状态一律用 .ok（蓝）/ .bad（橙），避免「绿色=成功」和
   「绿色=下跌」在同一屏里互相干扰。
   ================================================================ */

.ok { color: var(--accent); }
.bad { color: var(--warn); }
.small { font-size: 12px; font-weight: 400; }

/* ---------------- ① 市场状态条 ---------------- */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.strip-cell {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.strip-cell .k { color: var(--muted); font-size: 11px; }
.strip-cell b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip-cell > span:last-child { font-size: 11px; color: var(--muted); }
.strip-cell > span:last-child.up { color: var(--up); }
.strip-cell > span:last-child.down { color: var(--down); }

/* ---------------- 图表容器 ---------------- */
.chart-lg { width: 100%; height: 380px; }
.chart-md { width: 100%; height: 220px; }
@media (max-width: 760px) {
  .chart-lg { height: 300px; }
  .chart-md { height: 180px; }
}
.chart-lg > .empty, .chart-md > .empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 0 20px; text-align: center; line-height: 1.7;
}

/* ---------------- 象限标签 ---------------- */
.quad { font-size: 11px; padding: 1px 8px; border-radius: 20px; border: 1px solid transparent; }
.quad.q-main { color: #ff6b6d; background: rgba(255,77,79,.12); border-color: rgba(255,77,79,.3); }
.quad.q-fake { color: #f7b955; background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.3); }
.quad.q-build { color: #7aa9ff; background: rgba(76,141,255,.12); border-color: rgba(76,141,255,.3); }
.quad.q-weak { color: #6fd3a5; background: rgba(22,196,127,.12); border-color: rgba(22,196,127,.3); }

/* ---------------- ⑮ 漏斗 ---------------- */
.funnel { display: grid; gap: 6px; }
.funnel-row {
  display: grid; grid-template-columns: 88px 1fr 92px;
  gap: 10px; align-items: center; font-size: 12px;
}
.funnel-row .lbl { color: var(--muted); }
.funnel-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-track { height: 20px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.funnel-track > i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, rgba(76,141,255,.9), rgba(76,141,255,.35));
  transition: width .3s ease;
}
.funnel-note {
  color: var(--muted); font-size: 11px; line-height: 1.6;
  margin: 0 0 4px 98px;
}
@media (max-width: 760px) {
  .funnel-row { grid-template-columns: 70px 1fr 76px; }
  .funnel-note { margin-left: 80px; }
}

/* ---------------- ⑯ 候选卡片 ---------------- */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.cand { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel-2); }
.cand-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand-head b { font-size: 15px; }
.cand-price {
  font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
  margin: 6px 0 8px; display: flex; align-items: baseline; gap: 8px;
}
.cand-price .small { font-size: 13px; }
.cand-grid-2 {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 12px;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.cand-grid-2 .k { color: var(--muted); }
.cand-reason {
  color: var(--muted); font-size: 11px; line-height: 1.7;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(38,46,56,.9);
}
.cand-btns { margin-top: 10px; }
.cand-btns button { padding: 4px 10px; font-size: 12px; }

.gate-help {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.gate-help h3 { margin-bottom: 6px; }

/* ---------------- ⑱⑲⑳ 条件单 ---------------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  padding: 3px 10px; font-size: 12px; border-radius: 20px;
  background: transparent; color: var(--muted);
}
.chip-btn.active { background: var(--panel-2); color: var(--text); border-color: #3a4553; }

.order-list { display: grid; gap: 8px; }
.order-row {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: var(--panel-2);
}
.order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.order-code { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.order-meta { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.7; }
.order-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tip-dot { display: inline-block; margin-left: 4px; width: 14px; height: 14px;
  line-height: 14px; text-align: center; border-radius: 50%;
  background: var(--muted, #888); color: var(--bg, #fff); font-size: 10px;
  cursor: help; user-select: none; }
.manual-trade { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) 80px 90px 80px 140px minmax(90px, 1fr) auto;
  gap: 6px; align-items: center; margin-top: 8px; }
.manual-trade input, .manual-trade select { padding: 5px 8px; font-size: 13px; }
@media (max-width: 1100px) {
  .manual-trade { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .manual-trade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 条件单新建：7 列横排（代码/类型/触发价/激活价/回落%/数量/按钮） */
.rt-add { display: grid; gap: 6px; align-items: center; margin-top: 8px;
  grid-template-columns: 110px 1.6fr 110px 110px 80px 90px auto; }
.rt-add input, .rt-add select { padding: 5px 8px; font-size: 13px; }
.rt-oco { grid-template-columns: 110px repeat(2, minmax(0, 1fr)) minmax(150px, 1fr) auto; }
.rt-add button { white-space: nowrap; }
.rt-say { display: flex; gap: 6px; margin-top: 8px; align-items: stretch; }
.rt-say textarea { flex: 1; padding: 6px 9px; font-size: 13px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-family: inherit; resize: vertical; }
@media (max-width: 860px) {
  .rt-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-say { flex-direction: column; }
}
.order-btns button { padding: 3px 10px; font-size: 12px; }

.stat-chip {
  font-size: 11px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.stat-chip.pending { color: var(--accent); border-color: rgba(76,141,255,.45); }
.stat-chip.executed { color: var(--text); border-color: #3a4553; }
.stat-chip.ordered { color: #7aa9ff; border-color: rgba(76,141,255,.3); }
.stat-chip.skipped { color: var(--warn); border-color: rgba(245,166,35,.4); }
.stat-chip.expired { color: #5c6675; }

/* AI 复盘留档（#10）：每次调用的原文都在这，失败也留一条 */
.llm-hist { margin-top: 10px; }
.llm-hist > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.llm-item { border-top: 1px solid var(--line); padding: 8px 0; }
.llm-item-head { display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.llm-item-body { font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  margin-top: 4px; color: var(--text); }

/* 研究区折叠（2026-11-06 待办）：三张长期统计卡默认折叠，点开即看。
   折叠态它就是一张普通卡片；展开后内部三张子卡去掉下边距，避免叠边框。 */
.research-fold { padding-top: 12px; padding-bottom: 12px; }
.research-fold > summary { cursor: pointer; font-weight: 600; user-select: none;
  list-style: none; }
.research-fold > summary::-webkit-details-marker { display: none; }
.research-fold > summary::before { content: '▸ '; color: var(--muted); }
.research-fold[open] > summary::before { content: '▾ '; }
.research-fold[open] > summary { margin-bottom: 12px; }
.research-fold .grid-2 .card { margin-bottom: 0; }

/* 站内信（#3）：推送的落地页 */
.inbox-item { border-top: 1px solid var(--line); padding: 8px 0; }
.inbox-item:first-child { border-top: none; }
.inbox-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.inbox-item .notes { margin: 4px 0 0; font-size: 13px; }

/* 推理过程（两段式第一段的产物）：默认折叠，点开看模型怎么想的。
   不给它加边框和背景色块——它是正文的附属说明，视觉上不该比结论更重。 */
.llm-think { margin: 8px 0 2px; }
.llm-think > summary { cursor: pointer; font-size: 12px; color: var(--muted);
  list-style: none; padding: 2px 0; }
.llm-think > summary::-webkit-details-marker { display: none; }
.llm-think > summary::before { content: '▸ '; }
.llm-think[open] > summary::before { content: '▾ '; }
.llm-think-body { margin: 6px 0 0; padding: 8px 10px; font-size: 12px;
  line-height: 1.75; white-space: pre-wrap; color: var(--muted);
  background: rgba(38, 46, 56, .38); border-left: 2px solid var(--line);
  border-radius: 3px; max-height: 420px; overflow: auto; }

/* 板块「题材共振」标记（第 6 条：情绪日报 × 板块热力） */
.hot-tag { font-size: 11px; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.hot-tag.confirmed { background: rgba(245, 70, 92, .16); color: #ff8a99; }
.hot-tag.suspect   { background: rgba(154, 167, 184, .16); color: var(--muted); }
.hot-tag.divergent { background: rgba(240, 180, 41, .16); color: #f0b429; }

/* 券商 App 填单参数（原生单）：把我们的价位翻译成券商的几个框。
   折叠起来——它在「我要去券商挂单」那一刻才有用，平时不该占版面。 */
.rt-recipe { margin: 6px 0 2px; }
.rt-recipe > summary { cursor: pointer; font-size: 12px; color: var(--muted);
  list-style: none; padding: 2px 0; }
.rt-recipe > summary::-webkit-details-marker { display: none; }
.rt-recipe > summary::before { content: '▸ '; }
.rt-recipe[open] > summary::before { content: '▾ '; }
.rt-recipe-body { margin: 6px 0 0; padding: 8px 10px; font-size: 12px;
  background: rgba(38, 46, 56, .38); border-left: 2px solid var(--line);
  border-radius: 3px; }
.rt-field { display: flex; gap: 8px; align-items: baseline; padding: 2px 0;
  flex-wrap: wrap; }
.rt-field > span { color: var(--muted); min-width: 92px; }
.rt-field > b { color: var(--text); font-weight: 600; }
.rt-field > i { color: #6b7686; font-style: normal; font-size: 11px; }

/* 表单与滚动区在窄屏内收缩，不把整页撑宽。 */
.rt-add > *, .manual-trade > *, .rt-say > *, .row > *, .row-actions > * { min-width: 0; }
.rt-add input, .rt-add select, .manual-trade input, .manual-trade select {
  width: 100%; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; font-family: inherit;
}
.rt-say textarea { min-width: 0; }
.order-hint { overflow-wrap: anywhere; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row input[type="checkbox"] { accent-color: var(--accent); }
.row select, #broker-cookie {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font: inherit; max-width: 100%;
}
:root :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #a3c5ff; outline-offset: 3px;
}
@media (max-width: 760px) {
  .card { padding: 13px 12px; }
  .card-head > *, .row-actions { max-width: 100%; }
  .row-actions .inline-input { max-width: 100%; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell b { font-size: 16px; }
  .research-fold > summary .muted { display: block; font-size: 11px; font-weight: 400; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
