/* OpenRouter 用量看板 · 样式
   配色与 周报模板.html 保持一致：深藏青 + 暖白 + 克制的红蓝点缀 */

/* Montserrat 拉丁可变字重（100–900），自托管，运行时不依赖任何 CDN。
   unicode-range 只声明拉丁码位：中文不会命中此字体，按字体栈自然回落到 PingFang SC。
   授权见 ../assets/fonts/OFL.txt */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #0b1f3a;
  --navy-2: #16335c;
  --paper: #f7f4ec;
  --card: #ffffff;
  --line: #e7e1d3;
  --ink: #1d2b3a;
  --muted: #5e6b78;
  --muted-2: #63707d;
  --red-bg: #e03131;
  --red-text: #c92a2a;
  --red-soft: #fdeceb;
  --blue-bg: #1971c2;
  --blue-text: #1864ab;
  --blue-soft: #e7f0fb;
  --other: #9aa7b4;
  --focus: #1971c2;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Montserrat", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
}

a { color: var(--blue-text); }

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 防御性规则：本文件里给部分区块设置了 display:flex/grid 等，
   若同时又被 JS 打上 hidden 属性，必须确保 hidden 语义始终生效。 */
[hidden] { display: none !important; }

/* ========== Header / Footer ========== */
.site-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 16px 24px;
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.brand-mark {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: #7fa6d9;
}
.brand-name {
  display: block;
  font-size: 19px;
  font-weight: 800;
}
.header-meta {
  font-size: 12px;
  color: #aac3e6;
}
.header-right { text-align: right; }
.page-signature {
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .35px;
  color: #fff;
  white-space: nowrap;
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.8;
}

/* ========== Intro (public) ========== */
.intro {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.intro-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 48px;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--red-text);
  text-transform: uppercase;
}
.intro h1 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 800;
  color: var(--navy);
}
.intro-lead {
  font-size: 15px;
  color: var(--muted);
  max-width: 620px;
}
.value-props {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.value-props li {
  font-size: 14px;
  color: var(--ink);
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.value-props b { color: var(--navy); }

.teaser { margin: 28px 0; }
.teaser-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: linear-gradient(180deg, #fbfaf6, #f3f0e7);
}
.teaser-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.teaser-svg { width: 100%; height: 72px; display: block; opacity: 0.85; }
.teaser-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin-top: 12px;
}
.teaser-seg.cn { background: var(--red-bg); }
.teaser-seg.us { background: var(--blue-bg); }
.teaser-seg.other { background: var(--other); }
.teaser-caption {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
}
.cta-btn:hover { background: var(--navy-2); }

/* ========== Gate ========== */
.gate {
  padding: 40px 24px 56px;
  display: flex;
  justify-content: center;
}
.gate-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px 24px;
}
.gate-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.gate-sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.field .req { color: var(--red-text); }
.field input, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}
.field textarea { min-height: 60px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue-bg);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(25, 113, 194, 0.15);
}

.submit-btn {
  display: block;
  width: 100%;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.submit-btn:hover { background: var(--navy-2); }
.submit-btn:disabled { background: #c7cdd6; cursor: not-allowed; }

.err-msg, .err-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--red-soft);
  color: var(--red-text);
  border: 1px solid #f3b3ae;
  border-radius: 7px;
  font-size: 13px;
}
.err-banner { max-width: 780px; margin: 24px auto; }

.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  margin: 20px 0 0;
}

.gate-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
}
.spinner {
  width: 28px; height: 28px;
  margin: 0 auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--blue-bg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Dashboard ========== */
.dashboard { max-width: 1120px; margin: 0 auto; padding: 24px 24px 8px; }
.dash-topbar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.dash-topbar h2 { margin: 0 0 4px; color: var(--navy); font-size: 22px; }
.dash-welcome { margin: 0; font-size: 13px; color: var(--muted); }
/* 44px 触控目标：用等量 padding + 负 margin 撑大可点区域，
   不改变 .dash-welcome 段落本身的视觉行高/布局。 */
#reset-access {
  display: inline-block;
  box-sizing: border-box;
  min-height: 44px;
  padding: 11px 4px;
  margin: -11px -4px;
  color: var(--muted-2);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; }
.control-search { flex: 1 1 200px; }

