/* ============================================================
   Formula Racing · 基础样式与组件库
   ============================================================ */

@import url("./fonts.css");
@import url("./themed-select.css");

[hidden] { display: none !important; }

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

::selection {
  background: var(--red);
  color: #fff;
}

/* ---------- 排版工具 ---------- */
.display {
  font-family: var(--font-display);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.italic {
  font-style: italic;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dim {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

/* ---------- 应用外壳（固定视口，不纵向滚动） ---------- */
.app-shell {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(225, 6, 0, 0.10), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(54, 113, 198, 0.08), transparent 60%),
    linear-gradient(180deg, #0d0e13 0%, var(--bg) 30%, var(--bg-deep) 100%);
}

/* 细网格纹理 */
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 0%, transparent 100%);
  z-index: 0;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(12px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand-mark {
  width: 8px;
  height: 26px;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  transform: skewX(-18deg);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-name .thin {
  color: var(--text-faint);
  font-weight: 400;
}

/* 流程指示 */
.step-flow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
}

.step-flow .step {
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-flow .step .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line-strong);
  padding: 0 5px;
  line-height: 18px;
}

.step-flow .step.current {
  color: var(--text);
}

.step-flow .step.current .idx {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.step-flow .step.done {
  color: var(--text-dim);
}

.step-flow .step.done .idx {
  border-color: var(--green);
  color: var(--green);
}

.step-flow .sep {
  width: 20px;
  height: 1px;
  background: var(--line-strong);
  flex: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ---------- 主内容与底部操作条 ---------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 0;
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: var(--fs-2xl);
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.page-head h1 .accent {
  color: var(--red-bright);
}

.page-head .sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: var(--fs-md);
}

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(12px);
}

.actionbar .hint {
  color: var(--text-faint);
  font-size: var(--fs-label);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.actionbar .group {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-5);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: 0.05em;
  clip-path: var(--chamfer-xs);
  transition: filter var(--t-fast) var(--ease-out), background var(--t-fast), color var(--t-fast);
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(120deg, var(--red) 0%, #a70500 100%);
  color: #fff;
  font-style: italic;
}

.btn-primary:hover {
  filter: brightness(1.18);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--inset-top), inset 0 0 0 1px var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface-2);
  box-shadow: var(--inset-top), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.btn-text {
  min-height: 44px;
  padding: 0 var(--sp-3);
  color: var(--text-dim);
}

.btn-text:hover {
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--destructive);
  box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.5);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.12);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn .kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  opacity: 0.7;
  margin-left: var(--sp-2);
}

.btn-sm {
  min-height: 34px;
  padding: 0 var(--sp-4);
  font-size: var(--fs-label);
}

.btn-lg {
  min-height: 56px;
  padding: 0 var(--sp-7);
  font-size: var(--fs-lg);
}

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  clip-path: var(--chamfer-sm);
  box-shadow: var(--shadow-panel), var(--inset-top), inset 0 0 0 1px var(--line);
  padding: var(--sp-5);
}

.panel-tight {
  padding: var(--sp-4);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.panel-head .title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-head .title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--red);
  transform: skewX(-18deg);
}

.panel-head .title.neutral::before {
  background: var(--line-strong);
}

.panel-head .extra {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ---------- 轮胎芯片 ---------- */
.tyre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border: 2.5px solid;
  background: rgba(0, 0, 0, 0.45);
  flex: none;
}

.tyre-soft  { border-color: var(--red-bright);   color: var(--red-bright); }
.tyre-med   { border-color: var(--yellow);       color: var(--yellow); }
.tyre-hard  { border-color: var(--white-tyre);   color: var(--white-tyre); }
.tyre-none  { border-color: var(--text-faint);   color: var(--text-faint); }

.tyre-lg {
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-width: 4px;
}

/* ---------- 排名行 ---------- */
.pos-row {
  display: grid;
  grid-template-columns: 30px 4px 44px 1fr auto;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-2);
  font-family: var(--font-display);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pos-row:last-child {
  border-bottom: none;
}

.pos-row .p {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-dim);
  text-align: right;
}

.pos-row .bar {
  width: 4px;
  height: 22px;
  transform: skewX(-18deg);
  background: var(--team01);
}

.pos-row .abbr {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
}

.pos-row .tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.pos-row .gap {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  text-align: right;
}

.pos-row.is-player {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.22), transparent 70%);
}

.pos-row.is-player .p {
  color: var(--red-bright);
}

.pos-row.is-dnf .abbr,
.pos-row.is-dnf .gap {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

/* ---------- 性能条（A/S/H/G） ---------- */
.stat-bars {
  display: grid;
  gap: var(--sp-2);
}

.stat-bar {
  display: grid;
  grid-template-columns: 76px 1fr 36px;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-label);
}

.stat-bar .k {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-bar .track {
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  transform: skewX(-18deg);
  overflow: hidden;
}

.stat-bar .fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
}

.stat-bar .v {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  color: var(--text);
}

