/* =========================================================
   Astramer · UI v2
   浅色研究终端风格：宣纸底、墨色字、朱砂印章主色。
   保留 v1 全部 class 名，可直接替换 /static/app.css。
   ========================================================= */

:root {
  /* 底色与墨色 */
  --paper: #f3f5f2;
  --card: #ffffff;
  --ink: #171b19;
  --ink-2: #343c38;
  --muted: #6a736e;
  --faint: #99a29d;
  --line: #e2e7e3;
  --line-soft: #edf0ed;

  /* 品牌（印章朱砂）——不再随市场状态变化 */
  --seal: #b0312c;
  --seal-deep: #8c2521;
  --seal-tint: #faedec;

  /* 语义色：A 股红涨绿跌 */
  --up: #be3a32;
  --up-tint: #fbeceb;
  --down: #16724f;
  --down-tint: #e9f4ee;
  --amber: #a6741d;
  --amber-tint: #fbf3e2;

  /* 市场状态（由 body.bucket-* 覆盖，仅用于英雄区与评分环） */
  --regime: #b0312c;
  --hero1: #fff8f7;
  --hero2: #faebe9;

  /* 兼容 v1 变量名：模板内的内联样式仍可工作 */
  --bg: var(--paper);
  --text: var(--ink);
  --red: var(--up);
  --green: var(--down);
  --main: var(--seal);

  /* 圆角与高度 */
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 15px;
  --r-xl: 20px;

  --shadow-1: 0 1px 2px rgba(23, 27, 25, .04), 0 6px 16px rgba(23, 27, 25, .04);
  --shadow-2: 0 2px 6px rgba(23, 27, 25, .06), 0 18px 44px rgba(23, 27, 25, .09);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Roboto Mono", monospace;

  --nav-h: 64px;
  --gutter: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 所有数字等宽对齐，这是数据页最容易被忽略的细节 */
b, .num, .kpi b, .kpi .nums, .price-line b, .index-card b, .hs b,
.table td, .row span:last-child, .grid2 div span:last-child {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { color: var(--seal); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--seal-deep); text-decoration: none; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.up, .pos { color: var(--up); }
.down, .neg { color: var(--down); }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- 导航 ---------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }

.logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--seal), var(--seal-deep));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  flex: none;
}

.brandname {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}

.tag { font-size: 11px; color: var(--faint); }

.navlinks { display: flex; gap: 4px; flex: 1; }
.navlinks a {
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.navlinks a:hover { color: var(--ink); background: #f4f6f3; }
.navlinks a.on {
  color: var(--seal-deep);
  background: var(--seal-tint);
  font-weight: 600;
}

.navright {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
}
.navright .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
  display: inline-block;
  margin-right: 5px;
  box-shadow: 0 0 0 3px rgba(22, 114, 79, .12);
}

.userchip {
  background: #f6f8f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--ink-2);
  font-size: 12px;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.btn-ghost:hover {
  color: var(--seal-deep);
  border-color: #e8c9c6;
  background: var(--seal-tint);
}

/* ---------------- 布局 ---------------- */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px var(--gutter) 48px;
}
.foot {
  text-align: center;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 30px 0 40px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 18px;
}
.page-title {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}
.page-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 20px;
}

h2, h3, h4 { margin: 0 0 12px; color: var(--ink); }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }
h4 { font-size: 13.5px; font-weight: 600; }

.section-label {
  font-size: 12px;
  color: var(--muted);
  margin: 26px 0 10px;
}

/* ---------------- 英雄区 ---------------- */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, .9) 0%, transparent 55%),
    linear-gradient(120deg, var(--hero1), var(--hero2));
  padding: 22px 24px 16px;
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 26px;
  box-shadow: var(--shadow-1);
}

.hero-left { display: flex; flex-direction: column; align-items: flex-start; }
.hero-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
}

