:root {
  --paper: #f2f4f2;
  --panel: #ffffff;
  --ink: #162126;
  --ink-soft: #3f4d52;
  --muted: #718087;
  --line: #d9e0dc;
  --line-strong: #bfcac5;
  --navy: #121f27;
  --blue: #2459a6;
  --blue-dark: #173f7d;
  --blue-soft: #eaf1fb;
  --green: #18794e;
  --green-soft: #e8f5ed;
  --red: #b83b32;
  --red-soft: #fbeceb;
  --amber: #a56812;
  --amber-soft: #fff5dc;
  --shadow: 0 10px 28px rgba(24, 38, 35, .06);
  --display: "Avenir Next Condensed", "Arial Narrow", "PingFang SC", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --data: "SFMono-Regular", "Roboto Mono", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(41, 62, 55, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 24px;
  color: var(--ink);
  font: 14px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: #c8dcfa; color: #10253f; }

.top-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 5px 18px rgba(18, 31, 39, .12);
}

/* The market temperature tape is the product's signature element. */
.market-banner {
  --market-hue: 48;
  --market-score: 50%;
  display: grid;
  grid-template-columns: 330px minmax(560px, 1fr) auto;
  align-items: stretch;
  min-height: 84px;
  padding: 0 26px;
  background: #f9fbfa;
  border-top: 4px solid hsl(var(--market-hue) 62% 42%);
  border-bottom: 1px solid var(--line);
}
.market-primary {
  display: grid;
  grid-template-columns: 94px 1fr;
  align-items: center;
  gap: 15px;
  margin-right: 20px;
  padding: 12px 20px 11px 12px;
  border-right: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg,
    hsl(var(--market-hue) 72% 93%) 0%,
    hsl(var(--market-hue) 64% 89%) 100%);
}
.market-verdict { display: grid; align-content: center; }
.market-caption,
.utility-label {
  color: var(--muted);
  font: 700 10px/1.2 var(--data);
  letter-spacing: .11em;
  text-transform: uppercase;
}
.market-verdict strong {
  color: hsl(var(--market-hue) 58% 30%);
  font: 800 25px/1.05 var(--display);
  letter-spacing: .02em;
}
.market-strength { min-width: 0; }
.market-score {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font: 700 11px/1 var(--data);
}
.market-thermometer {
  position: relative;
  height: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, #1d8c58 0%, #7fad4c 28%, #d1a82f 50%, #d66a32 72%, #bc3532 100%);
  box-shadow: inset 0 0 0 1px rgba(19, 39, 30, .12);
}
.market-thumb {
  position: absolute;
  top: 50%;
  left: var(--market-score);
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: hsl(var(--market-hue) 62% 42%);
  box-shadow: 0 1px 5px rgba(12, 24, 19, .35);
  transition: left .45s ease, background .45s ease;
}
.market-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: #86928e;
  font: 600 9px/1 var(--data);
}
.market-indices {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  align-items: stretch;
  min-width: 0;
}
.market-index-mini {
  --idx-hue: 48;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 1px 12px;
  min-width: 0;
  padding: 11px 15px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg,
    hsl(var(--idx-hue) 72% 94%) 0%,
    hsl(var(--idx-hue) 64% 90%) 100%);
}
.market-index-mini:first-child { border-left: 0; }
.market-index-mini .market-index-name i {
  color: hsl(var(--idx-hue) 55% 32%);
  font-weight: 700;
}
.market-index-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.market-index-name b { font-size: 12px; white-space: nowrap; }
.market-index-name i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.market-index-mini em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--ink);
  font: 700 13px/1 var(--data);
}
.market-index-mini small {
  color: var(--muted);
  font: 650 10px/1.2 var(--data);
}
.market-index-mini small.up, .value-up { color: var(--red); }
.market-index-mini small.down, .value-down { color: var(--green); }
.market-index-placeholder {
  align-self: center;
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.market-asof {
  display: grid;
  place-items: center;
  padding-left: 18px;
  color: var(--muted);
  font: 600 10px/1.3 var(--data);
  white-space: nowrap;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 34px;
  min-height: 66px;
  padding: 0 26px;
  background: var(--navy);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(255,255,255,.42);
  font: 800 15px/1 var(--display);
  letter-spacing: .04em;
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy b {
  font: 800 15px/1 var(--display);
  letter-spacing: .15em;
}
.brand-copy small {
  margin-top: 4px;
  color: #8fa0a9;
  font-size: 9px;
  letter-spacing: .13em;
}
.nav {
  display: flex;
  align-self: stretch;
  flex: 1;
  gap: 2px;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: #9eacb4;
  text-decoration: none;
  font-size: 13px;
  transition: color .18s ease, background .18s ease;
}
.nav a::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  background: #8fb4ea;
  content: "";
  transform: scaleX(0);
  transition: transform .18s ease;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.035); }