.stat-bar.neutral .fill {
  background: linear-gradient(90deg, #3f4650, #8f97a3);
}

/* ---------- 分段选择器 ---------- */
.seg {
  display: inline-flex;
  clip-path: var(--chamfer-xs);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  background: var(--surface);
}

.seg button {
  min-height: 44px;
  padding: 0 var(--sp-4);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.05em;
  color: var(--text-dim);
  transition: background var(--t-fast), color var(--t-fast);
  border-right: 1px solid var(--line);
}

.seg button:last-child {
  border-right: none;
}

.seg button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.seg button.is-active {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

/* ---------- 标签页 ---------- */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line-strong);
}

.tabs .tab {
  position: relative;
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  color: var(--text-faint);
  transition: color var(--t-fast);
}

.tabs .tab:hover {
  color: var(--text-dim);
}

.tabs .tab.is-active {
  color: var(--text);
  font-weight: 600;
}

.tabs .tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--red);
  transform: skewX(-18deg);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: fadeIn var(--t-med) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 开关 ---------- */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

.toggle .label {
  font-size: var(--fs-md);
}

.toggle .desc {
  font-size: var(--fs-caption);
  color: var(--text-faint);
}

.toggle .switch {
  position: relative;
  width: 56px;
  height: 26px;
  flex: none;
  clip-path: var(--chamfer-xs);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background var(--t-fast);
}

.toggle .switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  background: var(--text-faint);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle input:checked ~ .switch {
  background: var(--red-deep);
}

.toggle input:checked ~ .switch::after {
  transform: translateX(30px);
  background: var(--red-bright);
}

.toggle.is-locked {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  clip-path: var(--chamfer-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
}

.badge-ok    { color: var(--green); }
.badge-warn  { color: var(--yellow); }
.badge-lock  { color: var(--text-faint); }
.badge-info  { color: var(--blue); }
.badge-red   { color: var(--red-bright); }

/* ---------- 旗语 ---------- */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  padding: 4px 12px;
  clip-path: var(--chamfer-xs);
}

.flag .sq {
  width: 12px;
  height: 12px;
  flex: none;
}

.flag-green  { background: rgba(47, 208, 90, 0.15);  color: var(--green); }
.flag-green .sq { background: var(--green); }
.flag-yellow { background: rgba(245, 197, 24, 0.15); color: var(--yellow); }
.flag-yellow .sq { background: var(--yellow); clip-path: polygon(0 0,100% 0,100% 100%,0 100%,50% 50%); }
.flag-red    { background: rgba(225, 6, 0, 0.18);    color: var(--red-bright); }
.flag-red .sq { background: var(--red-bright); }
.flag-blue   { background: rgba(74, 168, 255, 0.15); color: var(--blue); }
.flag-blue .sq { background: var(--blue); clip-path: polygon(50% 0,100% 100%,0 100%); }
.flag-chequer {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.flag-chequer .sq {
  background:
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%),
    linear-gradient(45deg, #fff 25%, #111 25%, #111 75%, #fff 75%);
  background-size: 6px 6px;
  background-position: 0 0, 3px 3px;
}

/* ---------- 键值行 ---------- */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  font-size: var(--fs-md);
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  color: var(--text-dim);
}

.kv .v {
  font-family: var(--font-mono);
  font-size: 15px;
  text-align: right;
}

/* ---------- 赛道小地图（示意占位） ---------- */
.track-mini {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
    #0e1016;
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
  overflow: hidden;
}

.track-mini svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.track-mini .lbl {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ---------- 卡片（赛道/车队可选卡） ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--panel-solid);
  clip-path: var(--chamfer-sm);
  box-shadow: var(--inset-top), inset 0 0 0 1px var(--line);
  padding: var(--sp-3);
  cursor: pointer;
  transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out);
  text-align: left;
}

.card:hover {
  box-shadow: var(--inset-top), inset 0 0 0 1px var(--line-strong);
  transform: translateY(-2px);
}

.card.is-selected {
  box-shadow: var(--inset-top), inset 0 0 0 2px var(--red), var(--glow-red);
}

.card.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.card .card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
}

.card .card-sub {
  font-size: var(--fs-caption);
  color: var(--text-faint);
}

/* ---------- 进度条 ---------- */
.progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  transform: skewX(-18deg);
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  transition: width var(--t-med) var(--ease-out);
}

/* ---------- 表格 ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body);
}

.table th {
  font-family: var(--font-display);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table .num {
  font-size: 14px;
}

.table tr.is-player td {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.16), transparent 80%);
}

.table tr.is-clickable {
  cursor: pointer;
}

.table tr.is-clickable:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- 车队色标 ---------- */
.team-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  transform: skewX(-18deg);
  background: var(--team01);
  flex: none;
}

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > .field-label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.field .input,
.field select {
  min-height: 44px;
  padding: 0 var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  clip-path: var(--chamfer-xs);
}

.field .input:focus,
.field select:focus {
  border-color: var(--red);
  outline: none;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  transform: skewX(-18deg);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 26px;
  margin-top: -10px;
  background: var(--red-bright);
  clip-path: var(--chamfer-xs);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 26px;
  border: none;
  border-radius: 0;
  background: var(--red-bright);
}

