/* =========================================================================
   世界杯 · 网友赔率估计 — styles.css
   现代运动感仪表盘 · 深色为默认 · 全自包含 · 无外部依赖
   ========================================================================= */

:root {
  /* 背景层（中性石墨，去掉霓虹海军蓝） */
  --bg: #0e1014;
  --bg-grad-1: #111318;
  --bg-grad-2: #0b0d11;
  --surface: #181b22;
  --surface-2: #1e222b;
  --surface-3: #272c37;
  --surface-hover: #232834;

  /* 边框 / 分隔 */
  --border: #2b3039;
  --border-soft: #20242c;
  --border-strong: #3a414f;

  /* 文本 */
  --text: #e9ecf2;
  --text-soft: #a6aebd;
  --text-dim: #737c8c;
  --text-faint: #515a6b;

  /* 品牌 / 强调：克制使用，仅交互高亮。旧金色，非霓虹。 */
  --accent: #c79a45;
  --accent-strong: #d8ab57;
  --accent-soft: #463716;
  --accent-ink: #181203;

  /* 通用数据条中性色（准确比分 / 让球 / 球员 等） */
  --bar-neutral: #6b82ab;

  /* 语义色：主队 / 客队 / 平局 / 中性 / 大球 / 小球（统一降饱和） */
  --home: #5b8fd6;            /* 蓝 = 主队 */
  --home-soft: #233347;
  --away: #d56f54;            /* 砖红 = 客队 */
  --away-soft: #45291f;
  --draw: #9f93bd;            /* 灰紫 = 平局 */
  --draw-soft: #312c3f;
  --neither: #818b9c;         /* 灰 = 无/其他 */
  --neither-soft: #272d38;
  --over: #4fa088;            /* 青绿 = 大球 */
  --under: #7488a8;           /* 蓝灰 = 小球 */
  --bar-track: #20283600;     /* 透明，实际用 surface-3 */

  /* 状态徽标 */
  --st-upcoming-bg: #1c2734;
  --st-upcoming-fg: #7fb0e6;
  --st-live-bg: #371d22;
  --st-live-fg: #e3697b;
  --st-finished-bg: #222730;
  --st-finished-fg: #8a94a5;

  /* 阴影（更收敛） */
  --shadow-card: 0 1px 2px rgba(0,0,0,.32), 0 5px 16px rgba(0,0,0,.22);
  --shadow-pop: 0 6px 18px rgba(0,0,0,.4);

  /* 几何 */
  --radius: 13px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --bar-h: 8px;

  /* 字体 */
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
              "Segoe UI", Roboto, system-ui, sans-serif;

  --maxw: 1240px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* 浅色（跟随系统） */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f1ec;
    --bg-grad-1: #f6f4ef;
    --bg-grad-2: #eceae3;
    --surface: #ffffff;
    --surface-2: #f6f5f1;
    --surface-3: #eceae3;
    --surface-hover: #f1efe9;
    --border: #e2ded4;
    --border-soft: #ece9e1;
    --border-strong: #d2cdbf;
    --text: #1c1e23;
    --text-soft: #515663;
    --text-dim: #767b88;
    --text-faint: #9aa0ac;
    --accent: #a87a1e;
    --accent-strong: #936a16;
    --accent-soft: #f0e4c8;
    --accent-ink: #ffffff;
    --bar-neutral: #6e84ad;
    --home: #3f74c4;
    --home-soft: #dbe7f7;
    --away: #c25738;
    --away-soft: #f6e0d8;
    --draw: #8a7cb0;
    --draw-soft: #ece4f4;
    --neither: #8b94a3;
    --neither-soft: #e8e6df;
    --over: #3f917a;
    --under: #5f7494;
    --st-upcoming-bg: #e3edf9;
    --st-upcoming-fg: #2a5fa3;
    --st-live-bg: #fbe2e3;
    --st-live-fg: #c33049;
    --st-finished-bg: #e8e6df;
    --st-finished-fg: #6a6f7c;
    --shadow-card: 0 1px 2px rgba(40,36,28,.05), 0 6px 18px rgba(40,36,28,.07);
    --shadow-pop: 0 6px 18px rgba(40,36,28,.13);
  }
}

