:root {
  color-scheme: light;
  --ink: #18201d;
  --ink-soft: #53605b;
  --paper: #f5f6f2;
  --surface: #ffffff;
  --line: #d9ded8;
  --line-strong: #b9c2ba;
  --accent: #157a55;
  --accent-dark: #0d5e40;
  --bull: #cf3e3e;
  --bear: #158465;
  --amber: #b57618;
  --danger-soft: #fff2f0;
  --green-soft: #edf7f2;
  --amber-soft: #fff7e8;
  --shadow: 0 12px 30px rgba(30, 43, 37, 0.08);
  --radius: 6px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 15%, rgba(21, 122, 85, 0.12), transparent 32%),
    linear-gradient(135deg, #eef3ed 0%, #f8f8f4 52%, #ecefe9 100%);
}
.auth-shell { width: min(960px, 100%); min-height: 580px; display: grid; grid-template-columns: 1.05fr 0.95fr; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 70px rgba(24, 32, 29, 0.14); }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff; background: linear-gradient(155deg, #17231e 0%, #163c2e 100%); }
.auth-brand .brand-mark { background: #fff; color: var(--accent-dark); }
.auth-brand .brand-en, .auth-intro .eyebrow { color: rgba(255, 255, 255, 0.62); }
.auth-intro h1 { max-width: 500px; margin: 14px 0 18px; font-size: clamp(30px, 4vw, 48px); line-height: 1.13; letter-spacing: -0.04em; }
.auth-intro > div > p:not(.eyebrow) { max-width: 460px; margin: 0; color: rgba(255, 255, 255, 0.72); line-height: 1.8; }
.auth-disclaimer { margin: 0; color: rgba(255, 255, 255, 0.5); font-size: 11px; line-height: 1.6; }
.auth-card { align-self: center; padding: 52px 56px; }
.auth-card h2 { margin: 8px 0 8px; font-size: 28px; }
.auth-lead { margin: 0 0 26px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.auth-tab { height: 36px; border: 0; border-radius: 4px; color: var(--ink-soft); background: transparent; font-size: 12px; font-weight: 700; }
.auth-tab.is-active { color: #fff; background: var(--ink); }
.auth-card form { display: grid; gap: 16px; }
.auth-submit { width: 100%; height: 42px; margin-top: 4px; }
.auth-link { margin: 18px auto 0; display: block; padding: 0; border: 0; color: var(--accent-dark); background: transparent; font-size: 12px; }
.auth-help { margin: 16px 0 0; color: var(--ink-muted); font-size: 12px; line-height: 1.6; text-align: center; }
.auth-message { min-height: 22px; margin: 20px 0 0; padding: 10px 12px; border-radius: var(--radius); font-size: 12px; line-height: 1.5; }
.auth-message:empty { padding: 0; }
.auth-message.is-error { color: #9d2f2f; background: var(--danger-soft); }
.auth-message.is-success { color: var(--accent-dark); background: var(--green-soft); }
.account-chip { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11px; }

.app-header {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-block, .header-actions, .result-topline, .pane-heading, .section-title-row, .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-block { gap: 11px; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}
.brand-name { font-size: 16px; font-weight: 760; line-height: 1.2; }
.brand-en { margin-top: 3px; font-size: 9px; color: #75807b; font-weight: 700; }
.header-actions { gap: 18px; }
.service-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-soft); }
.status-dot, .readiness-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.status-dot.is-offline, .readiness-dot.is-offline { background: var(--amber); }

.app-shell { max-width: 1600px; margin: 0 auto; padding: 0 28px 28px; }

.control-strip {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.7fr) minmax(190px, 1fr) minmax(150px, 0.8fr) minmax(120px, 0.65fr);
  gap: 18px;
  align-items: end;
  padding: 16px 0 17px;
  border-bottom: 1px solid var(--line);
}

.holding-editor { max-width: 1600px; margin: 0 auto; padding: 18px 28px; display: flex; align-items: end; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.account-settings-inline { min-height: 52px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-settings-inline > span { margin-right: auto; color: var(--ink-soft); font-size: 10px; }
.account-settings-inline .button { height: 32px; font-size: 10px; }
.holding-editor-copy { max-width: 520px; }
.holding-editor-copy h2 { font-size: 17px; }
.holding-editor-copy > p:last-child { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.holding-editor-fields { min-width: min(100%, 550px); display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) auto; align-items: end; gap: 12px; }
.holding-editor-fields .button { height: 38px; }

.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.field-note { display: block; max-width: 260px; margin-top: 3px; color: #8a6a35; font-size: 9px; font-weight: 500; line-height: 1.35; }
.field input, .field select, .input-affix {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  outline: none;
}
.field input, .field select { padding: 0 11px; }
.field input:focus, .field select:focus, .input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 122, 85, 0.1); }
.input-affix { display: flex; align-items: center; padding: 0 10px; color: #7b8681; }
.input-affix input { height: 34px; padding: 0 6px; border: 0; box-shadow: none !important; }
.holding-field legend { margin-bottom: 6px; }
.segmented { height: 38px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 3px; background: var(--surface); }
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { width: 100%; height: 30px; display: grid; place-items: center; border-radius: 3px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.segmented input:checked + span { background: var(--ink); color: #fff; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr); min-height: calc(100vh - 190px); background: var(--surface); border-bottom: 1px solid var(--line); }
.input-pane, .result-pane { min-width: 0; padding: 30px; }
.result-pane { border-left: 1px solid var(--line); background: #fcfdfb; }
.pane-heading { align-items: flex-end; margin-bottom: 24px; }
.instrument-identity { display: flex; align-items: baseline; gap: 9px; min-width: 0; margin-top: 8px; }
.instrument-identity strong { max-width: 260px; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.instrument-identity span { color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.data-mode-label { color: var(--ink-soft); font-size: 10px; }
.eyebrow { margin: 0 0 7px; color: #7b8681; font-size: 10px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 22px; line-height: 1.25; }
h2 { margin: 0; font-size: 23px; line-height: 1.35; }
h3 { margin: 0; font-size: 13px; }

.chart-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; position: relative; }
.chart-head { height: 43px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chart-head strong { font-size: 12px; }
.chart-head span { font-size: 10px; color: #87918c; }

.market-toolbar { display: grid; grid-template-columns: repeat(3, minmax(110px, 150px)) minmax(170px, 1fr); gap: 12px; align-items: end; margin-bottom: 14px; }
.compact-field { display: flex; flex-direction: column; gap: 6px; }
.compact-field span { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.compact-field select { height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); outline: none; }
.compact-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 122, 85, 0.1); }
.compact-field select option:disabled { color: #9aa39f; }
.provider-fixed { height: 36px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.provider-fixed span { color: var(--ink-soft); font-size: 9px; }
.provider-fixed strong { font-size: 11px; }
.provider-summary { min-width: 0; height: 36px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.provider-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); }
.provider-dot.is-ready { background: var(--accent); }
.market-meta { min-height: 32px; display: flex; align-items: center; padding-top: 10px; color: var(--ink-soft); font-size: 10px; }
.chart-card.is-empty::after { content: "等待行情"; position: absolute; inset: 43px 0 0; display: grid; place-items: center; color: #9aa39f; background: #fafbf8; font-size: 10px; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-card canvas { display: block; width: 100%; height: 185px; background: #fafbf8; }
.chart-card-wide canvas { height: 225px; }

.analysis-bar { min-height: 72px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.input-readiness { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; }
.button { height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: var(--radius); border: 1px solid transparent; font-size: 11px; font-weight: 750; line-height: 1.2; text-decoration: none; background: transparent; color: var(--ink); vertical-align: middle; }
.button-quiet { border-color: var(--line-strong); background: var(--surface); }
.button-quiet:hover { border-color: var(--ink); }
.button-primary { min-width: 126px; height: 42px; background: var(--accent); color: #fff; border-color: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-primary:disabled { background: #c8cfca; border-color: #c8cfca; color: #f7f8f6; }

.result-pane { overflow: hidden; }
.is-hidden { display: none !important; }
.result-empty { height: 100%; min-height: 460px; display: flex; flex-direction: column; justify-content: center; padding: 12%; }
.result-empty h2 { margin-top: 22px; }
.result-empty > p:last-child { max-width: 410px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.empty-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; width: min(300px, 90%); height: 60px; align-items: end; }
.empty-scale span { display: block; height: 18px; background: #dfe4df; border-radius: 2px 2px 0 0; }
.empty-scale span:nth-child(2), .empty-scale span:nth-child(4) { height: 34px; }
.empty-scale span:nth-child(3) { height: 54px; background: #aeb9b1; }

.result-content { max-width: 680px; margin: 0 auto; scroll-margin-top: 82px; }
.result-topline { align-items: flex-start; }
.action-label { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 4px; background: var(--amber-soft); color: #80591b; font-size: 11px; font-weight: 800; }
.action-label.is-positive { background: var(--danger-soft); color: #a92d2d; }
.action-label.is-negative { background: var(--green-soft); color: #08644a; }
.score-block { text-align: right; }
.score-block span { display: block; color: #7b8681; font-size: 10px; }
.score-block strong { display: block; margin-top: 1px; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.result-content > h2 { margin-top: 17px; font-size: 25px; }
.result-summary { margin: 9px 0 17px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.score-track { height: 7px; margin: 0 4px 13px; border-radius: 4px; background: linear-gradient(90deg, #2b8a6f 0 43%, #d9ded8 43% 57%, #df6969 57%); position: relative; }
.score-center { position: absolute; left: 50%; top: -3px; width: 1px; height: 13px; background: rgba(24,32,29,.5); }
.score-marker { position: absolute; left: 50%; top: -5px; width: 16px; height: 16px; margin-left: -8px; background: var(--surface); border: 3px solid var(--ink); border-radius: 50%; transition: left .35s ease; }
.confidence-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 10px; color: var(--ink-soft); }
.confidence-track { height: 4px; background: #e1e5e1; overflow: hidden; }
.confidence-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .35s ease; }
.confidence-row strong { min-width: 30px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.level-item { min-width: 0; padding: 12px 9px; border-right: 1px solid var(--line); background: var(--surface); }
.level-item:last-child { border-right: 0; }
.level-item span { display: block; color: #7b8681; font-size: 9px; }
.level-item strong { display: block; margin-top: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

.result-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.section-title-row { margin-bottom: 11px; }
.section-title-row span { max-width: 64%; text-align: right; font-size: 9px; color: #7b8681; }
.timeframe-table { border-top: 1px solid var(--line); }
.timeframe-row { display: grid; grid-template-columns: 48px 62px minmax(82px, .8fr) minmax(120px, 1.2fr) 24px 42px; min-height: 47px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); font-size: 10px; }
.timeframe-row:last-child { border-bottom: 0; }
.timeframe-row strong { font-size: 11px; }
.direction { font-weight: 750; }
.direction.bull { color: var(--bull); }
.direction.bear { color: var(--bear); }
.quality-meter { height: 3px; background: #e0e4e0; position: relative; }
.quality-meter span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }

.evidence-section, .plan-section { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.evidence-column h3, .plan-section h3 { margin-bottom: 11px; }
.evidence-column ul, .plan-section ol, .risk-details ul { margin: 0; padding: 0; list-style: none; }
.evidence-column li, .plan-section li, .risk-details li { position: relative; padding: 0 0 9px 13px; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.evidence-column li::before { content: ""; position: absolute; left: 0; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.evidence-opposing li::before { background: var(--amber); }
.plan-section { counter-reset: plan; }
.plan-section ol { counter-reset: item; }
.plan-section li { padding-left: 20px; counter-increment: item; }
.plan-section li::before { content: counter(item); position: absolute; left: 0; top: 0; color: #8a948f; font-size: 9px; font-weight: 800; }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.insight-panel { min-width: 0; }
.insight-panel .section-title-row { min-height: 22px; }
.technical-fact-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.technical-fact { min-width: 0; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.technical-fact:nth-child(2n) { border-right: 0; }
.technical-fact:nth-child(n+3) { border-bottom: 0; }
.technical-fact span { display: block; color: var(--ink-soft); font-size: 9px; }
.technical-fact strong { display: block; margin-top: 6px; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.estimate-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--amber-soft); color: #80591b !important; font-weight: 750; }
.chip-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip-summary > div { padding: 8px 10px; border-left: 2px solid var(--accent); background: #f6f8f5; }
.chip-summary span { display: block; color: var(--ink-soft); font-size: 9px; }
.chip-summary strong { display: block; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.chip-range { position: relative; height: 30px; margin: 14px 4px 7px; border-radius: 3px; background: #eef1ed; }
.chip-band { position: absolute; top: 8px; height: 14px; border-radius: 2px; }
.chip-band-90 { background: #cfd8d1; }
.chip-band-70 { top: 11px; height: 8px; background: #8bad9d; }
.chip-marker { position: absolute; z-index: 2; top: 3px; bottom: 3px; width: 2px; transform: translateX(-1px); }
.chip-marker-current { background: var(--bear); }
.chip-marker-average { background: #8b611e; }
.chip-marker::before { content: ""; position: absolute; top: -2px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: inherit; }
.chip-legend { display: flex; gap: 14px; color: var(--ink-soft); font-size: 8px; }
.chip-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chip-legend i { width: 8px; height: 2px; }
.legend-current { background: var(--bear); }
.legend-average { background: #8b611e; }
.chip-band-copy { display: grid; gap: 3px; margin: 10px 0 0; color: var(--ink-soft); font-size: 9px; font-variant-numeric: tabular-nums; }
.chip-note { margin: 8px 0 0; color: #7b8681; font-size: 8px; line-height: 1.5; }
.chip-panel.is-unavailable .chip-range, .chip-panel.is-unavailable .chip-legend { opacity: .25; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scenario-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-top-width: 3px; border-radius: var(--radius); background: var(--surface); }
.scenario-card h4 { margin: 0; font-size: 11px; }
.scenario-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.scenario-watch { border-top-color: var(--amber); }
.scenario-neutral { border-top-color: #aeb9b1; }
.scenario-risk { border-top-color: var(--bear); }

.position-section { margin: 22px 0 0; padding: 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #bfd7cb; border-radius: var(--radius); background: var(--green-soft); }
.position-section h3 { font-size: 15px; }
.position-metrics { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; }
.position-metrics span { display: block; color: #587066; font-size: 9px; }
.position-metrics strong { display: block; margin-top: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
.position-summary { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.position-summary > div:first-child { max-width: 270px; }
.position-summary p { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.position-summary-grid { min-width: 330px; display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); border: 1px solid var(--line); }
.position-summary-grid > div { min-width: 0; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.position-summary-grid > div:nth-child(2n) { border-right: 0; }
.position-summary-grid > div:nth-child(n+3) { border-bottom: 0; }
.position-summary-grid span { display: block; color: var(--ink-soft); font-size: 9px; }
.position-summary-grid strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.position-summary-grid strong.is-gain { color: var(--bull); }
.position-summary-grid strong.is-loss { color: var(--bear); }
.risk-details { margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.risk-details summary { padding: 13px 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.risk-details summary span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; border-radius: 50%; background: var(--amber-soft); color: #80591b; font-size: 9px; }
.risk-details ul { padding-bottom: 8px; }
.risk-details li::before { content: "—"; position: absolute; left: 0; color: var(--amber); }
.term-help { border-bottom: 1px solid var(--line); }
.term-help summary { padding: 13px 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.term-help dl { margin: 0; padding: 0 0 12px; }
.term-help dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid #e9ece8; }
.term-help dt { font-size: 10px; font-weight: 750; }
.term-help dd { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.result-actions { padding-top: 17px; display: flex; justify-content: flex-end; gap: 8px; }

.history-drawer { position: fixed; top: 0; right: 0; z-index: 50; width: min(390px, 92vw); height: 100vh; padding: 24px; background: var(--surface); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .25s ease; display: flex; flex-direction: column; }
.history-drawer.is-open { transform: translateX(0); }
.drawer-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 20px; }
.history-list { flex: 1; overflow-y: auto; padding: 12px 0; }
.history-item { width: 100%; padding: 13px 2px; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.history-item strong { font-size: 12px; }
.history-item span { font-size: 10px; color: var(--ink-soft); }
.history-item .history-symbol { font-variant-numeric: tabular-nums; }
.history-item .history-score { grid-row: 1 / 4; grid-column: 2; align-self: center; color: var(--ink); font-size: 18px; font-weight: 800; }
.history-empty { padding: 36px 0; color: var(--ink-soft); font-size: 11px; text-align: center; }
.clear-history { width: 100%; flex: 0 0 auto; }
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 45; background: rgba(24,32,29,.35); }
.drawer-backdrop.is-open { display: block; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; max-width: min(440px, calc(100vw - 32px)); padding: 11px 15px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 11px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.risk-confirm-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(24, 32, 29, .42); }
.risk-confirm-card { width: min(440px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 60px rgba(24, 32, 29, .22); }
.risk-confirm-card h2 { margin: 0; font-size: 20px; }
.risk-confirm-card > p:not(.eyebrow) { margin: 13px 0 21px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; white-space: pre-line; }
.risk-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.risk-confirm-actions .button { min-width: 92px; }
.app-footer { max-width: 1600px; margin: 0 auto; padding: 13px 28px 20px; color: #747e79; font-size: 9px; line-height: 1.6; }

@media (max-width: 1120px) {
  .control-strip { grid-template-columns: 1.2fr .7fr 1fr .8fr; }
  .field-risk { grid-column: 4; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .result-pane { border-left: 0; border-top: 1px solid var(--line); }
  .result-empty { min-height: 330px; padding: 8%; }
}

@media (max-width: 760px) {
  .app-header { height: 60px; padding: 0 16px; }
  .brand-en, .service-status { display: none; }
  .app-shell { padding: 0; }
  .control-strip { grid-template-columns: 1fr 1fr; gap: 11px; padding: 14px 16px; }
  .field-symbol, .holding-field { grid-column: 1 / -1; }
  .field-risk { grid-column: auto; }
  .input-pane, .result-pane { padding: 22px 16px; }
  .pane-heading { align-items: flex-start; gap: 18px; }
  .market-toolbar { grid-template-columns: repeat(3, 1fr); }
  .provider-summary { grid-column: 1 / -1; justify-content: flex-start; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
  .analysis-bar { position: sticky; bottom: 0; z-index: 10; margin: 18px -16px -22px; padding: 12px 16px; background: rgba(255,255,255,.96); }
  .level-grid { grid-template-columns: repeat(3, 1fr); }
  .level-item { border-bottom: 1px solid var(--line); }
  .level-item:nth-child(3) { border-right: 0; }
  .level-item:nth-child(n+4) { border-bottom: 0; }
  .evidence-section, .plan-section, .insight-grid { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .timeframe-row { grid-template-columns: 42px 55px 1fr; padding: 9px 0; }
  .timeframe-row > :nth-child(4) { grid-column: 2 / -1; }
  .timeframe-row > :nth-child(5) { grid-column: 2; }
  .timeframe-row > :nth-child(6) { grid-column: 3; }
  .position-section { align-items: flex-start; flex-direction: column; }
  .position-metrics { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .position-summary { align-items: flex-start; flex-direction: column; }
  .position-summary-grid { width: 100%; min-width: 0; }
  .app-footer { padding: 13px 16px 72px; }
}

@media (max-width: 430px) {
  .risk-confirm-card { padding: 20px; }
  .risk-confirm-actions { flex-direction: column-reverse; }
  .risk-confirm-actions .button { width: 100%; }
  .header-actions .button { padding: 0 10px; }
  .pane-heading { flex-direction: column; align-items: stretch; }
  .market-toolbar { grid-template-columns: 1fr 1fr; }
  .market-toolbar .compact-field:nth-child(3) { grid-column: 1 / -1; }
  .analysis-bar { align-items: stretch; flex-direction: column; }
  .button-primary { width: 100%; }
  .result-content > h2 { font-size: 22px; }
  .section-title-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-title-row span { max-width: 100%; text-align: left; }
}

@media print {
  .app-header, .control-strip, .input-pane, .result-actions, .app-footer, .history-drawer, .drawer-backdrop { display: none !important; }
  .app-shell { padding: 0; }
  .workspace { display: block; }
  .result-pane { border: 0; padding: 18px; }
}

.pane-heading-actions { display: flex; align-items: center; gap: 12px; }
.button.is-active { border-color: #9bc4b1; background: var(--green-soft); color: var(--accent-dark); }

.home-shell { width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; padding: 42px 28px 28px; }
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.home-hero h1 { font-size: 32px; letter-spacing: 0; }
.home-subtitle { max-width: 560px; margin: 12px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.home-hero-note { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.home-auto-divider { color: var(--line-strong); }
.account-settings { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.8fr); align-items: end; gap: 28px; margin-top: 24px; padding: 19px 22px 16px; border: 1px solid #c8d9d0; border-radius: var(--radius); background: var(--green-soft); }
.account-settings-copy { min-width: 0; }
.account-settings-copy h2 { margin: 0; font-size: 17px; }
.account-settings-copy p:last-child { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.account-settings-fields { min-width: 0; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: end; gap: 12px; }
.account-settings-fields .button { height: 38px; }
.account-risk-preview { min-width: 0; height: 38px; display: flex; flex-direction: column; justify-content: center; padding: 0 11px; border: 1px solid #c8d9d0; border-radius: var(--radius); background: rgba(255,255,255,.62); }
.account-risk-preview span { color: var(--ink-soft); font-size: 9px; }
.account-risk-preview strong { margin-top: 2px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.account-settings-hint { grid-column: 2; margin: 0; color: #587066; font-size: 10px; line-height: 1.5; }
.watchlist-form { width: 100%; min-width: 0; margin-top: 24px; padding: 20px 22px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.watchlist-form-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 15px; }
.watchlist-form-title strong { font-size: 14px; }
.watchlist-form-title span, .form-hint { color: var(--ink-soft); font-size: 10px; }
.watchlist-form-grid { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(120px, .7fr) minmax(190px, 1fr) auto; align-items: end; gap: 14px; }
.watchlist-form-grid .button { height: 38px; }
.holding-inputs { margin-top: 14px; padding-top: 14px; display: grid; grid-template-columns: minmax(150px, 220px) minmax(170px, 240px) 1fr; align-items: end; gap: 14px; border-top: 1px solid var(--line); }
.holding-inputs > p { margin: 0 0 8px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.form-hint { margin: 12px 0 0; }
.overview-toolbar { width: 100%; min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 44px; }
.overview-toolbar h2 { font-size: 24px; }
.overview-actions { min-width: 0; display: flex; align-items: flex-end; gap: 10px; }
.overview-actions .compact-field { width: 118px; }
.overview-actions .button { height: 36px; }
.watch-group { margin-top: 24px; }
.watch-group-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.watch-group-heading h2 { display: inline; margin: 0; font-size: 15px; }
.watch-group-heading span { margin-left: 10px; color: var(--ink-soft); font-size: 10px; }
.watch-group-heading > strong { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; }
.watch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.watch-card { min-width: 0; display: flex; flex-direction: column; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.watch-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.watch-card-top, .watch-card-decision, .watch-card-meta, .watch-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.watch-card-top { align-items: flex-start; }
.watch-instrument { min-width: 0; }
.watch-name { display: block; max-width: 240px; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.watch-symbol { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.watch-market { margin-left: 8px; color: var(--ink-soft); font-size: 10px; }
.holding-badge { display: inline-flex; align-items: center; height: 23px; padding: 0 8px; border-radius: 4px; background: var(--amber-soft); color: #80591b; font-size: 10px; font-weight: 750; }
.holding-badge.is-held { background: var(--green-soft); color: var(--accent-dark); }
.watch-card-decision { align-items: flex-end; margin-top: 21px; }
.watch-label { display: block; color: #7b8681; font-size: 9px; }
.watch-action { display: block; margin-top: 5px; font-size: 18px; }
.watch-action.is-positive { color: var(--bull); }
.watch-action.is-negative { color: var(--bear); }
.watch-action.is-pending { color: var(--ink-soft); }
.watch-quote { min-width: 122px; text-align: right; }
.watch-quote > strong { display: block; margin-top: 4px; color: var(--ink); font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.watch-quote-change { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.watch-quote-change.is-up { color: var(--bull); }
.watch-quote-change.is-down { color: var(--bear); }
.watch-card-summary { min-height: 34px; margin: 14px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.watch-card-position { min-height: 22px; margin: -6px 0 12px; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 22px; }
.watch-card-position.is-empty { color: #9aa39f; font-weight: 500; }
.watch-card-meta { align-items: flex-start; min-height: 28px; padding-top: 10px; border-top: 1px solid var(--line); color: #7b8681; font-size: 9px; }
.watch-card-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-card-meta span:last-child { flex: 0 0 auto; }
.watch-card-actions { justify-content: flex-start; margin-top: auto; padding-top: 15px; }
.watch-card-actions .button { height: 32px; font-size: 10px; }
.watch-card-actions .button-primary { min-width: 112px; }
.watch-group-empty { padding: 24px 4px 12px; color: var(--ink-soft); }
.watch-group-empty strong { display: block; color: var(--ink); font-size: 12px; }
.watch-group-empty span { display: block; margin-top: 5px; font-size: 10px; }
.home-empty { margin-top: 24px; padding: 56px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.55); }
.home-empty .empty-scale { margin: 0 auto; }
.home-empty h2 { margin: 20px 0 8px; font-size: 20px; }
.home-empty p { max-width: 420px; margin: 0 auto; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }

@media (max-width: 900px) {
  .watchlist-form-grid { grid-template-columns: 1.2fr .8fr; }
  .watchlist-form-grid .holding-field { grid-column: 1; }
  .watchlist-form-grid .button { grid-column: 2; }
  .account-settings { grid-template-columns: 1fr; align-items: stretch; }
  .account-settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-settings-hint { grid-column: 1 / -1; }
  .overview-toolbar { align-items: flex-start; flex-direction: column; }
  .overview-actions { width: 100%; }
  .overview-actions .compact-field { flex: 1; width: auto; }
  .holding-editor { align-items: stretch; flex-direction: column; }
  .holding-editor-fields { width: 100%; min-width: 0; }
}

@media (max-width: 760px) {
  .auth-page { padding: 0; }
  .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-intro { min-height: 240px; padding: 28px 24px; }
  .auth-intro h1 { max-width: 560px; margin: 28px 0 12px; font-size: 30px; }
  .auth-intro > div > p:not(.eyebrow) { font-size: 12px; }
  .auth-disclaimer { display: none; }
  .auth-card { padding: 34px 24px 44px; }
  body { overflow-x: hidden; }
  .home-shell { padding: 28px 16px 22px; }
  .holding-editor { padding: 16px; }
  .holding-editor-fields { grid-template-columns: 1fr; }
  .holding-editor-fields .button { width: 100%; }
  .account-settings-inline { align-items: stretch; flex-wrap: wrap; }
  .account-settings-inline > span { width: 100%; margin: 0 0 2px; }
  .account-settings-inline .button { flex: 1; }
  .account-settings { padding: 17px 16px 14px; }
  .account-settings-fields { grid-template-columns: 1fr; }
  .account-settings-fields .button { width: 100%; }
  .home-hero { align-items: flex-start; flex-direction: column; gap: 18px; padding-bottom: 24px; }
  .home-hero h1 { font-size: 26px; }
  .home-hero-note { white-space: normal; }
  .watchlist-form { padding: 17px 16px 14px; }
  .watchlist-form-title { align-items: flex-start; flex-direction: column; gap: 5px; }
  .watchlist-form-grid { grid-template-columns: minmax(0, 1fr); }
  .watchlist-form-grid .field:first-child, .watchlist-form-grid .holding-field, .watchlist-form-grid .button { grid-column: auto; }
  .watchlist-form-grid .button { width: 100%; }
  .holding-inputs { grid-template-columns: 1fr; }
  .overview-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .overview-actions .compact-field { width: auto; min-width: 0; }
  .overview-actions .compact-field:nth-child(4), .overview-actions .button { grid-column: 1 / -1; }
  .overview-actions .button { width: 100%; }
  .watch-grid { grid-template-columns: 1fr; }
  .pane-heading-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .position-summary { align-items: stretch; flex-direction: column; }
  .position-summary-grid { width: 100%; min-width: 0; }
}

@media (max-width: 430px) {
  .account-chip { display: none; }
  .overview-actions .compact-field { min-width: calc(50% - 6px); }
  .overview-actions .compact-field:nth-child(4) { min-width: 100%; }
}