/* ---------- 滑杆行（设置页） ---------- */
.slider-row {
  display: grid;
  grid-template-columns: 180px 1fr 64px;
  align-items: center;
  gap: var(--sp-4);
  min-height: 44px;
}

.slider-row .v {
  font-family: var(--font-mono);
  text-align: right;
  font-size: var(--fs-md);
}

/* ---------- 通用网格 ---------- */
.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .step-flow { display: none; }
}

/* ---------- 空状态 ---------- */
.empty {
  padding: var(--sp-7);
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--line-strong);
  clip-path: var(--chamfer-sm);
}

/* ============================================================
   横向翻页器：内容超出视口时左右分页，不纵向滚动
   ============================================================ */
.pager {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  position: relative;
}

.pager .track {
  display: flex;
  min-width: 100%;
  height: 100%;
  transition: transform 280ms var(--ease-out);
}

.pane {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-right: var(--sp-2);
}

/* 翻页导航（页码点 + 箭头） */
.pager-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-2) 0 0;
  flex: none;
}

.pager-nav .pg-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  clip-path: var(--chamfer-xs);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: color var(--t-fast), background var(--t-fast);
}

.pager-nav .pg-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.pager-nav .pg-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pager-nav .dots {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.pager-nav .dot {
  width: 22px;
  height: 5px;
  background: rgba(255, 255, 255, 0.14);
  transform: skewX(-18deg);
  transition: background var(--t-fast), width var(--t-fast);
  cursor: pointer;
}

.pager-nav .dot:hover {
  background: rgba(255, 255, 255, 0.32);
}

.pager-nav .dot.is-active {
  width: 34px;
  background: var(--red-bright);
}

.pager-nav .pg-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  min-width: 52px;
  text-align: center;
}

/* pane 内部自适应：让可伸缩区域填满、固定区不受挤压 */
.pane > .pane-fill {
  flex: 1;
  min-height: 0;
}

/* 矮窗口兜底：保内容可读（大屏正常翻页，极矮窗口允许滚动） */
@media (max-height: 700px) {
  .pane { overflow-y: auto; }
  .page { overflow-y: auto; }
}

/* ============================================================
   HUD 专用（1920×1080 基准舞台，随视口等比缩放）
   ============================================================ */
.hud-body {
  background: #000;
  overflow: hidden;
  height: 100vh;
}

.hud-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  background:
    linear-gradient(180deg, #1a2233 0%, #0e1420 45%, #070a10 100%);
}

/* 赛道占位背景（示意 3D 画面） */
.hud-stage .world {
  position: absolute;
  inset: 0;
}

.hud-panel {
  position: absolute;
  background: var(--panel);
  clip-path: var(--chamfer-sm);
  box-shadow: var(--shadow-panel), var(--inset-top), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px);
  padding: var(--sp-3) var(--sp-4);
}

.hud-panel .hud-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

/* HUD 演示缩放提示 */
.hud-note {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.1em;
  z-index: 99;
}

/* ---------- HUD 仪表 ---------- */
.dash {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.dash .gear {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 96px;
  line-height: 1;
  min-width: 72px;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 32px rgba(225, 6, 0, 0.4);
}

.dash .speed-block {
  text-align: left;
}

.dash .speed {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
}

.dash .speed-unit {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}

.rpm-track {
  width: 200px;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  transform: skewX(-18deg);
  display: flex;
  gap: 3px;
  padding: 2px;
  margin-top: var(--sp-2);
}

.rpm-track .seg-light {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
}

.rpm-track .seg-light.on-green { background: var(--green); }
.rpm-track .seg-light.on-red { background: var(--red-bright); }

.dash .res {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.dash .res .row {
  display: grid;
  grid-template-columns: 52px 1fr 44px;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11px;
  color: var(--text-dim);
}

.dash .res .row .bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  transform: skewX(-18deg);
  overflow: hidden;
}

.dash .res .row .bar i {
  display: block;
  height: 100%;
  background: var(--green);
}

.dash .res .row .bar.fuel i { background: var(--yellow); }
.dash .res .row .bar.dmg i { background: var(--destructive); }

.dash .res .val {
  font-family: var(--font-mono);
  color: var(--text);
  text-align: right;
}

/* ---------- HUD 圈时板 ---------- */
.lapboard .lap-line {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
}

.lapboard .cur {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
}

.lapboard .cur.invalid {
  color: var(--destructive);
}

.lapboard .sectors {
  display: flex;
  gap: var(--sp-2);
  margin-top: 6px;
}

.lapboard .sector {
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 1px 8px;
  clip-path: var(--chamfer-xs);
  background: rgba(255, 255, 255, 0.06);
}

.lapboard .sector.s-best { color: var(--green); }
.lapboard .sector.s-purple { color: var(--purple); }
.lapboard .sector.s-slow { color: var(--yellow); }

/* ---------- 响应式微调 ---------- */
@media (max-width: 900px) {
  .page {
    padding: var(--sp-4);
  }
  .actionbar {
    flex-wrap: wrap;
  }
}
