/* ============================================================
   期货交易复盘系统 — 样式表
   ============================================================ */

:root {
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, .14);
  --up: #f5494b;          /* 盈利（红）*/
  --up-soft: rgba(245, 73, 75, .14);
  --down: #17b26a;        /* 亏损（绿）*/
  --down-soft: rgba(23, 178, 106, .14);
  --warn: #f0a33a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.10);
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #121820;
  --panel: #151b24;
  --panel-2: #1a212b;
  --border: #242c38;
  --border-soft: #1c232d;
  --text: #e6edf3;
  --text-2: #a6b0bd;
  --muted: #6e7a88;
  --hover: #1e2733;
  --input-bg: #0f151d;
  --grid: #202836;
}

html[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e2e8f0;
  --border-soft: #eef2f7;
  --text: #111827;
  --text-2: #475569;
  --muted: #8a94a6;
  --hover: #f1f5f9;
  --input-bg: #ffffff;
  --grid: #e8edf3;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; }
a { color: var(--accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ------------------------------ 登录页 ------------------------------ */

.auth-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 600px at 15% -10%, var(--accent-soft), transparent 65%), var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px 28px 22px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.auth-brand h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.auth-brand p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 18px 0 0; }
.auth-error {
  color: var(--up); font-size: 12.5px; min-height: 18px; margin: 2px 0 8px;
}

/* 短信验证码：输入框 + 获取按钮同一行 */
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; padding: 0 12px; font-size: 12.5px; }
.code-tip { display: block; margin-top: 7px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.code-tip.warn { color: var(--warn, #b8860b); }
.code-tip b { font-weight: 600; }
/* 登录图形验证码 */
.captcha-img { flex: 0 0 auto; width: 136px; height: 44px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); display: block; user-select: none; }
.captcha-img:active { transform: scale(0.97); }
#authCaptcha { text-transform: uppercase; letter-spacing: 6px; }
#authBack { margin-top: 8px; }

/* ------------------------------ 表单 ------------------------------ */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea, .textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.field input::placeholder, .input::placeholder, .textarea::placeholder { color: var(--muted); }
input[type="date"], input[type="datetime-local"], input[type="time"] { color-scheme: dark; }
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="datetime-local"],
html[data-theme="light"] input[type="time"] { color-scheme: light; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  flex: 1; background: transparent; border: 0; padding: 9px 4px; cursor: pointer;
  color: var(--text-2); font-weight: 500; transition: .15s;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--hover); }
.seg button.on { background: var(--accent); color: #fff; }
.seg button.on.buy-on { background: var(--up); }
.seg button.on.sell-on { background: var(--down); }

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 15px; cursor: pointer;
  font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #3d7ded; border-color: #3d7ded; }
.btn-danger { color: var(--up); border-color: var(--border); }
.btn-danger:hover { background: var(--up-soft); border-color: var(--up); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* 持仓消息雷达：铃铛 + 未读角标（v1.11.0） */
.news-btn { position: relative; }
.news-btn svg { width: 18px; height: 18px; fill: currentColor; }
.news-btn.has-news { color: var(--warn); }
.news-dot {
  position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--up); color: #fff; font-size: 9.5px; font-style: normal;
  line-height: 15px; text-align: center; font-weight: 600; box-shadow: 0 0 0 2px var(--panel);
}

.news-list { display: flex; flex-direction: column; gap: 2px; }
.news-row {
  display: flex; gap: 10px; padding: 10px 10px; border-radius: var(--radius-sm); align-items: flex-start;
}
.news-row:hover { background: var(--panel-2); }
.news-row + .news-row { border-top: 1px solid var(--border-soft); border-radius: 0; }
.news-time { font-size: 11.5px; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.news-lv {
  font-size: 10.5px; padding: 1px 6px; border-radius: 5px; white-space: nowrap; margin-top: 1px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.news-lv.high { background: var(--up-soft); color: var(--up); border-color: transparent; }
.news-lv.mid { background: var(--warn); background: rgba(240,163,58,.14); color: var(--warn); border-color: transparent; }
.news-main { flex: 1; min-width: 0; }
.news-title { font-size: 13px; line-height: 1.6; color: var(--text); text-decoration: none; display: block; }
.news-title:hover { color: var(--accent); }
.news-meta { margin-top: 4px; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.news-tag { color: var(--text-2); }
.news-tag b { color: var(--up); font-weight: 600; }
.news-empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }

.chip {
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 12.5px;
  transition: .15s; white-space: nowrap;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ------------------------------ 布局 ------------------------------ */

.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 208px; flex-shrink: 0; background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: transparent; border: 0; cursor: pointer; color: var(--text-2); text-align: left;
  font-weight: 500; transition: .15s; width: 100%;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.who { font-size: 12px; color: var(--muted); padding: 0 8px; line-height: 1.6; }
.who b { color: var(--text-2); font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.daterange { display: flex; gap: 6px; }
.quick-range { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.quick-range .chip { padding: 5px 10px; font-size: 12px; }
.quick-range .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.quick-range::after {
  content: ''; width: 1px; height: 20px; background: var(--border);
  margin: 0 4px 0 3px; align-self: center;
}
.ic-moon { display: none; }
html[data-theme="dark"] .ic-sun { display: none; }
html[data-theme="dark"] .ic-moon { display: block; }

.content { flex: 1; overflow-y: auto; padding: 22px; scroll-behavior: smooth; }
.page { max-width: 1560px; margin: 0 auto; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 卡片 ------------------------------ */

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); letter-spacing: .4px; white-space: nowrap; }
.card-head .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 760px) {
  /* 窄屏：标题和按钮一行，说明文字整行下移，别把标题挤成竖排 */
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .card-head .hint { flex: 1 1 100%; order: 9; }
}

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); margin-bottom: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.kpi .value { font-size: 22px; font-weight: 700; font-family: var(--mono); letter-spacing: -.4px; line-height: 1.15; }
.kpi .sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
/* 收益率下面的「本金从哪来」：小一号、可悬停看口径 */
.kpi .kpi-cap { display: block; margin-top: 3px; font-size: 10.5px; opacity: .9; cursor: help; }
.kpi.accent-line { position: relative; overflow: hidden; }
.kpi.accent-line::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.tag {
  display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); margin-right: 4px;
}
.tag.long { color: var(--up); border-color: rgba(245,73,75,.4); background: var(--up-soft); }
.tag.short { color: var(--down); border-color: rgba(23,178,106,.4); background: var(--down-soft); }
.tag.open { color: var(--accent); border-color: rgba(76,141,255,.4); background: var(--accent-soft); }
.tag.warn { color: var(--warn); border-color: rgba(240,163,58,.4); background: rgba(240,163,58,.12); }
.tag.seed { color: var(--warn); border-color: rgba(240,163,58,.4); background: rgba(240,163,58,.1); }
/* 回合内动作：开仓 → 加仓（未清零继续开）→ 减仓（只平一部分）→ 平仓（清零结束） */
.tag.add { color: var(--accent); border-style: dashed; border-color: rgba(76,141,255,.5); background: transparent; }
.tag.reduce { color: var(--warn); border-color: rgba(240,163,58,.45); background: rgba(240,163,58,.1); }
/* 夜盘成交标记：21:00 之后属于下一个交易日，列表排在该日 9:00 日盘之前 */
.tag.night {
  padding: 0 4px; font-size: 10px; line-height: 15px; margin-right: 0; margin-left: 2px;
  color: #8b7bd8; border-color: rgba(139,123,216,.45); background: rgba(139,123,216,.12);
}
/* 关联成交明细里的「期初持仓」行：不是真实成交，淡底以示区分 */
tbody tr.seed-row td { background: color-mix(in srgb, var(--warn) 5%, transparent); }
tbody tr.seed-row td:first-child { box-shadow: inset 2px 0 0 rgba(240,163,58,.5); }

/* ------------------------------ 表格 ------------------------------ */

.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2; background: var(--panel-2); text-align: left;
  padding: 9px 11px; font-weight: 600; color: var(--text-2); font-size: 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 9px 11px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-family: var(--mono); }
/* 多笔成交合并的手数：只显示手数，笔数收在悬浮提示里，虚线提示「可悬浮」 */
td.num.merge-lots { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.empty { text-align: center; color: var(--muted); padding: 42px 12px; font-size: 13px; }

.rating { color: var(--warn); letter-spacing: 1px; font-size: 12px; }

/* ------------------------------ 多选 ------------------------------ */

th.sel, td.sel { width: 34px; padding-left: 12px; padding-right: 0; }
th.sel input, td.sel input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
tbody tr.picked { background: var(--accent-soft); }

.sel-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}
.sel-bar b { color: var(--accent); }
.sel-bar .spacer { flex: 1; }

/* ------------------------------ 结算单导入 ------------------------------ */

.page-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}

.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 30px 18px; text-align: center; cursor: pointer;
  background: var(--panel-2); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { font-size: 26px; line-height: 1; margin-bottom: 10px; opacity: .8; }
.dropzone .dz-main { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.dropzone .dz-sub { font-size: 12px; color: var(--muted); line-height: 1.7; }

.import-report { display: grid; gap: 12px; }
.import-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; background: var(--panel-2);
}
.pill b { margin-left: 5px; font-family: var(--mono); }
.pill.good { border-color: rgba(23,178,106,.45); color: var(--down); }
.pill.warn { border-color: rgba(240,163,58,.45); color: var(--warn); }
.pill.info { border-color: var(--accent); color: var(--accent); }

.notice {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 10px 13px; border-radius: 6px; font-size: 12.5px; line-height: 1.75;
}
.notice.warn { border-left-color: var(--warn); background: rgba(240,163,58,.1); }
.notice.danger { border-left-color: var(--up); background: var(--up-soft); }

.mode-list { display: grid; gap: 9px; }
.mode-opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; cursor: pointer; transition: border-color .15s, background .15s;
}
.mode-opt:hover { background: var(--hover); }
.mode-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.mode-opt input { width: auto; margin: 2px 0 0; accent-color: var(--accent); }
.mode-opt .mo-title { font-size: 13px; font-weight: 600; }
.mode-opt .mo-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.65; }

.import-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.mini-table { max-height: 260px; overflow: auto; }

/* ------------------------------ 账户资金（结算单） ------------------------------ */

