/* ==========================================================================
   衡 · WiseQuant 量化服务平台 —— 网页版样式
   A股配色约定：涨=红，跌=绿
   ========================================================================== */

:root {
  --up: #e5384a;
  --up-soft: rgba(229, 56, 74, .10);
  --down: #12a552;
  --down-soft: rgba(18, 165, 82, .10);
  --flat: #8b95a5;

  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --border: #e4e8ef;
  --border-strong: #d3d9e3;
  --text: #1a1f2b;
  --text-2: #5b6473;
  --text-3: #8b95a5;
  --brand: #2b5cd9;
  --brand-soft: rgba(43, 92, 217, .09);
  --warn: #d98600;
  --warn-soft: rgba(217, 134, 0, .12);
  --danger: #d92d20;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 58px;
  --side-w: 212px;
}

html[data-theme="dark"] {
  --bg: #0e1219;
  --panel: #161b24;
  --panel-2: #1b212c;
  --border: #252c39;
  --border-strong: #333c4d;
  --text: #e8ecf3;
  --text-2: #a3adbe;
  --text-3: #6f7a8d;
  --brand: #5b8cff;
  --brand-soft: rgba(91, 140, 255, .14);
  --warn: #e8a33d;
  --warn-soft: rgba(232, 163, 61, .14);
  --danger: #ff6b5e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  --up: #ff4d63;
  --down: #17c46a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

a { color: var(--brand); text-decoration: none; }

/* ============================== 布局 ============================== */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  /* 侧边栏是「视口高等高」的 flex 列，导航一溢出就会压缩子项：
     必须显式禁止收缩，否则窗口变矮时这里会被压扁、图标顶到上沿。 */
  flex: 0 0 var(--topbar-h);
}
.brand-mark {
  width: 35.2px; height: 35.2px; flex: 0 0 35.2px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b5cd9, #4f8bff);
  color: #fff;
  /* grid 的 auto 轨道默认会被拉伸，故显式 center：
     列宽取「较宽的 Quant」的自然宽，Wise 再撑满同一列 → 两行严格等宽。 */
  display: grid; grid-template-columns: auto;
  justify-content: center; align-content: center;
  justify-items: stretch;
  font-weight: 700; line-height: 1.1;
  text-align: center; white-space: nowrap;
  box-shadow: 0 3px 11px rgba(43, 92, 217, .35);
}
.brand-mark .bm-l1 { display: flex; justify-content: space-between; font-size: 10.4px; }
.brand-mark .bm-l2 { font-size: 9.35px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand-text span { font-size: 12.1px; color: var(--text-3); white-space: nowrap; }

.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .13s, color .13s;
  user-select: none;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: .82; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
html[data-theme="dark"] .nav-item:hover { background: #1d2431; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active svg { opacity: 1; }

.side-foot { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.chan { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.chan-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); }
.chan-row span { flex: 1; }
.chan-row b { font-weight: 600; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--flat); }
.dot.ok { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(217,45,32,.14); }
.dot.wait { background: var(--warn); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.side-note { font-size: 10.5px; color: var(--text-3); line-height: 1.5; }

.main {
  flex: 1;
  margin-left: var(--side-w);
  min-width: 0;
  display: flex; flex-direction: column;
}

/* ============================== 顶栏 ============================== */

.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
}
.tb-title { font-size: 15px; font-weight: 650; white-space: nowrap; }

.tb-search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.tb-search > svg {
  position: absolute; left: 11px; width: 15px; height: 15px;
  fill: var(--text-3); pointer-events: none;
}
.tb-search input {
  width: 100%;
  padding: 8px 12px 8px 33px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.tb-search input:focus {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.suggest {
  position: absolute; top: 42px; left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  max-height: 340px; overflow-y: auto;
  z-index: 40;
}
.suggest.show { display: block; }
.suggest-item {
  padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.suggest-item:hover, .suggest-item.hl { background: var(--brand-soft); }
.suggest-item .sc { font-family: ui-monospace, Consolas, monospace; color: var(--text-3); font-size: 12px; }

.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.trade-date { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid; place-items: center;
  cursor: pointer; color: var(--text-2);
  transition: background .13s, color .13s, border-color .13s;
}
.icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* ============================== 内容区 ============================== */

.view { padding: 20px; flex: 1; max-width: 1560px; width: 100%; }

.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0 0 4px; font-size: 19px; font-weight: 680; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 12.5px; }

/* ---- 卡片 ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.card-head .sub { font-size: 11.5px; color: var(--text-3); }
.card-head .grow { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }
.card-body.flush { padding: 0; }

/* ---- 恐贪指数（数值版） ----
   总览里只给数字 + 一条带 30/70 阈值刻度的轨道：四条迷你折线并排会互相挤压，
   反而看不出差异。曲线版留在「每日数据观察」生成的完整报告里。 */

.fg-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.fg-chip {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 13px 14px;
}
.fg-chip-top { display: flex; align-items: center; gap: 8px; }
.fg-chip-top .n { font-size: 12.6px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-chip-top .l { margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--text-3); }
.fg-chip > .v { display: block; margin-top: 3px; font-size: 27px; font-weight: 680; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fg-chip .track { position: relative; height: 5px; border-radius: 4px; margin-top: 10px; background: var(--border); overflow: hidden; }
.fg-chip .track i { display: block; height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.3, .9, .3, 1); }
.fg-chip .track .mk { position: absolute; top: 0; bottom: 0; width: 1px; z-index: 1; background: var(--text-3); opacity: .55; }

/* ---- 个股趋势分析卡（类名与 App 端保持一致，改口径时两处一起改） ---- */

.verdict { border-radius: var(--radius-sm); padding: 13px 15px; background: var(--panel-2); border-left: 3px solid var(--flat); }
.verdict.up { background: var(--up-soft); border-left-color: var(--up); }
.verdict.down { background: var(--down-soft); border-left-color: var(--down); }
.verdict .vd-top { display: flex; align-items: baseline; gap: 10px; }
.verdict .vd-top b { font-size: 21px; font-weight: 680; letter-spacing: .3px; }
.verdict.up .vd-top b, .verdict.up .vd-s { color: var(--up); }
.verdict.down .vd-top b, .verdict.down .vd-s { color: var(--down); }
.verdict .vd-s { margin-left: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict .vd-s i { margin-left: 1px; font-size: 11.5px; font-style: normal; font-weight: 500; color: var(--text-3); }
.verdict .vd-bar { height: 6px; border-radius: 4px; margin-top: 10px; background: rgba(0, 0, 0, .07); overflow: hidden; }
html[data-theme="dark"] .verdict .vd-bar { background: rgba(255, 255, 255, .09); }
.verdict .vd-bar i { display: block; height: 100%; border-radius: 4px; background: var(--flat); transition: width .6s cubic-bezier(.3, .9, .3, 1); }
.verdict.up .vd-bar i { background: var(--up); }
.verdict.down .vd-bar i { background: var(--down); }
.verdict .vd-h { margin-top: 8px; font-size: 12px; color: var(--text-2); }

.an-sum { margin: 12px 0 0; font-size: 13.4px; line-height: 1.7; color: var(--text); }
.an-sec { margin-top: 18px; }
.an-title { margin-bottom: 9px; font-size: 12.8px; font-weight: 640; color: var(--text-2); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.an-i { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.an-i .k { display: block; font-size: 11.5px; color: var(--text-3); }
.an-i .v { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.an-i .hint { display: block; margin-top: 3px; font-size: 11px; line-height: 1.45; color: var(--text-3); }
.an-ul { margin: 0; padding-left: 21px; font-size: 12.8px; line-height: 1.75; color: var(--text-2); }
.an-ul li { margin: 4px 0; }
/* 风险提示靠版式区分，不靠颜色 —— 这套配色里红色表示「涨」，拿来当警告会误导。 */
.an-ul.warn { padding: 11px 14px 11px 30px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.an-disc { margin: 14px 0 0; font-size: 11.6px; line-height: 1.7; color: var(--text-3); }

.sig-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.sig { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.sig-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.sig-h span { color: var(--text-2); }
.sig-h b { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.sig-note { margin-top: 3px; font-size: 11.4px; line-height: 1.5; color: var(--text-3); }

/* ---- 栅格 ---- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-280 { grid-template-columns: 336px minmax(0, 1fr); }

@media (max-width: 1180px) {
  .g3, .g4, .g-2-1, .g-1-2, .g-280 { grid-template-columns: minmax(0, 1fr); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 指数 / 指标卡 ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .14s, box-shadow .14s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.tile .v { font-size: 20px; font-weight: 660; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.tile .d { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .spark { position: absolute; right: 10px; bottom: 8px; width: 52px; height: 24px; opacity: .5; }
.tile::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--flat); opacity: .0;
}
.tile.up::after { background: var(--up); opacity: 1; }
.tile.down::after { background: var(--down); opacity: 1; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

/* ---- 涨跌结构条 ---- */
.dist { display: flex; gap: 3px; height: 34px; border-radius: 8px; overflow: hidden; }
.dist-seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11.5px; font-weight: 650;
  min-width: 0; transition: flex .4s ease;
  font-variant-numeric: tabular-nums;
}
.dist-seg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.dist-legend { display: flex; gap: 14px; margin-top: 9px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.dist-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- 表格 ---- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.tbl th {
  text-align: left;
  padding: 9px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-weight: 600;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
  font-size: 11.8px;
}
table.tbl td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl .code-cell { font-family: ui-monospace, Consolas, monospace; }
.tbl-empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.link-stock { color: var(--brand); cursor: pointer; font-weight: 600; }
.link-stock:hover { text-decoration: underline; }

/* ---- 徽标 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 620;
  background: var(--panel-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.badge.b-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.b-up { background: var(--up-soft); color: var(--up); border-color: transparent; }
.badge.b-down { background: var(--down-soft); color: var(--down); border-color: transparent; }
.badge.b-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.b-danger { background: rgba(217,45,32,.12); color: var(--danger); border-color: transparent; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13px; font-weight: 560;
  cursor: pointer;
  font-family: inherit;
  transition: all .14s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn.primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(43, 92, 217, .3);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); color: #fff; background: var(--brand); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text-2);
  font-size: 12.3px; cursor: pointer;
  transition: all .13s; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 表单 ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 11.8px; color: var(--text-3); font-weight: 580; }
input[type=text], input[type=date], input[type=number], select, textarea {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; line-height: 1.6; font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: 12.4px; }
input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--brand); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }

/* ---- 代码块 ---- */
pre.code {
  margin: 0;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
  font-size: 12.3px;
  line-height: 1.65;
  max-height: 560px;
  color: var(--text);
  tab-size: 4;
}
html[data-theme="dark"] pre.code { background: #10151d; }
code.inline {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 5px;
  color: var(--brand);
}

/* ---- tab 切换 ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; background: var(--panel-2); }
.tab {
  padding: 9px 13px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .13s, border-color .13s;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 620; }

/* ---- 条件构建器 ---- */
.cond-group { margin-bottom: 4px; }
.cond-group h4 {
  margin: 14px 0 8px; font-size: 11.5px; color: var(--text-3);
  font-weight: 650; letter-spacing: .5px; text-transform: uppercase;
}
.cond-group:first-child h4 { margin-top: 2px; }
.cond-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 60px 8px 60px;
  align-items: center; gap: 6px;
  padding: 5px 0;
}
.cond-row .cname { font-size: 12.2px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cond-row.on .cname { color: var(--text); font-weight: 600; }
.cond-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.cond-row input[type=number] { padding: 4px 6px; font-size: 12px; }
.cond-row .dash { text-align: center; color: var(--text-3); font-size: 11px; }
.cond-row input:disabled { opacity: .45; }
.cond-row.switch-only { grid-template-columns: 20px minmax(0, 1fr); }

/* ---- 体检报告 ---- */
.lint-sum { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.score {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700;
  border: 3px solid var(--border-strong);
  color: var(--text-2);
  flex: 0 0 56px;
}
.score.good { border-color: var(--down); color: var(--down); }
.score.mid { border-color: var(--warn); color: var(--warn); }
.score.bad { border-color: var(--danger); color: var(--danger); }
.lint-item {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.8px;
}
.lint-item:last-child { border-bottom: none; }
.lint-item .lv {
  flex: 0 0 auto; font-weight: 700; font-size: 11px;
  padding: 1px 6px; border-radius: 5px; height: 19px; line-height: 17px;
}
.lv.P0 { background: rgba(217,45,32,.14); color: var(--danger); }
.lv.P1 { background: var(--warn-soft); color: var(--warn); }
.lv.P2 { background: var(--brand-soft); color: var(--brand); }
.lv.INFO { background: var(--panel-2); color: var(--text-3); }
.lint-item .body { flex: 1; min-width: 0; }
.lint-item .msg { color: var(--text); }
.lint-item .fix { color: var(--text-3); font-size: 11.8px; margin-top: 2px; }
.lint-item .snip {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  color: var(--text-2); background: var(--panel-2);
  padding: 3px 7px; border-radius: 5px; margin-top: 4px;
  overflow-x: auto; white-space: pre;
}

/* ---- 图表 ---- */
.chart { width: 100%; }
.chart.h300 { height: 300px; }
.chart.h360 { height: 360px; }
.chart.h420 { height: 420px; }

/* ---- 状态提示 ---- */
.loading { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.spinner {
  width: 20px; height: 20px; margin: 0 auto 10px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.empty {
  padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13px;
}
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.err-box {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(217,45,32,.08); border: 1px solid rgba(217,45,32,.25);
  color: var(--danger); font-size: 12.5px;
  white-space: pre-wrap; word-break: break-all;
}
.note-box {
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid rgba(217,134,0,.25);
  color: var(--warn); font-size: 12.3px;
}

/* ---- toast ---- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  padding: 10px 15px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12.8px; max-width: 380px;
  animation: slideIn .22s ease;
}
.toast.ok { border-left: 3px solid var(--down); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px) } }

/* ---- 进度 ---- */
.bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12.8px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---- markdown 文档 ---- */
.md { font-size: 13.6px; line-height: 1.75; color: var(--text); }
.md h1 { font-size: 21px; margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 17px; margin: 26px 0 10px; padding-left: 9px; border-left: 3px solid var(--brand); }
.md h3 { font-size: 15px; margin: 20px 0 8px; }
.md h4 { font-size: 13.6px; margin: 16px 0 6px; color: var(--text-2); }
.md p { margin: 9px 0; }
.md ul, .md ol { margin: 9px 0; padding-left: 24px; }
.md li { margin: 4px 0; }
.md pre {
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 8px; overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.2px; line-height: 1.6;
}
.md blockquote {
  margin: 10px 0; padding: 8px 14px;
  border-left: 3px solid var(--border-strong);
  background: var(--panel-2); color: var(--text-2); border-radius: 0 8px 8px 0;
}
.md table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.6px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.md th { background: var(--panel-2); font-weight: 620; white-space: nowrap; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.md strong { font-weight: 660; }

/* ---- 晚报预览 ---- */
iframe.preview {
  width: 100%; height: 760px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #0f141c;
}

/* ============================== 底部站点栏 ============================== */
/* sticky bottom：钉在可视区底部；.main 是 flex 纵向容器，故不需要占位 padding */

.sitefoot {
  position: sticky; bottom: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 7px 20px;
  font-size: 12px; color: var(--text-2);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.sf-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sf-item b { color: var(--text); font-weight: 660; }
.sf-item a { color: inherit; text-decoration: none; }
.sf-item.sf-coins a { color: var(--brand); font-weight: 600; }
.sf-grow { flex: 1; }
.sf-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--down);
  box-shadow: 0 0 0 3px var(--down-soft);
  animation: pulse 1.8s infinite;
}
.sf-link {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--text-3); font-size: 12px; font-family: inherit; text-decoration: none;
}
.sf-link:hover { color: var(--brand); }

/* ============================== 智豆面板 ============================== */

.coin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #fff5d6, #ffe9a8);
  border: 1px solid #f0d17a; color: #8a6100;
  font-size: 12.5px; font-weight: 650;
}
html[data-theme="dark"] .coin-badge {
  background: linear-gradient(135deg, #3a3118, #4a3d1c);
  border-color: #6b5722; color: #f0c869;
}
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pack {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; cursor: pointer; background: var(--panel-2);
  transition: border-color .13s, box-shadow .13s, transform .13s;
}
.pack:hover { border-color: var(--brand); transform: translateY(-1px); }
.pack.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--panel); }
.pack .p-yuan { font-size: 20px; font-weight: 700; color: var(--text); }
.pack .p-yuan small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.pack .p-coin { color: #b8860b; font-weight: 660; margin-top: 4px; font-size: 13px; }
.pack .p-desc { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.qr-box img { width: 240px; height: 240px; object-fit: contain; border-radius: 8px; background: #fff; }
.step-list { margin: 0; padding-left: 20px; font-size: 12.8px; color: var(--text-2); line-height: 1.9; }
.step-list b { color: var(--text); }

/* ---- AI 生成 / 修改 ---- */
.ai-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .ai-pane { grid-template-columns: minmax(0, 1fr); } }
.ai-hint { font-size: 12px; color: var(--text-3); line-height: 1.7; }
.ai-hint code { background: var(--panel-2); border: 1px solid var(--border); padding: 0 4px; border-radius: 4px; }
.tmpl-chip { cursor: pointer; }
.diff-item {
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel-2);
}
.diff-item .why { font-size: 12.5px; color: var(--text); font-weight: 600; }
.diff-item .ln { font-size: 11px; color: var(--text-3); }
.diff-item .io { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; margin-top: 4px; }
.diff-item .io .old { color: var(--danger); text-decoration: line-through; }
.diff-item .io .new { color: var(--down); }
.warn-item {
  border: 1px solid var(--warn); background: var(--warn-soft);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 8px;
  font-size: 12.5px; color: var(--text);
}

/* ---- 运营后台 ---- */
.admin-gate { max-width: 420px; }
.admin-note {
  border: 1px solid var(--border); background: var(--panel-2);
  border-radius: 6px; padding: 8px 10px; font-size: 12.5px;
  color: var(--text-2); line-height: 1.7;
}
.admin-note b { color: var(--text); }
.admin-note code {
  background: var(--panel); border: 1px solid var(--border);
  padding: 0 4px; border-radius: 4px; font-size: 11.5px;
}
.sm-input { flex: 1 1 0; min-width: 0; }
select.sm-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text);
  font-size: 13px;
}

/* ---- 手机号登录 ---- */
.au-row { display: flex; gap: 8px; align-items: center; }
.au-row input { flex: 1 1 auto; min-width: 0; }
.au-row-code input { max-width: 200px; }
.au-row-code button { flex: 0 0 auto; white-space: nowrap; }
.sf-item.sf-phone a { color: var(--text-2); }
.sf-item.sf-phone a.on { color: var(--brand); font-weight: 600; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .view { padding: 14px; }
  .tb-search { max-width: none; }
  .sitefoot { gap: 10px; padding: 6px 14px; font-size: 11.5px; }
  .sf-hide-sm { display: none; }
}
