/* F1 观察站 —— F1 官网风（F1 红 + 大写粗斜标题），支持深色/浅色双主题 */
:root {
  color-scheme: dark;
  --bg: #15151e;
  --card: #1f1f29;
  --card-2: #262633;
  --ink: #ffffff;
  --sub: #a0a0ad;
  --hair: #2c2c38;
  --hair-soft: rgba(44, 44, 56, 0.55);
  --header-bg: #101014;
  --hover: rgba(255, 255, 255, 0.035);
  --hover-2: rgba(255, 255, 255, 0.05);
  --accent: #e10600;        /* F1 红 */
  --accent-dark: #a80400;
  --gold: #f5c542;
  --silver: #c0c4cc;
  --bronze: #cd8a4f;
  --green: #3ddc84;
  --purple: #b56cf0;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --next-glow: rgba(225, 6, 0, 0.22);
  --next-grad-1: #1f1f29;
  --next-grad-2: #191921;
  --circuit-pad: #101014;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Segoe UI", sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4f1;
  --card: #ffffff;
  --card-2: #f0ece7;
  --ink: #15151e;
  --sub: #6b6b76;
  --hair: #e3ded7;
  --hair-soft: #ece8e2;
  --header-bg: #ffffff;
  --hover: rgba(21, 21, 30, 0.04);
  --hover-2: rgba(21, 21, 30, 0.06);
  --accent: #e10600;
  --accent-dark: #c00500;
  --gold: #c28f06;
  --silver: #8a8f98;
  --bronze: #a5662f;
  --green: #15803d;
  --purple: #8b3fd9;
  --shadow: 0 8px 24px rgba(21, 21, 30, 0.08);
  --next-glow: rgba(225, 6, 0, 0.10);
  --next-grad-1: #ffffff;
  --next-grad-2: #f5f1ea;
  --circuit-pad: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
.hidden { display: none !important; }

/* ── 头部（通栏 + 红色激活下划线 + 主题切换）── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.header-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 12px 0; }
.brand-f1 {
  background: var(--accent); color: #fff; font-weight: 900; font-style: italic;
  font-size: 18px; letter-spacing: 0.02em; padding: 2px 10px 2px 12px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}
.brand-name { color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; }
.brand .tag { color: var(--sub); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.site-nav { display: flex; gap: 2px; height: 100%; }
.site-nav a {
  padding: 18px 14px; text-decoration: none; color: var(--sub);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  position: relative; transition: color 0.15s ease; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 3px; background: var(--accent);
}
.theme-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: none; border: 1px solid var(--hair); color: var(--sub);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--sub); transform: rotate(15deg); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── 布局 ── */
.container { max-width: 1060px; margin: 0 auto; padding: 32px 20px 72px; }
.loading { text-align: center; color: var(--sub); padding: 80px 0; font-size: 15px; }

/* 页面大标题：红色斜杠 + 中文 + 英文小标 */
.page-hero {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-size: 34px; font-weight: 900; font-style: italic; letter-spacing: 0.01em;
  margin: 8px 0 26px; text-transform: uppercase;
}
.page-hero .slash { color: var(--accent); }
.page-hero .en { font-size: 13px; font-weight: 600; color: var(--sub); letter-spacing: 0.18em; font-style: normal; }

/* 区块标题：红色竖条 */
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 44px 0 16px; font-size: 19px; font-weight: 800;
}
.section-head::before { content: ""; width: 5px; height: 20px; background: var(--accent); transform: skewX(-12deg); }
.section-head .sub { font-weight: 400; font-size: 12px; color: var(--sub); letter-spacing: 0.04em; }
.section-head .more { margin-left: auto; }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-card { padding: 4px 0; overflow-x: auto; }