.acct-grid {
  display: grid; gap: 10px; margin: 4px 0 14px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.acct-item {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.acct-item .ai-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; }
.acct-item .ai-value {
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  letter-spacing: -.3px; line-height: 1.2;
}
.acct-item .ai-value.big { font-size: 19px; }
.acct-item .ai-value.accent { color: var(--accent); }
.warn-text { color: var(--warn); }

.acct-chart { margin-bottom: 14px; }

.acct-foot {
  border-top: 1px solid var(--border); padding-top: 13px;
}
.acct-foot-col { min-width: 0; }
.fee-split { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.acct-empty .empty { font-size: 12.5px; line-height: 1.85; }

.acct-pos { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 13px; }
.pos-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.seg.mini { border-radius: var(--radius-sm); }
.seg.mini button { flex: none; padding: 5px 12px; font-size: 12px; }

.pos-table tfoot td {
  border-top: 1px solid var(--border); border-bottom: 0;
  font-weight: 700; background: var(--panel-2); padding: 9px 12px;
  font-family: var(--mono); font-size: 12.5px;
}
.pos-table tfoot td:first-child { font-family: inherit; }
.pos-table tbody td { white-space: nowrap; }

@media (max-width: 900px) {
  .pos-head-right { gap: 8px; }
}

/* ------------------------------ 出入金记录 ------------------------------ */

.cash-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 复用 .acct-grid 的栅格，只是去掉上面的间距 */
.cash-sum { margin: 12px 0 0; }
.acct-item .ai-sub { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; white-space: pre-line; }
/* 本金基准的口径说明：一句话讲清「期初权益 + 区间净入金」 */
.cash-note { margin: 10px 0 0; font-size: 11px; color: var(--muted); line-height: 1.65; }
.cash-in { color: var(--accent); }
.cash-out { color: var(--warn); }
.cash-fix { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.cash-fix .muted { font-size: 11.5px; }
/* 弹窗里的表单：日期和方向并排，金额独占一行更醒目 */
.cash-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.cash-form .field { margin-bottom: 0; }
.cash-form .field:nth-child(3),
.cash-form .field:nth-child(4),
.cash-form .field:nth-child(5) { grid-column: span 2; }
@media (max-width: 560px) {
  .cash-form { grid-template-columns: 1fr; }
  .cash-form .field:nth-child(3),
  .cash-form .field:nth-child(4),
  .cash-form .field:nth-child(5) { grid-column: auto; }
}


/* ------------------------------ 工具栏 ------------------------------ */

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
}
.toolbar .grow { flex: 1; min-width: 140px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 118px; }
.search { min-width: 200px !important; }

/* ------------------------------ 图表 ------------------------------ */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
.chart .bar-up { fill: var(--up); }
.chart .bar-down { fill: var(--down); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#eqGrad); }
.chart .dot { fill: var(--accent); }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.chart-empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 13px; }

/* 日历热力图（单月） */
.cal-wrap { display: flex; flex-direction: column; gap: 12px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav-group { display: flex; align-items: center; gap: 6px; }
.cal-nav { min-width: 32px; padding: 6px 10px; font-size: 14px; line-height: 1; }
.cal-nav:disabled { opacity: .35; cursor: not-allowed; }
.cal-select { min-width: 138px; padding: 6px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-dow { font-size: 10.5px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell {
  height: clamp(46px, 6.2vw, 72px); border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-family: var(--mono); color: var(--muted); position: relative; cursor: default;
}
.cal-cell.has { color: #fff; border-color: transparent; font-weight: 600; }
.cal-cell.has.flat { background: var(--panel-2); border-color: var(--border-soft); color: var(--text-2); }
.cal-cell.est { outline: 1px dashed rgba(160, 170, 185, .9); outline-offset: -2px; }
/* 夜盘预收：日期还没到，格子里只有上一交易日 21:00 后的夜盘成交 */
.cal-cell.pre { outline: 1px dashed rgba(240, 190, 90, .95); outline-offset: -2px; }
.cal-cell.pre::after {
  content: '夜'; position: absolute; top: 3px; right: 4px;
  font-family: var(--sans, inherit); font-size: 9px; line-height: 1; font-weight: 700;
  padding: 1px 2px; border-radius: 3px;
  background: rgba(0, 0, 0, .3); color: #ffd98a;
}
.cal-cell.hollow {
  border: 1px dashed var(--border);
  color: var(--muted);
  background: repeating-linear-gradient(135deg, rgba(140, 150, 165, .07) 0 6px, transparent 6px 12px);
}
.cal-cell.hollow .amt { font-size: 10px; opacity: .8; }
.cal-cell.wk { opacity: .55; }
.cal-cell.empty-cell { background: transparent; border-color: transparent; }
.cal-cell .d { font-size: 10px; opacity: .85; }
.cal-cell .amt { font-size: 11px; letter-spacing: -.2px; }
.cal-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.cal-summary .pill b { margin-left: 4px; font-family: var(--mono); }
.cal-key { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.cal-key i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.cal-key i.est { background: transparent; border: 1px dashed rgba(160, 170, 185, .9); }
.cal-key i.pre { background: transparent; border: 1px dashed rgba(240, 190, 90, .95); }
.cal-key i.hollow {
  background: repeating-linear-gradient(135deg, rgba(140, 150, 165, .35) 0 3px, transparent 3px 6px);
  border: 1px dashed var(--border);
}
.cal-toolbar .seg.mini button { padding: 5px 10px; font-size: 12px; }

/* 复盘维度：分数拆解 + 改进路径 */
.dim-breakdown { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.bd-item { display: grid; grid-template-columns: 128px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; }
.bd-label { color: var(--muted); display: flex; align-items: baseline; gap: 5px; }
.bd-label i { font-style: normal; font-size: 10.5px; opacity: .7; font-family: var(--mono); }
.bd-track { height: 5px; border-radius: 3px; background: var(--panel-3, rgba(140,150,165,.18)); overflow: hidden; }
.bd-fill { height: 100%; border-radius: 3px; }
.bd-score { font-family: var(--mono); text-align: right; }
.bd-note { grid-column: 2 / 4; font-size: 11px; color: var(--muted); margin-top: -2px; }
.dim-levers { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border-soft); }
.lv-title { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.lv-item { display: flex; gap: 8px; align-items: flex-start; }
.lv-item + .lv-item { margin-top: 8px; }
.lv-idx {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent, #4c8dff); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-family: var(--mono); margin-top: 1px;
}
.lv-body { min-width: 0; }
.lv-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lv-head b { font-size: 12.5px; font-weight: 500; }
.lv-gain { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.lv-how { font-size: 11.5px; color: var(--muted); line-height: 1.65; margin-top: 2px; }

/* 单日详情面板 */
.cal-day-detail {
  margin-top: 4px; padding: 14px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  min-height: 64px;
}
.cal-day-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border-soft);
}
.cal-day-date { font-size: 15px; font-weight: 500; font-family: var(--mono); }
.cal-day-pnl { font-size: 20px; font-weight: 600; font-family: var(--mono); margin-left: auto; }
.cal-day-pnl.up { color: var(--up, #f5494b); }
.cal-day-pnl.down { color: var(--down, #17b26a); }
.cal-day-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.cal-day-badges .tag { font-size: 10.5px; padding: 1px 6px; }
.cal-day-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; }
.cal-day-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.cal-day-row .k { color: var(--muted); }
.cal-day-row .v { font-family: var(--mono); font-weight: 500; }
.cal-day-row .v.up { color: var(--up, #f5494b); }
.cal-day-row .v.down { color: var(--down, #17b26a); }
.cal-day-note {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border-soft);
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
}
.cal-day-empty { font-size: 12.5px; color: var(--muted); }
.cal-cell.has.sel { outline: 2px solid var(--accent, #4c8dff); outline-offset: -2px; }

/* 单日详情：逐合约拆解 */
.cal-day-contracts { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-soft); }
.cd-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.cd-title .muted { font-size: 11.5px; }
.cd-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cd-table th {
  text-align: right; font-weight: 500; font-size: 11px; color: var(--muted);
  padding: 4px 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.cd-table th:first-child, .cd-table td:first-child { text-align: left; }
.cd-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft); text-align: right; font-family: var(--mono); }
.cd-table tbody tr:last-child td { border-bottom: none; }
.cd-table .cd-name { font-family: var(--sans, inherit); }
.cd-table .cd-pos { color: var(--muted); font-size: 11.5px; }
.cd-table .cd-total { font-weight: 600; }
.cd-table .up { color: var(--up, #f5494b); }
.cd-table .down { color: var(--down, #17b26a); }
.cd-note { margin-top: 6px; font-size: 11px; color: var(--muted); }
.cd-stmt { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.cd-stmt b { font-family: var(--mono); }
.cd-stmt .muted { font-size: 11px; }
.cal-cell.has:hover { filter: brightness(1.08); }

@media (max-width: 620px) {
  .cal-cell { height: 42px; }
  .cal-cell .amt { display: none; }
  .cal-toolbar .hint { display: none; }
}

/* 横向对比条 */
.hbar-row { display: grid; grid-template-columns: 108px 1fr 96px 60px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.hbar-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 18px; background: var(--panel-2); border-radius: 4px; overflow: hidden; position: relative; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.hbar-val { text-align: right; font-family: var(--mono); font-weight: 600; }
.hbar-meta { text-align: right; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }

/* ------------------------------ 详情 / 弹窗 ------------------------------ */

.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.modal {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.4); animation: pop .18s ease;
}
.modal.wide { max-width: 960px; }
.modal.xwide { max-width: 1100px; }
.modal.narrow { max-width: 460px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal-foot:empty { display: none; }

/* 登录后的「今日交易箴言」（v1.10.5） */
.tip-card { padding: 4px 2px 2px; }
.tip-quote {
  position: relative; font-size: 19px; line-height: 1.6; font-weight: 600; color: var(--text);
  padding: 2px 0 0 18px;
}
.tip-quote::before {
  content: '"'; position: absolute; left: -2px; top: -12px;
  font-size: 40px; line-height: 1; color: var(--accent); opacity: .35; font-family: Georgia, serif;
}
.tip-note {
  margin: 12px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.8; color: var(--muted);
  border-left: 2px solid var(--border);
}
.tip-meta { display: block; margin-top: 16px; font-size: 11px; color: var(--muted); opacity: .8; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin-bottom: 18px; }
.detail-item .k { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.detail-item .v { font-size: 14px; font-weight: 600; font-family: var(--mono); }

.dl { display: grid; grid-template-columns: 82px 1fr; gap: 8px 12px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ------------------------------ Toast ------------------------------ */

.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 16px; font-size: 13px; box-shadow: var(--shadow);
  animation: slideIn .2s ease; max-width: 340px;
}
.toast.err { border-left-color: var(--up); }
.toast.ok { border-left-color: var(--down); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 90; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar h2 { font-size: 15px; }
  .daterange { display: none; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 84px 1fr 84px; }
  .hbar-meta { display: none; }
}

/* ------------------------------ 监控中心同步 ------------------------------ */

.cf-dialog .field { margin-bottom: 12px; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img {
  height: 38px; width: 108px; object-fit: cover; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.cf-result ul li { margin-bottom: 2px; }

/* ------------------------------ 系统评价 ------------------------------ */

.review-card { margin-bottom: 14px; }
.review-hero {
  display: grid; grid-template-columns: 164px minmax(0, 1fr) 320px;
  gap: 18px; align-items: center; padding: 4px 0 16px;
}
.review-score { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.score-ring {
  width: 108px; height: 108px; border-radius: 50%;
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), var(--border-soft) 0);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--border);
}
.score-inner {
  width: 86px; height: 86px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.score-inner b { font-size: 27px; font-family: var(--mono); line-height: 1; letter-spacing: -1px; }
.score-inner span { font-size: 10.5px; color: var(--muted); }
.review-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.grade-badge, .rel-badge {
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--text-2); white-space: nowrap;
}
.grade-badge.good { color: var(--down); border-color: rgba(23,178,106,.45); background: var(--down-soft); }
.grade-badge.mid { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.grade-badge.warn { color: var(--warn); border-color: rgba(240,163,58,.45); background: rgba(240,163,58,.12); }
.grade-badge.bad { color: var(--up); border-color: rgba(245,73,75,.45); background: var(--up-soft); }
.grade-badge.na, .rel-badge.na { color: var(--muted); }
.rel-badge.good { color: var(--down); }
.rel-badge.warn { color: var(--warn); }
.rel-badge.mid { color: var(--text-2); }
.rel-badge.bad { color: var(--up); }

.review-verdict { min-width: 0; }
.review-verdict .rv-main { margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.65; }
.review-verdict .rv-sub { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.85; }
.review-radar { min-width: 0; }
.review-radar .chart { max-height: 290px; }
.radar-label { font-size: 11.5px; fill: var(--text-2); font-family: var(--sans); font-weight: 500; }
.radar-value { font-size: 11px; font-family: var(--mono); }

.review-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px; padding: 12px 0; border-top: 1px solid var(--border-soft);
}
.rfact { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.rfact .rf-label { display: block; font-size: 11px; color: var(--muted); }
.rfact .rf-value { display: block; font-size: 16px; font-family: var(--mono); line-height: 1.35; letter-spacing: -.3px; }
.rfact .rf-hint { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfact.good .rf-value { color: var(--down); }
.rfact.warn .rf-value { color: var(--warn); }
.rfact.bad .rf-value { color: var(--up); }

.review-dims {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 6px 20px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.dim-row { padding: 6px 0; min-width: 0; }
.dim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dim-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.dim-name i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.dim-score { font-family: var(--mono); font-size: 13px; }
.dim-track { height: 5px; border-radius: 3px; background: var(--border-soft); margin: 6px 0 5px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.dim-comment {
  font-size: 11.5px; color: var(--muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dim-row.na { opacity: .78; }
.dim-row.na .dim-comment { color: var(--warn); }

.review-gap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--muted);
}
.review-gap .tag { margin-right: 0; }

.review-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.review-list li { border-left: 2px solid var(--border); padding-left: 10px; }
.review-list.good li { border-left-color: var(--down); }
.review-list.bad li { border-left-color: var(--up); }
.review-list .rl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; }
.review-list .rl-top b { font-family: var(--mono); font-size: 12.5px; }
.review-list p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

.action-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.action-list li { display: flex; gap: 9px; align-items: flex-start; }
.action-list .act-tag {
  flex-shrink: 0; font-size: 10.5px; padding: 2px 6px; border-radius: 4px; margin-top: 1px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(76,141,255,.4);
}
.action-list .act-tag.p1 { background: var(--up-soft); color: var(--up); border-color: rgba(245,73,75,.4); }
.action-list b { font-size: 12.5px; display: block; line-height: 1.5; }
.action-list p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

@media (max-width: 1180px) {
  .review-hero { grid-template-columns: 150px minmax(0, 1fr); }
  .review-radar { grid-column: 1 / -1; }
  .review-radar .chart { max-height: 250px; }
}
@media (max-width: 640px) {
  .review-hero { grid-template-columns: 1fr; gap: 12px; }
  .review-score { flex-direction: row; justify-content: flex-start; gap: 14px; }
  .review-badges { flex-direction: column; align-items: flex-start; }
  .review-dims { grid-template-columns: 1fr; }
}

/* 表头带解释的列（悬停看说明） */
th.has-tip { cursor: help; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }

/* -------------------- 成交明细：同时间同价合并 -------------------- */

.merge-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; cursor: pointer; user-select: none;
}
.merge-toggle input { accent-color: var(--accent); }

.merge-chip {
  display: inline-block; margin-left: 4px; padding: 1px 5px;
  font-size: 10.5px; font-family: var(--sans); font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(76, 141, 255, .4); border-radius: 4px;
  vertical-align: 1px;
}

tr.fill-group td { background: var(--panel-2); }
tr.fill-child td {
  background: var(--panel); font-size: 12px; color: var(--text-2);
  border-bottom: 1px dashed var(--border-soft);
}
tr.fill-child td:first-child { border-left: 2px solid var(--accent); }
tr.fill-child .mono { font-size: 11.5px; }

/* -------------------- 开仓 / 平仓评分 -------------------- */

.score-pill {
  display: inline-block; min-width: 40px; padding: 1px 6px;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--panel-2); cursor: help;
}

.bar-edit {
  margin: 0 0 16px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.bar-edit > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.bar-edit > summary::-webkit-details-marker { display: none; }
.bar-edit > summary::before {
  content: '▸'; color: var(--muted); font-size: 11px; transition: transform .15s;
}
.bar-edit[open] > summary::before { content: '▾'; }
.bar-edit-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 6px 0; border-top: 1px dashed var(--border-soft); margin-top: 8px;
}
.bar-edit-date { font-size: 12px; color: var(--text-2); min-width: 150px; }
.bar-edit-row label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.bar-edit-row input {
  width: 96px; padding: 4px 7px; font-family: var(--mono); font-size: 12px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 5px;
}
.bar-edit-row input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 640px) {
  .bar-edit-date { min-width: 100%; }
}

/* -------------------- 数据备份 -------------------- */

.bk-list { margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; }
.bk-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 5px 9px; font-size: 11.5px;
  border: 1px solid var(--border-soft); border-radius: 6px; background: var(--panel-2);
}
.bk-row .mono { font-size: 11px; color: var(--text-2); }
.bk-tag {
  padding: 0 6px; font-size: 10.5px; line-height: 1.7; border-radius: 4px;
  color: var(--accent); border: 1px solid var(--border); background: var(--panel);
}

/* ============================================================
   风控中心
   ============================================================ */

.risk-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
  border-left: 3px solid var(--accent);
}
.risk-banner.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.risk-banner.breach { border-left-color: var(--up); background: color-mix(in srgb, var(--up) 7%, var(--panel)); }
.rb-mark {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
  color: #fff; background: var(--accent);
}
.risk-banner.warn .rb-mark { background: var(--warn); }
.risk-banner.breach .rb-mark { background: var(--up); }
.rb-main { flex: 1 1 320px; min-width: 220px; }
.rb-main b { display: block; font-size: 15px; letter-spacing: .2px; }
.rb-main p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.rb-side { text-align: right; min-width: 140px; }
.rb-side span { display: block; font-size: 11px; color: var(--muted); }
.rb-side b { display: block; font-family: var(--mono); font-size: 20px; margin: 2px 0; }
.rb-side i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }

.limit-list { display: flex; flex-direction: column; gap: 12px; }
.limit-row { padding: 0 1px; }
.limit-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.limit-name { font-size: 12.5px; color: var(--text-2); }
.limit-val { font-family: var(--mono); font-size: 12.5px; }
.limit-track {
  height: 6px; margin-top: 6px; border-radius: 4px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border-soft);
}
.limit-track > i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.limit-row.warn .limit-track > i { background: var(--warn); }
.limit-row.breach .limit-track > i { background: var(--up); }
.limit-row.breach .limit-val { color: var(--up); }
.limit-hint { margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.5; }

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.calc-grid .field { margin-bottom: 0; }
.calc-btn-wrap { display: flex; flex-direction: column; justify-content: flex-end; }
.calc-btn-wrap .btn { height: 36px; }
#calcOut { margin-top: 14px; }
.calc-error {
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.7;
  color: var(--up); background: var(--up-soft); border: 1px solid color-mix(in srgb, var(--up) 30%, transparent);
}
.calc-result { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--panel-2); padding: 14px; }
.calc-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.calc-main > span { font-size: 11.5px; color: var(--muted); width: 100%; }
.calc-main > b { font-family: var(--mono); font-size: 40px; line-height: 1; letter-spacing: -1px; }
.calc-main > i { font-style: normal; font-size: 13px; color: var(--text-2); }
.calc-main > em { font-style: normal; margin-left: auto; font-size: 12px; color: var(--text-2); }
.calc-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.calc-facts > div { display: flex; flex-direction: column; gap: 2px; }
.calc-facts span { font-size: 10.5px; color: var(--muted); }
.calc-facts b { font-family: var(--mono); font-size: 13px; }
.calc-facts i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.calc-notes { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 11.5px; line-height: 1.7; color: var(--warn); }

.ck-progress { height: 5px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--border-soft); overflow: hidden; margin-bottom: 10px; }
.ck-progress > i { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }
.ck-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px;
  border-radius: 6px; cursor: pointer; font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}
.ck-item:hover { background: var(--hover); }
.ck-box {
  flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; border-radius: 4px;
  border: 1.5px solid var(--border); background: var(--input-bg);
}
.ck-item.on { color: var(--text); }
.ck-item.on .ck-box { background: var(--accent); border-color: var(--accent); position: relative; }
.ck-item.on .ck-box::after {
  content: ""; position: absolute; left: 4px; top: 0.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(42deg);
}

/* 交易质量体检 */
.quality-card .q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.q-panel { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--panel-2); padding: 13px 14px; }
.q-title { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.q-title i { font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.q-table { font-size: 11.5px; }
.q-table th, .q-table td { padding: 5px 6px; }
.q-note { margin-top: 10px; font-size: 11.5px; line-height: 1.65; color: var(--text-2); }
.q-note.up { color: var(--up); }
.q-note.down { color: var(--down); }
.q-empty { font-size: 11.5px; line-height: 1.7; color: var(--muted); padding: 14px 0; }
.q-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.q-stats > div { display: flex; flex-direction: column; gap: 2px; }
.q-stats span { font-size: 10.5px; color: var(--muted); }
.q-stats b { font-family: var(--mono); font-size: 16px; }
.q-stats i { font-style: normal; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.q-stats.three { margin-bottom: 10px; }
.q-big { font-family: var(--mono); font-size: 27px; line-height: 1.1; margin-bottom: 10px; }
.q-big span { font-family: var(--sans); font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.q-field { margin-bottom: 8px; }
.q-field-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-bottom: 3px; }
.q-field-top b { font-family: var(--mono); }
.q-track { height: 4px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.q-track > i { display: block; height: 100%; background: var(--accent); }
.q-track > i.ok { background: var(--down); }
.q-track > i.warn { background: var(--warn); }
.q-track > i.bad { background: var(--up); }
.rr-bars { display: flex; flex-direction: column; gap: 5px; }
.rr-bar { display: grid; grid-template-columns: 52px 1fr 26px; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.rr-track { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.rr-track > i { display: block; height: 100%; background: var(--accent); }
.rr-bar b { font-family: var(--mono); color: var(--text-2); text-align: right; }
.q-pending { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.q-pending-head { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.q-pending-head span { font-size: 10.5px; color: var(--muted); }
.q-pending-row {
  display: grid; grid-template-columns: 52px 72px 1fr auto; gap: 8px; align-items: center;
  width: 100%; padding: 5px 6px; border: 0; border-radius: 5px; background: transparent;
  color: var(--text-2); font-size: 11px; text-align: left; cursor: pointer;
}
.q-pending-row:hover { background: var(--hover); }
.q-pending-row b { font-size: 11.5px; }
.q-pending-row i { font-style: normal; font-family: var(--mono); }
.q-worst { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 9px; }
.q-worst-head { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.q-worst-row { display: grid; grid-template-columns: 48px 72px 1fr auto; gap: 8px; align-items: center; font-size: 11px; padding: 3px 0; }
.q-worst-row i { font-style: normal; font-family: var(--mono); }

/* 交易体检 */
.cu-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: center; margin-bottom: 14px; }
.cu-hero-left { display: flex; gap: 20px; align-items: center; min-width: 0; }
.cu-ring { width: 128px; height: 128px; }
.cu-ring .score-inner { width: 102px; height: 102px; }
.cu-ring .score-inner b { font-size: 34px; }
.cu-hero-text { min-width: 0; }
.cu-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cu-mode {
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 700; background: var(--panel-2); color: var(--text-2); white-space: nowrap;
}
.cu-mode.good { color: var(--down); border-color: rgba(23,178,106,.45); background: var(--down-soft); }
.cu-mode.warn { color: var(--warn); border-color: rgba(240,163,58,.45); background: rgba(240,163,58,.12); }
.cu-mode.bad { color: var(--up); border-color: rgba(245,73,75,.45); background: var(--up-soft); }
.cu-main { margin: 0 0 5px; font-size: 15.5px; font-weight: 600; line-height: 1.6; }
.cu-sub { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.85; }

.cu-plan { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.cu-plan-title { font-size: 11px; letter-spacing: .4px; color: var(--muted); margin-bottom: 9px; }
.cu-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cu-plan-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cu-plan-grid span { font-size: 10.5px; color: var(--muted); }
.cu-plan-grid b { font-family: var(--mono); font-size: 17px; line-height: 1.35; letter-spacing: -.3px; }
.cu-danger { color: var(--up) !important; }
.cu-plan-foot {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 10.5px; color: var(--muted); line-height: 1.8;
}
.cu-plan-foot b { color: var(--text-2); font-family: var(--mono); font-weight: 500; }

/* 盘前闸门条：并入交易体检页后单独一条，别再占一整块 hero（v1.7.1） */
.ck-gate {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 16px; margin-bottom: 14px;
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel);
}
.ck-gate.ok { border-left-color: var(--down); background: color-mix(in srgb, var(--down) 5%, var(--panel)); }
.ck-gate.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.ck-gate.alert { border-left-color: var(--up); background: color-mix(in srgb, var(--up) 5%, var(--panel)); }
.ck-gate-mark {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--muted);
}
.ck-gate.ok .ck-gate-mark { background: var(--down); }
.ck-gate.warn .ck-gate-mark { background: var(--warn); }
.ck-gate.alert .ck-gate-mark { background: var(--up); }
.ck-gate-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 280px; min-width: 0; }
.ck-gate-text b { font-size: 12.5px; }
.ck-gate-text span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.ck-gate-progress { display: flex; align-items: center; gap: 8px; flex: 0 0 140px; }
.ck-gate-track { flex: 1; height: 5px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--border-soft); overflow: hidden; }
.ck-gate-track > i { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }
.ck-gate.ok .ck-gate-track > i { background: var(--down); }
.ck-gate-progress em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ck-gate-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ck-gate-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 720px) { .ck-gate-progress { flex-basis: 100%; } }

.cu-advice { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.cu-advice li { display: flex; gap: 9px; align-items: flex-start; border-left: 2px solid var(--border); padding-left: 10px; }
.cu-advice li.stop { border-left-color: var(--up); }
.cu-advice li.fix { border-left-color: var(--warn); }
.cu-advice li.tip { border-left-color: var(--accent); }
.cu-advice li.good { border-left-color: var(--down); }
.cu-tag {
  flex-shrink: 0; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); margin-top: 1px;
}
.cu-advice li.stop .cu-tag { color: var(--up); border-color: rgba(245,73,75,.4); background: var(--up-soft); }
.cu-advice li.fix .cu-tag { color: var(--warn); border-color: rgba(240,163,58,.4); background: rgba(240,163,58,.12); }
.cu-advice li.tip .cu-tag { color: var(--accent); border-color: rgba(76,141,255,.4); background: var(--accent-soft); }
.cu-advice li.good .cu-tag { color: var(--down); border-color: rgba(23,178,106,.4); background: var(--down-soft); }
.cu-advice b { display: block; font-size: 12.5px; line-height: 1.55; }
.cu-advice p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.75; }

.cu-dims { display: flex; flex-direction: column; gap: 11px; }
.cu-dim-top { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.cu-dim-top span { font-weight: 600; color: var(--text-2); }
.cu-dim-top b { margin-left: auto; font-family: var(--mono); font-size: 15px; }
.cu-dim-top i { font-style: normal; font-size: 10px; color: var(--muted); width: 54px; text-align: right; }
.cu-track {
  height: 5px; border-radius: 3px; background: var(--panel-2);
  border: 1px solid var(--border-soft); overflow: hidden; margin: 5px 0;
}
.cu-track > i { display: block; height: 100%; border-radius: 3px; transition: width .3s ease; }
.cu-dim-note { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 10.5px; color: var(--muted); }
.cu-dim-note span b { color: var(--text-2); font-family: var(--mono); font-weight: 500; }
.cu-dim-note p { flex: 1 0 100%; margin: 1px 0 0; font-size: 11.5px; color: var(--text-2); line-height: 1.7; }
.cu-dim.na { opacity: .85; }
.cu-dim.na .cu-dim-note p { color: var(--warn); }

@media (max-width: 1180px) {
  .cu-hero { grid-template-columns: 1fr; }
  .cu-plan { max-width: 560px; }
}
@media (max-width: 640px) {
  .cu-hero-left { flex-direction: column; align-items: flex-start; gap: 12px; }
}

tr.row-click { cursor: pointer; }
tr.row-click:hover td { background: var(--hover); }

@media (max-width: 900px) {
  .quality-card .q-grid { grid-template-columns: 1fr; }
  .calc-facts, .q-stats { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   盘前准备（v1.6.0）
   ============================================================ */

.nav-dot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent);
}

.gate-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--warn) 8%, var(--bg-elev));
  font-size: 12px;
}
.gate-bar[hidden] { display: none; }
.gate-bar .gate-mark {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--warn);
}
.gate-bar.alert { background: color-mix(in srgb, var(--up) 8%, var(--bg-elev)); }
.gate-bar.alert .gate-mark { background: var(--up); }
.gate-bar .gate-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.gate-bar .gate-text b { font-size: 12.5px; }
.gate-bar .gate-text i { font-style: normal; color: var(--muted); font-size: 11px; }

.prep-hero {
  display: flex; align-items: center; gap: 20px; padding: 22px 24px;
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--panel); margin-bottom: 14px;
}
.prep-hero.ok { border-left-color: var(--down); }
.prep-hero.warn { border-left-color: var(--warn); }
.prep-hero.breach { border-left-color: var(--up); background: color-mix(in srgb, var(--up) 4%, var(--panel)); }
.prep-hero-main { flex: 1; min-width: 0; }
.prep-hero-main h2 { margin: 6px 0 6px; font-size: 21px; letter-spacing: -.3px; }
.prep-hero-main p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.7; }
.prep-session {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted);
  padding: 3px 9px; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--panel-2);
}
.prep-session i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.prep-session.live { color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.prep-session.live i { background: var(--up); animation: prepPulse 1.6s infinite; }
@keyframes prepPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.prep-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.prep-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.prep-hero-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.prep-ring {
  --p: 0;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--panel-2) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.prep-ring::after {
  content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--panel);
  border: 1px solid var(--border-soft);
}
.prep-ring > div { position: relative; z-index: 1; text-align: center; }
.prep-ring b { display: block; font-family: var(--mono); font-size: 22px; line-height: 1.1; }
.prep-ring b i { font-style: normal; font-size: 12px; color: var(--muted); }
.prep-ring span { font-size: 10.5px; color: var(--muted); }
.prep-hero-note { font-size: 10.5px; color: var(--muted); }

.prep-kpis { margin-bottom: 14px; }
.prep-top { align-items: start; }

.ck-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ck-text { display: block; }
.ck-std { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.6; }
.ck-auto {
  align-self: flex-start; font-size: 10.5px; color: var(--text-2);
  padding: 1px 7px; border-radius: 4px; background: var(--panel-2);
  border: 1px solid var(--border-soft);
}
.ck-auto b { font-family: var(--mono); font-weight: 600; }
.ck-auto.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.ck-auto.breach { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, transparent); }
.ck-item.on .ck-text { text-decoration: line-through; text-decoration-color: var(--muted); }
.ck-list .ck-item { align-items: flex-start; padding: 9px 8px; }

.prep-advice li { padding: 10px 0; }
.prep-advice li + li { border-top: 1px dashed var(--border-soft); }
.prep-advice li.good .cu-tag { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); }

.prep-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prep-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
.prep-facts span { font-size: 10.5px; color: var(--muted); }
.prep-facts b { font-family: var(--mono); font-size: 15px; }
.prep-facts i { font-style: normal; font-size: 10.5px; color: var(--muted); }

.prep-sectors { display: flex; flex-direction: column; gap: 6px; }
.prep-sector {
  display: grid; grid-template-columns: 64px 60px 1fr; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--border-soft); font-size: 11.5px;
}
.prep-sector span { color: var(--text-2); }
.prep-sector b { font-family: var(--mono); }
.prep-sector i { font-style: normal; color: var(--muted); font-size: 10.5px; text-align: right; }
.prep-sector.hot { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 6%, var(--panel-2)); }
.prep-warn {
  margin: 10px 0 0; padding: 8px 10px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--up) 7%, transparent); color: var(--up);
  font-size: 11.5px; line-height: 1.6;
}

/* ------------------------------ 盘前准备弹窗（每时段第一次进来） ------------------------------ */

.modal.modal-locked { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.modal.modal-locked .modal-head { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.prep-gate { display: flex; flex-direction: column; gap: 14px; }
.pg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg-head .pg-date { font-size: 11.5px; color: var(--muted); }
.pg-head p { flex: 1 0 100%; margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.pg-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pg-facts > div {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.pg-facts span { font-size: 10.5px; color: var(--muted); }
.pg-facts b { font-family: var(--mono); font-size: 16px; }
.pg-facts i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.pg-ck-head { display: flex; align-items: center; justify-content: space-between; }
.pg-ck-head h4, .pg-advice h4 { margin: 0; font-size: 13px; font-weight: 600; }
.pg-ck-head span { font-size: 11.5px; color: var(--muted); }
.pg-advice { border-top: 1px dashed var(--border-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pg-advice .prep-advice li { padding: 8px 0; }
.pg-foot-note { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.7; }
@media (max-width: 760px) {
  .pg-facts { grid-template-columns: 1fr 1fr; }
}

.check-line {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 12px;
  font-size: 12.5px; color: var(--text-2);
}
.check-line input { width: 15px; height: 15px; accent-color: var(--accent); }

@media (max-width: 900px) {
  .prep-hero { flex-direction: column; align-items: flex-start; }
  .prep-hero-side { flex-direction: row; align-items: center; }
  .prep-facts { grid-template-columns: 1fr; }
  .prep-sector { grid-template-columns: 56px 52px 1fr; }
}

/* ============================================================
   平仓（v1.6.1）
   ============================================================ */

.btn-pos {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
}
.btn-pos:hover { background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); border-color: var(--accent); }

.pos-bar {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}
.pos-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pos-bar-text b { font-size: 13.5px; }
.pos-bar-text span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.tag.ct { border-style: solid; }
.tag.ct.ct-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tag.ct.ct-stop { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.tag.ct.ct-target { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); background: color-mix(in srgb, var(--up) 9%, transparent); }
.tag.ct.ct-force { color: var(--muted); border-color: var(--border); background: var(--panel-2); }

.close-head {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.close-head > div {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.close-head span { font-size: 10.5px; color: var(--muted); }
.close-head b { font-size: 14px; font-family: var(--mono); font-weight: 600; }

.input-quick { display: flex; gap: 6px; align-items: center; }
.input-quick input { flex: 1; min-width: 0; }
.input-quick .btn { flex: 0 0 auto; padding: 8px 9px; }

.close-preview {
  margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border-soft);
}
.close-preview:empty { display: none; }
.cp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 0; }
.cp-row + .cp-row { border-top: 1px dashed var(--border-soft); }
.cp-row > span { color: var(--text-2); }
.cp-row > b { font-family: var(--mono); font-weight: 600; }
.cp-row > b i { font-family: var(--sans); font-style: normal; font-size: 11px; }
.cp-warn { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--warn); }
.close-msg { min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--up); }

@media (max-width: 720px) {
  .close-head { grid-template-columns: 1fr; }
}

/* ============================================================
   系统评分（v1.6.2）
   ============================================================ */

.sys-score {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 5px; cursor: help;
  border: 1px solid var(--border); background: var(--panel-2);
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
}
.sys-score b { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.sys-score i { font-style: normal; font-weight: 600; }
.sys-score em { font-style: normal; font-size: 9.5px; color: var(--muted); margin-left: 1px; }

.sys-score.ss-a { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, transparent); background: color-mix(in srgb, var(--down) 9%, transparent); }
.sys-score.ss-b { color: color-mix(in srgb, var(--down) 70%, var(--text)); border-color: color-mix(in srgb, var(--down) 32%, transparent); background: color-mix(in srgb, var(--down) 6%, transparent); }
.sys-score.ss-c { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.sys-score.ss-d { color: color-mix(in srgb, var(--up) 75%, var(--warn)); border-color: color-mix(in srgb, var(--up) 38%, transparent); background: color-mix(in srgb, var(--up) 6%, transparent); }
.sys-score.ss-e { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, transparent); background: color-mix(in srgb, var(--up) 9%, transparent); }

.ssc {
  margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
}
.ssc-head {
  display: flex; align-items: center; gap: 18px; padding: 14px 16px;
  background: var(--panel-2); border-bottom: 1px solid var(--border-soft);
}
.ssc-grade {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 58px; flex: 0 0 auto; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel);
}
.ssc-grade b { font-family: var(--mono); font-size: 23px; line-height: 1; font-weight: 700; }
.ssc-grade span { font-size: 10px; color: var(--muted); margin-top: 4px; }
.ssc.ss-a .ssc-grade { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, transparent); background: color-mix(in srgb, var(--down) 8%, var(--panel)); }
.ssc.ss-b .ssc-grade { color: color-mix(in srgb, var(--down) 70%, var(--text)); border-color: color-mix(in srgb, var(--down) 32%, transparent); }
.ssc.ss-c .ssc-grade { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--panel)); }
.ssc.ss-d .ssc-grade { color: color-mix(in srgb, var(--up) 75%, var(--warn)); border-color: color-mix(in srgb, var(--up) 38%, transparent); }
.ssc.ss-e .ssc-grade { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, transparent); background: color-mix(in srgb, var(--up) 8%, var(--panel)); }