* { box-sizing: border-box; }

/* hidden 属性始终隐藏（覆盖 .date-bar 等显式 display） */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

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

/* ============================ HEADER ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(120%) blur(12px);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px clamp(14px, 3vw, 28px) 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand { display: flex; gap: 13px; align-items: flex-start; min-width: 0; }
.brand-logo {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-top: 1px;
}
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-text { min-width: 0; }
.brand-title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 750;
  letter-spacing: -.2px;
  color: var(--text);
}
.brand-subtitle {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 62ch;
}
.brand-subtitle strong { color: var(--text-soft); font-weight: 650; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.updated {
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .1s var(--ease);
}
.btn-refresh:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-refresh:active { transform: scale(.96); }
.refresh-icon { display: inline-block; font-size: 15px; line-height: 1; }
.btn-refresh.is-loading { pointer-events: none; opacity: .7; }
.btn-refresh.is-loading .refresh-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 日历选择器 ============================ */
.date-picker {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px) 13px;
}

/* 触发按钮：显示当前选中的比赛日 */
.cal-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.cal-trigger:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.cal-trigger[aria-expanded="true"] { border-color: var(--accent); }
.cal-trigger .ct-icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.cal-trigger .ct-date { font-variant-numeric: tabular-nums; }
.cal-trigger .ct-today {
  font-size: 10.5px; font-weight: 700; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: var(--radius-pill); padding: 1px 7px;
}
.cal-trigger .ct-count {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  background: var(--surface-3); border-radius: var(--radius-pill); padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.cal-trigger .ct-chev { color: var(--text-dim); font-size: 11px; transition: transform .2s var(--ease); }
.cal-trigger[aria-expanded="true"] .ct-chev { transform: rotate(180deg); }

/* 月历浮层 */
.cal-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% - 4px);
  left: clamp(14px, 3vw, 28px);
  width: 312px;
  max-width: calc(100vw - 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 14px;
  animation: calIn .16s var(--ease);
}
@keyframes calIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.cal-nav {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.cal-nav:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.cal-nav:disabled { opacity: .35; cursor: default; }

.cal-wds, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wds { margin-bottom: 6px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-faint); padding: 2px 0; }

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; border-radius: 9px;
  color: var(--text-soft); background: none;
}
.cal-day.is-blank { visibility: hidden; }
.cal-day.is-off { color: var(--text-faint); opacity: .55; }
.cal-day.has-games {
  cursor: pointer; color: var(--text);
  background: var(--surface-2); border-color: var(--border-soft);
  transition: background .12s var(--ease), border-color .12s var(--ease), transform .08s var(--ease);
}
.cal-day.has-games:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.cal-day.has-games:active { transform: scale(.94); }
.cal-day .cd-num { line-height: 1; }
.cal-day .cd-dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 14px; height: 14px; padding: 0 3px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; line-height: 1;
  color: var(--text-dim); background: var(--surface-3);
  border-radius: var(--radius-pill); font-variant-numeric: tabular-nums;
}
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-today .cd-num { color: var(--accent-strong); }
.cal-day.is-selected {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); font-weight: 800;
}
.cal-day.is-selected .cd-num { color: var(--accent-ink); }
.cal-day.is-selected .cd-dot { background: rgba(0,0,0,.18); color: var(--accent-ink); }

/* ============================ MAIN / GRID ============================ */
.main { outline: none; }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 28px) 56px;
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 2px 16px;
}
.day-heading h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.1px; }
.day-heading .day-sub { font-size: 13px; color: var(--text-dim); }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ============================ CARD ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: cardIn .3s var(--ease) both;
}
/* 整张卡片可点击进入详情 */
a.card { cursor: pointer; }
a.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}
a.card:hover .card-cta { color: var(--accent-strong); }
a.card:hover .card-cta .cta-arrow { transform: translateX(3px); }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 卡片头 */
.card-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.card-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.badges { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.4;
}
.badge-group { background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border); }
.badge-status { display: inline-flex; align-items: center; gap: 5px; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-status.s-upcoming { background: var(--st-upcoming-bg); color: var(--st-upcoming-fg); }
.badge-status.s-live { background: var(--st-live-bg); color: var(--st-live-fg); }
.badge-status.s-live::before { animation: pulse 1.3s var(--ease) infinite; }
.badge-status.s-finished { background: var(--st-finished-bg); color: var(--st-finished-fg); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.5); } }