/* ── 下一站横幅（首页）── */
.next-card {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center;
  padding: 32px; border: 1px solid var(--hair);
  background:
    radial-gradient(600px 220px at 85% 120%, var(--next-glow), transparent 65%),
    linear-gradient(135deg, var(--next-grad-1) 0%, var(--next-grad-2) 100%);
  position: relative; overflow: hidden;
}
.next-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--accent);
}
.next-label {
  color: var(--accent); font-size: 13px; font-weight: 800;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.next-name {
  font-size: 40px; font-weight: 900; font-style: italic; letter-spacing: -0.01em;
  margin: 8px 0 10px; text-transform: uppercase; line-height: 1.15;
}
.next-meta { color: var(--sub); font-size: 14px; }
.next-time { margin-top: 12px; font-size: 18px; font-weight: 800; }
.next-time .weekday { color: var(--sub); font-weight: 400; font-size: 14px; margin-left: 8px; }
.next-right { text-align: right; }
.countdown-label {
  color: var(--sub); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; margin-bottom: 8px;
}
/* 分段倒计时：天/时/分/秒 各自一格（F1 官网风） */
.countdown { display: flex; gap: 8px; }
.next-right .countdown { justify-content: flex-end; }
.cd-cell {
  background: var(--card-2); border: 1px solid var(--hair); border-radius: 6px;
  min-width: 64px; padding: 8px 6px 6px; text-align: center;
}
.cd-num {
  display: block; font-size: 30px; font-weight: 900; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.cd-lab {
  display: block; font-style: normal; font-size: 11px; color: var(--sub);
  letter-spacing: 0.2em; margin-top: 3px;
}
.cd-done { font-size: 22px; font-weight: 800; color: var(--green); }
.sessions { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.sessions .sess { font-size: 12px; color: var(--sub); }
.sessions .sess b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── 红色链接按钮 ── */
.btn-red {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; padding: 8px 18px;
  border-radius: 4px; transition: background 0.15s ease;
}
.btn-red:hover { background: var(--accent-dark); }
.btn-ghost {
  display: inline-block; color: var(--sub); text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 8px 10px;
}
.btn-ghost:hover { color: var(--ink); }

/* ── 表格 ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 14px; color: var(--sub);
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border-bottom: 1px solid var(--hair); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--hair-soft); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.12s ease; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .pts { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.tbl th.pts { text-align: right; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--hover-2); }
.tbl tr.is-next td { background: rgba(225, 6, 0, 0.10); }
.tbl tr.is-next td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl tr.is-done td:last-child { color: var(--sub); }

.rank { color: var(--sub); font-weight: 700; font-variant-numeric: tabular-nums; }
.rank.top1 { color: var(--gold); font-weight: 900; }
.rank.top2 { color: var(--silver); font-weight: 800; }
.rank.top3 { color: var(--bronze); font-weight: 800; }

.driver-cell { display: flex; align-items: center; gap: 8px; }
.driver-cell .code { color: var(--sub); font-size: 12px; }
.driver-cell b { font-weight: 700; }
.team-dot { width: 4px; height: 22px; border-radius: 2px; flex: none; }
.team-name { color: var(--sub); font-size: 13px; display: flex; align-items: center; gap: 7px; }

.pts-bar { position: relative; }
.pts-bar .bar {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  height: 6px; border-radius: 3px; background: var(--accent); opacity: 0.4;
}

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 3px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap;
}
.badge-sprint { background: rgba(245, 197, 66, 0.15); color: var(--gold); }
.badge-done { background: rgba(61, 220, 132, 0.12); color: var(--green); }
.badge-next { background: var(--accent); color: #fff; }
.delta-up { color: var(--green); font-size: 12px; font-weight: 700; }
.delta-down { color: var(--accent); font-size: 12px; font-weight: 700; }
.fl { color: var(--purple); font-weight: 700; }

/* ── 领奖台 ── */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.podium .step {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; box-shadow: var(--shadow); position: relative;
  transition: transform 0.15s ease;
}
.podium .step:hover { transform: translateY(-2px); }
.podium .step::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.podium .step.p1::before { background: var(--gold); }
.podium .step.p2::before { background: var(--silver); }
.podium .step.p3::before { background: var(--bronze); }
.podium .medal { font-size: 28px; }
.podium .pname { font-weight: 800; font-size: 17px; margin-top: 6px; }
.podium .pteam { color: var(--sub); font-size: 12px; }
.podium .ptime { font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--sub); }

/* ── 首页速览 ── */
.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.snapshot-grid .card { padding: 18px 20px; }
.snapshot-title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sub); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;
}
.mini-list { list-style: none; }
.mini-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--hair-soft); font-size: 14px;
}
.mini-list li:last-child { border-bottom: none; }
.mini-list .m-pos { width: 20px; color: var(--sub); font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-list .m-pos.p1 { color: var(--gold); }
.mini-list .m-name { flex: 1; font-weight: 600; }
.mini-list .m-team { color: var(--sub); font-size: 12px; }
.mini-list .m-pts { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── 统计条（上站回顾）── */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-row .stat {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 14px 18px;
}
.stat .k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sub); font-weight: 700; }
.stat .v { font-size: 20px; font-weight: 800; margin-top: 4px; }
.stat .v .small { font-size: 13px; color: var(--sub); font-weight: 400; }

/* ── 分站详情：赛道卡 ── */
.circuit-card {
  display: grid; grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 28px; padding: 26px; align-items: center;
}
.circuit-img { width: 100%; border-radius: 6px; background: var(--circuit-pad); padding: 8px; }
html[data-theme="light"] .circuit-img { filter: invert(0.92); } /* 官方赛道图是黑底白线，浅色模式反色 */
.circuit-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 18px; }
.circuit-stats .k { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sub); font-weight: 700; }
.circuit-stats .v { font-size: 18px; font-weight: 800; margin-top: 2px; }

/* ── 页脚（顶部格纹旗条）── */
.site-footer {
  border-top: 1px solid var(--hair); background: var(--header-bg);
  padding: 30px 20px 42px; text-align: center;
  color: var(--sub); font-size: 12px; line-height: 2;
  position: relative;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 7px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, transparent 0% 50%) 0 0 / 14px 14px;
  opacity: 0.16;
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; padding: 8px 12px 0; }
  .brand { padding: 6px 0; }
  .header-right { width: 100%; }
  .site-nav { overflow-x: auto; flex: 1; }
  .site-nav a { padding: 12px 10px; }
  .next-card { grid-template-columns: 1fr; padding: 24px 20px; }
  .next-right { text-align: left; }
  .next-right .countdown { justify-content: flex-start; }
  .sessions { align-items: flex-start; }
  .next-name { font-size: 28px; }
  .cd-cell { min-width: 56px; }
  .cd-num { font-size: 24px; }
  .page-hero { font-size: 26px; }
  .podium, .snapshot-grid, .stat-row { grid-template-columns: 1fr; }
  .circuit-card { grid-template-columns: 1fr; }
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 9px 10px; }
}