.ssc-total { display: flex; flex-direction: column; gap: 1px; }
.ssc-total strong { font-family: var(--mono); font-size: 27px; line-height: 1.1; font-weight: 600; }
.ssc-total span { font-size: 10.5px; color: var(--muted); }
.ssc-hint { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ssc-hint b { font-size: 12px; }
.ssc-hint span { font-size: 11px; color: var(--muted); line-height: 1.55; }
.ssc-hint i { font-style: normal; font-size: 10.5px; color: var(--warn); }

.ssc-parts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 14px 16px; }
.ssc-part { display: flex; flex-direction: column; gap: 5px; }
.ssc-part.na { opacity: .6; }
.ssc-part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ssc-part-head span { font-size: 11.5px; font-weight: 600; }
.ssc-part-head span i { font-style: normal; font-size: 9.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.ssc-part-head b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ssc-bar { height: 5px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--border-soft); overflow: hidden; }
.ssc-bar i { display: block; height: 100%; border-radius: 2px; }
.ssc-note { font-size: 10.5px; color: var(--muted); line-height: 1.55; min-height: 32px; }
.ssc-missing { margin: 0; padding: 0 16px 14px 32px; font-size: 10.5px; color: var(--muted); line-height: 1.7; }

/* 交易纪律建议：按对总分的影响排序，高优先级红色左边线 */
.ssc-advice { border-top: 1px solid var(--border-soft); padding: 12px 16px 14px; }
.ssc-advice-head { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; font-weight: 600; margin-bottom: 8px; }
.ssc-advice-head i { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; }
.ssc-advice ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ssc-advice li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; line-height: 1.6; color: var(--text-2, var(--text));
  padding: 6px 9px; border-radius: 6px;
  background: var(--panel-2); border-left: 2px solid var(--border);
}
.ssc-advice li span { flex: 1; min-width: 0; }
.ssc-advice li em { font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; padding-top: 1px; }
.ssc-advice li.lv-high { border-left-color: var(--up); background: color-mix(in srgb, var(--up) 7%, var(--panel-2)); }
.ssc-advice li.lv-mid { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--panel-2)); }
.ssc-advice li.lv-low { border-left-color: var(--border); }