.ring {
  --pct: 50;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--regime) calc(var(--pct) * 1%), #e7ebe8 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 10px;
  position: relative;
}
.ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 27, 25, .05);
}
.ring-in {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(23, 27, 25, .06);
}
.ring-in b {
  font-size: 32px;
  line-height: 1;
  color: var(--regime);
  font-weight: 650;
  letter-spacing: -.02em;
}
.ring-in span { font-size: 11px; color: var(--muted); margin-top: 5px; }

.hero-note {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.6;
  max-width: 190px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-content: start;
}
.kpi {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
  backdrop-filter: blur(2px);
}
.kpi span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.kpi b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.kpi .nums {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.kpi small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.45;
}

.hero-scale { grid-column: 1 / -1; margin-top: 6px; }
.hero-scale .scale-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hero-scale .scale-head b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.hero-scale .scale-head span { font-size: 11px; color: var(--muted); }

.scale {
  position: relative;
  display: flex;
  gap: 3px;
  padding: 0 1px;
}
.scale .seg {
  flex: 1;
  height: 9px;
  display: block;
  border-radius: 2px;
  opacity: .9;
}
.seg1 { background: #1f6b4c; }
.seg2 { background: #5e9b7b; }
.seg3 { background: #c6a02c; }
.seg4 { background: #c4663d; }
.seg5 { background: #a22b26; }
.scale .marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 19px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-1px);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .55);
}
.scale .marker::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}
.scale-labels {
  display: flex;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: .02em;
}
.scale-labels span { flex: 1; text-align: center; }

/* ---------------- 指数条 ---------------- */
.index-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.index-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 15px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(23, 27, 25, .03);
  transition: border-color .15s ease;
}
.index-card:hover { border-color: #d3dad4; }
.index-card .name { font-size: 11.5px; color: var(--muted); }
.index-card b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.index-card .chg { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar .toolbar-note { font-size: 12px; color: var(--muted); }

.segmented {
  display: inline-flex;
  background: #eaeeea;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-item {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.seg-item:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
.seg-item.on {
  background: #fff;
  color: var(--seal-deep);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(23, 27, 25, .08);
}

/* ---------------- 方案卡 ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.plan {
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease;
}
.plan:hover { border-color: #d3dad4; }
.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.plan-head h3 { font-size: 15.5px; margin: 0; line-height: 1.4; }
.plan-head .plan-code {
  display: block;
  font-size: 11px;
  color: var(--faint);
  font-family: var(--font-mono);
  margin-top: 3px;
}
.score-chip {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8c9c6;
  background: var(--seal-tint);
  color: var(--seal-deep);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.plan-body { margin-top: 10px; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  margin: 6px 0;
  color: var(--muted);
  gap: 10px;
}
.row b, .row strong { color: var(--ink); font-weight: 600; }
.range {
  height: 5px;
  background: #edf0ed;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.range i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e0a3a0, var(--seal));
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  font-size: 12px;
  margin: 10px 0 4px;
}
.grid2 div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.grid2 div span:last-child { color: var(--ink-2); font-weight: 500; }

.state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f3f5f2;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
}
.state.on { background: var(--down-tint); color: var(--down); }
.state.warn { background: var(--amber-tint); color: var(--amber); }

.tagline {
  font-size: 11.5px;
  color: var(--ink-2);
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  margin-top: 12px;
  line-height: 1.6;
}
.card-link {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--seal);
}
.card-link:hover { color: var(--seal-deep); }

/* ---------------- 面板 / 列表 / 空态 ---------------- */
.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--ink-2);
}
.list li:last-child { border-bottom: 0; padding-bottom: 2px; }
.list li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.empty { text-align: left; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 52ch; }
.empty-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.empty-stats div {
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 13px;
}
.empty-stats span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.empty-stats b { font-size: 17px; font-weight: 600; }
.empty-stats small { display: block; color: var(--faint); font-size: 10.5px; margin-top: 2px; }

.report-snippet { white-space: pre-wrap; line-height: 1.75; color: var(--ink-2); font-size: 12.5px; }

/* ---------------- 表格 ---------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .02em;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  white-space: nowrap;
}
.table tbody tr:hover td { background: #fafbf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table td b { color: var(--ink); font-weight: 600; }

/* ---------------- 表单 ---------------- */
.form-card label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--ink-2); }
.field-hint { display: block; font-size: 11.5px; color: var(--faint); margin-top: 6px; }

input, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  background: #fbfcfa;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #d3dad4; }
input:focus, select:focus {
  outline: none;
  border-color: var(--seal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(176, 49, 44, .12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--seal);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, transform .06s ease;
}
.btn:hover { background: var(--seal-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: #f7f9f6; color: var(--ink); border-color: #d3dad4; }

.inline-form { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.inline-form input { margin: 0; }
.searchbar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.searchbar .inline-form input { width: min(380px, 100%); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }

.alert {
  background: var(--seal-tint);
  color: #8c2521;
  border: 1px solid #f0d2d0;
  border-radius: var(--r-md);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.6;
}
.alert.ok {
  background: var(--down-tint);
  border-color: #cbe6d7;
  color: #145c40;
}

/* ---------------- 个股 ---------------- */
.stock-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.stock-head h2 { margin-bottom: 4px; }
.price-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-line b { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.price-line .chg { font-size: 14px; font-weight: 600; }

.stock-score { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stock-score .cap { font-size: 11px; color: var(--muted); }
.small-ring { width: 86px; height: 86px; margin: 0; }
.small-ring::after { display: none; }
.small-ring .ring-in { width: 66px; height: 66px; }
.small-ring b { font-size: 24px; font-weight: 650; }

.dims { display: flex; flex-direction: column; gap: 10px; }
.dim {
  display: grid;
  grid-template-columns: 52px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.dim span:last-child { text-align: right; color: var(--ink-2); font-weight: 500; }
.bar { height: 6px; background: #edf0ed; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--seal); }

.horizon-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hs {
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 10px;
  text-align: center;
}
.hs span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.hs b { font-size: 20px; font-weight: 600; display: block; letter-spacing: -.01em; }
.hs small { color: var(--faint); font-size: 10.5px; }

.chart { width: 100%; height: 260px; }

/* ---------------- 资金 ---------------- */
.funds-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0;
}
.kpi-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.kpi-card b { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }

/* ---------------- 研报 ---------------- */
.report { margin-bottom: 16px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.report-text {
  white-space: pre-wrap;
  font: 12.5px/1.8 var(--font-mono);
  margin: 0;
  color: var(--ink-2);
  max-width: 78ch;
}

/* ---------------- 登录 ---------------- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 520px at 8% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(700px 500px at 100% 110%, #e9efe9 0%, rgba(233, 239, 233, 0) 60%),
    var(--paper);
}

.login-shell {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.login-side {
  position: relative;
  padding: 44px 42px 36px;
  color: #f1f3f0;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(176, 49, 44, .28) 0%, rgba(176, 49, 44, 0) 62%),
    linear-gradient(155deg, #1b211e 0%, #262e29 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.login-side .brand { color: #fff; }
.login-side .brandname { color: #fff; letter-spacing: .02em; }
.login-side .logo {
  width: 38px; height: 38px; border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 18px rgba(0, 0, 0, .25);
}
.login-side h1 {
  margin: 34px 0 10px;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: #fbfcf9;
}
.login-side h1 em { font-style: normal; color: #e9b7b2; }
.login-side .side-lede {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(241, 243, 240, .62);
  max-width: 34ch;
}
.login-side .side-scale { margin-top: 30px; }
.login-side .scale-labels { color: rgba(241, 243, 240, .45); }
.login-side .scale .seg { opacity: .95; }
.login-side .scale .marker { background: #fbfcf9; box-shadow: 0 0 0 3px rgba(27, 33, 30, .6); }
.login-side .scale .marker::before { border-top-color: #fbfcf9; }

.side-facts {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 22px;
}
.side-facts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  color: rgba(241, 243, 240, .55);
}
.side-facts b { color: #fbfcf9; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

.login-card {
  width: auto;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 46px 42px 38px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand { margin-bottom: 0; }
.login-mobile-brand { display: none; margin-bottom: 26px; }
.login-card .login-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.login-card .login-lede {
  margin: 0 0 26px;
  font-size: 12.5px;
  color: var(--muted);
}
.login-form { margin-top: 0; }
.login-form label { display: block; font-size: 12.5px; color: var(--ink-2); }
.login-form input { margin-top: 8px; padding: 11px 13px; }
.login-form button { width: 100%; margin-top: 16px; padding: 11px 20px; }
.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.7;
}
.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.login-meta .secure { display: inline-flex; align-items: center; gap: 6px; }
.login-meta .secure i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--down);
  display: inline-block;
}

/* ---------------- 市场状态调色（只影响英雄区与刻度，不动品牌色） ---------------- */
body.bucket-strong { --regime: #8c2521; --hero1: #fff6f5; --hero2: #f7e4e2; }
body.bucket-up     { --regime: #b0312c; --hero1: #fff8f7; --hero2: #faebe9; }
body.bucket-mid    { --regime: #a6741d; --hero1: #fffdf6; --hero2: #f7f0de; }
body.bucket-down   { --regime: #16724f; --hero1: #f6fbf8; --hero2: #e4f1e9; }
body.bucket-weak   { --regime: #14563c; --hero1: #f3faf6; --hero2: #dbece2; }

/* ---------------- 横幅与细节 ---------------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 13px 18px;
  border-left: 3px solid var(--regime);
}
.banner b { font-size: 14px; margin-right: 10px; font-weight: 600; }
.banner .warn { color: var(--amber); font-size: 12px; }

details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
details summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 6px; }

.kv {
  display: inline-block;
  margin: 3px 8px 3px 0;
  background: #f4f6f3;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--ink-2);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1120px) {
  .cards, .panels, .index-strip, .hero-kpis, .funds-cards { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 180px 1fr; gap: 20px; }
  .two-col { grid-template-columns: 1fr; }
  .navlinks { overflow-x: auto; scrollbar-width: none; }
  .navlinks::-webkit-scrollbar { display: none; }
  .login-shell { grid-template-columns: 1fr; max-width: 440px; }
  .login-side { display: none; }
  .login-mobile-brand { display: flex; }
  .login-card { padding: 36px 28px 30px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .nav { height: 58px; gap: 12px; }
  .tag, .navright .hint, .navright .userchip { display: none; }
  .brandname { font-size: 16px; }
  .logo { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
  .navlinks a { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
  .container { padding: 16px var(--gutter) 32px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .page-title { font-size: 21px; }
  .hero { grid-template-columns: 1fr; padding: 18px 16px 14px; gap: 14px; }
  .hero-left { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
  .ring { width: 96px; height: 96px; margin: 0; }
  .ring-in { width: 74px; height: 74px; }
  .ring-in b { font-size: 26px; }
  .hero-note { max-width: none; }
  .hero-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 11px; }
  .kpi b, .kpi .nums { font-size: 17px; }
  .cards, .panels, .index-strip, .funds-cards { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .stock-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .price-line b { font-size: 26px; }
  .horizon-scores { gap: 6px; }
  .hs b { font-size: 17px; }
  .searchbar .inline-form input { width: 100%; }
  .inline-form { flex-wrap: wrap; }
  .grid2 { gap: 4px 12px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
  .report-text { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .nav, .toolbar, .foot, .card-link { display: none !important; }
  body { background: #fff; }
  .card, .hero { box-shadow: none; }
}

/* =========================================================
   Astramer 模板兼容补丁（v2 未覆盖的当前模板 class）
   ========================================================= */
.hint { font-size: 12px; color: var(--muted); }
.plain { list-style: none; margin: 8px 0; padding: 0; }
.plain li { padding: 4px 0; font-size: 13px; color: var(--ink-2); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs a { color: var(--muted); font-size: 13px; padding: 6px 12px; border-radius: 8px; }
.tabs a.on { color: var(--seal); background: var(--seal-tint); font-weight: 600; }
.login-body .login-card { width: 400px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: 32px 30px; }
.login-brand { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
/* 我们独有的“市场状态横幅”在 v2 语义色下仍用状态色标注 */
.banner .warn { color: var(--amber); }