.toggle-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toggle-group button {
  min-height: 44px;
  padding: 0 14px;
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--line);
}
.toggle-group button:last-child { border-right: none; }
.toggle-group button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.toggle-group button:hover:not([aria-pressed="true"]) { background: #efe9d9; }

#date-select, #provider-select, #model-search {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
#model-search { min-width: 200px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.kpi-value.up { color: var(--red-text); }
.kpi-value.down { color: var(--blue-text); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; color: var(--navy); }
.panel-sub { margin: 0; font-size: 12px; color: var(--muted-2); }

.panel-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.panel-row .panel { margin-bottom: 0; }

.chart-wrap { position: relative; }
.trend-chart { width: 100%; }
.trend-chart svg { width: 100%; height: auto; display: block; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  transform: translate(-50%, -110%);
  white-space: nowrap;
  z-index: 5;
}

.bar { display: flex; height: 32px; border-radius: 8px; overflow: hidden; font-size: 12px; color: #fff; font-weight: 700; }
.bar span.seg { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.seg.cn { background: var(--red-bg); }
.seg.us { background: var(--blue-bg); }
.seg.other { background: var(--other); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--paper); color: var(--muted); }
.chip.cn { background: var(--red-soft); color: var(--red-text); }
.chip.us { background: var(--blue-soft); color: var(--blue-text); }

.provider-share-list { display: flex; flex-direction: column; gap: 10px; }
.provider-row { display: grid; grid-template-columns: 90px 1fr 56px; align-items: center; gap: 10px; font-size: 12px; }
.provider-row .name { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-row .track { background: var(--paper); border-radius: 6px; height: 10px; overflow: hidden; }
.provider-row .fill { height: 100%; background: var(--navy); border-radius: 6px; }
.provider-row .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.movers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.movers-title { margin: 0 0 10px; font-size: 13px; }
.movers-title.up { color: var(--red-text); }
.movers-title.down { color: var(--blue-text); }
.mover-cards { display: flex; flex-direction: column; gap: 8px; }
.mover-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mover-card .name { font-size: 13px; font-weight: 600; color: var(--ink); }
.mover-card .by { font-size: 11px; color: var(--muted-2); }
.mover-card .chg { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mover-card .chg.up { color: var(--red-text); }
.mover-card .chg.down { color: var(--blue-text); }
.empty-note { font-size: 13px; color: var(--muted-2); }

.table-wrap { overflow-x: auto; max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.model-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.model-table thead th {
  position: sticky; top: 0;
  background: var(--paper);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.model-table th.num, .model-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.model-table td { padding: 9px 12px; border-bottom: 1px solid #f0ece0; }
.model-table td.rank { color: var(--muted-2); width: 30px; }
.model-table .region-flag { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.region-flag.cn { background: var(--red-bg); }
.region-flag.us { background: var(--blue-bg); }
.region-flag.other { background: var(--other); }
.model-table .chg.up { color: var(--red-text); font-weight: 700; }
.model-table .chg.down { color: var(--blue-text); font-weight: 700; }

.archive-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.archive-list a {
  display: block;
  min-height: 44px;
  display: flex; align-items: center;
  padding: 0 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
}
.archive-list a:hover { border-color: var(--blue-bg); color: var(--blue-text); }

.methodology summary { cursor: pointer; list-style: none; display: flex; align-items: center; min-height: 44px; }
.methodology summary::-webkit-details-marker { display: none; }
.methodology summary h3::after { content: " ▾"; color: var(--muted-2); font-size: 12px; }
.methodology[open] summary h3::after { content: " ▴"; }
.methodology ul { margin: 14px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.methodology li { margin-bottom: 8px; }
.methodology b { color: var(--ink); }

/* ========== Vercel 开放权重渗透率（独立口径区块） ========== */
.vercel-panel { --vercel-open: #2f9e44; --vercel-closed: #868e96; }
.vercel-kpi-grid { margin-bottom: 16px; }
.vercel-insight-value { font-size: 18px; line-height: 1.35; }
.vercel-controls { margin-bottom: 16px; }
.chip.vercel-open, .chip.vercel-closed { display: inline-flex; align-items: center; gap: 6px; }
.chip.vercel-open::before, .chip.vercel-closed::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.chip.vercel-open { background: #e6f4ea; color: #2b7a3d; }
.chip.vercel-open::before { background: var(--vercel-open); }
.chip.vercel-closed { background: #eceff1; color: #5c666f; }
.chip.vercel-closed::before { background: var(--vercel-closed); }
.vercel-footnote { margin-top: 12px; line-height: 1.7; }

/* ========== Responsive ========== */
@media (max-width: 860px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-row { grid-template-columns: 1fr; }
  .movers-grid { grid-template-columns: 1fr; }
  .archive-list { grid-template-columns: 1fr 1fr; }
  .intro h1 { font-size: 24px; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .archive-list { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-right { text-align: left; }
  .model-table { font-size: 12px; }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ========== Barry RS 首页标识 ========== */
/* Barry RS 首页标识：48px 方块，蓝底 + 1px 白色内描边，点击回主站首页 */
.barry-rs-home { display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
  width:48px; height:48px; flex:none; background:#1B34E8; color:#fff; text-decoration:none;
  box-shadow:inset 0 0 0 1px #fff; line-height:1; border-radius:2px;
  -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.barry-rs-home:hover { box-shadow:inset 0 0 0 2px #fff; }
.barry-rs-home .brs-top { font-size:8px; font-weight:600; letter-spacing:0.12em; text-indent:0.12em; }
.barry-rs-home .brs-bot { font-size:18px; font-weight:800; letter-spacing:0.04em; margin-top:3px; }
.site-header .barry-rs-home { margin-right: 16px; align-self: center; }
@media (max-width: 560px) { .site-header .barry-rs-home { margin-right: 0; margin-bottom: 10px; } }
@media print { .barry-rs-home { box-shadow: inset 0 0 0 1px #fff; } }