@media (max-width: 1200px) {
  .ssc-parts { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .ssc-parts { grid-template-columns: repeat(2, 1fr); }
  .ssc-head { flex-wrap: wrap; gap: 12px; }
  .ssc-hint { flex-basis: 100%; }
}

/* ============================================================
   手工记录 ↔ 结算单：同一笔交易的认领
   ============================================================ */

.tag.ok { color: var(--down); border-color: rgba(23,178,106,.45); background: var(--down-soft); }

.link-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.link-bar .btn { flex: 0 0 auto; }

.ml-section { margin: 4px 0 16px; }
.ml-section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 13px; flex-wrap: wrap; }
.ml-section-head .hint { color: var(--muted); font-size: 11.5px; }

.ml-card, .ml-merged {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); margin-bottom: 12px; overflow: hidden;
}
.ml-merged { background: var(--panel-2); }
.ml-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2); font-size: 12.5px;
}
.ml-merged .ml-head { border-bottom: none; }
.ml-when { color: var(--text-2); font-size: 11.5px; }
.ml-memo {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px 0; font-size: 12px; color: var(--text-2);
}

.ml-cand { padding: 11px 12px; border-top: 1px dashed var(--border-soft); }
.ml-cand-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.ml-cand-head b { font-size: 12px; }
.ml-match {
  font-family: var(--mono); font-size: 11px; padding: 1px 7px;
  border-radius: 20px; border: 1px solid var(--border); color: var(--muted);
}
.ml-match.good { color: var(--down); border-color: rgba(23,178,106,.45); background: var(--down-soft); }
.ml-match.mid { color: var(--accent); border-color: rgba(76,141,255,.45); background: var(--accent-soft); }
.ml-match.warn { color: var(--warn); border-color: rgba(240,163,58,.45); background: rgba(240,163,58,.12); }

