:root {
  /* 北京十一学校配色 + Point72 机构风中性色 */
  --bg: #f6f5f1;            /* 米白页底 */
  --card: #ffffff;
  --line: #e7e4db;          /* 细分隔线 */
  --line-2: #efece4;
  --ink: #14233b;           /* 太空蓝/海军蓝 —— 主文字 */
  --ink-2: #45526a;
  --muted: #8a8f99;         /* 银鹰灰 */
  --red: #c8102e;           /* 国旗红 —— 主强调色(组合线) */
  --red-soft: rgba(200, 16, 46, 0.07);
  --navy: #14233b;
  --green: #2e9e6b;         /* 春华绿 */
  --up: #2e9e6b;
  --down: #c8102e;
  --radius: 4px;            /* 机构风:克制的小圆角 */
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 小标签:大写 + 字距,机构风 */
.eyebrow, .kicker, .k-label, .seg, h3, .tab {
  font-feature-settings: "tnum" 0;
}

/* ── 顶栏 ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 34px;
  background: rgba(246, 245, 241, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: -0.2px; color: var(--ink); }
.brand .mark { width: 9px; height: 18px; background: var(--red); border-radius: 1px; flex: none; }
.tabs { display: flex; gap: 4px; }
.tab {
  font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: 0.2px;
  color: var(--ink-2); background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius); position: relative;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--ink); background: rgba(20,35,59,0.04); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--red);
}

/* ── 视图 ─────────────────────────────── */
main { position: relative; z-index: 1; }
.view { animation: fade .35s ease both; }
.view[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── 封面 ─────────────────────────────── */
.cover {
  min-height: calc(100vh - 72px);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 26px 90px; text-align: center;
}
.cover-inner { max-width: 760px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 3px; font-size: 12.5px; font-weight: 600;
  color: var(--red); margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(44px, 8vw, 88px); line-height: 1.02; letter-spacing: -2px;
  font-weight: 800; margin: 0; color: var(--ink);
}
.rule { width: 56px; height: 3px; background: var(--red); margin: 30px auto; }
.hero-tag { max-width: 520px; margin: 0 auto; color: var(--ink-2); font-size: clamp(15px, 2.2vw, 18px); }
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: 44px 0 46px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.hstat { padding: 18px 26px; text-align: left; border-right: 1px solid var(--line); flex: 1; min-width: 150px; }
.hstat:last-child { border-right: 0; }
.hstat .hl { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.hstat .hv { font-size: 21px; font-weight: 700; margin-top: 7px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.4px; white-space: nowrap; }
.hstat .hv.pos { color: var(--up); }

.btn-primary {
  font-family: var(--ui); font-weight: 600; font-size: 14.5px; letter-spacing: 0.3px;
  color: #fff; background: var(--navy); border: 0; border-radius: var(--radius);
  padding: 14px 28px; cursor: pointer; transition: background .18s, transform .15s;
}
.btn-primary:hover { background: var(--red); transform: translateY(-1px); }
.btn-primary .arr { display: inline-block; margin-left: 4px; transition: transform .2s; }
.btn-primary:hover .arr { transform: translateX(4px); }

/* ── 仪表盘 ───────────────────────────── */
.dash-view { max-width: 1180px; margin: 0 auto; padding: 36px 26px 72px; }
.page-head { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.kicker { text-transform: uppercase; letter-spacing: 2px; font-size: 11.5px; font-weight: 600; color: var(--red); margin-bottom: 12px; }
.page-head h2 { font-size: clamp(22px, 3.6vw, 32px); margin: 0; font-weight: 700; letter-spacing: -0.6px; color: var(--ink); }
.subtitle { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
h3 { font-size: 11.5px; letter-spacing: 1.8px; text-transform: uppercase; margin: 0 0 16px; font-weight: 600; color: var(--muted); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 18px; margin-bottom: 18px; }
.chart-card { padding: 20px 22px 16px; min-width: 0; }
.selector-card { padding: 20px; }

/* 工具栏 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; }
.seg button {
  font-family: var(--ui); font-weight: 600; font-size: 12.5px; letter-spacing: 0.2px;
  border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 3px;
  cursor: pointer; white-space: nowrap; transition: color .15s, background .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { color: #fff; background: var(--navy); }
.metrics button.active { background: var(--red); }

/* 图表 */
.chart-wrap { position: relative; height: 430px; padding: 10px 0 2px; min-width: 0; }
.chart-wrap canvas { max-width: 100%; }
.asof { color: var(--muted); font-size: 12px; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 自定义 tooltip */
.ctip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 188px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(20,35,59,0.13); padding: 12px 14px; font-size: 12.5px; color: var(--ink);
  transition: opacity .1s;
}
.ctip .ct-date { color: var(--muted); font-size: 11.5px; margin-bottom: 9px; font-variant-numeric: tabular-nums; }
.ctip .ct-row { display: flex; align-items: center; gap: 9px; margin: 4px 0; }
.ctip .ct-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ctip .ct-row .nm { flex: 1; color: var(--ink-2); }
.ctip .ct-row .vl { font-weight: 600; font-variant-numeric: tabular-nums; }
.ctip .ct-row.port .nm { color: var(--ink); font-weight: 700; }
.ctip .ct-row.port .vl { color: var(--red); }
.ctip .ct-alpha { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.ctip .ct-alpha .nm { font-size: 11.5px; }

/* 基准选择器 */
.selector { display: flex; flex-direction: column; gap: 1px; }
.opt { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: var(--radius); cursor: pointer; user-select: none; transition: background .12s; }
.opt:hover { background: var(--bg); }
.opt input { display: none; }
.opt .box { width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid var(--line); flex: none; position: relative; transition: background .12s, border-color .12s; }
.opt input:checked + .box { background: var(--swatch, var(--navy)); border-color: var(--swatch, var(--navy)); }
.opt input:checked + .box::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.opt .swatch { width: 16px; height: 3px; border-radius: 2px; flex: none; }
.opt .label { font-size: 13.5px; color: var(--ink); }
.opt.port .label { font-weight: 700; }
.opt.port .swatch { height: 4px; }
.opt.disabled { cursor: default; }

/* KPI 卡片 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.kpi { padding: 18px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.k-label { color: var(--muted); font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 9px; }
.k-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.k-value.big { font-size: 24px; }
.k-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.up { color: var(--up); }
.down { color: var(--down); }
.arrow { font-size: 0.66em; vertical-align: 1.5px; }

/* ── 响应式 ───────────────────────────── */
@media (max-width: 880px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .selector-card { order: -1; }
  .selector { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .opt { padding: 7px 11px; border: 1px solid var(--line); }
  .chart-wrap { height: 330px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .seg { display: flex; width: 100%; }
}
@media (max-width: 560px) {
  .topbar { padding: 15px 18px; }
  .brand { font-size: 14px; }
  .tab { padding: 7px 10px; font-size: 12.5px; }
  .dash-view { padding: 28px 16px 56px; }
  .chart-wrap { height: 288px; }
  .hstat { min-width: 50%; border-right: 0; }
  .hstat:nth-child(odd) { border-right: 1px solid var(--line); }
  .hstat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