.kickoff {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kickoff .ko-day { color: var(--text-dim); font-weight: 600; font-size: 11.5px; margin-right: 4px; }

/* 对阵 */
.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.team.away { flex-direction: row-reverse; text-align: right; }
.team-flag {
  font-size: 30px;
  line-height: 1;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.team-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-code { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.team-id { min-width: 0; }
.vs {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-faint);
  letter-spacing: .5px;
  padding: 0 2px;
  flex: none;
}

/* 卡片体 */
.card-body { padding: 0; display: flex; flex-direction: column; }

/* ============================ 一眼摘要 ============================ */
.summary { padding: 14px 16px 4px; }

/* 胜负预测（核心 main message） */
.win-pred { margin-bottom: 12px; }
.win-fav {
  display: flex; align-items: center; gap: 9px; margin-bottom: 9px;
}
.win-fav .wf-flag { font-size: 24px; line-height: 1; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.win-fav .wf-text { font-size: 14px; font-weight: 700; color: var(--text-soft); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-fav .wf-text b { font-size: 16px; font-weight: 800; color: var(--text); }
.win-fav .wf-pct {
  margin-left: auto; flex: none; font-size: 26px; font-weight: 900; line-height: 1;
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.tri-bar {
  display: flex; height: 11px; border-radius: 99px; overflow: hidden;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-soft);
}
.tri-seg { height: 100%; min-width: 0; width: 0; transition: width .55s var(--ease); }
.tri-seg.s-home { background: var(--home); }
.tri-seg.s-draw { background: var(--draw); }
.tri-seg.s-away { background: var(--away); }
.tri-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px;
  font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.tri-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.tri-legend .lg-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--neither); flex: none; }
.tri-legend .s-home .lg-dot { background: var(--home); }
.tri-legend .s-draw .lg-dot { background: var(--draw); }
.tri-legend .s-away .lg-dot { background: var(--away); }

/* 关键预测 KPI */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 8px 10px; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.kpi-label { font-size: 11px; color: var(--text-dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.kpi-val { font-size: 14px; font-weight: 700; color: var(--text-soft);
  display: flex; align-items: baseline; gap: 6px; }
.kpi-val .kv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-val i { font-style: normal; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; margin-left: auto; flex: none; }

/* ============================ 全部数据面板 ============================ */
.details { padding: 0 16px 14px; }
.details-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text-soft);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.details-toggle:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); }
.details-toggle .dt-count { margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--text-dim); background: var(--surface-3); padding: 2px 8px; border-radius: 99px; }
.details-toggle .chev { transition: transform .2s var(--ease); display: inline-block; color: var(--text-dim); }
.details-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.details-inner { padding: 0 2px; }
.details-inner[hidden] { display: none; }
.details-inner .stat:first-child { border-top: none; padding-top: 4px; }

/* ============================ STAT MODULE ============================ */
.stat {
  padding: 12px 0 11px;
  border-top: 1px solid var(--border-soft);
}
.stat:first-child { border-top: none; }
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.stat-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat-label .stat-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); flex: none; }
.stat-toggle {
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.stat-toggle:hover { background: var(--surface-hover); color: var(--text); }
.stat-toggle .chev { transition: transform .2s var(--ease); display: inline-block; }
.stat-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.collapsible { overflow: hidden; }
.collapsible[hidden] { display: none; }

/* ----- 行 + 条形（通用） ----- */
.rows { display: flex; flex-direction: column; gap: 7px; }

.row {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 3px;
}
.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.row-name {
  font-size: 12.5px;
  color: var(--text-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.row.is-top .row-name { color: var(--text); font-weight: 800; }
.row-pct {
  font-family: var(--font-num);
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex: none;
}
.row.is-top .row-pct { color: var(--bar-color, var(--accent)); }

.bar {
  position: relative;
  height: var(--bar-h);
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--bar-color, var(--accent));
  transition: width .65s var(--ease);
  will-change: width;
}
.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22));
  opacity: .5;
}