.ml-diff { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 11.5px; color: var(--text-2); }
.ml-diff span { white-space: nowrap; }
.ml-diff i { font-style: normal; color: var(--muted); margin-right: 5px; }
.ml-diff b { color: var(--accent); font-weight: 500; margin: 0 3px; }
.ml-diff.none { color: var(--muted); }
.ml-notes { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.65; }
.ml-cand-foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.ml-cand-foot .muted { font-size: 11px; }
.ml-foot { padding: 9px 12px 11px; border-top: 1px dashed var(--border-soft); }

.merge-note { border-left-color: var(--accent); }
.merge-note .ml-diff { margin-bottom: 2px; }

@media (max-width: 720px) {
  .link-bar { flex-direction: column; align-items: flex-start; }
  .ml-cand-foot { align-items: flex-start; }
}

/* ---------------- 下单计划 / 三个下单理由 ---------------- */

.fill-plan {
  margin: 4px 0 14px; padding: 12px 12px 2px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.fill-plan-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.fill-plan-head b { font-size: 12.5px; color: var(--text); }
.fill-plan-head .hint { font-size: 11px; color: var(--muted); }
.fill-plan .field { margin-bottom: 10px; }

.reason-inputs { display: grid; gap: 6px; }
.reason-row { display: flex; align-items: center; gap: 8px; }
.reason-row > span {
  flex: none; width: 18px; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 1;
}
.reason-row input { flex: 1; min-width: 0; }

.reason-card {
  margin-bottom: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--panel-2);
}
.reason-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 6px; }
.reason-card ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.reason-card li { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.reason-card li > span { flex: none; color: var(--muted); }

.plan-card {
  margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel-2);
}
.plan-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.plan-card-head .muted { font-size: 11px; }
.plan-card-body {
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------------- 交易回合列表：计划 / 情绪 / 理由 ---------------- */
.tag.emo { color: var(--warn); border-color: rgba(240, 163, 58, .42); background: rgba(240, 163, 58, .10); }
.plan-prices { display: block; font-size: 11.5px; color: var(--text-2); line-height: 1.45; }
.reason-inline {
  display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12px; color: var(--text-2); vertical-align: bottom;
}
.reason-inline i { font-style: normal; color: var(--accent); font-size: 11px; margin-left: 4px; }

/* ---------------- 合约 → 品种 自动识别提示 ---------------- */
.inst-hint {
  font-size: 11.5px; line-height: 1.7; min-height: 18px;
  margin: -6px 0 12px; color: var(--muted);
}
.inst-hint b { font-weight: 600; }
.inst-hint.ok b { color: var(--accent); }
.inst-hint.warn { color: var(--warn); }

/* ---------------- 成交录入：紧凑表单栅格 ---------------- */
.fill-grid { display: grid; gap: 10px 12px; align-items: start; }
.fill-grid > * { min-width: 0; }
.fill-grid > .field { margin-bottom: 0; }
.fill-grid.c4 { grid-template-columns: 1.25fr 1.15fr 1fr .85fr; }
.fill-grid.c5 { grid-template-columns: 1.1fr 1.05fr .9fr .65fr .8fr; }

.fill-plan { padding: 10px 12px 4px; }
.fill-plan .field { margin-bottom: 8px; }
.fill-plan .fill-grid { margin-bottom: 8px; }
.fill-plan .fill-grid > .field { margin-bottom: 0; }

.reason-inputs.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.inst-hint { margin: 2px 0 10px; }

@media (max-width: 1080px) {
  .fill-grid.c4, .fill-grid.c5 { grid-template-columns: 1fr 1fr; }
  .reason-inputs.c3 { grid-template-columns: 1fr; }
}

/* ---------------- 交易回合列表：列宽 / 两行时间 / 复盘状态 ---------------- */

.trades-table { overflow-x: auto; }
.trades-table table { min-width: 1470px; table-layout: fixed; }
.trades-table thead th, .trades-table tbody td { padding: 7px 8px; }
.trades-table thead th { font-size: 11.5px; text-align: center; }
.trades-table tbody td { font-size: 12.5px; vertical-align: middle; }

/* 一笔回合占两行：上行开仓侧、下行平仓侧 */
.pair { display: flex; flex-direction: column; gap: 2px; line-height: 1.28; }
.pair .pl { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.pair .pl > i {
  font-style: normal; font-size: 10px; line-height: 1.4;
  color: var(--muted); flex: 0 0 auto; min-width: 10px;
}
.pair .pl .mono { font-size: 12px; }
.pair.num-strong .pl b { font-size: 12.5px; }
/* 止损止盈：价位贴左、金额贴右 */
.pair.sl .pl { display: grid; grid-template-columns: 24px minmax(40px, auto) 1fr; column-gap: 6px; }
.pair.sl .pl .amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 11.5px; }
/* 两行里的评分胶囊收紧一点，避免行高被撑开 */
.trades-table .pair .score-pill { min-width: 34px; padding: 0 4px; font-size: 11px; line-height: 1.45; }
/* 日期一行、时间一行（其它表格仍在用） */
.dt { display: flex; flex-direction: column; line-height: 1.35; }
.dt .d { font-size: 12px; color: var(--text-2); }
.dt .t { font-size: 11px; color: var(--muted); }

/* 状态：期初 / 结算单校正 收进悬停提示，右上角小圆点提示有附注 */
.st-cell.has-note { position: relative; display: inline-block; }
.st-cell.has-note::after {
  content: ''; position: absolute; top: 1px; right: -5px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--warn); opacity: .85;
}
.st-cell.has-note { cursor: help; }