.nav a.active { color: #fff; }
.nav a.active::after { transform: scaleX(1); }
.logout-form { margin-left: auto; }

.wrap {
  width: min(1500px, 100%);
  margin: auto;
  padding: 38px 28px 56px;
}
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}
.hero.compact { padding-top: 4px; }
.hero h1 {
  max-width: 880px;
  margin: 6px 0 8px;
  font: 750 clamp(30px, 3vw, 42px)/1.08 var(--display);
  letter-spacing: -.02em;
}
.hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  color: var(--blue);
  font: 750 10px/1.4 var(--data);
  letter-spacing: .13em;
}

button {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 15px;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
button:hover { border-color: #92a49c; }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}
.primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.ghost { border-color: #3c4c55; background: transparent; color: #bac5ca; }
.ghost:hover { border-color: #6c7d86; color: #fff; }
.small { padding: 6px 11px; }
.full { width: 100%; }
.run-action {
  display: grid;
  min-width: 260px;
  padding: 12px 18px;
  text-align: left;
}
.run-action span { font-size: 14px; }
.run-action small { margin-top: 2px; color: #dbe8fa; font-size: 10px; font-weight: 500; }

.card {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.muted { color: var(--muted); }
.model-status {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(300px, 1.8fr) auto;
  align-items: center;
  gap: 18px;
  margin: -8px 0 18px;
  padding: 12px 15px;
  border: 1px solid #ead4a7;
  border-left: 4px solid var(--amber);
  border-radius: 4px;
  background: var(--amber-soft);
}
.model-status div { display: grid; gap: 4px; }
.model-status strong { font-size: 13px; }
.model-status p { margin: 0; color: #70572f; font-size: 12px; }
.progress-card {
  margin-bottom: 22px;
  padding: 20px 22px 16px;
  border-left: 4px solid var(--blue);
}
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.progress-copy { display: grid; gap: 4px; }
.progress-copy strong { font-size: 15px; }
.progress-track {
  height: 5px;
  overflow: hidden;
  background: #e7ece9;
}
.progress-fill {
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .4s ease;
}
.status-pill {
  height: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f5f7f6;
  color: var(--ink-soft);
  font: 700 10px/1.3 var(--data);
}
.status-pill[data-state="running"] { border-color: #bbcef0; background: var(--blue-soft); color: var(--blue); }
.status-pill[data-state="completed"] { border-color: #bddfc9; background: var(--green-soft); color: var(--green); }
.status-pill[data-state="completed_with_warnings"] { border-color: #ead4a7; background: var(--amber-soft); color: var(--amber); }
.status-pill[data-state="failed"] { border-color: #efc5c2; background: var(--red-soft); color: var(--red); }
.progress-warnings {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.progress-warnings[hidden] { display: none; }
.progress-warnings div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #70572f;
  font-size: 12px;
}
.progress-warnings strong { color: var(--amber); white-space: nowrap; }
.log-panel { margin-top: 13px; color: var(--muted); }
.log-panel summary {
  width: fit-content;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.log-panel summary span { margin-left: 6px; color: #98a49f; font-weight: 400; }
.log-panel pre {
  max-height: 250px;
  margin-bottom: 2px;
  overflow: auto;
  padding: 15px;
  border-radius: 3px;
  background: #122029;
  color: #d6e2e7;
  font: 11px/1.65 var(--data);
  white-space: pre-wrap;
}

.table-card { overflow: hidden; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.tab {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12px;
}
.tab:hover { border-color: var(--line); color: var(--ink); }
.tab.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.card-meta { color: var(--muted); font: 550 11px/1.4 var(--data); }
.table-wrap { overflow: auto; }
table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #e7ebe9;
  white-space: nowrap;
  text-align: right;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9f8;
  color: #5f6e74;
  font-size: 11px;
  font-weight: 700;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f4f7f5; }
tbody tr:last-child td { border-bottom: 0; }
th:nth-child(2), th:nth-child(3), th:nth-child(4),
td:nth-child(2), td:nth-child(3), td:nth-child(4) { text-align: left; }
.rank {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  color: var(--ink-soft);
  font: 700 11px/1 var(--data);
}
tbody tr:nth-child(-n+3) .rank {
  border: 1px solid #aab7b1;
  background: #f2f5f3;
  color: var(--ink);
}
.code { color: var(--blue); font: 650 12px/1 var(--data); }
.score-value { color: var(--ink); font: 750 12px/1 var(--data); }
.signal {
  display: inline-block;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 2px;
  text-align: center;
  font-size: 11px;
}
.signal.positive { background: var(--red-soft); color: var(--red); }
.signal.negative { background: var(--green-soft); color: var(--green); }
.signal.neutral { background: #f1f3f2; color: #617069; }
.risk {
  padding: 2px 6px;
  border-left: 2px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
}
.quiet { color: #b1bbb7; }
.value-up, .value-down { font-weight: 700; }
.empty { padding: 58px 24px; text-align: center; color: var(--muted); }
.small-empty { padding: 20px 10px; }

/* News is presented as a source-aware wire, not a generic card wall. */
.news-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}
.news-rail {
  position: sticky;
  top: 190px;
  display: grid;
  padding-top: 15px;
  border-top: 3px solid var(--ink);
}
.news-rail strong {
  margin-top: 10px;
  font: 800 55px/.9 var(--display);
}
.news-rail > span:not(.utility-label) { color: var(--muted); }
.section-note {
  margin-top: 20px;
  color: var(--muted);
  font: 11px/1.8 var(--data);
  white-space: pre-line;
}
.news-list {
  border-top: 1px solid var(--line-strong);
  background: rgba(255,255,255,.52);
}
.news-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  padding: 23px 26px 21px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.news-item:hover { background: #fff; }
.news-number {
  padding-top: 2px;
  color: #a1aca7;
  font: 650 11px/1 var(--data);
}
.news-body { min-width: 0; }
.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 10px/1.4 var(--data);
}
.source-mark {
  padding-left: 8px;
  border-left: 3px solid var(--blue);
  color: var(--ink-soft);
  font-weight: 750;
}
.news-item h2 {
  max-width: 960px;
  margin: 8px 0 7px;
  font: 720 clamp(18px, 1.8vw, 23px)/1.42 var(--display);
}
.news-item h2 a { text-decoration: none; }
.news-item h2 a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.news-item p {
  display: -webkit-box;
  max-width: 1050px;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.news-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 13px;
  color: #8b9893;
  font-size: 11px;
}
.news-foot a {
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.summary-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.history-card {
  position: sticky;
  top: 190px;
  padding-top: 15px;
  border-top: 3px solid var(--ink);
}
.history-card h3 {
  margin: 8px 0 12px;
  font: 720 21px/1.2 var(--display);
}
.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  padding: 10px 7px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.history-row:last-child { border-bottom: 1px solid var(--line); }
.history-row:hover { border-color: var(--line); background: rgba(255,255,255,.7); }
.history-row.active { background: var(--navy); color: #fff; }
.history-row span { align-self: center; color: var(--muted); font-size: 10px; }
.history-row.active span { color: #b9c7ce; }
.summary-card { overflow: hidden; }
.summary-header {
  display: grid;
  gap: 8px;
  padding: 22px 30px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}
.summary-content {
  max-width: 920px;
  min-height: 480px;
  padding: 34px 52px 54px;
  font-size: 15px;
  line-height: 1.95;
  white-space: normal;
}
.summary-content h2 {
  margin: 34px 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  font: 740 24px/1.3 var(--display);
}
.summary-content h2:first-child { margin-top: 0; }
.summary-content h3, .summary-content h4 {
  margin: 28px 0 9px;
  font: 720 18px/1.35 var(--display);
}
.summary-content p { margin: 9px 0 17px; color: #344349; }
.summary-content ul, .summary-content ol { margin: 10px 0 21px; padding-left: 22px; }
.summary-content li { margin: 8px 0; padding-left: 4px; color: #344349; }
.summary-content li::marker { color: var(--blue); font-weight: 700; }
.summary-content strong { color: var(--ink); }
.summary-content code {
  padding: 2px 5px;
  border-radius: 2px;
  background: #eef2f0;
  font: 12px var(--data);
}
.error-text { color: var(--red); }

.chat-card {
  max-width: 1120px;
  margin: 0 auto;
  overflow: hidden;
}
.chat-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 43px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
  font-size: 11px;
}
.context-primary { display: flex; align-items: center; gap: 9px; min-width: 0; }
.context-primary > span:last-child {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.network-mode {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}
.network-mode select {
  min-height: 28px;
  outline: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink-soft);
  padding: 3px 25px 3px 8px;
  font-size: 10px;
}
.network-mode select:focus { border-color: #6f96ce; box-shadow: 0 0 0 2px var(--blue-soft); }
.messages {
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-height: 430px;
  height: min(56vh, 630px);
  overflow: auto;
  padding: 30px 34px;
  background:
    linear-gradient(90deg, transparent 49px, rgba(60, 85, 75, .06) 50px, transparent 51px),
    #fbfcfb;
}
.message {
  max-width: 80%;
  padding: 12px 15px 13px;
  border-radius: 3px;
}
.message.assistant {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: #fff;
}
.message.user {
  align-self: flex-end;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
}
.message-role {
  display: block;
  margin-bottom: 5px;
  color: #8a9892;
  font: 700 9px/1 var(--data);
  letter-spacing: .12em;
}
.message.user .message-role { color: #9eb0ba; }
.message-body {
  min-width: 0;
  line-height: 1.72;
}
.message.user .message-body { white-space: pre-wrap; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body p { margin: 0 0 9px; }
.message-body h2,
.message-body h3,
.message-body h4 {
  margin: 17px 0 7px;
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.35;
}
.message-body h2 { font-size: 18px; }
.message-body h3 { font-size: 16px; }
.message-body h4 { font-size: 14px; }
.message-body ul,
.message-body ol {
  margin: 7px 0 11px;
  padding-left: 21px;
}
.message-body li { margin: 4px 0; padding-left: 2px; }
.message-body li::marker { color: var(--blue); font-weight: 700; }
.message-body strong { color: var(--ink); }
.message-body code {
  padding: 2px 5px;
  border-radius: 2px;
  background: #eef2f0;
  color: #304d61;
  font: 12px/1.5 var(--data);
}
.message-body pre {
  max-width: 100%;
  margin: 9px 0 12px;
  overflow-x: auto;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #f5f7f6;
  white-space: pre;
}
.message-body pre code { padding: 0; background: transparent; }
.message-body blockquote {
  margin: 9px 0 12px;
  padding: 6px 11px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--ink-soft);
}
.message-body.streaming {
  position: relative;
  min-width: 12px;
  padding-right: 11px;
}
.web-sources {
  display: grid;
  gap: 6px;
  width: min(720px, 92%);
  margin-top: -7px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--blue);
  border-radius: 3px;
  background: #f8faf9;
}
.web-sources-label {
  margin-bottom: 2px;
  color: var(--muted);
  font: 700 9px/1 var(--data);
  letter-spacing: .1em;
}
.web-sources a {
  overflow: hidden;
  color: var(--blue);
  font-size: 11px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-sources a:hover { text-decoration: underline; text-underline-offset: 3px; }
.streaming::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: 6px;
  height: 14px;
  background: var(--blue);
  content: "";
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.prompt-suggestions {
  display: flex;
  gap: 7px;
  padding: 10px 14px 0;
  border-top: 1px solid var(--line);
}
.prompt-suggestions button {
  padding: 6px 10px;
  border-color: var(--line);
  background: #f8faf9;
  color: var(--ink-soft);
  font-size: 11px;
}
.chat-form {
  display: flex;
  gap: 12px;
  padding: 12px 14px 14px;
}
.composer {
  position: relative;
  flex: 1;
}
.chat-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 11px 13px 27px;
  background: #fff;
}
.composer-hint {
  position: absolute;
  right: 10px;
  bottom: 9px;
  color: #9ca8a3;
  font: 9px/1 var(--data);
}
.chat-form button { align-self: flex-end; min-width: 112px; }
.chat-form textarea:focus,
.login-form input:focus {
  border-color: #6f96ce;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(125deg, rgba(36,89,166,.08), transparent 38%),
    #e9eeeb;
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(360px, .85fr);
  width: min(980px, 100%);
  min-height: 570px;
  overflow: hidden;
  border: 1px solid #aebbb5;
  background: #fff;
  box-shadow: 0 30px 80px rgba(21, 37, 30, .17);
}
.login-market-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px 46px 34px;
  background:
    linear-gradient(90deg, transparent 49px, rgba(255,255,255,.05) 50px, transparent 51px),
    var(--navy);
  background-size: 50px 100%, auto;
  color: #fff;
}
.login-market-panel::after {
  position: absolute;
  right: -70px;
  bottom: 60px;
  width: 290px;
  height: 290px;
  border: 50px solid rgba(109, 150, 210, .13);
  border-radius: 50%;
  content: "";
}
.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font: 800 16px/1 var(--display);
  letter-spacing: .14em;
}
.login-brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #71828c;
  letter-spacing: 0;
}
.login-thesis { position: relative; z-index: 1; max-width: 470px; }
.login-thesis .utility-label { color: #8fa6b2; }
.login-thesis h1 {
  margin: 16px 0;
  font: 750 clamp(38px, 5vw, 58px)/1.08 var(--display);
  letter-spacing: -.035em;
}
.login-thesis p { max-width: 390px; color: #a9b8c0; font-size: 13px; }
.login-tape {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  color: #84969f;
  font: 600 9px/1 var(--data);
  letter-spacing: .08em;
}
.login-tape i { width: 32px; height: 1px; margin: 0 8px; background: #465963; }
.login-card {
  align-self: center;
  width: 100%;
  padding: 50px 52px;
  background: #fff;
}
.login-card h2 {
  margin: 8px 0 8px;
  font: 750 34px/1.1 var(--display);
}
.login-card > p { margin: 0; }
.login-form {
  display: grid;
  gap: 8px;
  margin-top: 29px;
}
.login-form label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.login-form input {
  margin-bottom: 9px;
  padding: 12px 13px;
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}
.login-form button { min-height: 45px; }
.login-note {
  display: block;
  margin-top: 18px;
  color: #9aa6a1;
  text-align: center;
}
.alert { margin-top: 17px; padding: 10px 12px; border-radius: 2px; }
.alert.error { border-left: 3px solid var(--red); background: var(--red-soft); color: var(--red); }

:focus-visible {
  outline: 3px solid rgba(36, 89, 166, .28);
  outline-offset: 2px;
}

a, button { -webkit-tap-highlight-color: transparent; }

/* Mobile-only navigation; activated inside the <=820px media query. */
.mobile-tabbar { display: none; }

/* Mobile ranking cards — activated inside the <=820px media query. */
.pool-cards { display: none; }
.pool-card {
  padding: 12px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(24, 38, 35, .05);
}
.pc-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pc-rank {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #eef2f0;
  color: var(--ink-soft);
  font: 750 12px/1 var(--data);
}
.pc-rank.top { background: var(--navy); color: #fff; }
.pc-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.pc-title b { font-size: 15px; white-space: nowrap; }
.pc-code { color: var(--blue); font: 650 11px/1 var(--data); }
.pc-scope {
  max-width: 40%;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-score-row { display: flex; align-items: baseline; gap: 7px; margin-top: 9px; }
.pc-score { color: var(--ink); font: 800 24px/1 var(--data); }
.pc-score-label { color: var(--muted); font-size: 10px; }
.pc-pills { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: 12px; }
.pc-price { font: 700 13px/1 var(--data); }
.pc-grid,
.pc-signals {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 8px 4px;
  border-radius: 6px;
  background: #f5f8f6;
}
.pc-grid { grid-template-columns: repeat(5, 1fr); }
.pc-signals { grid-template-columns: repeat(4, 1fr); }
.pc-grid div, .pc-signals div { display: grid; justify-items: center; gap: 3px; }
.pc-grid i, .pc-signals i {
  color: var(--muted);
  font: 600 9px/1.2 var(--data);
  font-style: normal;
  letter-spacing: .04em;
}
.pc-grid b { color: var(--ink); font: 750 12.5px/1 var(--data); }
.pc-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 11px;
}
.pc-metrics i {
  margin-right: 4px;
  color: var(--muted);
  font: 600 9.5px/1 var(--data);
  font-style: normal;
}
.pc-more { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pc-more summary { color: var(--blue); cursor: pointer; font-size: 11.5px; font-weight: 650; }
.pc-detail-row { display: grid; gap: 3px; margin-top: 8px; }
.pc-detail-row i {
  color: var(--muted);
  font: 700 9.5px/1 var(--data);
  font-style: normal;
  letter-spacing: .06em;
}
.pc-detail-row p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }

@media (max-width: 1160px) {
  .market-banner { grid-template-columns: 290px minmax(500px, 1fr); padding-right: 16px; }
  .market-primary { grid-template-columns: 80px 1fr; }
  .market-index-mini { padding-right: 10px; padding-left: 10px; }
  .market-asof { display: none; }
  .table-toolbar { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (max-width: 820px) {
  /* 为底部 Tab Bar 让位 */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .top-shell { position: relative; box-shadow: 0 2px 10px rgba(18, 31, 39, .08); }

  /* 市场横幅：判定行 + 2×2 指数网格，全部一屏可见 */
  .market-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
    border-top-width: 3px;
  }
  .market-primary {
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin: 0;
    padding: 9px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .market-verdict strong { font-size: 21px; }
  .market-score { margin-bottom: 5px; }
  .market-indices { display: grid; grid-template-columns: 1fr 1fr; }
  .market-index-mini {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    min-height: 0;
    padding: 8px 16px 7px;
    border-bottom: 1px solid var(--line);
  }
  .market-index-mini:nth-child(2n) { border-right: 0; }
  .market-index-mini:nth-child(n+3) { border-bottom: 0; }
  .market-index-mini .market-index-name {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: space-between;
    width: 100%;
  }
  .market-index-name i { overflow: hidden; text-overflow: ellipsis; }
  .market-index-mini em { grid-row: 2; grid-column: 1; font-size: 14px; }
  .market-index-mini small { grid-row: 2; grid-column: 2; align-self: end; }
  .market-index-placeholder { grid-column: 1 / -1; padding: 14px 16px; }

  /* 顶栏压缩为单行，主导航移至底部 */
  .site-header { flex-wrap: nowrap; gap: 12px; min-height: 52px; padding: 0 16px; }
  .brand-mark { width: 30px; height: 30px; font-size: 13px; }
  .brand-copy small { display: none; }
  .nav { display: none; }
  .logout-form { margin-left: auto; }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(18, 31, 39, .97);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .mobile-tabbar a {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0 6px;
    color: #8fa0a9;
    font-size: 10px;
    text-decoration: none;
  }
  .mobile-tabbar a svg { width: 21px; height: 21px; }
  .mobile-tabbar a.active { color: #fff; }
  .mobile-tabbar a.active::before {
    position: absolute;
    top: 0;
    right: 22%;
    left: 22%;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: #8fb4ea;
    content: "";
  }

  /* 内容区 */
  .wrap { padding: 18px 14px 34px; }
  .hero { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 16px; }
  .hero.compact { padding-top: 0; }
  .hero h1 { font-size: clamp(23px, 6.6vw, 30px); text-wrap: balance; }
  .hero p { font-size: 12.5px; }
  .run-action { width: 100%; min-width: 0; }
  .hero .primary:not(.run-action) { width: 100%; min-height: 46px; }

  .model-status { grid-template-columns: 1fr; gap: 9px; margin: 0 0 14px; }
  .model-status .status-pill { justify-self: start; }
  .progress-card { margin-bottom: 16px; padding: 15px 15px 12px; }
  .progress-head { flex-wrap: wrap; gap: 8px; }
  .status-pill { white-space: nowrap; }

  /* 榜单：宽表隐藏，切换为卡片流 */
  .table-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; min-height: 0; padding: 10px 12px; }
  .tabs { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; }
  .card-meta { font-size: 10px; }
  .table-wrap { display: none; }
  .pool-cards { display: grid; gap: 10px; padding: 12px; background: #f3f6f4; }

  /* 新闻流 */
  .news-shell, .summary-layout { grid-template-columns: 1fr; gap: 14px; }
  .news-rail, .history-card { position: static; }
  .news-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding-top: 10px;
    border-top-width: 2px;
  }
  .news-rail .utility-label { width: 100%; }
  .news-rail strong { margin: 0; font-size: 30px; }
  .news-rail .section-note { width: 100%; margin-top: 0; font-size: 10px; }
  .news-list { border-top: 0; background: transparent; }
  .news-item {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 10px;
    padding: 15px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .news-item:hover { background: #fff; }
  .news-number { display: none; }
  .news-item h2 { margin: 7px 0 6px; font-size: 17px; }
  .news-foot { margin-top: 10px; }

  /* 每日总结：历史改为顶部横向 chips */
  .history-card { order: -1; padding-top: 0; border-top: 0; }
  .history-card h3 { display: none; }
  .history-card .utility-label { display: block; margin-bottom: 8px; }
  #historyList { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  #historyList::-webkit-scrollbar { display: none; }
  .history-row {
    display: flex;
    align-items: baseline;
    flex: 0 0 auto;
    gap: 6px;
    width: auto;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
  }
  .history-row:last-child { border-bottom: 1px solid var(--line); }
  .history-row.active { border-color: var(--navy); }
  .summary-header { padding: 16px 16px 13px; }
  .summary-content { min-height: 320px; padding: 22px 18px 38px; font-size: 14.5px; line-height: 1.85; }
  .summary-content h2 { font-size: 20px; }

  /* 数据问答：卡片撑满剩余视高，输入区固定在卡内底部 */
  .page-chat .hero { gap: 6px; margin-bottom: 12px; }
  .page-chat .hero p { display: none; }
  .chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 430px);
    min-height: 400px;
  }
  .chat-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
    padding: 9px 12px;
  }
  .context-primary { width: 100%; }
  .network-mode { width: 100%; justify-content: space-between; }
  .network-mode select { font-size: 12px; }
  .messages {
    flex: 1;
    gap: 12px;
    height: auto;
    min-height: 0;
    padding: 16px 12px;
    background: #fbfcfb;
  }
  .message { max-width: 92%; }
  .web-sources { width: 100%; }
  .prompt-suggestions { overflow-x: auto; padding: 8px 10px 0; scrollbar-width: none; }
  .prompt-suggestions::-webkit-scrollbar { display: none; }
  .prompt-suggestions button { flex: 0 0 auto; }
  .chat-form { align-items: flex-end; flex-direction: row; gap: 8px; padding: 10px; }
  .chat-form textarea { min-height: 44px; max-height: 120px; padding: 11px 12px; font-size: 16px; }
  .composer-hint { display: none; }
  .chat-form button { align-self: flex-end; width: auto; min-width: 76px; min-height: 44px; }

  /* 登录页 */
  .login-body { padding: 14px; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-market-panel { gap: 18px; min-height: 0; padding: 22px 22px 20px; }
  .login-thesis h1 { margin: 10px 0; font-size: 30px; }
  .login-thesis p, .login-tape { display: none; }
  .login-card { padding: 28px 22px 30px; }
  .login-card h2 { font-size: 28px; }
  .login-form input { font-size: 16px; }
}

@media (max-width: 520px) {
  .market-primary { gap: 10px; padding: 8px 14px 9px; }
  .market-verdict strong { font-size: 19px; }
  .market-index-mini { padding: 7px 14px 6px; }
  .market-index-mini em { font-size: 13px; }
  .wrap { padding: 16px 12px 30px; }
  .hero h1 { font-size: clamp(22px, 6.8vw, 27px); }
  .news-item h2 { font-size: 16px; }
  .summary-content { padding: 20px 15px 32px; }
  .progress-card { padding: 14px 13px 11px; }
  .chat-card { height: calc(100dvh - 415px); min-height: 370px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
