:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-raised: #f5f5f5;
  --line: #eaecef;
  --line-soft: #f5f5f5;
  --text: #1e2329;
  --muted: #707a8a;
  --teal: #0ecb81;
  --teal-soft: #e8f8f1;
  --amber: #f0b90b;
  --amber-soft: #fdf6e3;
  --gold: #a87e00;
  --red: #f6465d;
  --red-soft: #fdecee;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; font-weight: 500; line-height: 1.6; }
button, select { font: inherit; }
button { cursor: pointer; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
button { color: inherit; }
select { min-width: 0; width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 7px; background: #ffffff; color: var(--text); padding: 9px 12px; }
select:focus { border-color: var(--teal); }
label { display: block; color: var(--muted); font-size: 14px; font-weight: 600; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.numeric, time, .summary-item strong { font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.button.primary { background: #fcd535; color: #1e2329; border-color: #fcd535; }
.button.primary:hover:not(:disabled) { background: #f0b90b; border-color: #f0b90b; }
.button.secondary { background: var(--panel-raised); border-color: var(--line); color: var(--text); }
.button.secondary:hover:not(:disabled) { background: #eaecef; border-color: #d8dcdf; }
.button.ghost { background: transparent; color: var(--muted); }
.button.ghost:hover:not(:disabled) { background: var(--panel-raised); color: var(--text); }
.button.compact { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.text-button { background: transparent; color: #0a9e6b; border: 0; text-underline-offset: 4px; padding: 5px; font-size: 14px; }
.text-button:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border: 1px solid #fcd535; background: #fcd535; color: #1e2329; border-radius: 10px; font-size: 19px; font-weight: 700; }
.brand-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 1.4px; }
.readonly-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid #cdeeda; border-radius: 6px; background: #e8f8f1; color: #0a9e6b; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--teal); }
.status-dot.neutral { background: #707a8a; }
.status-dot.busy { background: var(--amber); animation: pulse 1.5s ease-in-out infinite; }
.status-dot.failed { background: var(--red); }
.error-text { color: var(--red); font-size: 14px; overflow-wrap: anywhere; }
.noscript { position: fixed; z-index: 20; top: 0; left: 0; right: 0; padding: 16px; color: #8a6d00; background: var(--amber-soft); text-align: center; }
.skip-link { position: fixed; top: -70px; left: 20px; z-index: 10; padding: 10px 18px; background: #fcd535; color: #1e2329; }
.skip-link:focus { top: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 78px; border-bottom: 1px solid var(--line); padding: 15px max(28px, calc((100vw - 1480px) / 2)); background: #ffffff; gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.main-content { max-width: 1536px; padding: 38px 28px 20px; margin: 0 auto; }
.notice { padding: 12px 16px; margin-top: 10px; border: 1px solid; border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; line-height: 1.8; }
.notice.danger { background: #fef0f1; border-color: #fbd5da; color: #c93a4c; }
.notice.warning { background: var(--amber-soft); border-color: #f3e2ae; color: #8a6d00; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0; padding: 10px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.summary-item { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-width: 0; padding: 0 4px; white-space: nowrap; }
.summary-item + .summary-item { border-left: 1px solid var(--line); }
.summary-item > span { color: var(--muted); font-size: 14px; }
.summary-item strong { font-size: 20px; line-height: 1.3; font-weight: 650; }
.metric-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; }
.teal { background: var(--teal); }
.amber { background: var(--amber); }
.records-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.collapsible-panel > section + section { border-top: 1px solid var(--line); }
.collapsible-panel:not([open]) > *:not(summary) { display: none; }
.heatmap-panel .summary-grid { margin: 0 22px 12px; }
.rankings-panel { margin-bottom: 20px; }
.rankings-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); }
.ranking-board { min-width: 0; background: var(--panel); }
.ranking-board h3 { padding: 10px 12px 8px; font-size: 14px; font-weight: 700; }
.ranking-table td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table .rank-no { display: inline-block; margin-right: 4px; font-size: 12px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking-table .rank-symbol { min-width: 0; }
.ranking-table .rank-main { vertical-align: top; }
.ranking-table .rank-nums { width: 1%; text-align: right; white-space: nowrap; vertical-align: top; }
.ranking-table .rank-price { margin-left: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ranking-table .rank-value { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ranking-table .rank-empty { padding: 10px 12px; color: var(--muted); }
.rankings-panel .symbol-name { display: inline-block; vertical-align: bottom; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rankings-panel .symbol-code { display: inline; margin: 0 0 0 4px; max-width: none; font-size: 10px; }
.heatmap-panel { margin-bottom: 20px; }
.market-breadth { padding: 6px 22px 2px; }
.breadth-bar { display: flex; width: 100%; height: 16px; border-radius: 5px; overflow: hidden; background: var(--line-soft); }
.breadth-seg { height: 100%; min-width: 0; }
.breadth-seg.up { background: #0ecb81; }
.breadth-seg.flat { background: #b7bec7; }
.breadth-seg.down { background: #f6465d; }
.breadth-legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-top: 9px; font-size: 14px; font-weight: 650; }
.breadth-up { color: #0a8f5b; }
.breadth-flat { color: var(--muted); }
.breadth-down { color: #c8324a; }
.breadth-avg { color: var(--text); }
.breadth-avg.positive { color: #0a8f5b; }
.breadth-avg.negative { color: #c8324a; }
.heatmap { display: flex; flex-wrap: wrap; align-content: stretch; gap: 10px; width: 100%; margin: 0 0 6px; padding: 0 22px; box-sizing: border-box; }
.heat-col { flex: 1 1 0; min-width: 0; }
.heat-group { padding: 3px 0; font-size: 12px; font-weight: 700; }
.heat-group-up { color: #0a8f5b; }
.heat-group-down { color: #c8324a; }
.heat-group-flat { color: var(--muted); }
.heat-row { display: flex; align-items: center; gap: 6px; height: 20px; cursor: pointer; }
.heat-row:hover { background: rgba(0, 0, 0, .04); }
.heat-row:focus-visible { outline: 2px solid #1e2329; outline-offset: -2px; }
.heat-row.heat-held { box-shadow: inset 3px 0 0 #f0b90b; background: rgba(240, 185, 11, .10); }
.heat-track { position: relative; flex: 1 1 auto; min-width: 56px; height: 16px; background: rgba(0, 0, 0, .05); border-radius: 2px; overflow: hidden; }
.heat-bar { position: absolute; left: 0; top: 0; height: 100%; }
.heat-label { position: absolute; top: 0; height: 100%; display: flex; align-items: center; gap: 5px; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.heat-label-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.heat-label-pct { font-weight: 700; }
.heat-label-price { opacity: .82; }
.heat-label-dir { flex: 0 0 auto; padding: 0 2px; border-radius: 2px; background: #f0b90b; color: #1e2329; font-size: 9px; font-weight: 800; line-height: 12px; }
.heat-label-pnl { flex: 0 0 auto; padding: 0 3px; border-radius: 3px; background: rgba(30, 35, 41, .85); font-size: 16px; line-height: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.heat-label-pnl.positive { color: #0ecb81; }
.heat-label-pnl.negative { color: #f6465d; }
.heat-label-pnl.flat { color: #fff; }
.heat-label.positive { color: #0a8f5b; }
.heat-label.negative { color: #c8324a; }
.heat-label.in { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.heat-label.in .heat-label-price { opacity: .9; }
.heat-label.pin { padding: 0 3px; border-radius: 2px; background: rgba(30, 35, 41, .55); color: #fff; text-shadow: none; }
/* 条形窄时先压字号保住现价，而不是把现价隐掉 */
.heat-label.compact { font-size: 9px; gap: 2px; }
.heat-label.compact .heat-label-dir { padding: 0 1px; font-size: 8px; line-height: 10px; }
.heat-label.compact.pin { font-size: 8px; }
/* 条形最右的操作次数角标：常驻顶层、深底金字高对比，压在色条/灰底上都读得清；点击看该标的历史持仓。 */
.heat-count { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; min-width: 15px; height: 14px; padding: 0 3px; border: 0; border-radius: 7px; background: #1e2329; color: #f0b90b; font: 800 10px/14px system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; }
.heat-count:hover { background: #f0b90b; color: #1e2329; }
.heat-count:focus-visible { outline: 2px solid #f0b90b; outline-offset: 1px; }
.heat-up-5 { background: #0a8f5b; }
.heat-up-3 { background: #0ecb81; }
.heat-up-1 { background: #79dfb6; }
.heat-flat { background: #b7bec7; }
.heat-down-1 { background: #f6a7b2; }
.heat-down-3 { background: #f6465d; }
.heat-down-5 { background: #c8324a; }
.account-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 22px 12px; padding: 12px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.account-strip .summary-item > span { font-size: 13px; }
.account-strip .summary-item strong { font-size: 18px; }
.account-strip .account-unit { font-size: 11px; color: var(--muted); }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 22px 10px; }
.panel-heading h2 { font-size: 18px; font-weight: 700; }
.panel-heading h2 small, .panel-heading h2 span { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 8px; }
.panel-heading > span { color: var(--muted); font-size: 13px; }
.panel-toggle { cursor: pointer; list-style: none; padding: 12px 22px; flex-wrap: nowrap; }
.panel-toggle::-webkit-details-marker { display: none; }
.panel-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; }
.panel-toggle h2 { min-width: 0; }
.panel-toggle-label { flex-shrink: 0; }
.panel-heading h2 > span.panel-open-only { margin-left: 0; }
.collapsible-panel:not([open]) .panel-open-only,
.collapsible-panel:not([open]) .panel-collapse-label,
.collapsible-panel[open] .panel-expand-label { display: none; }
.panel-note { padding: 0 22px 14px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.panel-empty { padding: 18px 22px; color: var(--muted); font-size: 14px; }
.positions-table { table-layout: fixed; }
.range-caption { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding: 12px 22px; color: var(--muted); font-size: 12px; }
.records-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-height: 63px; }
#pnl-summary { color: var(--muted); font-size: 14px; font-weight: 600; }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-color: #c8ccd0 #ffffff; scrollbar-width: thin; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.cycles-table { table-layout: fixed; }
.sort-button { padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; line-height: inherit; }
.sort-button:hover, .sort-button[aria-pressed="true"] { color: #0a9e6b; }
.sort-button:focus-visible { outline-offset: 2px; }
.data-table th { padding: 12px 16px; background: #fafafa; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 22px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 22px; }
.data-table th small { display: block; font-size: 11px; color: #98a1ab; font-weight: 500; margin-top: 2px; }
.data-table td { padding: 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody > tr:last-child > td { border-bottom: 0; }
.data-table .numeric { text-align: right; white-space: nowrap; }
.data-table .entry-heading { color: var(--teal); }
.data-table .exit-heading { color: var(--gold); }
.cycle-row:hover > td { background: #fafafa; }
.symbol-name { display: block; font-weight: 650; color: var(--text); overflow-wrap: anywhere; max-width: 220px; }
.symbol-code { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; max-width: 220px; }
.subtext { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; }
.nowrap { white-space: nowrap; }
.price-entry { color: var(--teal); font-weight: 700; font-size: 15px; }
.price-exit { color: var(--gold); font-weight: 700; font-size: 15px; }
.price-unknown { color: var(--gold); font-size: 13px; font-weight: 600; }
.positive { color: var(--teal); }
.negative { color: var(--red); }
.pnl { font-weight: 650; }
.direction { display: inline-block; border-radius: 4px; padding: 2px 7px; background: var(--teal-soft); color: #0a9e6b; font-size: 12px; white-space: nowrap; }
.direction.short { color: var(--red); background: var(--red-soft); }
.entry-direction { padding: 1px 6px; font-size: 11px; }
.exit-verdict { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.exit-verdict[hidden] { display: none; }
.exit-verdict.sold-early { color: var(--red); background: var(--red-soft); }
.exit-verdict.escaped-top { color: #0a9e6b; background: var(--teal-soft); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 5px; background: var(--panel-raised); color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-badge.open { background: var(--teal-soft); color: #0a9e6b; }
.status-badge.partial { background: var(--amber-soft); color: var(--gold); }
.inherited-label { color: var(--gold); }
.cycles-table th, .cycles-table td, .positions-table th, .positions-table td { white-space: normal; overflow-wrap: anywhere; }
.cycles-table .numeric, .positions-table .numeric { white-space: normal; }
.cycles-table th:nth-child(1) { width: 24%; }
.cycles-table th:nth-child(2) { width: 34%; }
.cycles-table th:nth-child(3) { width: 42%; }
.positions-table th:nth-child(1) { width: 34%; }
.positions-table th:nth-child(2) { width: 26%; }
.positions-table th:nth-child(3) { width: 40%; }
.cycles-table td, .positions-table td { padding-top: 10px; padding-bottom: 10px; line-height: 1.4; }
/* 每个持仓压成一行高：三格内容全部内联不换行，多个仓位的总高约等于原来单行。 */
.positions-table td { padding-top: 4px; padding-bottom: 4px; white-space: nowrap; overflow: hidden; }
.positions-table .symbol-name { display: inline; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.positions-table .symbol-code { display: inline; margin: 0 0 0 4px; font-size: 10px; }
.positions-table .direction { margin-right: 4px; }
.positions-table .pnl { font-size: 13px; }
.positions-table .subtext { display: inline; margin: 0 0 0 4px; font-size: 10px; white-space: nowrap; }
.positions-table .position-prices .record-line { display: inline; margin-right: 8px; }
.positions-table .position-prices .record-line > :last-child { text-align: left; }
.positions-table .position-prices .record-label { font-size: 10px; margin-right: 1px; }
.positions-table .position-prices .price-entry, .positions-table .position-prices .mark-price, .positions-table .position-prices .numeric { font-size: 12px; }
.record-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.record-line { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.record-line + .record-line { margin-top: 3px; }
.record-label { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.cycle-prices .record-line > :last-child, .position-prices .record-line > :last-child { text-align: right; }
.mark-price { font-weight: 700; }
.price-value { display: inline-flex; align-items: baseline; justify-content: flex-end; flex-wrap: nowrap; gap: 5px; }
.cycle-net { font-size: 17px; font-weight: 800; }
.detail-row > td { padding: 0 !important; background: #fafafa; }
.detail-row .cycle-detail { padding: 5px 10px 6px; border-bottom: 1px solid var(--line); }
.detail-row .detail-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1px 10px; margin-bottom: 2px; }
.detail-row .detail-heading h3 { margin: 0; font-weight: 700; font-size: 13px; }
.detail-row .detail-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
.detail-row .detail-note { color: var(--muted); font-size: 11px; line-height: 1.35; margin: 0 0 4px; }
.detail-row .detail-table { font-size: 12px; background: #ffffff; border: 1px solid var(--line); }
.detail-row .detail-table th, .detail-row .detail-table td { padding: 2px 8px; line-height: 1.3; white-space: nowrap; overflow-wrap: normal; }
.detail-row .detail-table th:first-child, .detail-row .detail-table td:first-child { padding: 2px 8px; }
.detail-row .detail-table th:last-child, .detail-row .detail-table td:last-child { padding: 2px 8px; }
.detail-row .detail-table .price-entry, .detail-row .detail-table .price-exit, .detail-row .detail-table .price-unknown { font-size: 12px; }
.detail-row .detail-table .status-badge, .detail-row .detail-table .direction { padding: 0 5px; font-size: 11px; }
.detail-row .detail-empty { padding: 6px 10px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); text-align: center; font-size: 12px; }
.detail-footer { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.cycle-row { cursor: pointer; }
.cycle-row.expanded > td { background: #fafafa; }
.cycle-detail-hint { color: #0a9e6b; }
.detail-total { font-weight: 800; font-size: 13px; }
.detail-net { white-space: nowrap; }
.detail-arrow { color: var(--muted); }
.detail-table .detail-current > td { background: var(--amber-soft); }
.detail-current-tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: var(--amber); color: #1e2329; font-size: 10px; font-weight: 700; }
.empty-state { min-height: 280px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 38px 24px; text-align: center; }
.empty-symbol { display: flex; align-items: flex-end; gap: 5px; height: 30px; margin-bottom: 19px; opacity: .8; }
.empty-symbol span { display: block; width: 6px; border: 1px solid #cdeeda; border-radius: 2px; height: 17px; background: #e8f8f1; }
.empty-symbol span:nth-child(2) { height: 29px; }
.empty-symbol span:nth-child(3) { height: 22px; background: var(--amber-soft); border-color: #f3e2ae; }
.empty-state h2 { font-size: 18px; font-weight: 650; }
.empty-state p { font-size: 14px; color: var(--muted); max-width: 520px; margin-top: 9px; line-height: 1.9; }
.empty-state .button { margin-top: 20px; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pagination > div { display: flex; align-items: center; gap: 14px; }
.workspace-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: #98a1ab; font-size: 11px; letter-spacing: .6px; padding-top: 30px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30; max-width: calc(100vw - 32px); padding: 12px 20px; border: 1px solid #1e2329; background: #1e2329; color: #ffffff; border-radius: 9px; font-size: 14px; box-shadow: 0 8px 30px #00000026; }
.ranking-table tr.rank-clickable { cursor: pointer; }
.ranking-table tr.rank-clickable:hover td { background: var(--teal-soft); }
.ranking-table tr.rank-clickable:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.kline-modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 18px; background: #1e232966; }
.kline-modal[hidden] { display: none; }
.kline-card { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px #00000033; }
.history-body { padding: 4px 6px 10px; }
.history-body .cycle-detail { border-bottom: 0; padding: 6px 10px 4px; }
.kline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.kline-heading { min-width: 0; }
.kline-heading strong { display: block; font-size: 19px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.kline-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .4px; }
.kline-close { flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-raised); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.kline-close:hover { background: #ffffff; color: var(--text); }
.kline-chart { padding: 14px 12px 4px; }
.kline-svg { display: block; width: 100%; height: auto; }
.kline-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: center; padding: 6px 0 2px; font-size: 12px; color: var(--muted); }
.kline-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.kline-legend-swatch { width: 16px; height: 0; border-top-width: 2px; border-top-style: solid; }
.kline-legend-swatch.upper { border-top-color: #0ecb81; }
.kline-legend-swatch.middle { border-top-color: #f0b90b; }
.kline-legend-swatch.lower { border-top-color: #f6465d; }
.kline-legend-swatch.last { border-top-color: #1e2329; border-top-style: dashed; }
.kline-legend-note { letter-spacing: .4px; }
.kline-cross { padding: 4px 18px 6px; }
.kline-cross-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kline-cross-table th { padding: 7px 8px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.kline-cross-table td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.kline-cross-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.kline-src-name { font-weight: 650; color: var(--text); }
.kline-src-meta { display: block; color: var(--muted); font-size: 11px; }
.kline-price { font-weight: 700; color: var(--text); }
.kline-dev { color: var(--muted); font-weight: 600; }
.kline-dev.positive { color: var(--teal); }
.kline-dev.negative { color: var(--red); }
.kline-dev-flag { position: relative; }
.kline-dev-flag::after { content: "偏离大"; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--amber-soft); color: var(--gold); font-size: 10px; font-weight: 700; }
.kline-ref td { background: var(--panel-raised); }
.kline-cross-empty { padding: 8px; color: var(--muted); font-size: 13px; }
.kline-status { padding: 6px 18px 16px; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (min-width: 1600px) { .main-content { padding-top: 46px; } }
@media (max-width: 1000px) {
  .rankings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 12px 18px; }
  .topbar-actions { gap: 8px; }
  .topbar .brand { font-size: 14px; gap: 8px; }
  .topbar .brand-mark { width: 33px; height: 33px; font-size: 17px; }
  .topbar .brand-sub { font-size: 11px; letter-spacing: .5px; }
  .topbar .readonly-badge { padding: 4px 7px; font-size: 12px; }
  .topbar .button { font-size: 13px; padding: 7px; }
  .main-content { padding: 25px 16px 20px; }
  .summary-grid { padding: 8px 0; margin: 12px 0; }
  .summary-item { gap: 3px; padding: 0 2px; }
  .summary-item > span { font-size: 11px; }
  .summary-item strong { font-size: 14px; }
  .account-strip { margin: 12px 12px; padding: 10px 0; }
  .account-strip .summary-item { gap: 2px; padding: 0 1px; }
  .account-strip .summary-item > span { font-size: 9px; }
  .account-strip .summary-item strong { font-size: 11px; }
  /* 窄屏一行放不下三个「标签+金额+USDT」：隐藏重复的单位（下方说明已注明 USDT），只留标签+金额。 */
  .account-strip .account-unit { display: none; }
  .ranking-board h3 { padding: 8px 16px 6px; font-size: 14px; }
  .ranking-table td { padding: 7px 10px; font-size: 13px; }
  .market-breadth { padding: 6px 16px 2px; }
  .heatmap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }   /* five columns are unreadable this narrow: fall back to a 2+2+1 grid */
  .heat-col:nth-child(5) { grid-column: 1 / -1; }   /* the fifth column takes the whole bottom row instead of leaving a hole */
  .heatmap-panel .summary-grid { margin: 0 16px 10px; }
  select { font-size: 16px; }
  .range-caption { padding: 12px 16px; gap: 4px; }
  .records-toolbar { padding: 0 16px; gap: 8px; min-height: 57px; }
  .view-tabs { gap: 18px; }
  .view-tabs button { font-size: 14px; padding-top: 16px; padding-bottom: 14px; }
  .records-toolbar .button { font-size: 12px; padding: 6px 9px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
  .pagination { padding: 14px 16px; }
  .pagination > div { gap: 12px; }
  .empty-state { min-height: 260px; padding: 30px 18px; }
  .workspace-footer { font-size: 11px; padding-top: 22px; }
}
@media (max-width: 560px) {
  .rankings-grid { grid-template-columns: minmax(0, 1fr); }
  .heatmap { gap: 8px; padding: 0 12px; }
  .heat-track { min-width: 48px; }
  .heat-label { font-size: 10px; gap: 4px; }
}
@media (max-width: 380px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar .readonly-badge { font-size: 11px; gap: 5px; }
  .main-content { padding-left: 10px; padding-right: 10px; }
  .records-toolbar { padding-left: 12px; padding-right: 12px; }
  .view-tabs { gap: 13px; }
}
@media (max-width: 800px) {
  .cycles-table, .positions-table { font-size: 13px; }
  .cycles-table th, .cycles-table td, .cycles-table th:first-child, .cycles-table td:first-child, .cycles-table th:last-child, .cycles-table td:last-child,
  .positions-table th, .positions-table td, .positions-table th:first-child, .positions-table td:first-child, .positions-table th:last-child, .positions-table td:last-child { padding: 8px 5px; }
  .cycles-table th:nth-child(1) { width: 20%; }
  .cycles-table th:nth-child(2) { width: 34%; }
  .cycles-table th:nth-child(3) { width: 46%; }
  .record-line { gap: 3px; }
  .cycles-table .price-entry, .cycles-table .price-exit, .positions-table .price-entry { font-size: inherit; }
  .cycles-table .cycle-net { font-size: 15px; }
  .cycles-table .status-badge, .cycles-table .direction, .positions-table .direction { padding: 1px 3px; font-size: 11px; }
  /* 持仓行仍压成一行：覆盖上面 8px 的竖向内边距。 */
  .positions-table td { padding-top: 4px; padding-bottom: 4px; }
}
@media (max-width: 480px) {
  .cycles-table, .positions-table { font-size: 12px; }
  .cycles-table th, .positions-table th { font-size: 11px; }
  .cycles-table td, .positions-table td { line-height: 1.3; }
  .record-line { display: block; }
  .record-label { margin-right: 3px; font-size: 11px; }
  .cycles-table .cycle-net { font-size: 14px; }
  .record-line > :last-child { display: inline; }
  .cycles-table .record-line > .price-value { display: inline-flex; gap: 4px; }
  /* 入场/平仓盈亏/现价三档价格在窄屏也保持右对齐网格：标签宽度不一，但价格作为每行最右元素贴齐同一右边缘、竖排不错位。 */
  .cycle-prices .record-line { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px; }
  .cycle-prices .record-line > .record-label { margin-right: 0; }
  /* 持仓行的三档价格在窄屏也保持一行内联，不跟随 .record-line 的 block 堆叠。 */
  .positions-table .position-prices .record-line { display: inline; margin-right: 8px; }
  .positions-table .position-prices .record-line > :last-child { display: inline; }
  /* 窄屏一行排不下三档价格：允许单元格内换行，避免横向溢出把强平价裁掉。 */
  .positions-table td { white-space: normal; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