/* 复盘状态 */
.rev { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; line-height: 1.2; }
.rev .tag { margin-right: 0; }
.rev-note {
  display: block; max-width: 92px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 11px; color: var(--muted);
}
.trades-table .tag.todo {
  color: var(--muted); border-color: var(--border); background: transparent; cursor: help;
}

/* ---------------- 合约名称：点击看行情 ---------------- */

.contract-link {
  display: inline; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  border-bottom: 1px dashed transparent;
}
.contract-link:hover { border-bottom-color: var(--accent); }
.contract-link:hover b { color: var(--accent); }
.contract-name { font-weight: 600; }

/* ---------------- 合约联想输入（中文 / 代码 / 年月） ---------------- */

.contract-field { position: relative; }
.contract-drop {
  position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% - 2px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28); padding: 4px; max-height: 286px; overflow-y: auto;
}
.contract-drop[hidden] { display: none; }
.copt {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; width: 100%;
  padding: 7px 9px; border: 0; background: none; border-radius: 7px; cursor: pointer;
  text-align: left; color: var(--text); font: inherit;
}
.copt:hover, .copt.on { background: var(--hover); }
.copt b { font-size: 12.5px; font-weight: 600; }
.copt span { font-family: var(--mono); font-size: 11.5px; color: var(--accent); justify-self: end; }
.copt em { grid-column: 1 / -1; font-style: normal; font-size: 10.5px; color: var(--muted); }

/* ---------------- 行情弹窗 ---------------- */

.q-title-code { font-family: var(--mono); color: var(--accent); }
.q-title-name { color: var(--muted); font-weight: 400; font-size: 12.5px; }

