:root {
  color-scheme: light;
  --ink: #17191d;
  --muted: #666b73;
  --line: #d9dde2;
  --paper: #f4f5f6;
  --white: #fff;
  --red: #c63630;
  --red-soft: #f8e9e7;
  --green: #16765a;
  --green-soft: #e5f2ed;
  --amber: #b76a13;
  --amber-soft: #f7eddc;
  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; letter-spacing: 0; }
body { min-width: 320px; max-width: 100%; }
button, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.overline { margin: 0 0 8px; color: var(--red); font-size: 12px; font-weight: 800; }
.up, .profit { color: var(--red); }
.down, .loss { color: var(--green); }

.bind-screen { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: max(28px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); background: #f7f8f9; }
.bind-brand { display: flex; align-items: center; gap: 12px; max-width: 460px; width: 100%; margin: 0 auto; }
.bind-brand img { border-radius: 6px; }
.bind-brand div { display: flex; flex-direction: column; }
.bind-brand strong { font-size: 17px; }
.bind-brand span { color: var(--muted); font-size: 12px; }
.bind-content { width: min(460px, 100%); align-self: center; margin: 44px auto; padding-top: 34px; border-top: 4px solid var(--red); }
.bind-content h1 { margin: 0; font-size: clamp(34px, 11vw, 52px); line-height: 1.1; }
.bind-content > p:not(.overline):not(.form-message) { margin: 18px 0 28px; color: var(--muted); line-height: 1.7; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
input { width: 100%; height: 52px; padding: 0 14px; border: 1px solid #bfc5cc; border-radius: 5px; background: #fff; outline: none; }
input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,25,29,.08); }
#card-code { font-family: Consolas, monospace; font-size: 16px; }
#bind-code { text-align: center; font-family: Consolas, monospace; font-size: 25px; letter-spacing: 8px; }
.primary-command, .secondary-command { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; border: 1px solid transparent; border-radius: 5px; font-weight: 800; cursor: pointer; }
.primary-command { background: var(--red); color: #fff; }
.primary-command:active { background: #962823; }
.secondary-command { background: transparent; border-color: #bfc5cc; }
.secondary-command:active { background: #eaedef; }
.primary-command svg, .secondary-command svg { width: 18px; }
.form-message { min-height: 22px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.code-login { margin-top: 14px; border-top: 1px solid var(--line); }
.code-login summary { padding: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.code-login form { padding-top: 8px; }
.bind-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px; color: #8a8f96; font-size: 11px; }
.bind-divider::before, .bind-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.bind-footer { width: min(460px, 100%); margin: 0 auto; color: var(--muted); font-size: 12px; text-align: center; }

.app-shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }
.app-header { position: sticky; z-index: 10; top: 0; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between; background: rgba(247,248,249,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.app-title { display: flex; align-items: center; gap: 9px; }
.app-title img { border-radius: 5px; }
.app-title strong { font-size: 16px; }
.header-tools { flex: none; display: flex; align-items: center; gap: 8px; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.connection-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.connection-state.offline > span { background: #8a8e94; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; cursor: pointer; }
.icon-button:active { background: #e4e7ea; }
.icon-button svg { width: 19px; height: 19px; }
.demo-banner { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 14px; background: var(--amber-soft); color: #77470f; border-bottom: 1px solid #e8d5b5; font-size: 11px; text-align: center; }
.demo-banner button { flex: none; border: 0; border-bottom: 1px solid currentColor; padding: 1px 0; background: transparent; color: inherit; cursor: pointer; }

.view-container { width: min(760px, 100%); margin: 0 auto; }
.view { display: none; padding: 24px 16px 34px; }
.view.active { display: block; }
.page-heading { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 7vw, 32px); line-height: 1.25; }

.market-summary { min-height: 116px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.temperature { display: flex; flex-wrap: wrap; align-items: baseline; max-width: 118px; color: var(--amber); }
.temperature small { flex-basis: 100%; margin-top: 8px; color: var(--muted); font-size: 11px; }
.temperature strong { font-size: 48px; line-height: 1; }
.temperature span { font-size: 13px; }
.market-summary > div:nth-child(2) strong { font-size: 16px; }
.market-summary p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.state-tag { align-self: start; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 800; }
.state-tag.neutral { background: #e7e9ec; color: #5c6168; }
.state-tag.positive { background: #e2f1e9; color: #176b48; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.metric-grid div { min-width: 0; padding: 15px 8px; border-right: 1px solid var(--line); }
.metric-grid div:first-child { padding-left: 0; }
.metric-grid div:last-child { padding-right: 0; border-right: 0; }
.metric-grid span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.metric-grid strong { display: block; margin-top: 4px; font-size: clamp(13px, 4vw, 17px); white-space: nowrap; }
.metric-grid small { display: block; margin-top: 5px; font-size: 11px; }
.market-indices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 0 6px; }
.market-indices span { min-width: 0; font-size: 12px; }
.market-indices strong { display: block; margin-top: 4px; font-size: 14px; }
.market-evidence { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 8px 0 12px; overflow-wrap: anywhere; }
.market-factors { padding: 10px 0 14px; font-size: 12px; border-bottom: 1px solid var(--line); }
.market-factors summary { cursor: pointer; font-weight: 600; }
.market-factor { padding: 10px 0; border-bottom: 1px solid var(--line); }
.market-factor > div { display: flex; justify-content: space-between; gap: 12px; }
.market-factor p, #market-score-note { margin: 5px 0 0; color: var(--muted); line-height: 1.7; }
.market-conditions { font-size: 12px; line-height: 1.8; padding: 6px 0; color: var(--muted); }
.market-conditions p { margin: 6px 0; }
.market-conditions strong { color: var(--ink); }

.content-section { margin-top: 30px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title > span { color: var(--muted); font-size: 10px; }
.section-title button { padding: 0; border: 0; background: transparent; color: var(--red); font-size: 12px; cursor: pointer; }
.sector-list { border-top: 1px solid var(--line); }
.sector-row { width: 100%; min-height: 68px; display: grid; grid-template-columns: 28px 1fr auto 18px; align-items: center; gap: 10px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.rank { color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.sector-name, .sector-score { display: flex; flex-direction: column; min-width: 0; }
.sector-name strong { font-size: 14px; }
.sector-name small, .sector-score small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sector-score { align-items: flex-end; }
.sector-score strong { color: var(--red); }
.sector-row svg { width: 17px; color: #989da4; }

.holding-list { display: grid; gap: 12px; }
.holding-card { padding: 16px; border: 1px solid #d2d6dc; border-left: 3px solid #777d85; border-radius: 5px; background: #fff; }
.stock-entry { cursor: pointer; }
.holding-card.priority { border-left-color: var(--red); }
.stock-line, .advice-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stock-line > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.stock-line strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.stock-line span { color: var(--muted); font-size: 11px; }
.stock-line > .profit, .stock-line > .loss { font-size: 14px; font-weight: 800; }
.advice-line { margin-top: 13px; padding: 10px 0; border-top: 1px solid #eceef0; border-bottom: 1px solid #eceef0; }
.advice { padding: 4px 7px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.advice.reduce { background: var(--red-soft); color: #a32925; }
.advice.hold { background: var(--amber-soft); color: #8d510e; }
.advice.watch { background: #e7e9ec; color: #555a61; }
.holding-card dl { margin: 10px 0 0; }
.holding-card dl div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; margin-top: 7px; font-size: 11px; }
.holding-card dt { color: var(--muted); }
.holding-card dd { margin: 0; text-align: right; }
.trade-assistant { margin-top: 12px; padding: 10px; border-left: 3px solid #8a5a12; background: #f7f4ed; }
.trade-assistant.confirmed { border-left-color: #176b48; background: #edf7f1; }
.trade-assistant.risk { border-left-color: var(--red); background: var(--red-soft); }
.trade-assistant header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trade-assistant header span { color: var(--muted); font-size: 10px; font-weight: 700; }
.trade-assistant header strong { font-size: 11px; text-align: right; }
.trade-assistant > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.trade-assistant > div span { min-width: 0; color: var(--muted); font-size: 9px; }
.trade-assistant > div b { display: block; margin-top: 2px; color: var(--ink); font: 11px Consolas, monospace; }
.trade-assistant p { margin: 8px 0 0; color: #555b63; font-size: 10px; line-height: 1.55; }
.holding-delete { width: 34px; height: 34px; display: grid; place-items: center; margin: 12px 0 0 auto; padding: 0; border: 1px solid #cdd1d6; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.holding-delete:active { background: #eceef0; color: var(--red); }
.holding-delete svg { width: 16px; height: 16px; }

.signal-row { min-height: 58px; display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.signal-row:last-child { border-bottom: 1px solid var(--line); }
.signal-row time { color: var(--muted); font-family: Consolas, monospace; font-size: 11px; }
.signal-row > span { display: flex; flex-direction: column; }
.signal-row strong { font-size: 13px; }
.signal-row small { color: var(--muted); font-size: 10px; }
.signal-row b { font-size: 12px; }
.data-time { margin: 24px 0 0; color: #90949a; font-size: 10px; text-align: center; }

.segmented { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; padding: 3px; border: 1px solid #cdd1d6; border-radius: 6px; background: #e8eaed; }
.segmented button { min-width: 0; height: 38px; display: flex; align-items: center; justify-content: center; gap: 5px; overflow: hidden; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.segmented svg { width: 13px; }
.filter-bar { display: flex; gap: 8px; margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar button { flex: none; height: 34px; display: flex; align-items: center; gap: 4px; padding: 0 10px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: #4f545b; font-size: 11px; }
.filter-bar svg { width: 13px; }
.selection-tools { margin: 14px 0 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.selection-tools-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sort-control { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; }
.sort-control select { height: 34px; padding: 0 28px 0 10px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: var(--ink); outline: none; }
.sort-control select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,25,29,.08); }
.selection-range { color: var(--muted); font-size: 10px; }
.scope-control { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.scope-control[hidden] { display: none; }
.scope-control select { width: 100%; height: 34px; padding: 0 28px 0 10px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: var(--ink); outline: none; }
.signal-choices { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.signal-choices legend { padding: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.signal-choices > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.signal-choices label { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 9px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: #4f545b; font-size: 11px; cursor: pointer; }
.signal-choices input { width: 15px; height: 15px; margin: 0; accent-color: var(--red); box-shadow: none; }
.signal-choices input:checked + span { color: #932b27; font-weight: 800; }
.selection-count { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.scan-control { margin: 0 0 18px; padding: 14px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scan-control-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-control-line > span:first-child { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.scan-control-line svg { width: 16px; color: var(--red); }
.scan-control .primary-command { min-height: 40px; margin-top: 10px; font-size: 12px; }
.scan-control .primary-command:disabled { background: #aeb2b7; cursor: wait; }
.scan-control p { min-height: 18px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.scan-progress { width: 100%; height: 4px; margin-top: 12px; overflow: hidden; background: #e2e5e8; }
.scan-progress span { display: block; width: 0; height: 100%; background: var(--red); transition: width .22s ease; }
.pick-list { border-top: 1px solid var(--line); }
.pick-row { position: relative; min-height: 96px; padding: 15px 42px 15px 0; border-bottom: 1px solid var(--line); }
.pick-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pick-head > span { display: flex; flex-direction: column; }
.pick-head strong { font-size: 14px; }
.pick-head small { color: var(--muted); font-size: 10px; }
.pick-head b { font-size: 13px; }
.pick-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.pick-detail .signal-gain { font-weight: 800; }
.signal-chip { padding: 3px 6px; border-radius: 3px; font-weight: 800; }
.signal-chip.buy { background: var(--red-soft); color: #a32925; }
.pick-row > button { position: absolute; right: 0; top: 32px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #cdd1d6; border-radius: 4px; background: transparent; }
.pick-row > button svg { width: 16px; }
.locked-feature { padding: 62px 22px; border-top: 1px solid var(--line); text-align: center; }
.locked-feature > svg { width: 42px; height: 42px; color: var(--red); }
.locked-feature h2 { margin: 15px 0 8px; font-size: 22px; }
.locked-feature p { margin: 0 auto; max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.locked-feature .primary-command { max-width: 240px; }

.status-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: -4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.watch-add { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; }
.watch-add input { height: 44px; min-width: 0; }
.watch-add button { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 5px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.watch-add button:disabled { background: #9da2a8; }
.watch-add svg { width: 16px; }
.monitor-settings { margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.monitor-settings summary { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); cursor: pointer; list-style: none; }
.monitor-settings summary::-webkit-details-marker { display: none; }
.monitor-settings summary > span { display: inline-flex; align-items: center; gap: 7px; }
.monitor-settings summary svg { width: 16px; color: var(--red); }
.monitor-settings summary strong { font-size: 12px; }
.monitor-settings summary small { color: var(--muted); font-size: 9px; text-align: right; }
.monitor-settings fieldset { margin: 4px 0 12px; padding: 0; border: 0; }
.monitor-settings legend { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.monitor-option-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.monitor-option-list label { min-width: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid #d3d7dc; border-radius: 4px; background: #fff; color: #555b63; font-size: 10px; cursor: pointer; }
.monitor-option-list input { width: 14px; height: 14px; flex: none; margin: 0; accent-color: var(--red); }
.monitor-option-list input:checked + span { color: var(--ink); font-weight: 800; }
.monitor-settings > p { margin: 0 0 11px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.monitor-settings .secondary-command { width: 100%; min-height: 38px; margin: 0 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.monitor-settings .secondary-command:disabled { color: var(--muted); cursor: wait; }
.monitor-settings .secondary-command svg { width: 15px; }
.watch-status { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.watch-list { border-top: 0; }
.watch-row { min-height: 70px; display: grid; grid-template-columns: minmax(0, 1fr) 38px 38px; align-items: center; border-bottom: 1px solid var(--line); }
.watch-open { min-width: 0; height: 69px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.watch-open > span { min-width: 0; display: flex; flex-direction: column; }
.watch-open strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.watch-open small { color: var(--muted); font-size: 10px; }
.watch-quote { align-items: flex-end; }
.watch-quote strong { font-family: Consolas, monospace; font-size: 13px; }
.watch-quote small { font-weight: 800; }
.watch-open > svg { width: 16px; color: #989da4; }
.watch-delete { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #8b9097; cursor: pointer; }
.watch-delete:active { background: #e7e9ec; color: var(--red); }
.watch-delete svg { width: 16px; }
.watch-push { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #8b9097; cursor: pointer; }
.watch-push.active { color: var(--red); }
.watch-push:disabled { opacity: .45; cursor: wait; }
.watch-push svg { width: 16px; }

.stock-view { padding-top: 14px; }
.stock-toolbar { min-height: 48px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.stock-toolbar > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.stock-toolbar strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.stock-toolbar span { flex: none; color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }
#stock-watch-toggle.active { color: var(--amber); }
#stock-watch-toggle.active svg { fill: currentColor; }
.stock-quote { min-height: 72px; display: flex; align-items: baseline; gap: 11px; padding: 15px 0 12px; }
.stock-quote > strong { font-family: Consolas, monospace; font-size: 30px; }
.stock-quote > span { font-size: 14px; font-weight: 800; }
.stock-quote > small { margin-left: auto; color: var(--muted); font-size: 11px; }
.chart-periods { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-periods button { height: 40px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.chart-periods button.active { border-bottom-color: var(--red); color: var(--ink); font-weight: 800; }
.chart-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 6px; margin: 12px 0 0; padding: 0; border: 0; }
.chart-options legend { margin-bottom: 8px; padding: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.chart-options label { min-width: 0; height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 6px; border: 1px solid #d3d7dc; border-radius: 4px; background: #fff; color: #555b63; font-size: 10px; cursor: pointer; }
.chart-options input { width: 14px; height: 14px; flex: none; margin: 0; accent-color: var(--red); }
.chart-options input:checked + span { color: var(--ink); font-weight: 800; }
.chart-tool { position: relative; margin: 10px -4px 0; border-bottom: 1px solid var(--line); background: #fff; }
.kline-chart { width: 100%; height: 420px; position: relative; }
.chart-tool.dark, .chart-tool.dark .kline-chart { background: #101317; }
.chip-overlay { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chip-summary { position: absolute; z-index: 4; right: 58px; bottom: 75px; max-width: 170px; padding: 4px 6px; border-radius: 3px; background: rgba(255,255,255,.84); color: #4d535b; font: 9px/1.45 Consolas, monospace; pointer-events: none; }
.chart-tool.dark .chip-summary { background: rgba(16,19,23,.84); color: #cfd4dc; }
.chart-loading, .chart-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); font-size: 12px; text-align: center; }
.chart-error button { height: 34px; margin-top: 10px; padding: 0 12px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: var(--ink); }
.chart-tooltip { position: absolute; z-index: 4; width: 132px; padding: 7px 8px; border: 1px solid #c9cdd2; border-radius: 4px; background: rgba(255,255,255,.94); color: var(--ink); font: 10px/1.55 Consolas, monospace; white-space: pre-line; pointer-events: none; box-shadow: 0 3px 12px rgba(0,0,0,.08); }
.chart-legend { min-height: 38px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend span::before { content: ""; width: 13px; height: 3px; background: currentColor; }
.legend-up { color: var(--red); }
.legend-down { color: var(--green); }
.legend-buy { color: #d53530; }
.legend-sell { color: #16815f; }
.legend-main-build { color: #be185c; }
.legend-main-fund { color: #dc5e00; }
.legend-bottom { color: #0070be; }
.legend-bi { color: #30343a; }
.legend-duan { color: #7856a8; }
.legend-center { color: var(--amber); }
.stock-chan-summary { margin-top: 22px; }
.stock-signal-list { border-top: 1px solid var(--line); }
.stock-signal { min-height: 58px; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.stock-signal .signal-chip.sell { background: #e2f1e9; color: #176b48; }
.stock-signal .signal-level { color: var(--muted); font-size: 9px; }
.stock-signal strong { font-family: Consolas, monospace; font-size: 12px; }
.stock-signal small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.signal-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.signal-filters button { min-width: 54px; height: 32px; border: 1px solid #cdd1d6; border-radius: 4px; background: transparent; font-size: 11px; }
.signal-filters button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.timeline { border-top: 1px solid var(--line); }
.timeline article { display: grid; grid-template-columns: 44px 12px 1fr; gap: 10px; min-height: 108px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font-family: Consolas, monospace; font-size: 11px; }
.timeline-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #888; }
.timeline-dot.buy { background: var(--red); }
.timeline-dot.sell { background: var(--green); }
.timeline-dot.neutral { background: var(--amber); }
.timeline article > div > div { display: flex; justify-content: space-between; gap: 10px; }
.timeline strong, .timeline b { font-size: 13px; }
.timeline p { margin: 5px 0; font-size: 11px; }
.timeline small { display: block; color: var(--muted); font-size: 10px; line-height: 1.55; }

.account-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-summary img { border-radius: 7px; }
.account-summary div { display: flex; flex-direction: column; }
.account-summary strong { font-size: 14px; }
.account-summary span:not(.state-tag) { color: var(--muted); font-size: 10px; }
.settings-list { margin-top: 24px; border-top: 1px solid var(--line); }
.settings-list button { width: 100%; min-height: 66px; display: grid; grid-template-columns: 24px 1fr 18px; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.settings-list button > svg:first-child { width: 19px; color: var(--red); }
.settings-list button > svg:last-child { width: 16px; color: #989da4; }
.settings-list button span { display: flex; flex-direction: column; }
.settings-list strong { font-size: 13px; }
.settings-list small { color: var(--muted); font-size: 10px; }
.system-status { margin-top: 26px; border-top: 1px solid var(--line); }
.system-status div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.system-status span { color: var(--muted); }
.official-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 24px; color: var(--red); font-size: 12px; }
.official-link svg { width: 15px; }

.bottom-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: var(--safe-bottom); background: rgba(249,250,251,.97); border-top: 1px solid #cfd3d8; backdrop-filter: blur(14px); }
.bottom-nav button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: #747980; font-size: 10px; cursor: pointer; }
.bottom-nav svg { width: 20px; height: 20px; }
.bottom-nav button.active { color: var(--red); font-weight: 800; }

.password-dialog { width: min(420px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 7px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.32); }
.password-dialog::backdrop { background: rgba(13,15,17,.62); }
.password-dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.password-dialog form > p:not(.overline):not(.form-message) { color: var(--muted); font-size: 12px; line-height: 1.65; }
.holding-fields { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 12px 10px; margin-top: 20px; }
.holding-fields label { margin: 0; color: var(--muted); font-size: 12px; }
.holding-fields input { height: 44px; }
.holding-detail-trigger { width: 100%; min-height: 36px; margin-top: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cdd1d6; border-radius: 4px; background: #fff; color: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.holding-detail-trigger svg { width: 15px; }
.holding-detail-dialog { width: min(680px, calc(100% - 18px)); max-height: min(92dvh, 820px); }
.holding-detail-shell { max-height: min(92dvh, 820px); padding: 20px; overflow: auto; }
.holding-detail-shell .dialog-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.holding-detail-advice { margin: 15px 0 12px; padding: 12px; border-left: 3px solid var(--red); background: #f5f6f7; }
.holding-detail-advice strong { display: block; margin-bottom: 5px; font-size: 14px; }
.holding-detail-advice p { margin: 0; color: #555b63; font-size: 10px; line-height: 1.6; }
.holding-detail-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.holding-detail-tabs.has-trade { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.holding-detail-tabs button { min-width: 0; height: 42px; padding: 0 3px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.holding-detail-tabs button.active { border-bottom-color: var(--red); color: var(--ink); font-weight: 800; }
.holding-detail-content { min-height: 280px; padding: 12px 0 4px; }
.detail-loading { min-height: 260px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.period-detail { padding: 12px 0; border-bottom: 1px solid var(--line); }
.period-detail:last-child { border-bottom: 0; }
.period-detail header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.period-detail header strong { font-size: 13px; }
.period-detail header span { color: var(--muted); font-size: 10px; }
.period-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 9px 0; }
.period-metrics div { min-width: 0; padding: 7px; background: #f5f6f7; }
.period-metrics span { display: block; color: var(--muted); font-size: 8px; }
.period-metrics strong { display: block; margin-top: 3px; overflow: hidden; font: 11px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.period-signals { display: flex; flex-wrap: wrap; gap: 6px; }
.period-signal { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 3px; background: var(--red-soft); color: #8f2925; font-size: 9px; }
.period-signal.sell { background: #e2f1e9; color: #176b48; }
.period-empty { color: var(--muted); font-size: 9px; }
.stat-section h3, .fund-summary h3 { margin: 5px 0 9px; font-size: 13px; }
.stat-note, .fund-source { margin: 8px 0 14px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.stat-table, .fund-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9px; }
.stat-table th, .stat-table td, .fund-table th, .fund-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; word-break: break-word; }
.stat-table th:first-child, .stat-table td:first-child, .fund-table th:first-child, .fund-table td:first-child { text-align: left; }
.stat-table th, .fund-table th { color: var(--muted); font-weight: 700; }
.fund-summary { padding: 8px 0 14px; border-bottom: 1px solid var(--line); }
.fund-summary > p { margin: 0 0 10px; font-size: 11px; line-height: 1.6; }
.fund-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.fund-metrics div { min-width: 0; padding: 8px 6px; background: #f5f6f7; }
.fund-metrics span { display: block; color: var(--muted); font-size: 8px; }
.fund-metrics strong { display: block; margin-top: 3px; font: 10px Consolas, monospace; }
.trade-detail { margin: 2px 0 14px; padding: 12px; border-left: 3px solid #8a5a12; background: #f7f4ed; }
.trade-detail.confirmed { border-left-color: #176b48; background: #edf7f1; }
.trade-detail header { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.trade-detail header div { min-width: 0; }
.trade-detail header span { display: block; color: var(--muted); font-size: 9px; }
.trade-detail header strong { display: block; margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.trade-detail p { margin: 10px 0 0; color: #555b63; font-size: 10px; line-height: 1.6; }
.trade-log h3 { margin: 0 0 8px; font-size: 12px; }
.trade-log table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9px; }
.trade-log th, .trade-log td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.trade-log th { color: var(--muted); font-weight: 700; }
.trade-log th:nth-child(1) { width: 54px; }
.trade-log th:nth-child(2) { width: 92px; }
.trade-log th:nth-child(3) { width: 58px; }
.detail-empty { min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.holding-detail-shell > .primary-command { margin-bottom: 0; }
.empty-state { min-height: 78px; display: grid; place-items: center; padding: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.report-dialog { width: min(620px, calc(100% - 24px)); }
.report-dialog form { max-height: min(82dvh, 760px); display: flex; flex-direction: column; }
.report-dialog pre { min-height: 260px; margin: 18px 0; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: #f6f7f8; color: var(--ink); font: 12px/1.7 "Microsoft YaHei UI", sans-serif; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 5px; background: #202327; color: #fff; font-size: 12px; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 759px) {
  .app-shell.stock-open { padding-bottom: var(--safe-bottom); }
  .app-shell.stock-open .bottom-nav { display: none; }
}

@media (min-width: 760px) {
  .app-shell { padding-left: 90px; padding-bottom: 0; }
  .app-header { margin-left: -90px; padding-left: 112px; }
  .bottom-nav { top: 0; right: auto; width: 90px; height: 100dvh; grid-template-columns: 1fr; grid-template-rows: repeat(5, 76px); padding: 84px 0 0; border-top: 0; border-right: 1px solid #cfd3d8; }
  .bottom-nav button { justify-content: center; }
  .view { padding: 36px 28px 60px; }
  .demo-banner { margin-left: -90px; }
  .chart-options { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .market-summary { grid-template-columns: auto 1fr; }
  .market-summary .state-tag { display: none; }
  .temperature strong { font-size: 42px; }
  .metric-grid strong { font-size: 12px; }
  .kline-chart { height: 350px; }
}