/* 颜色变体（由 highlight / 语义决定） */
.c-home    { --bar-color: var(--home); }
.c-away    { --bar-color: var(--away); }
.c-draw    { --bar-color: var(--draw); }
.c-neither { --bar-color: var(--neither); }
.c-accent  { --bar-color: var(--bar-neutral); }
.c-over    { --bar-color: var(--over); }
.c-under   { --bar-color: var(--under); }
.c-yes     { --bar-color: var(--over); }
.c-no      { --bar-color: var(--neither); }

/* ----- lines（大小盘）表格 ----- */
.lines-table { display: flex; flex-direction: column; gap: 6px; }
.team-group-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-dim);
  margin: 6px 0 2px;
  display: flex; align-items: center; gap: 6px;
}
.line-row {
  display: grid;
  grid-template-columns: 52px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.line-row.is-main { background: var(--surface-3); box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.line-label {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.line-label .main-tag {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .3px;
}
.ou-cell { display: grid; grid-template-columns: 1fr; gap: 2px; }
.ou-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.ou-tag { font-size: 10px; font-weight: 800; color: var(--text-dim); letter-spacing: .3px; }
.ou-pct {
  font-family: var(--font-num);
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.ou-bar { height: 6px; }

/* ----- exact_score 网格 ----- */
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
@media (min-width: 420px) { .score-grid { grid-template-columns: repeat(2, 1fr); } }
.score-cell {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-cell.is-top { box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.score-cell.is-other { opacity: .72; border-style: dashed; }
.score-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.score-name {
  font-family: var(--font-num);
  font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
  letter-spacing: .5px;
}
.score-pct {
  font-family: var(--font-num);
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--accent);
}
.score-bar { height: 6px; }

/* ----- binary ----- */
.binary-wrap { display: flex; flex-direction: column; gap: 8px; }
.binary-bar {
  display: flex;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 800;
}
.binary-seg {
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: width .6s var(--ease);
  font-variant-numeric: tabular-nums;
}
.binary-seg.seg-yes { background: linear-gradient(90deg, var(--accent-soft), var(--accent)); color: var(--accent-ink); }
.binary-seg.seg-no  { background: var(--neither-soft); color: var(--text-soft); }
.binary-seg .seg-lbl { opacity: .92; font-weight: 700; }

/* ----- players ----- */
.players-list { display: flex; flex-direction: column; gap: 7px; }
.player-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: center;
}
.player-rank {
  font-family: var(--font-num);
  font-size: 12px; font-weight: 800;
  color: var(--text-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.player-row.top1 .player-rank { color: var(--accent); }
.player-main { min-width: 0; }

/* ============================ SKELETON ============================ */
.skel-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px)  { .skel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .skel-grid { grid-template-columns: repeat(3, 1fr); } }
.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.skel { background: var(--surface-3); border-radius: 8px; position: relative; overflow: hidden; }
.skel::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; margin-bottom: 9px; }
.skel-line.w40 { width: 40%; } .skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; }
.skel-line.w100 { width: 100%; }
.skel-row { height: 18px; margin-bottom: 10px; }
.skel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.skel-circle { width: 34px; height: 34px; border-radius: 50%; flex: none; }

/* ============================ STATES ============================ */
.state {
  text-align: center;
  padding: 64px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.state-emoji { font-size: 52px; line-height: 1; margin-bottom: 14px; display: block; }
.state-title { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.state-text { font-size: 14px; color: var(--text-dim); margin: 0 0 18px; }
.state .btn-retry {
  font: inherit; font-size: 14px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-pill);
  padding: 10px 22px; cursor: pointer;
  transition: transform .1s var(--ease), filter .15s var(--ease);
}
.state .btn-retry:hover { filter: brightness(1.06); }
.state .btn-retry:active { transform: scale(.96); }

.no-stats { font-size: 12.5px; color: var(--text-faint); padding: 14px 16px; }

/* ============================ FOOTER ============================ */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px) 40px;
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
  padding-top: 22px;
}
.disclaimer { font-size: 12px; color: var(--text-dim); margin: 0 0 6px; line-height: 1.6; }
.disclaimer strong { color: var(--text-soft); }
.source-line { font-size: 11.5px; color: var(--text-faint); margin: 0; }

/* ============================ 卡片底部 CTA ============================ */
.card-cta {
  margin: 4px 16px 0;
  padding: 11px 0 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color .15s var(--ease);
}
.card-cta .cta-arrow { transition: transform .18s var(--ease); }

/* ============================ 详情页 ============================ */
.detail { max-width: 980px; margin: 0 auto; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.back-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

.detail-head {
  margin-top: 16px;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.detail-badges { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-time { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.detail-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 14px;
}
.dm-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.dm-flag { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.dm-name { font-size: 19px; font-weight: 700; letter-spacing: -.2px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-code { font-size: 11px; font-weight: 700; color: var(--text-dim); letter-spacing: .6px; }
.dm-vs { align-self: center; font-size: 12px; font-weight: 800; color: var(--text-faint); letter-spacing: 1px; }

.detail-summary {
  margin-top: 14px;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.detail-summary .win-fav .wf-pct { font-size: 30px; }
.detail-summary .kpis { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

.detail-context {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-soft);
}
.detail-context .dc-label {
  display: inline-block;
  margin-right: 9px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  vertical-align: middle;
}

.detail-stats {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .detail-stats { grid-template-columns: 1fr 1fr; } }
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px 16px 14px;
  box-shadow: var(--shadow-card);
}
.detail-panel .stat { border-top: none; padding-top: 12px; }

/* ============================ 历史走势（详情页） ============================ */

/* 「📈 历史走势」按钮：复用 stat-toggle 的克制风格 */
.hist-toggle {
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.hist-toggle:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.hist-toggle[aria-expanded="true"] { color: var(--accent-strong); border-color: var(--accent-soft); }
.hist-toggle .ht-icon { font-size: 12px; line-height: 1; }

/* stat-head 已是 space-between：当存在 stat-toggle（折叠）时，把走势按钮也排进去 */
.stat-head .hist-toggle { margin-left: 8px; }

/* 英雄区胜平负下方的走势按钮：靠左单独一行 */
.win-pred .hist-bar { margin-top: 12px; }
.win-pred .hist-bar .hist-toggle { display: inline-flex; }

/* 图表容器 */
.hist-chart {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  animation: histIn .22s var(--ease);
}
.hist-chart[hidden] { display: none; }
@keyframes histIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 加载 / 空 / 错误态 */
.hist-state {
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 22px 8px;
  text-align: center;
}
.hist-loading { color: var(--text-soft); }
.hist-empty { color: var(--text-faint); }

/* SVG 折线图：等比缩放到容器宽度 */
.hist-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.hist-grid {
  stroke: var(--border-soft);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.hist-ylabel, .hist-xlabel {
  fill: var(--text-faint);
  font-size: 10px;
  font-family: var(--font-num);
}
.hist-line {
  fill: none;
  stroke: var(--c, var(--accent));
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  /* 描画动画：dash 长度由 JS 按真实路径长度设置，这里只定义过渡 */
  transition: stroke-dashoffset .7s var(--ease);
}
.hist-dot {
  fill: var(--c, var(--accent));
  stroke: var(--surface);
  stroke-width: 1.5;
}

/* 图例：名称 + 最新百分比 */
.hist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.hist-lg { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.hist-lg-dot {
  width: 9px; height: 9px; border-radius: 2px; flex: none;
  background: var(--c, var(--accent));
}
.hist-lg-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 22ch; color: var(--text-soft);
}
.hist-lg-pct { font-weight: 800; color: var(--text); flex: none; }
.hist-note {
  font-size: 10.5px; color: var(--text-faint);
  align-self: center;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* 折线描画动画关闭后需直接显示完整线条 */
  .hist-line { stroke-dasharray: none; stroke-dashoffset: 0; }
}