.q-wrap { display: flex; flex-direction: column; gap: 10px; }
.q-head {
  display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap;
  padding: 4px 2px 10px; border-bottom: 1px solid var(--border-soft);
}
.q-head-empty { color: var(--muted); }
.q-main { display: flex; align-items: baseline; gap: 12px; min-width: 240px; }
.q-last { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1; }
.q-chg { display: flex; gap: 8px; font-family: var(--mono); font-size: 13px; }
.q-last.up, .q-chg.up, .q-stat b.up { color: var(--up); }
.q-last.down, .q-chg.down, .q-stat b.down { color: var(--down); }
.q-last.flat, .q-chg.flat { color: var(--text-2); }
.q-fb {
  font-size: 11px; color: var(--warn); border: 1px solid rgba(240,163,58,.4);
  background: rgba(240,163,58,.1); border-radius: 5px; padding: 1px 6px;
}
.q-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.q-stat { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.q-stat > span { color: var(--muted); }
.q-stat > b { font-family: var(--mono); font-weight: 600; color: var(--text-2); }

.q-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-tabs { flex: 0 0 auto; }
.q-tabs button { white-space: nowrap; }
.q-periods { display: flex; gap: 6px; flex: 0 0 auto; }
.q-periods .chip { font-size: 12px; padding: 3px 9px; }
.q-upd { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.q-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.q-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.q-legend .lg i { width: 10px; height: 2px; border-radius: 1px; display: inline-block; }
.q-legend .lg i.dot { width: 7px; height: 7px; border-radius: 50%; }

/* 回合信息条（成交 + 止损止盈） */
.q-marks {
  display: flex; align-items: center; gap: 7px 16px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--text-2);
}
.q-marks .mk-tag {
  padding: 1px 8px; border-radius: 5px; font-weight: 700; font-size: 11.5px;
  background: var(--accent-soft); color: var(--accent);
}
.q-marks .mk-tag.long { background: rgba(245, 73, 75, .14); color: var(--up); }
.q-marks .mk-tag.short { background: rgba(23, 178, 106, .14); color: var(--down); }
.q-marks .mk { display: inline-flex; align-items: baseline; gap: 5px; }
.q-marks .mk i { font-style: normal; color: var(--muted); }
.q-marks .mk b { font-family: var(--mono); font-weight: 600; color: var(--text-2); }
.q-marks .mk em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.q-marks .mk b em { color: var(--muted); font-weight: 400; }
.q-marks .mk.stop b { color: var(--up); }
.q-marks .mk.stop b em { color: var(--up); opacity: .8; }
.q-marks .mk.target b { color: var(--down); }
.q-marks .mk.target b em { color: var(--down); opacity: .8; }
.q-marks .mk.up b { color: var(--up); }
.q-marks .mk.down b { color: var(--down); }
.q-marks .mk-hint {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--muted);
}
.q-marks .mk-hint i.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin: 0 2px 0 5px; }
.q-marks .mk-hint i.dot.buy { background: #f5494b; }
.q-marks .mk-hint i.dot.sell { background: #17b26a; }
.q-marks .mk-hint i.ln { width: 12px; height: 0; border-top: 1.5px dashed; display: inline-block; margin: 0 2px 0 6px; }
.q-marks .mk-hint i.ln.stop { border-color: #f5494b; }
.q-marks .mk-hint i.ln.target { border-color: #17b26a; }

/* 缩放控件 */
.q-zoom { display: flex; align-items: center; gap: 4px; }
.q-zhint { font-size: 10.5px; color: var(--muted); min-width: 92px; text-align: center; }
.q-zbtn {
  width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--input-bg, var(--panel-2)); color: var(--text-2);
  font-size: 13px; line-height: 1; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.q-zbtn:hover { border-color: var(--accent); color: var(--accent); }
.q-zreset { font-size: 12px; }
.q-days .chip { font-size: 11.5px; padding: 2px 8px; }


.q-chart { position: relative; width: 100%; height: 360px; }
.q-chart canvas { display: block; width: 100%; height: 360px; touch-action: none; }
.q-chart canvas.dragging { cursor: grabbing; }

/* K 线时间平移滑杆 */
.q-nav { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 0 6px 0 2px; }
.q-nav-date {
  flex: 0 0 auto;                 /* 不参与压缩，否则日期会被挤掉最后一位 */
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  white-space: nowrap; text-align: center; min-width: 44px;
}
.q-nav-track {
  position: relative; flex: 1; height: 20px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  cursor: pointer; overflow: hidden; touch-action: none;
}
.q-nav-track::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to right, var(--border-soft) 0 1px, transparent 1px 12px);
  opacity: .8;
}
.q-nav-win {
  position: absolute; top: 0; bottom: 0;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  cursor: grab;
}
.q-nav-win:hover, .q-nav.drag .q-nav-win {
  background: color-mix(in srgb, var(--accent) 34%, transparent);
}
.q-nav.drag .q-nav-win, .q-nav.drag .q-nav-track { cursor: grabbing; }
.q-tip-mk {
  margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px;
}
.q-tip-mk b { color: var(--muted); font-weight: 500; font-size: 10.5px; }


.q-tip {
  position: absolute; z-index: 3; min-width: 168px; pointer-events: none;
  padding: 8px 10px; border-radius: 8px; font-size: 11.5px;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.q-tip-h { font-family: var(--mono); color: var(--text-2); margin-bottom: 6px; font-size: 11.5px; }
.q-tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.q-tip-grid > div { display: flex; justify-content: space-between; gap: 8px; }
.q-tip-grid span { color: var(--muted); }
.q-tip-grid b { font-family: var(--mono); font-weight: 600; color: var(--text-2); }
.q-tip-grid b.up { color: var(--up); }
.q-tip-grid b.down { color: var(--down); }
.q-tip-grid b.flat { color: var(--text-2); }
.q-tip-grid b.ma5 { color: #f0a33a; }
.q-tip-grid b.ma10 { color: var(--accent); }
.q-tip-grid b.ma20 { color: #c678dd; }
.q-live { font-style: normal; font-size: 10px; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; }

.q-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--panel) 55%, transparent); border-radius: var(--radius-sm);
}
.q-mask-box { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.q-mask-box b { color: var(--text); }
.q-mask-box span { color: var(--muted); font-size: 12px; }

.q-foot { font-size: 11.5px; color: var(--muted); padding-top: 2px; }

@media (max-width: 720px) {
  .q-head { gap: 12px; }
  .q-last { font-size: 24px; }
  .q-chart, .q-chart canvas { height: 300px; }
}

/* ------------------------------ 登录与安全（设置页） ------------------------------ */

.sec-now {
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--input-bg);
  border: 1px solid var(--border); font-size: 13px; color: var(--text-2);
  font-variant-numeric: tabular-nums; min-height: 38px; display: flex; align-items: center;
}
.sec-sub {
  margin: 16px 0 10px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}

/* ------------------------------ 自动导入结算单（日历选择） ------------------------------ */

.cal-nav {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.cal-nav b { font-size: 13.5px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px;
}
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.cal-day {
  border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  min-height: 44px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; background: var(--input-bg, var(--panel-2));
  cursor: pointer; user-select: none; transition: border-color .12s, background .12s;
}
.cal-day b { font-size: 13px; line-height: 1; }
.cal-day i { font-size: 9.5px; font-style: normal; color: var(--muted); line-height: 1; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.pad { visibility: hidden; pointer-events: none; }
.cal-day.wk { color: var(--muted); }
.cal-day.imported {
  background: var(--down-soft); border-color: rgba(23, 178, 106, .55); cursor: default;
}
.cal-day.imported b { color: var(--down); }
.cal-day.imported i { color: var(--down); }
.cal-day.future { opacity: .38; cursor: default; pointer-events: none; }
.cal-day.sel {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.cal-day.sel i { color: var(--accent); }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px;
  font-size: 11.5px; color: var(--muted);
}
.cal-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 4px; vertical-align: -1px;
}

/* ------------------------------ 成交图片导入 ------------------------------ */

.c-warn { color: var(--warn); }
.c-ok { color: var(--down); }
.c-muted { color: var(--muted); }

.ii-top { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ii-file input[type="file"] { padding: 6px; font-size: 12px; }
.ii-note { margin: 12px 0 0; font-size: 12px; line-height: 1.7; }
.ii-status { margin-top: 10px; min-height: 16px; line-height: 1.6; }
.ii-preview {
  margin-top: 10px; max-height: 240px; overflow: auto; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
}
.ii-preview img { max-width: 100%; display: block; margin: 0 auto; border-radius: 4px; }
.ii-table-wrap {
  margin-top: 12px; overflow: auto; max-height: 44vh;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ii-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ii-table th {
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
  padding: 7px 4px; text-align: center; font-weight: 500;
  color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border);
}
.ii-table td { padding: 4px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.ii-table tr.bad td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.ii-in {
  width: 100%; min-width: 58px; padding: 4px 6px;
  font-size: 12px; font-family: inherit; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px;
}
.ii-in:focus { outline: none; border-color: var(--accent); }
.ii-phy { white-space: nowrap; color: var(--text-2); }
.ii-msg { font-size: 11px; line-height: 1.45; max-width: 170px; }

/* ------------------------------ 成交录入：三条自动通道 ------------------------------ */

.chan-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chan {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 14px 16px; font-family: inherit; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s, transform .1s;
}
.chan:hover { border-color: var(--accent); background: var(--hover); }
.chan:active { transform: translateY(1px); }
.chan b { font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.chan span { font-size: 12px; line-height: 1.6; color: var(--muted); }

/* ------------------------------ 文华 WH6 导入弹窗 ------------------------------ */

.w6-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.w6-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.w6-path code, .ii-note code {
  padding: 1px 5px; font-family: var(--mono); font-size: 11px;
  background: var(--input-bg); border: 1px solid var(--border-soft); border-radius: 4px;
}
.w6-warn { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.w6-day { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; }
.w6-sum { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 8px; }
.w6-sum .pill b { margin-left: 4px; font-family: var(--mono); }
.w6-table { table-layout: auto; }
.w6-table .num { text-align: right; padding-right: 8px; white-space: nowrap; }
.w6-table td b { font-weight: 600; }
@media (max-width: 760px) {
  .chan-row { grid-template-columns: 1fr; }
  .w6-table .ii-msg { max-width: 120px; }
}

/* ------------------------------ 消息雷达：宏观数据 ------------------------------ */

.news-filters {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-soft);
}
.news-kind {
  display: inline-block; margin-right: 6px; padding: 1px 6px;
  font-size: 10.5px; line-height: 16px; border-radius: 4px; vertical-align: 1px;
  color: var(--accent); background: var(--accent-soft);
}
.news-row.is-macro { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.news-row.is-macro .news-tag b { color: var(--accent); }
.news-note { color: var(--text-2); opacity: .85; }

/* ---------------- 消息雷达：影响说明（v1.20.0） ---------------- */

/* 顶部汇总：与持仓相关多少条、几条不利 */
.news-radar {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
  margin: 0 0 12px; padding: 9px 12px; font-size: 11.5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.news-radar b { margin-left: 3px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.news-radar .bad b { color: var(--down); }
.news-radar .good b { color: var(--up); }
.news-radar .dim { margin-left: auto; opacity: .8; }
.news-filter-sep { width: 1px; height: 14px; background: var(--border); margin: 0 3px; align-self: center; }

/* 方向徽章：利多红、利空绿（与盈亏配色一致） */
.news-imp { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; margin-top: 5px; }
.imp-badge {
  flex-shrink: 0; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600;
  line-height: 16px; border: 1px solid transparent;
}
.imp-badge.bull { background: var(--up-soft); color: var(--up); }
.imp-badge.bear { background: var(--down-soft); color: var(--down); }
.imp-badge.flat { background: transparent; color: var(--muted); border-color: var(--border); }
.imp-badge.mixed { background: rgba(240, 163, 58, .14); color: var(--warn); }
.imp-text { flex: 1; min-width: 200px; font-size: 11.5px; line-height: 1.6; color: var(--text-2); }

/* 受影响持仓：有利 / 不利 */
.news-pos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pos-chip {
  padding: 1px 7px; border-radius: 5px; font-size: 10.5px; line-height: 16px;
  border: 1px solid var(--border); color: var(--text-2);
}
.pos-chip.against { border-color: transparent; background: var(--down-soft); color: var(--down); }
.pos-chip.favor { border-color: transparent; background: var(--up-soft); color: var(--up); }
.news-weak { padding: 0 5px; border: 1px dashed var(--border); border-radius: 5px; font-size: 10px; }
.news-row.is-bad { box-shadow: inset 2px 0 0 var(--warn); }

@media (max-width: 720px) {
  .news-radar .dim { margin-left: 0; }
  .imp-text { min-width: 0; }
  .pos-chip { font-size: 10px; }
}
/* ============================================================
   行情中心（一级菜单「行情」）
   ============================================================ */

/* 自选合约在上、自选行情在下：整页单列，不再分左右两栏 */
.mk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

/* ---------------- 顶部：自选合约（横向：切换 + 刷新 / 添加） ---------------- */
.mk-side-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* 下拉框 + ↑ ↓ ✕ 一行 */
.mk-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 300px;
  max-width: 460px;
  min-width: 0;
}
.mk-pick select {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
}
.mk-pick-ops { display: flex; gap: 2px; flex-shrink: 0; }
.icon-btn.mini {
  width: 22px; height: 22px; padding: 0;
  font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 添加自选：品种 → 合约 → 添加，同一行排开 */
.mk-add {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 210px) auto;
  gap: 8px;
  justify-content: start;
  margin-bottom: 0;
}
.mk-add select {
  width: 100%;
  min-width: 0;
  font-size: 12.5px;
}
.mk-add select:disabled { opacity: .5; cursor: not-allowed; }
.mk-add .btn { width: auto; white-space: nowrap; }
@media (max-width: 820px) {
  .mk-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mk-add .btn { grid-column: 1 / -1; }
}

.mk-p { margin-left: 6px; font-family: var(--mono); font-size: 13px; }
.mk-chg { margin-left: 6px; font-style: normal; font-size: 11.5px; font-family: var(--mono); }
.mk-chg.up, .mk-p.up { color: var(--up); }
.mk-chg.down, .mk-p.down { color: var(--down); }

.mk-side-foot {
  display: flex; align-items: center;
  gap: 10px; margin-left: auto;
  flex-shrink: 0;
}
.mk-auto { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }

/* ---------------- 自选行情一览表 ---------------- */
.mk-watch-wrap { max-height: 300px; overflow: auto; }
.mk-watch-table { width: 100%; }
.mk-watch-table th:first-child, .mk-watch-table td:first-child { width: 26%; }
.mk-watch-table { font-size: 12.5px; }
.mk-watch-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--panel-2);
}
.mk-watch-table tbody tr.picked { background: var(--accent-soft); }
.mk-watch-table tbody tr.picked td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.mk-watch-table td b { font-size: 12.5px; margin-left: 4px; }
.mk-watch-table td.muted { color: var(--text-3); }

/* ---------------- 实时行情卡片 ---------------- */
.mk-quote-main { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }

.mk-last { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.mk-last b { font-family: var(--mono); font-size: 30px; line-height: 1.1; color: var(--text); }
.mk-last i { font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.mk-last.up b, .mk-last.up i { color: var(--up); }
.mk-last.down b, .mk-last.down i { color: var(--down); }

.mk-cells {
  flex: 1; min-width: 260px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 16px;
}
.mk-cell { display: flex; flex-direction: column; gap: 2px; }
.mk-cell span { font-size: 11.5px; color: var(--muted); }
.mk-cell b { font-family: var(--mono); font-size: 13.5px; color: var(--text); font-weight: 500; }
.mk-cell b.up { color: var(--up); }
.mk-cell b.down { color: var(--down); }

.mk-note {
  margin-top: 12px; padding: 8px 10px;
  font-size: 12px; color: var(--warn);
  background: rgba(240, 163, 58, .1);
  border: 1px solid rgba(240, 163, 58, .25);
  border-radius: var(--radius-sm);
}

/* ---------------- K 线画布 ---------------- */
.mk-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.mk-draw .chip { min-width: 34px; text-align: center; }

.mk-canvas-wrap {
  position: relative;
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mk-canvas-wrap canvas { display: block; cursor: crosshair; }

.mk-tip {
  position: absolute; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  font-size: 11.5px; color: var(--text-2);
  white-space: nowrap;
}
.mk-tip b { color: var(--text); font-family: var(--mono); }
.mk-tip b.up { color: var(--up); }
.mk-tip b.down { color: var(--down); }

/* ---------------- 时间平移滑杆 ---------------- */
.mk-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 0 2px;
}
.mk-nav-date {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  min-width: 76px;
  text-align: center;
  white-space: nowrap;
}
.mk-nav-track {
  position: relative;
  flex: 1;
  height: 22px;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  overflow: hidden;
}
.mk-nav-track::before {
  /* 刻度感：底纹 */
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--border-soft) 0 1px,
    transparent 1px 12px
  );
  opacity: .5;
}
.mk-nav-win {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  pointer-events: auto;
  cursor: grab;
  min-width: 6px;
  transition: background .12s ease;
}
.mk-nav-win:hover,
.mk-nav.drag .mk-nav-win {
  background: color-mix(in srgb, var(--accent) 34%, transparent);
}
.mk-nav.drag .mk-nav-win,
.mk-nav.drag .mk-nav-track { cursor: grabbing; }

/* ---------------- 行情结构列表 ---------------- */
.mk-pat-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.mk-pat-row:last-child { border-bottom: 0; }
.mk-pat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.mk-pat-head b { font-size: 13.5px; }
.mk-pat-head .muted { font-size: 11.5px; font-family: var(--mono); }
.mk-pat-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}
.mk-pat-row .muted { font-size: 11.5px; margin-top: 3px; }

.mk-canvas-hint {
  margin-top: 8px;
  font-size: 11.5px; color: var(--muted);
}

/* ---------------- 结构分析 ---------------- */
.mk-verdict {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.2fr);
  gap: 18px; margin-bottom: 12px;
}
@media (max-width: 720px) { .mk-verdict { grid-template-columns: 1fr; } }
.mk-verdict-l, .mk-verdict-r { display: flex; flex-direction: column; gap: 6px; }
.mk-verdict-l b { font-family: var(--mono); }
.mk-verdict-l b.up { color: var(--up); }
.mk-verdict-l b.down { color: var(--down); }
.mk-verdict-r b { font-size: 14px; color: var(--text); }

.mk-summary {
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px; line-height: 1.75; color: var(--text-2);
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.mk-inds {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
.mk-ind {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mk-ind span { font-size: 11px; color: var(--muted); }
.mk-ind b { font-family: var(--mono); font-size: 13.5px; color: var(--text); font-weight: 500; }

.mk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
@media (max-width: 720px) { .mk-two { grid-template-columns: 1fr; } }
.mk-col h4 {
  margin: 0 0 8px; font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .4px;
}

.mk-lv {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--border);
}
.mk-lv:last-child { border-bottom: none; }
.mk-lv b { font-family: var(--mono); font-size: 13.5px; color: var(--text); min-width: 78px; }
.mk-lv span { color: var(--text-2); font-size: 12px; }
.mk-lv i { font-style: normal; font-size: 11px; color: var(--muted); }
.mk-lv.up b { color: var(--up); }
.mk-lv.down b { color: var(--down); }

.mk-pat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel-2);
  border-left: 3px solid var(--muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.mk-pat b { font-size: 12.5px; color: var(--text); }
.mk-pat span { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.mk-pat.up { border-left-color: var(--up); }
.mk-pat.down { border-left-color: var(--down); }

.mk-ai { padding-top: 14px; border-top: 1px solid var(--border); }
.mk-ai h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .4px; }
.mk-ai-text {
  font-size: 13px; line-height: 1.85; color: var(--text-2);
  white-space: pre-wrap;
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
}

/* ---------- 盘前检查：弹窗一次性确认（v1.32） ---------- */
.pg-group { display: flex; flex-direction: column; gap: 8px; }
.pg-group-title { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.pg-choice {
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 9px 11px; background: var(--panel-2);
}
.pg-choice.warn {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--border-soft));
  background: color-mix(in srgb, var(--warn) 6%, var(--panel-2));
}
.pg-choice-top { display: flex; flex-direction: column; gap: 2px; }
.pg-choice-top .ck-text { font-size: 12.5px; font-weight: 600; }
.pg-choice-top .ck-std { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.6; }
.pg-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pg-opt {
  font: inherit; font-size: 11.5px; cursor: pointer; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-soft); background: var(--panel); color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
}
.pg-opt:hover { background: var(--hover); color: var(--text); }
.pg-opt.on {
  border-color: var(--accent); color: var(--text); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}
.pg-opt.risk.on {
  border-color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, var(--panel));
}
.pg-choice-note { margin: 7px 0 0; font-size: 11px; line-height: 1.65; color: var(--warn); }

/* ---------- 今日建议里的盘前检查（v1.32，不再单独占一个卡片） ---------- */
.ck-inline {
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 10px 12px; margin-bottom: 12px;
}
.ck-inline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ck-inline-head b { font-size: 12.5px; }
.ck-inline-head .muted { flex: 1 1 auto; font-size: 11.5px; }
.ck-inline .ck-list { max-height: 240px; overflow: auto; margin-top: 8px; }
.ck-choice {
  display: inline-block; margin-top: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border-soft); color: var(--muted); background: var(--panel);
}
.ck-choice.risk {
  color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border-soft));
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}
.ck-state { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ck-state span {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-soft); background: var(--panel); color: var(--text-2);
}
.ck-state span.risk {
  color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border-soft));
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}

