:root {
  --canvas: #f4f2ec;
  --paper: #fffefa;
  --ink: #11110f;
  --muted: #77766f;
  --hairline: #dedcd4;
  --soft-line: #ebe8df;
  --lime: #dceeb1;
  --lilac: #cdbcf5;
  --cream: #f3e9cf;
  --mint: #c9e7d1;
  --coral: #f2c9b7;
  --magenta: #ff3d8b;
  --chart: #171719;
  --chart-grid: #2c2d30;
  --success: #16794b;
  --danger: #b83e35;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(34, 31, 23, .08);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-width: 1180px; min-height: 100vh; background: var(--canvas); }
.topbar { height: 68px; display: flex; align-items: center; gap: 30px; padding: 0 22px; background: var(--paper); border-bottom: 1px solid var(--hairline); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 190px; color: inherit; text-decoration: none; }
.brand-mark { width: 29px; height: 34px; display: grid; grid-template: repeat(2, 1fr) / repeat(2, 1fr); gap: 2px; }
.dot { display: block; border-radius: 50%; }
.dot-coral { background: #f05a43; border-bottom-right-radius: 3px; }
.dot-lilac { background: #9c7af2; border-bottom-left-radius: 3px; }
.dot-ink { background: #191919; border-top-right-radius: 3px; }
.dot-lime { background: #a8c94f; border-top-left-radius: 3px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 14px; letter-spacing: .04em; }
.brand-copy small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: .23em; margin-top: 5px; color: var(--muted); }
.main-nav { display: flex; height: 100%; align-items: center; gap: 4px; }
.nav-item { height: 38px; border: 0; background: transparent; border-radius: 999px; padding: 0 15px; font-size: 13px; cursor: pointer; }
.nav-item:hover { background: #f2f0ea; }
.nav-item.active { color: white; background: var(--ink); }
.nav-item span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 10px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.live-pill { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--hairline); border-radius: 999px; font-size: 11px; background: white; }
.live-pill i, .status-dot, .pulse-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #21a766; box-shadow: 0 0 0 4px rgba(33, 167, 102, .12); }
.icon-button, .avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hairline); background: white; cursor: pointer; }
.avatar { background: var(--lilac); border-color: var(--ink); font-size: 11px; font-weight: 700; }

.workspace { height: calc(100vh - 68px); display: grid; grid-template-columns: 210px minmax(650px, 1fr) 390px; }
.market-rail { padding: 20px 14px; border-right: 1px solid var(--hairline); overflow: auto; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 13px; }
.eyebrow { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.plus-button { border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.search-box { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.watchlist { display: grid; gap: 5px; margin-top: 13px; }
.watch-item { position: relative; width: 100%; display: flex; align-items: stretch; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; }
.watch-item:hover { background: rgba(255,255,255,.65); }
.watch-item.active { background: var(--paper); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.watch-main { min-width: 0; flex: 1; display: flex; justify-content: space-between; padding: 11px 28px 11px 10px; border: 0; border-radius: inherit; background: transparent; text-align: left; cursor: pointer; }
.watch-main > span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.watch-delete { position: absolute; top: 50%; right: 5px; width: 22px; height: 22px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; opacity: 0; cursor: pointer; transition: .15s ease; }
.watch-item:hover .watch-delete, .watch-item:focus-within .watch-delete { opacity: 1; }
.watch-delete:hover { background: #f5d9d5; color: #9f392f; }
.watch-item strong { font-size: 12px; }
.watch-item small { font-size: 10px; color: var(--muted); }
.quote { text-align: right; }
.quote.up small { color: var(--success); }.quote.down small { color: var(--danger); }
.quote.flat small { color: var(--muted); }
.rail-card { margin-top: 20px; padding: 15px; border-radius: var(--radius-md); border: 1px solid rgba(17,17,15,.72); }
.lime-card { background: var(--lime); }
.rail-card-title { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; font-size: 12px; font-weight: 700; }
.rail-card > p:last-child { margin: 10px 0 0; font-size: 10px; line-height: 1.55; color: #4f5541; }
.switch input { display: none; }.switch span { position: relative; display: block; width: 34px; height: 20px; border: 1px solid var(--ink); border-radius: 999px; background: white; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background: var(--ink); transition: .2s; }
.switch input:checked + span::after { transform: translateX(14px); }.switch input:checked + span { background: var(--ink); }.switch input:checked + span::after { background: var(--lime); }
.status-card { background: var(--paper); border-color: var(--hairline); }
.status-card > div:first-child { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.status-card p { margin: 8px 0 12px; font-size: 10px; color: var(--muted); }
.mini-metrics { display: flex; border-top: 1px solid var(--soft-line); padding-top: 10px; justify-content: space-between; font-size: 9px; color: var(--muted); }.mini-metrics b { color: var(--ink); }

.main-stage { min-width: 0; padding: 16px; overflow: auto; }
.command-bar { min-height: 64px; display: flex; align-items: end; gap: 9px; padding: 11px 12px; border: 1px solid var(--hairline); background: var(--paper); border-radius: var(--radius-md); }
.field-group { display: grid; gap: 5px; min-width: 112px; }.field-group.symbol-field { min-width: 96px; }.field-group.exchange-field { min-width: 104px; }
.field-group label { font-size: 9px; color: var(--muted); }
.field-group select, .field-group input { height: 33px; min-width: 0; padding: 0 9px; border: 1px solid var(--hairline); background: white; border-radius: 7px; outline: 0; font-size: 11px; }
.field-group input:focus, .field-group select:focus { border-color: var(--ink); }
.symbol-search-wrap { position: relative; min-width: 0; }
.symbol-search-wrap > input { width: 100%; }
.symbol-suggestions { position: absolute; z-index: 80; top: calc(100% + 7px); left: 0; width: min(360px, calc(100vw - 44px)); max-height: 320px; overflow: auto; padding: 6px; border: 1px solid var(--ink); border-radius: 11px; background: var(--paper); box-shadow: 0 14px 30px rgba(17,17,15,.18); }
.symbol-suggestions[hidden] { display: none; }
.symbol-suggestion { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 9px; width: 100%; min-height: 50px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.symbol-suggestion:hover, .symbol-suggestion.active { background: var(--lilac); }
.symbol-market { display: grid; place-items: center; min-height: 23px; padding: 0 5px; border: 1px solid var(--hairline); border-radius: 999px; background: white; font: 8px ui-monospace, monospace; }
.symbol-result-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 8px; min-width: 0; }
.symbol-result-copy strong { font: 11px ui-monospace, monospace; }
.symbol-result-copy b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.symbol-result-copy small { grid-column: 1 / -1; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.symbol-suggestion-message { padding: 14px 12px; color: var(--muted); font-size: 10px; text-align: center; }
.timeframe-group { display: flex; gap: 2px; padding: 3px; background: #efede7; border-radius: 9px; }
.timeframe-group button { min-width: 32px; height: 31px; border: 0; border-radius: 7px; background: transparent; font-size: 10px; cursor: pointer; }
.timeframe-group button.active { background: var(--ink); color: white; }
.primary-button, .secondary-button { height: 38px; padding: 0 15px; border-radius: 999px; white-space: nowrap; font-size: 11px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }.primary-button span { margin-left: 7px; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--lilac); }
.secondary-button { border: 1px solid var(--ink); background: white; }

.flow-track { display: flex; align-items: center; margin: 12px 0; padding: 13px 16px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.flow-step { display: flex; align-items: center; gap: 8px; min-width: 105px; opacity: .45; }.flow-step.complete, .flow-step.active { opacity: 1; }
.flow-step > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--hairline); border-radius: 50%; font: 9px ui-monospace, monospace; }
.flow-step.complete > span { background: var(--lime); border-color: var(--ink); }.flow-step.active > span { background: var(--lilac); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(205,188,245,.35); }
.flow-step p { display: grid; gap: 2px; margin: 0; }.flow-step small { font-size: 8px; color: var(--muted); }.flow-step strong { font-size: 9px; }
.flow-line { height: 1px; min-width: 15px; flex: 1; margin: 0 8px; background: var(--hairline); }.flow-line.complete { background: var(--ink); }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 12px; }
.summary-card { min-height: 86px; padding: 13px 14px; border: 1px solid rgba(17,17,15,.55); border-radius: var(--radius-md); }
.summary-card p { margin: 0 0 9px; font-size: 9px; color: rgba(17,17,15,.62); }.summary-card strong { display: block; font-size: 15px; }.summary-card span { display: block; margin-top: 8px; font: 8px ui-monospace, monospace; letter-spacing: .09em; }
.lilac { background: var(--lilac); }.cream { background: var(--cream); }.mint { background: var(--mint); }.coral { background: var(--coral); }

.chart-card { min-height: 540px; overflow: hidden; background: var(--chart); color: #f4f3ef; border: 1px solid #080808; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.chart-header { height: 72px; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid #2c2d30; }
.chart-header .eyebrow { color: #7f8188; }.chart-header h1 { margin: 5px 0 0; font-size: 17px; }.chart-header h1 small { font-weight: 400; font-size: 10px; color: #8f9096; }
.chart-price { display: grid; gap: 3px; }.chart-price strong { font: 16px ui-monospace, SFMono-Regular, monospace; }.chart-price span { color: #6fd6a2; font: 9px ui-monospace, monospace; }
.chart-tools { margin-left: auto; display: flex; gap: 5px; }.tool-button, .more-button { height: 30px; padding: 0 9px; border: 1px solid #34353a; border-radius: 7px; background: #202125; color: #a6a7ad; font-size: 9px; cursor: pointer; }.tool-button.active { border-color: #777880; color: white; }.more-button { width: 32px; }
.legend { height: 34px; display: flex; align-items: center; gap: 16px; padding: 0 18px; font: 9px ui-monospace, monospace; color: #85878e; }.legend i { width: 11px; height: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }.legend b { color: #c1c2c6; font-weight: 400; }.ema20 { background: #d8b4fe; }.atr14 { background: #f3c56b; }.market-state { margin-left: auto; color: #6fd6a2; }
.chart-wrap { position: relative; height: 390px; }.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-watermark { position: absolute; left: 22px; bottom: 20px; color: rgba(255,255,255,.06); font-weight: 900; font-size: 42px; letter-spacing: -.05em; pointer-events: none; }.chart-watermark span { color: rgba(205,188,245,.11); }
.structure-label { position: absolute; right: 42px; padding: 4px 8px; border-radius: 5px; font: 8px ui-monospace, monospace; }.structure-label.resistance { top: 45px; color: #f6baa2; border: 1px solid rgba(242,201,183,.35); background: rgba(242,201,183,.08); }.structure-label.support { bottom: 51px; color: #bfe7ca; border: 1px solid rgba(201,231,209,.3); background: rgba(201,231,209,.07); }
.chart-footer { height: 36px; position: relative; display: flex; justify-content: space-around; align-items: center; padding-right: 170px; border-top: 1px solid #292a2e; color: #65676e; font: 8px ui-monospace, monospace; }.chart-status { position: absolute; right: 15px; display: flex; align-items: center; gap: 8px; }.pulse-dot { width: 5px; height: 5px; box-shadow: none; }

.inspector { display: flex; min-width: 0; flex-direction: column; background: var(--paper); border-left: 1px solid var(--hairline); }
.inspector-head { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--hairline); }.inspector-head h2 { margin: 5px 0 0; font-size: 17px; }.inspector-context { display: grid; justify-items: end; gap: 5px; }.asset-chip, .model-chip { padding: 5px 8px; border-radius: 999px; font: 8px ui-monospace, monospace; }.asset-chip { max-width: 155px; overflow: hidden; background: var(--lime); text-overflow: ellipsis; white-space: nowrap; }.model-chip { background: var(--lilac); }
.inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 10px; border-bottom: 1px solid var(--hairline); }.inspector-tabs button { height: 32px; border: 0; border-radius: 999px; background: transparent; font-size: 10px; cursor: pointer; }.inspector-tabs button.active { background: var(--ink); color: white; }
.inspector-scroll { flex: 1; overflow: auto; padding: 13px; }.tab-panel { display: none; }.tab-panel.active { display: grid; gap: 11px; animation: reveal .24s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ai-stage, .diagnosis-card, .decision-hero, .price-plan, .forecast-card, .path-card, .debug-card { border: 1px solid var(--hairline); border-radius: var(--radius-md); background: white; }
.ai-stage { overflow: hidden; }.ai-stage > header { display: flex; align-items: center; gap: 9px; padding: 13px; }.stage-index { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font: 8px ui-monospace, monospace; }.ai-stage header div { display: grid; gap: 2px; }.ai-stage header p { margin: 0; font-size: 8px; color: var(--muted); }.ai-stage header strong { font-size: 12px; }.running-chip, .waiting-chip { margin-left: auto; padding: 5px 8px; border-radius: 999px; font-size: 8px; }.running-chip { background: var(--lime); }.waiting-chip { background: #eeeae2; color: var(--muted); }
.active-stage { border-color: var(--ink); box-shadow: 3px 3px 0 var(--lilac); }.reasoning-stream { padding: 2px 14px 13px; font-size: 11px; line-height: 1.65; color: #45443f; }.reasoning-stream p { margin: 0 0 8px; }.cursor-dot { width: 6px; height: 6px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--magenta); animation: blink 1.2s infinite; }@keyframes blink { 50% { opacity: .25; } }
.stream-history-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid rgba(17,17,15,.18); border-radius: 9px; background: var(--lilac); }
.stream-history-banner span { font-size: 9px; font-weight: 800; letter-spacing: .04em; }.stream-history-banner small { overflow: hidden; color: #5e526f; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.recorded-stream-block { padding-left: 10px; border-left: 2px solid #cdbcf5; }
.ai-stage > footer { display: flex; justify-content: space-between; padding: 9px 13px; border-top: 1px solid var(--soft-line); font: 8px ui-monospace, monospace; color: var(--muted); }.muted-stage { opacity: .62; }
.diagnosis-card { padding: 14px; background: var(--lilac); border-color: var(--ink); }.diagnosis-top { display: flex; justify-content: space-between; font-size: 9px; }.diagnosis-top strong { font: 25px ui-monospace, monospace; }.diagnosis-top small { font-size: 9px; }.diagnosis-card h3 { margin: 8px 0 11px; font-size: 15px; line-height: 1.35; }.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }.tag-row span { padding: 5px 7px; border: 1px solid rgba(17,17,15,.45); border-radius: 999px; font-size: 8px; }.confidence-bar { height: 4px; margin-top: 13px; border-radius: 999px; background: rgba(255,255,255,.55); }.confidence-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.decision-hero { padding: 18px; background: var(--cream); border-color: var(--ink); }.wait-badge { display: inline-block; margin-top: 11px; padding: 6px 9px; border-radius: 999px; background: var(--ink); color: white; font-size: 8px; }.decision-hero h3 { margin: 14px 0 8px; font-size: 24px; letter-spacing: -.04em; }.decision-hero > p:last-child { margin: 0; font-size: 11px; line-height: 1.6; color: #5f594e; }
.price-plan { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }.price-plan div { display: grid; gap: 6px; padding: 14px; border-bottom: 1px solid var(--soft-line); }.price-plan div:nth-child(odd) { border-right: 1px solid var(--soft-line); }.price-plan span { font-size: 8px; color: var(--muted); }.price-plan strong { font: 13px ui-monospace, monospace; }
.forecast-card { padding: 14px; background: var(--mint); }.forecast-card p { margin: 0; font-size: 9px; }.forecast-card h3 { margin: 9px 0; font-size: 14px; }.forecast-card h3 span { float: right; font: 18px ui-monospace, monospace; }.forecast-card > div { display: flex; height: 7px; overflow: hidden; border-radius: 999px; }.forecast-card i:nth-child(1) { background: #27875a; }.forecast-card i:nth-child(2) { background: #e2b44d; }.forecast-card i:nth-child(3) { background: #c55b50; }.forecast-card footer { display: flex; justify-content: space-between; margin-top: 8px; font-size: 7px; color: #496151; }
.path-card { padding: 16px; background: #faf8f3; }.path-card h3 { margin: 8px 0 18px; font-size: 17px; }.path-card ol { list-style: none; margin: 0; padding: 0; }.path-card li { position: relative; display: flex; gap: 11px; min-height: 62px; }.path-card li:not(:last-child)::after { content: ""; position: absolute; width: 1px; top: 29px; bottom: 4px; left: 13px; background: var(--hairline); }.path-card li > span { z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: white; border: 1px solid var(--hairline); font-size: 9px; }.path-card li.passed > span { background: var(--lime); border-color: var(--ink); }.path-card li.current > span { background: var(--lilac); border-color: var(--ink); }.path-card li div { display: grid; align-content: start; gap: 4px; padding-top: 2px; }.path-card li strong { font-size: 11px; }.path-card li small { font-size: 9px; color: var(--muted); }
.debug-card { overflow: hidden; }.debug-card > div { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--soft-line); font-size: 10px; font-weight: 700; }.debug-card button { border: 0; background: transparent; font-size: 8px; text-decoration: underline; cursor: pointer; }.debug-card code { display: block; padding: 14px; font: 9px/1.8 ui-monospace, monospace; color: #dedee4; background: #19191c; }.debug-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 13px; gap: 9px; font-size: 9px; }.debug-card dt { color: var(--muted); }.debug-card dd { margin: 0; text-align: right; font-family: ui-monospace, monospace; }
.chat-composer { padding: 11px 13px 13px; border-top: 1px solid var(--hairline); background: var(--paper); }.chat-composer > label { display: block; margin-bottom: 7px; font-size: 9px; font-weight: 700; }.chat-composer > div { display: flex; align-items: end; gap: 8px; padding: 8px; border: 1px solid var(--hairline); border-radius: 12px; background: white; }.chat-composer textarea { flex: 1; resize: none; border: 0; outline: 0; font-size: 10px; line-height: 1.45; }.chat-composer button { width: 29px; height: 29px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--ink); color: white; cursor: pointer; }.chat-composer small { display: block; margin-top: 6px; font-size: 7px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px); padding: 10px 15px; border-radius: 999px; background: var(--ink); color: white; font-size: 10px; opacity: 0; pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(17,17,15,.48); backdrop-filter: blur(4px); }
.settings-modal { width: min(520px, 100%); overflow: hidden; border: 1px solid var(--ink); border-radius: 24px; background: var(--paper); box-shadow: 8px 8px 0 var(--ink); animation: reveal .2s ease; }
.settings-modal header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--hairline); background: var(--lilac); }.settings-modal header h2 { margin: 5px 0 0; font-size: 20px; }.settings-modal header button { width: 32px; height: 32px; border: 1px solid var(--ink); border-radius: 50%; background: white; cursor: pointer; }
.settings-form { display: grid; gap: 14px; padding: 20px 22px; }.settings-form label { display: grid; gap: 6px; font-size: 10px; font-weight: 700; }.settings-form input, .settings-form select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--hairline); border-radius: 9px; background: white; outline: none; font-size: 11px; }.settings-form input:focus, .settings-form select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime); }.settings-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.settings-form .secret-hint { margin: -5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }.settings-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.history-overlay { position: fixed; inset: 0; z-index: 28; background: rgba(17,17,15,.34); backdrop-filter: blur(3px); }
.history-drawer { position: absolute; inset: 0 0 0 auto; width: min(430px, 94vw); display: flex; flex-direction: column; border-left: 1px solid var(--ink); background: var(--canvas); box-shadow: -10px 0 28px rgba(17,17,15,.16); animation: drawer-in .24s ease; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.history-drawer > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 22px 18px; border-bottom: 1px solid var(--hairline); background: var(--lime); }.history-drawer h2 { margin: 5px 0 4px; font-size: 24px; }.history-drawer header small { font-size: 9px; color: #4f5541; }.history-drawer header button { width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; background: white; cursor: pointer; font-size: 18px; }
.history-list { flex: 1; display: grid; align-content: start; gap: 9px; overflow: auto; padding: 14px; }.history-item { display: grid; gap: 8px; width: 100%; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--paper); text-align: left; cursor: pointer; transition: .16s ease; }.history-item:hover { transform: translateX(-3px); border-color: var(--ink); box-shadow: 4px 4px 0 var(--lilac); }.history-item.loading { opacity: .55; pointer-events: none; }.history-item-top { display: flex; align-items: center; justify-content: space-between; }.history-item-top strong { font-size: 14px; }.history-item-top i { padding: 4px 7px; border-radius: 999px; background: var(--ink); color: white; font: normal 8px ui-monospace, monospace; }.history-item-meta { color: var(--muted); font: 8px ui-monospace, monospace; }.history-item-tags { display: flex; flex-wrap: wrap; gap: 5px; }.history-item-tags em { padding: 5px 7px; border: 1px solid var(--soft-line); border-radius: 999px; background: #f3f0e9; font: normal 8px sans-serif; }.history-empty { padding: 40px 22px; border: 1px dashed var(--hairline); border-radius: var(--radius-md); text-align: center; background: var(--paper); }.history-empty p { font-size: 10px; line-height: 1.6; color: var(--muted); }
.cancel-button { background: #9f392f !important; border-color: #9f392f !important; }

body.contrast { --canvas: #e9e6dd; --paper: #fff; --lilac: #bca2f6; --lime: #cfe894; }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 188px minmax(610px, 1fr) 350px; }
  .field-group.exchange-field { display: none; }
  .summary-card { padding: 11px; }
  .summary-card strong { font-size: 13px; }
}

@media (max-width: 900px) {
  .app-shell { min-width: 0; }
  .topbar { padding: 0 12px; }.brand { min-width: auto; }.brand-copy small, .main-nav { display: none; }
  .live-pill { display: none; }
  .workspace { height: auto; display: block; }
  .market-rail { display: none; }
  .main-stage { padding: 10px; overflow: visible; }
  .command-bar { align-items: stretch; flex-wrap: wrap; }.field-group { flex: 1; }.field-group.exchange-field { display: none; }.timeframe-group { order: 5; width: 100%; justify-content: space-between; }.timeframe-group button { flex: 1; }
  .flow-track { overflow-x: auto; }.flow-step { min-width: 110px; }.flow-line { min-width: 18px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .chart-card { min-height: 480px; }.chart-wrap { height: 330px; }.chart-tools .tool-button:not(.active) { display: none; }
  .inspector { border: 0; margin: 0 10px 20px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }.inspector-scroll { max-height: none; }.inspector-head { background: var(--paper); }
}

@media (max-width: 720px) {
  .analysis-history-drawer .history-list { padding-top: 12px; }
  .history-table-head { display: none; }
  .history-table-row { min-width: 0; }
  .analysis-history-drawer .history-item { grid-template-columns: 1fr; }
  .analysis-history-drawer .history-main { grid-template-columns: 1fr 1fr; min-height: 0; }
  .history-cell { min-height: 76px; border-bottom: 1px solid var(--soft-line); }
  .history-cell:nth-child(even) { border-right: 0; }
  .history-cell small { display: block; }
  .analysis-history-drawer .item-actions { display: flex; border-top: 0; }
  .analysis-history-drawer .item-actions button { flex: 1; text-align: center; }
}

@media (max-width: 520px) {
  .brand-mark { width: 25px; height: 30px; }.top-actions { gap: 6px; }
  .command-bar .field-group { min-width: calc(50% - 8px); }.primary-button, .secondary-button { flex: 1; }
  .flow-track { padding-left: 12px; }.summary-grid { gap: 7px; }
  .chart-header { height: auto; min-height: 82px; flex-wrap: wrap; padding: 12px; }.chart-price { margin-left: auto; }.chart-tools { width: 100%; margin: 0; }.chart-wrap { height: 285px; }.chart-footer { padding-right: 0; }.chart-footer > span:nth-child(even) { display: none; }.chart-status { display: none; }
  .inspector { margin: 0 10px 14px; }.inspector-head { padding: 0 13px; }.model-chip { display: none; }
}

/* Web 完整版扩展 */
.command-bar { flex-wrap: wrap; }
.field-group.mode-field { min-width: 92px; }
.compact-check { height: 38px; display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 9px; color: var(--muted); }
.compact-check small { color: var(--danger); font: 8px ui-monospace, monospace; }
.summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-card strong { overflow-wrap: anywhere; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #74767d; font-size: 11px; pointer-events: none; }
.watch-empty { margin: 10px; color: var(--muted); font-size: 10px; text-align: center; }
.inspector-tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.inspector-tabs button { min-width: 54px; padding: 0 9px; }
.reasoning-stream { max-height: 42vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.reasoning-stream { min-height: 180px; scroll-behavior: auto; overscroll-behavior: contain; }
.stream-stats { flex-wrap: wrap; gap: 5px 10px; }
.stream-stats #charStats { order: 3; width: 100%; line-height: 1.45; color: #5b5b62; }
.empty-copy { color: var(--muted); font-size: 10px; line-height: 1.6; }
.detail-card { overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: white; }
.detail-row { padding: 12px 14px; border-bottom: 1px solid var(--soft-line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); font-size: 8px; }
.detail-row p { margin: 5px 0 0; white-space: pre-wrap; font-size: 10px; line-height: 1.6; }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-title-row h3 { margin-bottom: 15px; }
.panel-title-row button { padding: 6px 11px; border: 1px solid var(--ink); border-radius: 999px; background: var(--lime); font-size: 9px; cursor: pointer; }
.tree-content { display: grid; gap: 7px; }
.tree-content details { border: 1px solid var(--soft-line); border-radius: 9px; background: white; }
.tree-content summary { padding: 10px; cursor: pointer; font-size: 10px; font-weight: 700; }
.tree-node { display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--soft-line); font-size: 9px; line-height: 1.5; }
.tree-node b { font-family: ui-monospace, monospace; }
.probability-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 7px; padding: 7px 12px; font-size: 9px; }
.probability-row i { height: 5px; overflow: hidden; border-radius: 99px; background: var(--soft-line); }
.probability-row b { display: block; height: 100%; background: var(--lilac); }
.probability-row strong { text-align: right; font-family: ui-monospace, monospace; }
.debug-card pre, .demo-controls pre { max-height: 56vh; margin: 0; overflow: auto; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: #19191c; color: #dedee4; font: 9px/1.65 ui-monospace, monospace; }
.chat-composer small button { width: auto; height: auto; margin-left: 5px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); text-decoration: underline; font-size: inherit; }
.modal-body { max-height: min(76vh, 820px); overflow: auto; }
.settings-wide { width: min(720px, 96vw); }
.settings-form h3 { margin: 5px 0 -3px; padding-bottom: 7px; border-bottom: 1px solid var(--hairline); font-size: 12px; }
.settings-check { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 8px !important; }
.settings-check input { width: 16px !important; height: 16px !important; }
.notification-actions, .demo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-summary { padding: 22px; }
.alert-summary > strong { font-size: 25px; }
.alert-summary p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.alert-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 13px; border-radius: 12px; background: var(--cream); font-size: 10px; }
.alert-summary dd { margin: 0; text-align: right; font-family: ui-monospace, monospace; }
.drawer-search { display: flex; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.drawer-search input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 9px; }
.drawer-search button { padding: 0 12px; border: 1px solid var(--ink); border-radius: 9px; background: white; cursor: pointer; }
.history-item { padding: 0; cursor: default; overflow: hidden; }
.history-item:hover { transform: none; }
.history-main { display: grid; gap: 8px; width: 100%; padding: 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.item-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--soft-line); }
.item-actions button { border: 0; background: transparent; color: var(--muted); font-size: 8px; text-decoration: underline; cursor: pointer; }
.trade-item { padding: 14px; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--paper); }
.trade-item > div { display: flex; justify-content: space-between; }
.trade-item i { padding: 4px 7px; border-radius: 99px; background: var(--ink); color: white; font: normal 8px ui-monospace, monospace; }
.trade-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.trade-item p { font-size: 10px; }
.trade-item dl { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; font-size: 8px; }
.trade-item dd { margin: 0; text-align: right; }
.trade-item a { font-size: 9px; color: var(--ink); }
.demo-controls { display: grid; gap: 14px; padding: 18px 20px 22px; }
.demo-controls > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.demo-mode-note { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; padding: 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--cream); }
.demo-mode-note span { color: var(--muted); font-size: 9px; }.demo-mode-note strong { text-align: right; font: 10px ui-monospace, monospace; }.demo-mode-note small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.55; }
.file-label { display: inline-flex; align-items: center; cursor: pointer; }
.file-label input { display: none; }

.demo-replay-bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; padding: 10px 11px 13px; border: 1px solid var(--ink); border-radius: 12px; background: var(--lime); box-shadow: 3px 3px 0 var(--ink); }
.demo-replay-bar[hidden] { display: none; }
.demo-replay-copy { display: flex; min-width: 0; align-items: center; gap: 8px; }.demo-replay-copy > div { display: grid; min-width: 0; gap: 2px; }.demo-replay-copy small { font: 7px ui-monospace, monospace; letter-spacing: .1em; }.demo-replay-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.demo-live-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 0 4px rgba(201,89,134,.15); animation: blink 1s infinite; }
.demo-replay-actions { display: flex; flex: 0 0 auto; gap: 4px; }.demo-replay-actions button { padding: 5px 7px; border: 1px solid rgba(17,17,15,.35); border-radius: 99px; background: rgba(255,255,255,.7); font-size: 8px; cursor: pointer; }
.demo-replay-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 4px; background: rgba(255,255,255,.5); }.demo-replay-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--magenta), #7654a6); transition: width .08s linear; }

/* 分析记录采用有表头的大号数据表，普通查看与演示选择共用 */
.analysis-history-drawer { width: min(1120px, 98vw); }
.analysis-history-drawer .history-list { display: block; padding: 0 16px 20px; overflow: auto; }
.history-table-head, .history-table-row { min-width: 1030px; }
.history-table-head { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 130px 170px minmax(150px, 1.2fr) 80px minmax(130px, 1fr) 90px 80px 150px; align-items: center; margin: 0 -1px; padding: 12px 0; border-bottom: 1px solid var(--ink); background: var(--canvas); color: #67665f; font-size: 11px; font-weight: 800; }
.history-table-head span { padding: 0 12px; }
.analysis-history-drawer .history-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px; margin-top: 10px; overflow: hidden; border: 1px solid #a7a49c; border-radius: 13px; background: white; }
.analysis-history-drawer .history-item:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--lilac); }
.analysis-history-drawer .history-main { display: grid; grid-template-columns: 130px 170px minmax(150px, 1.2fr) 80px minmax(130px, 1fr) 90px 80px; align-items: stretch; gap: 0; min-height: 76px; padding: 0; }
.history-cell { display: grid; min-width: 0; align-content: center; gap: 5px; padding: 12px; border-right: 1px solid var(--soft-line); }
.history-cell small { display: none; color: var(--muted); font-size: 10px; font-weight: 500; }
.history-cell strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.asset-cell { grid-template-columns: 1fr auto; }.asset-cell small { grid-column: 1 / -1; }.asset-cell strong { font-size: 16px; }.asset-cell i { align-self: center; padding: 4px 7px; border-radius: 99px; background: var(--ink); color: white; font: normal 9px ui-monospace, monospace; }
.time-cell strong { font: 11px/1.5 ui-monospace, monospace; }
.confidence-cell strong { color: #65458f; font: 15px ui-monospace, monospace; }
.status-cell b { width: fit-content; padding: 5px 8px; border-radius: 99px; font-size: 10px; }.status-cell b.success { background: var(--lime); color: #394226; }.status-cell b.failed { background: #f4d0ca; color: #8e3730; }
.analysis-history-drawer .item-actions { display: grid; align-content: center; gap: 5px; padding: 10px; border-top: 0; background: #f4f1ea; }
.analysis-history-drawer .item-actions button { padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; font-size: 10px; text-align: left; text-decoration: none; }
.analysis-history-drawer .item-actions button[data-action="view"] { border-color: var(--ink); background: var(--lime); color: var(--ink); font-weight: 800; }
.analysis-history-drawer .item-actions button:hover { border-color: var(--ink); background: white; color: var(--ink); }

/* 与桌面端对齐的决策树 */
.decision-tree-card { display: grid; gap: 13px; padding: 13px; }
.decision-tree-card > h3 { margin: 0; }
.terminal-banner { display: grid; gap: 3px; padding: 12px 13px; border: 1px solid var(--hairline); border-radius: 12px; text-align: center; background: #f1eee7; }
.terminal-banner small { font: 7px ui-monospace, monospace; color: var(--muted); letter-spacing: .1em; }
.terminal-banner strong { font-size: 13px; }
.terminal-banner span { font-size: 9px; color: var(--muted); }
.terminal-banner.outcome-trade { border-color: #438e68; background: #dff3e7; color: #276747; }
.terminal-banner.outcome-reject { border-color: #b75e54; background: #fae4df; color: #923b34; }
.terminal-banner.outcome-wait, .terminal-banner.outcome-proceed { border-color: #b89a54; background: #f7edcf; color: #765f29; }
.tree-block { overflow: hidden; border: 1px solid var(--soft-line); border-radius: 12px; background: white; }
.tree-block-title { display: grid; gap: 3px; padding: 11px 12px; border-bottom: 1px solid var(--soft-line); }
.tree-block-title strong { font-size: 11px; }
.tree-block-title small { font-size: 8px; color: var(--muted); }
.path-table-wrap { max-height: 290px; overflow: auto; }
.path-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 8px; line-height: 1.45; }
.path-table th { position: sticky; top: 0; z-index: 1; padding: 8px; background: #f1eee7; color: var(--muted); text-align: left; white-space: nowrap; }
.path-table td { max-width: 210px; padding: 8px; border-top: 1px solid var(--soft-line); vertical-align: top; }
.path-table td:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-table tr[data-node-id] { cursor: pointer; }
.path-table tr[data-node-id]:hover { background: #f6f2ff; }
.path-table tr.skipped { opacity: .55; }
.answer { font-style: normal; font-weight: 800; }
.answer-yes { color: #27875a; }.answer-no { color: #b34a42; }.answer-neutral { color: #9b741c; }
.tree-content details { overflow: hidden; }
.tree-content summary { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 6px; }
.tree-content summary span { font-family: ui-monospace, monospace; color: #7e68a7; }
.tree-content summary b { padding: 3px 6px; border-radius: 99px; background: #f0ede6; color: var(--muted); font-size: 7px; }
.tree-node { grid-template-columns: 38px minmax(150px, 1fr) 55px 65px; align-items: start; }
.tree-node em, .tree-node small { text-align: right; font-size: 8px; }
.tree-node:not(.visited) { color: #a3a19b; }
.tree-node.visited { background: #f3edff; color: var(--ink); font-weight: 650; }
.tree-node.visited b { color: #6e4aac; }
.tree-node.located { animation: node-pulse 1.2s ease; }
@keyframes node-pulse { 0%,100% { box-shadow: none; } 35% { box-shadow: inset 0 0 0 2px #8a69c6; background: var(--lilac); } }
.gate-hint { margin: 0; font-size: 8px; line-height: 1.55; color: var(--muted); }

/* 可缩放、可回放的决策路径画布 */
.flow-visual { padding: 12px; }
.flow-title-row { align-items: flex-start; flex-direction: column; }
.flow-title-row h3 { margin-bottom: 9px; }
.flow-controls { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; }
.flow-controls button { padding: 5px 8px; background: white; }
.flow-controls button:first-child { background: var(--lime); }
.flow-hud { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 8px; padding: 8px 10px; border: 1px solid #28292d; border-radius: 8px; background: #17181b; color: #dadbe0; font: 7px ui-monospace, monospace; }
.flow-hud b { color: #d4ef9e; text-align: right; }
.flow-canvas-viewport { height: min(62vh, 680px); overflow: auto; border: 1px solid #313237; border-radius: 12px; background-color: #16171a; background-image: radial-gradient(#35363b 1px, transparent 1px); background-size: 18px 18px; cursor: grab; }
.flow-canvas-viewport.dragging { cursor: grabbing; user-select: none; }
.flow-canvas { width: 760px; min-height: 100%; padding: 22px 28px 45px; transform-origin: top left; color: #e8e8eb; }
.flow-empty { display: grid; min-height: 400px; place-items: center; color: #777981; font-size: 10px; }
.flow-phase { display: flex; align-items: center; gap: 10px; width: 330px; margin: 8px auto 14px; padding: 8px 12px; border: 1px solid #54565e; border-radius: 99px; background: #24252a; }
.flow-phase span { padding: 3px 7px; border-radius: 99px; background: #cdbcf5; color: #19191c; font: 7px ui-monospace, monospace; }
.flow-phase strong { font-size: 10px; }
.flow-node-row { position: relative; display: grid; grid-template-columns: 210px 330px 210px; align-items: center; min-height: 132px; transition: opacity .25s; }
.flow-node-row.lean-left .flow-node { grid-column: 2; transform: translateX(-35px); }
.flow-node-row.lean-right .flow-node { grid-column: 2; transform: translateX(35px); }
.flow-node-row.lean-left .flow-alt { grid-column: 3; }
.flow-node-row.lean-right .flow-alt { grid-column: 1; grid-row: 1; }
.flow-node { padding: 12px; border: 1px solid #696b74; border-radius: 12px; background: #24252a; box-shadow: 0 5px 16px rgba(0,0,0,.24); }
.flow-node header, .flow-node footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flow-node header b { color: #d4ef9e; font: 9px ui-monospace, monospace; }
.flow-node header em { color: #8d8f98; font: normal 7px ui-monospace, monospace; }
.flow-node > strong { display: block; margin: 9px 0; font-size: 11px; line-height: 1.5; }
.flow-node footer small { color: #8d8f98; font: 8px ui-monospace, monospace; }
.flow-node p { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #38393f; color: #acadb4; font-size: 8px; line-height: 1.55; }
.flow-alt { position: relative; display: grid; gap: 5px; max-width: 190px; padding: 9px 10px; border: 1px dashed #55575f; border-radius: 9px; color: #777983; font-size: 8px; }
.flow-alt::after { content: ""; position: absolute; top: 50%; width: 55px; border-top: 1px dashed #55575f; }
.lean-left .flow-alt::after { right: 100%; }.lean-right .flow-alt::after { left: 100%; }
.flow-alt small { color: #a1a2a9; }.flow-alt span { line-height: 1.45; }
.flow-connector { width: 2px; height: 28px; margin: -6px auto; background: linear-gradient(#d4ef9e, #9f82d2); }
.flow-terminal { display: grid; gap: 4px; width: 330px; margin: 10px auto; padding: 14px; border: 1px solid #d4ef9e; border-radius: 12px; background: #273126; text-align: center; }
.flow-terminal small { color: #d4ef9e; font: 8px ui-monospace, monospace; }.flow-terminal strong { font-size: 13px; }
.flow-terminal.outcome-reject { border-color: #dd756b; background: #382523; }.flow-terminal.outcome-wait { border-color: #d8b768; background: #342f21; }
.flow-node-row.playing .flow-node { border-color: #d4ef9e; box-shadow: 0 0 0 3px rgba(212,239,158,.16), 0 0 25px rgba(205,188,245,.26); }
.flow-canvas.is-playing .flow-node-row:not(.played):not(.playing) .flow-node { opacity: .38; }
.flow-progress { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e5e1d8; }.flow-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #9f82d2, #b9db78); transition: width .25s; }
.flow-visual:fullscreen { padding: 24px; background: #efede7; }.flow-visual:fullscreen .flow-canvas-viewport { height: calc(100vh - 130px); }

/* 桌面端未来预期的双模块信息结构 */
.forecast-heading { display: flex; justify-content: space-between; gap: 12px; padding: 3px 2px; }.forecast-heading h3 { margin: 5px 0 0; }.forecast-heading small { max-width: 130px; color: var(--muted); text-align: right; font-size: 8px; }
.forecast-card { border-color: #92af9d; }
.forecast-card h3 { line-height: 1.5; }
.forecast-card #barPredictionBars { display: flex; height: 8px; }
.forecast-card .forecast-reason, .forecast-reason { display: block; height: auto; margin-top: 12px; padding: 11px; border-radius: 9px; background: rgba(255,255,255,.62); white-space: pre-wrap; font-size: 9px; line-height: 1.65; color: #505751; }
.cycle-forecast-card { padding: 14px; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: #f5f1fb; }
.cycle-forecast-card .panel-title-row > span { color: #755b9f; font-size: 9px; font-weight: 800; }
.cycle-top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 13px 0 9px; }
.cycle-chip { display: grid; gap: 5px; min-width: 0; padding: 10px; border: 1px solid #bca8de; border-radius: 10px; background: white; }
.cycle-chip small { color: #8b75ae; font: 7px ui-monospace, monospace; }.cycle-chip strong { font-size: 9px; line-height: 1.4; }.cycle-chip b { color: #65458f; font: 15px ui-monospace, monospace; }
.cycle-chip.rank-1 { border-color: #7356a0; box-shadow: 2px 2px 0 #d8c9ef; }.cycle-chip.unpredictable { grid-column: 1 / -1; text-align: center; }
.cycle-rest { overflow: hidden; border: 1px solid #dfd5ed; border-radius: 9px; background: white; }
.cycle-forecast-card .forecast-reason { background: white; color: #554e5c; }
.forecast-empty { opacity: .7; }

/* 桌面端原始会话：轮次列表 + 四个独立数据区 */
.raw-workbench { overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: white; }
.raw-workbench > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-bottom: 1px solid var(--soft-line); }.raw-workbench h3 { margin: 4px 0 0; font-size: 14px; }
.raw-workbench button { border: 0; background: transparent; color: inherit; font-size: 8px; text-decoration: underline; cursor: pointer; }
.raw-layout { display: grid; grid-template-columns: 100px minmax(0, 1fr); min-height: 560px; }
.raw-turns { padding: 8px; border-right: 1px solid var(--soft-line); background: #f4f1ea; }
.raw-turns button { display: grid; gap: 3px; width: 100%; margin-bottom: 6px; padding: 9px 7px; border: 1px solid transparent; border-radius: 8px; text-align: left; text-decoration: none; }
.raw-turns button.active { border-color: var(--ink); background: var(--lime); }.raw-turns button strong { font-size: 8px; }.raw-turns button small { color: var(--muted); font-size: 7px; }
.raw-detail { min-width: 0; padding: 8px; background: #1a1b1f; }
.raw-detail section { margin-bottom: 8px; overflow: hidden; border: 1px solid #36373d; border-radius: 9px; }
.raw-detail section > header { display: flex; justify-content: space-between; padding: 8px 10px; background: #27282d; color: #dadbe0; font-size: 8px; }.raw-detail section button { color: #aeb0b7; }
.raw-detail pre { min-height: 70px; max-height: 230px; margin: 0; overflow: auto; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; background: #17181b; color: #d6d7db; font: 8px/1.55 ui-monospace, monospace; }

@media (max-width: 1450px) {
  .workspace { grid-template-columns: 190px minmax(620px, 1fr) 360px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .compact-check { order: 8; }
}

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .mode-field { order: 4; }
  .compact-check { order: 4; }
  .inspector-tabs button { flex: 1 0 58px; }
  .main-nav { position: fixed; z-index: 25; right: 10px; bottom: 10px; left: 10px; display: flex; justify-content: space-around; height: 52px; padding: 6px; border: 1px solid var(--hairline); border-radius: 18px; background: rgba(255, 254, 250, .94); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
  .nav-item { flex: 1; height: 38px; padding: 0 7px; font-size: 10px; }
  body { padding-bottom: 66px; }
}

@media (max-width: 520px) {
  .summary-grid { grid-template-columns: 1fr; }
  .settings-form .form-row { grid-template-columns: 1fr; }
  .chart-tools { overflow-x: auto; }
  .cycle-top3 { grid-template-columns: 1fr; }
  .raw-layout { grid-template-columns: 1fr; }
  .raw-turns { display: flex; gap: 5px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--soft-line); }
  .raw-turns button { min-width: 90px; margin: 0; }
  .path-table { min-width: 590px; }
  .demo-replay-bar { align-items: flex-start; flex-direction: column; }
  .demo-replay-actions { width: 100%; }.demo-replay-actions button { flex: 1; }
  .analysis-history-drawer .history-main { grid-template-columns: 1fr; }
  .history-cell { border-right: 0; }
}

/* 手机端采用自选 / 图表 / 分析分区，避免把桌面三栏简单纵向堆叠 */
.mobile-dock { display: none; }
.mobile-analysis-stop[hidden] { display: none !important; }

@media (max-width: 900px) {
  html { scroll-behavior: smooth; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-shell { min-width: 0; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 24;
    height: 60px;
    padding: 0 max(12px, env(safe-area-inset-left));
    background: rgba(255, 254, 250, .94);
    backdrop-filter: blur(14px);
  }
  .brand { min-width: 0; }
  .brand-copy small, .main-nav { display: none; }
  .top-actions { min-width: 0; }
  .live-pill {
    display: flex;
    min-width: 0;
    max-width: 142px;
    height: 32px;
    overflow: hidden;
    padding: 0 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .icon-button, .avatar { width: 38px; height: 38px; flex: 0 0 auto; }

  .workspace { min-height: calc(100dvh - 60px - 74px); height: auto; display: block; }
  .workspace > .market-rail,
  .workspace > .main-stage,
  .workspace > .inspector { display: none; }
  .workspace[data-mobile-view="market"] > .market-rail { display: block; }
  .workspace[data-mobile-view="chart"] > .main-stage { display: block; }
  .workspace[data-mobile-view="analysis"] > .inspector { display: flex; }

  .market-rail {
    min-height: calc(100dvh - 134px);
    padding: 18px 14px 28px;
    overflow: visible;
    border-right: 0;
  }
  .rail-heading { padding-inline: 3px; }
  .plus-button { width: 44px; height: 44px; display: grid; place-items: center; }
  .search-box { height: 46px; border-radius: 12px; }
  .watchlist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .watch-item { min-height: 66px; background: rgba(255, 255, 255, .58); }
  .watch-main { min-height: 64px; padding: 12px 34px 12px 12px; }
  .watch-delete { width: 30px; height: 30px; right: 4px; opacity: 1; }
  .rail-card { margin-top: 14px; }

  .main-stage { padding: 10px 10px 24px; overflow: visible; }
  .command-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    padding: 12px;
  }
  .command-bar .field-group { min-width: 0; width: 100%; }
  .command-bar .field-group:first-child,
  .command-bar .timeframe-group,
  .command-bar .compact-check { grid-column: 1 / -1; }
  .command-bar .field-group:first-child { order: 1; }
  .command-bar .symbol-field { order: 2; }
  .command-bar .mode-field { order: 3; }
  .command-bar .timeframe-group { order: 4; width: 100%; overflow-x: auto; }
  .command-bar .compact-check { order: 5; min-height: 34px; }
  .command-bar .secondary-button { order: 6; }
  .command-bar .primary-button { order: 7; }
  .field-group select, .field-group input { height: 42px; font-size: 13px; }
  .symbol-suggestions { width: min(360px, calc(100vw - 44px)); max-height: min(360px, 48dvh); }
  .timeframe-group button { min-width: 44px; height: 38px; flex: 1; font-size: 11px; }
  .primary-button, .secondary-button { min-height: 44px; }
  .compact-check { font-size: 11px; }
  .compact-check input { width: 18px; height: 18px; }

  .flow-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 7px; margin: 10px 0; overflow: visible; padding: 9px; }
  .flow-track .flow-line { display: none; }
  .flow-step { min-width: 0; min-height: 58px; padding: 9px; border: 1px solid var(--soft-line); border-radius: 10px; background: #f8f6f0; scroll-snap-align: none; }
  .flow-step p { min-width: 0; }
  .flow-step strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { min-height: 92px; }

  .chart-card { min-height: 0; border-radius: 18px; }
  .chart-header { min-height: 78px; height: auto; padding: 12px 14px; }
  .chart-tools { overflow-x: auto; scrollbar-width: none; }
  .chart-tools .tool-button:not(.active) { display: inline-block; }
  .tool-button { min-width: 54px; min-height: 36px; }
  .chart-wrap { height: min(48dvh, 390px); min-height: 300px; touch-action: pan-y; }
  .chart-watermark { font-size: 30px; }

  .inspector {
    min-height: calc(100dvh - 134px);
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .inspector-head {
    min-height: 76px;
    height: auto;
    padding: 12px 14px;
    background: var(--paper);
  }
  .inspector-context { max-width: 48%; }
  .asset-chip { max-width: 160px; }
  .inspector-tabs {
    position: sticky;
    top: 60px;
    z-index: 12;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(255, 254, 250, .96);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }
  .inspector-tabs button { min-width: 64px; height: 40px; flex: 1 0 64px; font-size: 11px; }
  .inspector-scroll { flex: none; min-height: 58dvh; max-height: none; overflow: visible; padding: 12px 10px; }
  .reasoning-stream { max-height: 52dvh; min-height: 220px; }
  .chat-composer {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 11;
    box-shadow: 0 -10px 24px rgba(34, 31, 23, .08);
  }
  .chat-composer textarea { font-size: 12px; }
  .chat-composer button { width: 38px; height: 38px; }

  .mobile-dock {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 32;
    height: 60px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid rgba(17, 17, 15, .18);
    border-radius: 20px;
    background: rgba(255, 254, 250, .94);
    box-shadow: 0 14px 40px rgba(34, 31, 23, .18);
    backdrop-filter: blur(16px);
  }
  .mobile-dock.has-analysis-stop { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mobile-dock button {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    cursor: pointer;
  }
  .mobile-dock button span { font-size: 16px; line-height: 1; }
  .mobile-dock button small { font-size: 9px; }
  .mobile-dock button.active { background: var(--ink); color: white; }
  .mobile-dock button.active span { color: var(--lime); }
  .mobile-dock .mobile-analysis-stop { background: #9f3027; color: white; }
  .mobile-dock .mobile-analysis-stop:disabled { opacity: .58; cursor: wait; }

  .modal-backdrop { align-items: end; padding: 0; }
  .settings-modal {
    width: 100%;
    max-height: 94dvh;
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -16px 44px rgba(17, 17, 15, .22);
  }
  .settings-modal header { padding: 16px 18px; }
  .modal-body { max-height: calc(94dvh - 72px); }
  .settings-form { padding: 16px 18px calc(22px + env(safe-area-inset-bottom)); }
  .history-drawer { inset: 0 0 calc(76px + env(safe-area-inset-bottom)) 0; width: 100%; height: auto; overflow: hidden; border-left: 0; }
  .history-drawer > header { padding-top: max(20px, env(safe-area-inset-top)); }
  .history-overlay { max-width: 100vw; overflow-x: hidden; }
  .analysis-history-drawer { width: 100%; max-width: 100vw; }
  .analysis-history-drawer > header { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; }
  .analysis-history-drawer > header > div { min-width: 0; }
  .analysis-history-drawer > header h2 { max-width: 100%; overflow-wrap: anywhere; line-height: 1.15; }
  .analysis-history-drawer > header small { display: block; max-width: 100%; overflow-wrap: anywhere; line-height: 1.45; }
  .analysis-history-drawer > header button { width: 40px; height: 40px; align-self: start; }
  .analysis-history-drawer .history-list { min-width: 0; min-height: 0; overflow-x: hidden; overscroll-behavior: contain; }
  .analysis-history-drawer .history-table-head { display: none; }
  .analysis-history-drawer .history-table-row { min-width: 0; max-width: 100%; }
  .analysis-history-drawer .history-item { min-width: 0; max-width: 100%; grid-template-columns: 1fr; }
  .analysis-history-drawer .history-main { min-width: 0; max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
  .analysis-history-drawer .history-cell { min-width: 0; border-bottom: 1px solid var(--soft-line); }
  .analysis-history-drawer .history-cell small { display: block; }
  .analysis-history-drawer .history-cell:nth-child(1),
  .analysis-history-drawer .history-cell:nth-child(2),
  .analysis-history-drawer .history-cell:nth-child(5) { grid-column: 1 / -1; border-right: 0; }
  .analysis-history-drawer .history-cell:nth-child(4),
  .analysis-history-drawer .history-cell:nth-child(7) { border-right: 0; }
  .analysis-history-drawer .item-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; }
  .analysis-history-drawer .item-actions button { min-width: 0; text-align: center; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); white-space: normal; text-align: center; }
}

@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .brand-mark { width: 24px; height: 28px; }
  .brand-copy strong { font-size: 12px; }
  .top-actions { gap: 5px; }
  .live-pill { max-width: 106px; padding: 0 8px; font-size: 9px; }
  .icon-button, .avatar { width: 36px; height: 36px; }

  .watchlist { grid-template-columns: 1fr; }
  .watch-main { font-size: 12px; }
  .command-bar { gap: 9px; padding: 10px; }
  .command-bar .field-group { min-width: 0; }
  .flow-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step:last-child { grid-column: 1 / -1; }
  .summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-right: 0; overflow: visible; padding-right: 0; }
  .summary-card { min-width: 0; min-height: 88px; scroll-snap-align: none; }
  .summary-card:last-child { grid-column: 1 / -1; }
  .chart-header { gap: 10px; }
  .chart-header h1 { max-width: 185px; }
  .chart-price { margin-left: auto; }
  .chart-tools { width: 100%; margin: 0; }
  .chart-tools .tool-button { flex: 1 0 58px; }
  .legend { gap: 10px; padding: 0 12px; }
  .market-state { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chart-wrap { height: 340px; min-height: 0; }

  .inspector-head { padding: 11px 12px; }
  .inspector-head h2 { font-size: 16px; }
  .model-chip { display: none; }
  .inspector-tabs { padding-inline: 8px; }
  .inspector-scroll { padding-inline: 8px; }
  .stream-stats { font-size: 8px; }
  .price-plan { grid-template-columns: 1fr 1fr; }
  .cycle-top3 { grid-template-columns: 1fr; }
  .tree-node { grid-template-columns: 32px minmax(0, 1fr); }
  .tree-node em, .tree-node small { grid-column: 2; text-align: left; }
  .flow-visual { min-width: 0; padding: 10px; }
  .flow-controls { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flow-controls button { min-width: 0; min-height: 38px; padding-inline: 6px; }
  #zoomOutFlowButton, #zoomInFlowButton { display: none; }
  .flow-hud { align-items: flex-start; flex-direction: column; }
  .flow-hud b { text-align: left; }
  .flow-canvas-viewport { width: 100%; height: auto; max-height: none; overflow-x: hidden; overflow-y: visible; cursor: default; }
  .flow-canvas-viewport.dragging { cursor: default; user-select: auto; }
  .flow-canvas { width: 100%; min-height: 360px; padding: 16px 10px 30px; transform: none !important; }
  .flow-empty { min-height: 320px; padding: 20px; text-align: center; }
  .flow-phase, .flow-terminal { width: min(100%, 330px); }
  .flow-node-row,
  .flow-node-row.lean-left,
  .flow-node-row.lean-right {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 10px 0;
  }
  .flow-node-row.lean-left .flow-node,
  .flow-node-row.lean-right .flow-node {
    width: 100%;
    order: 1;
    transform: none;
  }
  .flow-node-row.lean-left .flow-alt,
  .flow-node-row.lean-right .flow-alt {
    width: calc(100% - 24px);
    max-width: none;
    order: 2;
    margin-inline: 12px;
  }
  .flow-alt::after { display: none; }
  .flow-node > strong, .flow-node p, .flow-alt span { overflow-wrap: anywhere; }
  .flow-connector { height: 22px; margin: 0 auto; }
  .flow-visual:fullscreen { padding: 10px; overflow: auto; }
  .flow-visual:fullscreen .flow-canvas-viewport { height: auto; }
  .raw-workbench > header { align-items: flex-start; flex-direction: column; }
  .raw-workbench > header > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .raw-layout { min-height: 0; }

  .settings-form .form-row { grid-template-columns: 1fr; }
  .settings-form footer { position: sticky; bottom: 0; padding: 10px 0; background: var(--paper); }
  .settings-form footer button { flex: 1; }
  .drawer-search { padding: 10px; }
  .history-drawer > header { padding: max(16px, env(safe-area-inset-top)) 14px 12px; }
  .analysis-history-drawer > header h2 { margin-top: 4px; font-size: clamp(20px, 6vw, 24px); }
  .analysis-history-drawer > header small { margin-top: 6px; font-size: 10px; }
  .analysis-history-drawer .history-list { padding: 8px 10px calc(20px + env(safe-area-inset-bottom)); }
  .analysis-history-drawer .history-item { min-width: 0; grid-template-columns: 1fr; margin-top: 8px; }
  .analysis-history-drawer .history-main { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-cell { min-width: 0; min-height: 64px; padding: 10px 11px; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
  .history-cell:nth-child(even) { border-right: 1px solid var(--soft-line); }
  .history-cell:nth-child(1), .history-cell:nth-child(2), .history-cell:nth-child(5) { grid-column: 1 / -1; border-right: 0; }
  .history-cell:nth-child(4), .history-cell:nth-child(7) { border-right: 0; }
  .history-cell strong { overflow-wrap: anywhere; word-break: break-word; }
  .asset-cell { min-height: 58px; }
  .analysis-history-drawer .item-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px; }
  .analysis-history-drawer .item-actions button { min-width: 0; min-height: 42px; text-align: center; }
}

@media (max-width: 360px) {
  .brand-copy { display: none; }
  .live-pill { max-width: 96px; }
  .mobile-dock button small { font-size: 8px; }
  .command-bar { grid-template-columns: 1fr; }
  .command-bar > * { grid-column: 1 !important; }
  .analysis-history-drawer > header .eyebrow { display: none; }
}
