:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
  --bg: #071019;
  --surface: #0c1721;
  --surface-2: #101e29;
  --surface-3: #09131c;
  --line: #213746;
  --line-strong: #315063;
  --text: #edf5fb;
  --muted: #8fa7b8;
  --cyan: #42d8cf;
  --blue: #54a9ff;
  --green: #37d996;
  --yellow: #f0c75e;
  --red: #ff6b72;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); padding-bottom: 132px; }
button { font: inherit; letter-spacing: 0; }
h1, h2, h3, p { margin: 0; }

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 2.6vw, 42px);
  border-bottom: 1px solid var(--line);
  background: #08121b;
}
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-block img { width: 40px; height: 40px; flex: 0 0 auto; }
h1 { font-size: 21px; line-height: 1.2; }
.brand-block p { color: var(--muted); margin-top: 4px; font-size: 12px; }
.header-status { display: flex; align-items: center; gap: 10px; }
#clock { font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.pill.ok, .pill.readonly { color: var(--green); border-color: rgba(55,217,150,.48); }
.pill.warn, .pill.privacy { color: var(--yellow); border-color: rgba(240,199,94,.48); }
.pill.error { color: var(--red); border-color: rgba(255,107,114,.5); }
.pill.neutral { color: var(--muted); }

.status-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  padding: 0 clamp(14px, 2vw, 30px);
}
.status-rail > div { min-width: 0; padding: 11px 14px; border-right: 1px solid var(--line); }
.status-rail > div:last-child { border-right: 0; }
.status-rail span { display: block; color: var(--muted); font-size: 11px; }
.status-rail strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }

.workspace { width: min(1500px, calc(100% - 28px)); margin: 0 auto; }
.page { display: none; padding: 18px 0 30px; }
.page.active { display: block; }
.page-title, .section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.page-title { padding: 0 2px 13px; margin-bottom: 14px; }
.section-title { padding: 18px 2px 11px; }
.section-title.compact { padding-top: 0; }
.eyebrow { color: var(--cyan); font-size: 11px; margin-bottom: 5px; }
h2 { font-size: 23px; }
h3 { font-size: 16px; }
.section-title p { margin-top: 5px; color: var(--muted); font-size: 12px; }

.verdict-band {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--cyan);
  background: var(--surface);
}
.verdict-band strong { font-size: 18px; }
.verdict-band p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.verdict-band.warning { border-left-color: var(--yellow); }
.verdict-band.blocked { border-left-color: var(--red); }
.loading-line { color: var(--muted); }

.metric-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0; border: 1px solid var(--line); background: var(--surface); }
.metric-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-tile { min-width: 0; padding: 13px 14px; border-right: 1px solid var(--line); }
.metric-tile:last-child { border-right: 0; }
.metric-tile span { display: block; color: var(--muted); font-size: 11px; }
.metric-tile strong { display: block; margin-top: 5px; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-tile small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }

.top2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0 2px; }
.stock-card, .opportunity-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}
.stock-card.buyable { border-color: rgba(55,217,150,.72); }
.stock-card.forbidden { border-color: rgba(255,107,114,.5); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.stock-id { min-width: 0; }
.stock-id strong { display: block; font-size: 18px; }
.stock-id span { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.decision { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; white-space: nowrap; }
.decision.buy { color: var(--green); border-color: rgba(55,217,150,.55); }
.decision.wait { color: var(--yellow); border-color: rgba(240,199,94,.55); }
.decision.block { color: var(--red); border-color: rgba(255,107,114,.55); }
.price-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 13px 16px 8px; gap: 8px; }
.mini-metric span, .score-cell span { display: block; color: var(--muted); font-size: 11px; }
.mini-metric strong { display: block; margin-top: 4px; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.positive { color: var(--red); }
.negative { color: var(--green); }
.score-matrix { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 8px 16px 13px; }
.score-cell { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); background: #09141d; }
.score-cell strong { display: block; margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.reason-line { margin: 0 16px 14px; padding: 9px 11px; border-left: 3px solid var(--yellow); background: #09141d; color: #c7d5df; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }

.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.overview-lower { margin-top: 14px; }
.panel-section { min-width: 0; }
.theme-list, .record-list { border: 1px solid var(--line); background: var(--surface); }
.theme-row, .record-row { min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.theme-row:last-child, .record-row:last-child { border-bottom: 0; }
.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-head strong { overflow-wrap: anywhere; }
.row-head span { color: var(--yellow); font-size: 12px; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.row-copy { margin-top: 7px; color: #c5d3dd; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.record-row.risk { border-left: 3px solid var(--red); }
.record-row.good { border-left: 3px solid var(--green); }

.list-section { margin-top: 14px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); background: var(--surface-2); }
.list-heading span { color: var(--muted); font-size: 12px; }
.opportunity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-top: 9px; }
.opportunity-card { padding: 13px 14px; }
.opportunity-card .row-copy { min-height: 38px; }
.confirm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.confirm-item { padding: 6px 7px; border: 1px solid var(--line); font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.confirm-item.pass { color: var(--green); border-color: rgba(55,217,150,.34); }
.confirm-item.fail { color: var(--red); border-color: rgba(255,107,114,.34); }
.confirm-item.wait { color: var(--yellow); border-color: rgba(240,199,94,.34); }

.privacy-note, .legal-notice { padding: 13px 15px; border: 1px solid rgba(240,199,94,.42); background: #171607; color: #e7d390; font-size: 12px; line-height: 1.65; }
.integrity-box { display: grid; grid-template-columns: 190px 1fr; border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; }
.integrity-level { display: grid; place-items: center; min-height: 108px; padding: 16px; border-right: 1px solid var(--line); text-align: center; }
.integrity-level strong { font-size: 19px; }
.integrity-level span { margin-top: 6px; color: var(--muted); font-size: 11px; }
.integrity-reasons { padding: 14px 16px; }
.integrity-reasons p { color: #c7d5df; line-height: 1.7; font-size: 12px; }

.group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 0; }
.group-block { border: 1px solid var(--line); background: var(--surface); }
.group-block h4 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.group-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.group-table th, .group-table td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: right; }
.group-table th:first-child, .group-table td:first-child { text-align: left; }
.group-table th { color: var(--muted); font-weight: 400; }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.about-grid section { padding: 17px 18px; border: 1px solid var(--line); background: var(--surface); }
.about-grid p { margin-top: 9px; color: #c6d4de; line-height: 1.75; font-size: 13px; }
.empty-state { grid-column: 1 / -1; min-height: 100px; display: grid; place-items: center; padding: 24px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.empty-state.small { min-height: 68px; }

.page-dock {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 20;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  width: min(820px, calc(100% - 24px));
  padding: 6px;
  border: 1px solid #23515a;
  border-radius: 7px;
  background: rgba(6, 15, 23, .96);
  box-shadow: 0 12px 35px rgba(0,0,0,.38);
}
.page-dock button { min-height: 52px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.page-dock button:hover { color: var(--text); background: var(--surface-2); }
.page-dock button.active { color: var(--text); border-color: #2a7478; background: #0e3037; }
.page-dock b, .page-dock span { display: block; }
.page-dock b { font-size: 15px; }
.page-dock span { margin-top: 3px; font-size: 11px; }
.disclaimer { position: fixed; z-index: 19; left: 0; right: 0; bottom: 0; height: 32px; display: grid; place-items: center; border-top: 1px solid var(--line); background: #08121b; color: var(--muted); font-size: 11px; text-align: center; padding: 0 10px; }

@media (max-width: 900px) {
  .status-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-rail > div:nth-child(3) { border-right: 0; }
  .status-rail > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-strip .metric-tile:nth-child(3) { border-right: 0; }
  .metric-strip .metric-tile:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric-strip.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip.four .metric-tile:nth-child(2) { border-right: 0; }
  .metric-strip.four .metric-tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { padding-bottom: 118px; }
  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 12px 14px;
  }
  .brand-block img { width: 34px; height: 34px; }
  h1 { font-size: 17px; }
  .brand-block p { font-size: 10px; }
  .header-status {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  #clock { font-size: 11px; }
  .status-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .status-rail > div { padding: 9px 11px; }
  .status-rail > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .status-rail > div:nth-child(even) { border-right: 0; }
  .status-rail > div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .status-rail > div:last-child { grid-column: 1 / -1; border-right: 0; }
  .workspace { width: calc(100% - 18px); }
  .page { padding-top: 12px; }
  h2 { font-size: 20px; }
  .verdict-band { align-items: flex-start; flex-direction: column; }
  .metric-strip, .metric-strip.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip .metric-tile:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric-strip .metric-tile:nth-child(even) { border-right: 0; }
  .metric-strip .metric-tile:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .top2-grid, .opportunity-grid, .group-grid, .about-grid { grid-template-columns: 1fr; }
  .price-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .confirm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integrity-box { grid-template-columns: 1fr; }
  .integrity-level { min-height: 74px; border-right: 0; border-bottom: 1px solid var(--line); }
  .page-dock {
    left: 4px;
    right: auto;
    bottom: 28px;
    transform: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: min(380px, calc(100vw - 8px));
    padding: 4px;
    overflow: hidden;
  }
  .page-dock button { min-width: 0; min-height: 48px; padding: 4px 1px; }
  .page-dock b { font-size: 13px; }
  .page-dock span { font-size: 9px; }
  .disclaimer { height: 28px; font-size: 9px; }
}