/* 交易回合列表：条目下方内联展开的行情图 */
/* 回合详情弹窗最下方的行情图（原来在列表里就地展开，已搬到这里） */
.td-chart-sep { height: 1px; background: var(--border-soft); margin: 20px 0 14px; }
.td-chart-box { min-height: 300px; }
.td-chart-box .q-wrap { width: 100%; }
.td-chart-box .q-foot { font-size: 11px; color: var(--muted); }

/* 交易日历 · 当日盈亏拆解：合约行可点，跳到交易回合 */
.cd-table tbody tr.cd-jump:hover { background: var(--hover); }
.cd-table .cd-go { margin-left: 5px; font-size: 10px; opacity: .5; }
.cd-table tbody tr.cd-jump:hover .cd-go { opacity: 1; color: var(--accent); }
/* 交易回合列表：从日历定位过来的回合 */
.trades-table tbody tr.row-focus { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
#trFocusBar:empty { display: none; }
#trFocusBar { margin-bottom: 10px; }

/* ---------------- 复盘：执行评价 / 错误类型 ---------------- */
.rv-core { display: grid; gap: 12px; margin-bottom: 14px; }
.rv-block { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.rv-title { font-size: 12.5px; font-weight: 600; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.rv-req { font-weight: 400; font-size: 11px; color: var(--muted); }
.rv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-opts-sub { margin-top: 8px; }
.rv-opt { border: 1px solid var(--border); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 5px 13px; font-size: 12px; cursor: pointer; line-height: 1.5; }
.rv-opt:hover { border-color: var(--accent); color: var(--text); }
.rv-opt.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rv-opt.on[data-exec="deviate"], .rv-opt.on[data-exec="impulse"] {
  background: rgba(240,163,58,.14); border-color: var(--warn); color: var(--warn); }
.rv-hint { font-size: 11.5px; color: var(--muted); margin-top: 9px; line-height: 1.6; }

/* 复盘完成条 */
.rv-done { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: var(--panel-2); border: 1px dashed var(--border-soft);
  border-radius: var(--radius-sm); }
.rv-done-state { font-size: 12px; color: var(--muted); line-height: 1.5; }
.rv-done-state.ok { color: var(--accent); }
.rv-done-state.warn { color: var(--warn); }
.rv-done .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .rv-done { flex-direction: column; align-items: stretch; }
}

/* ---------------- 批量复盘 ---------------- */
.br-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 2px; }
.br-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.br-list { display: grid; gap: 10px; max-height: 58vh; overflow: auto; padding-right: 4px; }
.br-card { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--panel-2); }
.br-card.done { opacity: .5; }
.br-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 13px; }
.br-note { margin-top: 9px; width: 100%; }

/* ---------------- 复盘诊断：期望值 + 分布 ---------------- */
.diag-card .exp-row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--panel-2); border-radius: var(--radius-sm); }
.exp-main { min-width: 132px; }
.exp-label { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.exp-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.exp-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.exp-formula { flex: 1; min-width: 230px; font-size: 13px; line-height: 1.5; }
.exp-formula b { font-variant-numeric: tabular-nums; }
.exp-side { display: flex; gap: 28px; }
.exp-side div { display: flex; flex-direction: column; gap: 3px; }
.exp-side span { font-size: 11.5px; color: var(--muted); }
.exp-side b { font-size: 17px; font-variant-numeric: tabular-nums; }
.dist-block { min-width: 0; }
.dist-head { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dist-head .muted { font-weight: 400; font-size: 11.5px; }
.dist-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 32px 70px; align-items: center; gap: 10px; padding: 3px 0; font-size: 12px; }
.dist-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-track { height: 7px; background: var(--border-soft); border-radius: 4px; overflow: hidden; }
.dist-track i { display: block; height: 100%; border-radius: 4px; }
.dist-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.dist-extra { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }
.c-good { background: var(--accent); }
.c-bad { background: var(--warn); }
.c-loss { background: var(--down); }
.dist-empty { font-size: 12px; color: var(--muted); padding: 10px 0; line-height: 1.6; }
.dist-foot { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 8px; }

/* ---------------- 双击 K 线：当日分时弹窗 ---------------- */
.mk-min { display: flex; flex-direction: column; gap: 10px; }
.mk-min-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.mk-min-head > b.mono { font-size: 13px; }
.mk-min-kv { color: var(--muted); }
.mk-min-kv b { color: var(--text); font-variant-numeric: tabular-nums; }
.mk-min-kv b.up { color: var(--up); }
.mk-min-kv b.down { color: var(--down); }
.mk-min-wrap { width: 100%; background: var(--panel-2); border-radius: var(--radius-sm); padding: 6px 2px; }
.mk-min-wrap canvas { display: block; cursor: crosshair; }
.mk-min-foot { font-size: 11.5px; line-height: 1.6; }
.mk-min-foot .down { color: var(--down); }

/* ---------------- K 线缩放按钮 ---------------- */
.mk-zoom { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.mk-zoom .mk-zbtn {
  flex: 0 0 32px; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px solid var(--accent);
  background: var(--accent-soft); color: var(--accent);
  font-size: 19px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, transform .08s;
}
.mk-zoom .mk-zbtn:hover {
  background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft);
}
.mk-zoom .mk-zbtn:active { transform: scale(.92); }
.mk-zoom .mk-zbtn:disabled { opacity: .4; cursor: default; box-shadow: none; }
