:root {
  --bg: #0a0f1e;
  --bg2: #111832;
  --panel: rgba(22, 29, 54, 0.78);
  --panel-solid: #161d36;
  --panel-2: #1d2544;
  --ink: #f3f1ea;
  --muted: #a5afcc;
  --faint: #7e89a8;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --amber: #ffb03a;
  --amber-2: #ff8a3d;
  --mint: #5fd0a8;
  --blue: #5b9cf7;
  --pink: #ff7f9f;
  --red: #ff5d5d;
  --yellow: #ffd75e;
  --green: #4fd07a;
  --purple: #a78bfa;
  --radius: 20px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(91, 70, 190, 0.55), transparent 62%),
    radial-gradient(760px 520px at 100% 0%, rgba(24, 111, 140, 0.45), transparent 60%),
    radial-gradient(900px 700px at 50% 115%, rgba(255, 127, 159, 0.13), transparent 62%),
    linear-gradient(180deg, #0b1122 0%, #0a0e1c 55%, #070a14 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 78%);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 8px;
  z-index: 50;
  width: min(1180px, calc(100% - 20px));
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 20, 39, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.15s, transform 0.15s;
}
.home:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.home svg { width: 20px; height: 20px; fill: currentColor; }

.brand { flex: 1 1 auto; min-width: 0; }
.brand h1 { margin: 0; font-size: 17px; letter-spacing: 0.02em; white-space: nowrap; }
.brand p {
  margin: 2px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn .ico-off { display: none; }
.icon-btn.is-muted .ico-on { display: none; }
.icon-btn.is-muted .ico-off { display: block; }
.icon-btn .fs-exit { display: none; }
:fullscreen .icon-btn .fs-enter { display: none; }
:fullscreen .icon-btn .fs-exit { display: block; }
.icon-btn .fs-enter, .icon-btn .fs-exit { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- 通用 ---------- */
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 18px 16px 56px; }

.view { display: none; animation: viewIn 0.28s ease both; }
.view.is-active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stage {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 65% at 50% 35%, rgba(103, 84, 210, 0.34), transparent 70%),
    radial-gradient(50% 45% at 75% 15%, rgba(255, 176, 58, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(21, 28, 55, 0.75), rgba(9, 13, 27, 0.85));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 46px rgba(0, 0, 0, 0.3);
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 90px rgba(4, 7, 16, 0.75);
}
.cube-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.cube-canvas:active { cursor: grabbing; }
.stage-hint {
  position: absolute;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.55);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  pointer-events: none;
  white-space: nowrap;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: transform 0.12s, filter 0.15s;
}
.btn:active { transform: translateY(2px); }
.btn-main {
  color: #26160a;
  background: linear-gradient(180deg, #ffc85e, var(--amber) 55%, #f0902a);
  box-shadow: 0 6px 0 #a3601b, 0 14px 26px rgba(255, 156, 44, 0.32);
}
.btn-main:hover { filter: brightness(1.05); }
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.ghost-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, transform 0.12s;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.12); }
.ghost-btn:active { transform: translateY(1px); }

.chip-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.13); }
.chip-btn.is-on { background: rgba(255, 176, 58, 0.2); border-color: rgba(255, 176, 58, 0.55); color: #ffd899; }

.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 4px;
}
.link-btn:hover { color: var(--ink); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #d9c9ff;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.3);
  white-space: nowrap;
}

.tiny { font-size: 11.5px; line-height: 1.55; color: var(--faint); margin: 10px 0 0; }

.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}
.view-title { flex: 1 1 auto; min-width: 0; }
.view-title h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); letter-spacing: 0.01em; }
.view-title p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- 首页 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}
.hero-copy {
  padding: 26px clamp(18px, 4vw, 34px);
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(255, 176, 58, 0.12), transparent 60%),
    linear-gradient(155deg, rgba(38, 33, 82, 0.85), rgba(16, 22, 44, 0.85));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--amber);
  font-weight: 800;
}
.hero-copy h2 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.14;
  letter-spacing: -0.01em;
}
.hero-copy h2 span {
  display: inline-block;
  white-space: nowrap;
  background: linear-gradient(100deg, #ffd75e, #ff9a5c 55%, #ff7f9f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin: 14px 0 0;
  max-width: 40em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}
.profile-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 7px 12px 7px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
}
.profile-chip .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #13111d;
  background: var(--pc, var(--amber));
}
.profile-chip small { color: var(--faint); font-weight: 600; font-size: 10.5px; }
.profile-chip.is-active {
  color: var(--ink);
  border-color: rgba(255, 176, 58, 0.55);
  background: rgba(255, 176, 58, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 176, 58, 0.07);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.hero-stage { min-height: 360px; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.entry {
  --e: var(--amber);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 16px 16px 14px;
  min-height: 132px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--e) 18%, transparent), transparent 60%),
    linear-gradient(170deg, rgba(30, 37, 68, 0.92), rgba(14, 19, 38, 0.9));
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.entry::after {
  content: "";
  position: absolute;
  right: -24px; top: -24px;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--e);
  opacity: 0.16;
  filter: blur(6px);
}
.entry:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--e) 52%, transparent);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.entry:active { transform: translateY(0); }
.entry-icon { font-size: 26px; line-height: 1; }
.entry-body { display: flex; flex-direction: column; gap: 3px; }
.entry-body b { font-size: 15px; }
.entry-body small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.entry-go { margin-top: auto; font-size: 12px; font-weight: 800; color: var(--e); }

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mini-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px;
  min-height: 132px;
}
.mini-card h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.mini-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0; }
.mini-row b { font-family: var(--mono); font-size: 20px; letter-spacing: 0.02em; }
.mini-row span { font-size: 12px; color: var(--faint); }
.mini-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); line-height: 1.6; }
.mini-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.empty-line { font-size: 13px; color: var(--faint); line-height: 1.7; }

/* ---------- 比赛 ---------- */
.race-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 318px;
  gap: 14px;
  align-items: stretch;
}
.race-stage { min-height: clamp(380px, 58vh, 620px); }

.scramble-panel { padding: 16px; display: flex; flex-direction: column; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted);
  margin-bottom: 10px;
}
.scramble {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  word-spacing: 0.35em;
  color: #e9e4ff;
  min-height: 96px;
  flex: 1 1 auto;
}
.scramble .mv {
  display: inline-block;
  padding: 1px 5px;
  margin: 2px 1px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.scramble .mv.now { background: rgba(255, 176, 58, 0.28); border-color: rgba(255, 176, 58, 0.7); color: #fff3da; }
.scramble-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

.net {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 2px;
  margin-top: 12px;
  aspect-ratio: 12 / 9;
  width: 100%;
  max-width: 260px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}
.net-face { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; }
.net-face.U { grid-area: 1 / 4 / 4 / 7; }
.net-face.L { grid-area: 4 / 1 / 7 / 4; }
.net-face.F { grid-area: 4 / 4 / 7 / 7; }
.net-face.R { grid-area: 4 / 7 / 7 / 10; }
.net-face.B { grid-area: 4 / 10 / 7 / 13; }
.net-face.D { grid-area: 7 / 4 / 10 / 7; }
.net-cell { border-radius: 2.5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }

.control-panel { padding: 16px; display: flex; flex-direction: column; }
.phase {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--amber);
  text-transform: uppercase;
}
.bigtime {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(44px, 6.4vw, 66px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
  text-shadow: 0 0 28px rgba(255, 176, 58, 0.18);
  white-space: nowrap;
}
.bigtime.counting { color: var(--yellow); }
.bigtime.running { color: #fff; }
.bigtime.done { color: var(--mint); }
.penalty { min-height: 18px; font-size: 12.5px; color: var(--red); font-weight: 700; margin-bottom: 8px; }

.lanes { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.lane {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 11px;
}
.lane.player { border-color: rgba(95, 208, 168, 0.3); background: rgba(95, 208, 168, 0.06); }
.lane.robot { border-color: rgba(255, 138, 92, 0.28); background: rgba(255, 138, 92, 0.05); }
.lane.winner { box-shadow: 0 0 0 2px rgba(255, 215, 94, 0.4), 0 0 24px rgba(255, 215, 94, 0.18); }
.lane-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lane-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-time { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 8px 0 6px;
}
.bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar, var(--amber)), color-mix(in srgb, var(--bar, var(--amber)) 55%, #fff));
  transition: width 0.12s linear;
}
.lane-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--faint); }
.lane-status { font-weight: 700; }
.lane-status.go { color: var(--mint); }
.lane-status.wait { color: var(--amber); }
.lane-finish {
  margin-top: 9px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px;
  font-weight: 800;
  font-size: 14px;
  color: #10241c;
  background: linear-gradient(180deg, #7ff0c7, var(--mint));
  box-shadow: 0 4px 0 #2c8361;
}
.lane-finish:active { transform: translateY(2px); box-shadow: 0 2px 0 #2c8361; }
.lane-finish:disabled { opacity: 0.45; box-shadow: none; cursor: default; }

.action-wrap { margin-top: auto; }
.main-action {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 18px 14px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #2a1806;
  background: linear-gradient(180deg, #ffd270, var(--amber) 55%, #f08e26);
  box-shadow: 0 7px 0 #9d5c18, 0 16px 30px rgba(255, 156, 44, 0.28);
  transition: transform 0.1s, filter 0.15s;
}
.main-action:hover { filter: brightness(1.05); }
.main-action:active { transform: translateY(3px); box-shadow: 0 4px 0 #9d5c18; }
.main-action.running {
  color: #fff;
  background: linear-gradient(180deg, #ff7a7a, #e83838 60%, #b91f1f);
  box-shadow: 0 7px 0 #751313, 0 16px 30px rgba(255, 70, 70, 0.24);
}
.main-action.finish { font-size: 19px; }
.main-action:disabled { opacity: 0.5; cursor: default; }
.under-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.hint { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--faint); }

/* ---------- 结果 ---------- */
.result {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.result-card {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(255, 176, 58, 0.18), transparent 60%),
    linear-gradient(170deg, #1c2444, #11162b);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 24px;
  text-align: center;
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }
.result-emoji { font-size: 44px; line-height: 1; }
.result-kicker { margin: 8px 0 0; font-size: 11px; letter-spacing: 0.2em; color: var(--amber); font-weight: 800; }
.result-title { margin: 4px 0 0; font-size: 26px; }
.result-time {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
}
.result-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.result-rows { margin: 14px 0 0; display: flex; flex-direction: column; gap: 7px; }
.result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 13px;
}
.result-row b { font-family: var(--mono); font-size: 14px; }
.result-row span:first-child { color: var(--muted); }
.result-row.hi { background: rgba(255, 215, 94, 0.1); border-color: rgba(255, 215, 94, 0.3); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.result-actions .btn { padding: 11px 16px; font-size: 13.5px; }
.result-note { margin-top: 12px; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.result-note b { color: var(--amber); }
.pb-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #221704;
  background: linear-gradient(90deg, #ffe08a, #ffb03a);
}

/* ---------- 教程 ---------- */
.learn-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.learn-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
}
.learn-tab:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.learn-tab.is-active {
  color: #251704;
  background: linear-gradient(180deg, #ffd270, var(--amber));
  border-color: transparent;
  box-shadow: 0 4px 0 #9d5c18;
}
.learn-body { min-height: 260px; }
.track-intro {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.track-intro h3 { margin: 0 0 6px; font-size: 18px; }
.track-intro p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); }
.track-progress { margin-top: 10px; font-size: 12px; color: var(--faint); }

.step-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.step-card {
  display: flex; gap: 12px; align-items: flex-start;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(30, 37, 68, 0.85), rgba(15, 20, 39, 0.85));
  color: var(--ink);
  transition: transform 0.15s, border-color 0.15s;
}
.step-card:hover { transform: translateY(-2px); border-color: rgba(255, 176, 58, 0.4); }
.step-num {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 14px;
  color: #241704;
  background: linear-gradient(180deg, #ffd270, var(--amber));
}
.step-card.done .step-num { background: linear-gradient(180deg, #8cf0c8, var(--mint)); }
.step-main { min-width: 0; }
.step-main b { display: block; font-size: 14px; margin-bottom: 3px; }
.step-main small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.step-done { margin-left: auto; font-size: 11px; color: var(--mint); font-weight: 800; white-space: nowrap; }

.atlas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.atlas-card {
  text-align: left;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  transition: transform 0.15s, border-color 0.15s;
}
.atlas-card:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, 0.45); }
.atlas-card h4 { margin: 0 0 2px; font-size: 15px; }
.atlas-card .en { font-size: 10px; letter-spacing: 0.08em; color: var(--faint); }
.atlas-card p { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.atlas-stars { margin-top: 8px; font-size: 10.5px; color: var(--amber); letter-spacing: 0.12em; }

.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.record-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(52, 42, 108, 0.55), rgba(16, 21, 41, 0.9));
}
.record-card .label { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.record-card .time { font-family: var(--mono); font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.record-card .who { font-size: 12px; color: var(--ink); }
.record-card .when { font-size: 11px; color: var(--faint); margin-top: 2px; }
.record-card .note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 8px; }

.lesson-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: stretch;
}
.lesson-list { padding: 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); }
.lesson-item {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  text-align: left;
  border: 0; background: none; color: var(--muted);
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.35;
  transition: background 0.15s, color 0.15s;
}
.lesson-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.lesson-item.is-active { background: rgba(255, 176, 58, 0.16); color: var(--ink); }
.lesson-item .n {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: 10.5px; font-weight: 800;
  background: rgba(255, 255, 255, 0.09);
}
.lesson-item.done .n { background: rgba(95, 208, 168, 0.25); color: #a8f0d4; }
.lesson-stage { min-height: 440px; }
.lesson-panel { padding: 18px; overflow-y: auto; max-height: 70vh; }
.lesson-panel h3 { margin: 0 0 6px; font-size: 19px; }
.lesson-goal {
  font-size: 12.5px;
  line-height: 1.7;
  color: #ffe0b0;
  background: rgba(255, 176, 58, 0.1);
  border: 1px solid rgba(255, 176, 58, 0.24);
  border-radius: 11px;
  padding: 9px 11px;
  margin: 0 0 12px;
}
.lesson-panel p.body { font-size: 13px; line-height: 1.78; color: #d8ddEE; margin: 0 0 10px; }
.tips { margin: 10px 0 14px; padding: 0 0 0 16px; }
.tips li { font-size: 12px; line-height: 1.65; color: var(--muted); margin-bottom: 5px; }
.alg-list { display: flex; flex-direction: column; gap: 8px; }
.alg {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 11px;
}
.alg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.alg-name { font-size: 12.5px; font-weight: 800; }
.alg-seq { font-family: var(--mono); font-size: 12.5px; color: #ffe0a8; margin: 6px 0 3px; letter-spacing: 0.04em; line-height: 1.6; }
.alg-note { font-size: 11px; color: var(--faint); line-height: 1.55; }
.alg-play {
  border: 1px solid rgba(255, 176, 58, 0.4);
  background: rgba(255, 176, 58, 0.14);
  color: #ffd899;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.alg-play:hover { background: rgba(255, 176, 58, 0.24); }
.alg-play.is-playing { background: rgba(95, 208, 168, 0.18); border-color: rgba(95, 208, 168, 0.5); color: #9ff0d2; }
.alg-steps { font-size: 11px; color: var(--mint); min-height: 16px; margin-top: 4px; }
.lesson-nav { display: flex; gap: 8px; margin-top: 16px; }
.lesson-nav .btn { flex: 1; padding: 10px 12px; font-size: 12.5px; }

/* ---------- 纪录 ---------- */
.rec-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 16px 18px; margin-bottom: 12px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--panel);
}
.rec-hero select {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(32, 40, 74, 0.9), rgba(14, 19, 38, 0.9));
}
.stat small { display: block; font-size: 11px; color: var(--faint); letter-spacing: 0.05em; }
.stat b { display: block; font-family: var(--mono); font-size: 23px; margin-top: 4px; }
.hist { display: flex; flex-direction: column; gap: 6px; }
.hist-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 86px 74px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
}
.hist-row .t { font-family: var(--mono); font-weight: 800; font-size: 14px; }
.hist-row .m { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-row .d { color: var(--faint); font-size: 11px; text-align: right; }
.win-badge { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; justify-self: end; }
.win-badge.win { color: #0d2b1f; background: var(--mint); }
.win-badge.lose { color: #331111; background: #ff8f8f; }
.win-badge.plain { color: var(--faint); background: rgba(255, 255, 255, 0.07); }
.records-empty { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 13px; line-height: 1.8; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set-card { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); }
.set-card h3 { margin: 0 0 10px; font-size: 15px; }
.set-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); font-size: 13px; }
.set-card .row:last-child { border-bottom: 0; }
.set-card .row span { color: var(--muted); }
.set-card .row b { font-size: 13px; }
.profile-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.profile-line:last-child { border-bottom: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; color: #14101f;
  background: var(--pc, var(--amber));
  flex: 0 0 auto;
}
.profile-line .who { flex: 1 1 auto; min-width: 0; }
.profile-line .who b { display: block; font-size: 13.5px; }
.profile-line .who small { display: block; color: var(--faint); font-size: 11px; }
.profile-line .mini { font-size: 11px; color: var(--faint); font-family: var(--mono); }

/* ---------- 弹层 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}
.sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 14, 0.72); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.sheet-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(100% 100% at 50% 0%, rgba(76, 64, 160, 0.35), transparent 60%),
    linear-gradient(170deg, #1d2545, #10152a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  padding: 22px;
  animation: popIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
}
.sheet-close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.13); }
.sheet h3 { margin: 0 30px 4px 0; font-size: 21px; }
.sheet .sub { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.form-row { margin: 12px 0; }
.form-row > label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 7px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 7px; }
.opt {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  transition: all 0.14s;
}
.opt:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.opt.is-on {
  color: #251704;
  background: linear-gradient(180deg, #ffd270, var(--amber));
  border-color: transparent;
  box-shadow: 0 3px 0 #9d5c18;
}
.opt small { display: block; font-size: 10.5px; font-weight: 600; opacity: 0.75; margin-top: 2px; }
.opt.locked { opacity: 0.45; }
.robot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.robot-opt {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 13px;
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
  transition: all 0.14s;
}
.robot-opt:hover { background: rgba(255, 255, 255, 0.09); }
.robot-opt.is-on { border-color: rgba(255, 176, 58, 0.65); background: rgba(255, 176, 58, 0.13); box-shadow: 0 0 0 3px rgba(255, 176, 58, 0.08); }
.robot-opt.locked { opacity: 0.5; }
.robot-opt .rn { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 800; }
.robot-opt .rt { font-family: var(--mono); font-size: 11.5px; color: var(--amber); }
.robot-opt small { display: block; font-size: 10.5px; color: var(--faint); margin-top: 3px; line-height: 1.45; }
.sel {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 11px;
  padding: 10px 11px;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
}
.sel:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.time-input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 11px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.04em;
}
.time-input:focus { outline: none; border-color: rgba(255, 176, 58, 0.65); box-shadow: 0 0 0 3px rgba(255, 176, 58, 0.12); }
.time-input::placeholder { color: var(--faint); font-size: 13px; letter-spacing: 0; }

.pair-row { display: flex; align-items: center; gap: 8px; }
.pair-row > span { flex: 0 0 auto; color: var(--faint); font-size: 12px; }

.hcap {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid rgba(95, 208, 168, 0.3);
  background: rgba(95, 208, 168, 0.07);
}
.hcap .num { font-family: var(--mono); font-size: 26px; font-weight: 800; color: var(--mint); min-width: 92px; text-align: center; }
.hcap button {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.hcap button:hover { background: rgba(255, 255, 255, 0.14); }
.hcap .who { flex: 1 1 auto; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.sheet-actions .btn { flex: 1 1 auto; }
.sheet-actions .btn-main { flex: 2 1 140px; }
.sheet-note { margin: 12px 0 0; font-size: 11px; color: var(--faint); line-height: 1.6; }
.atlas-detail .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.atlas-detail .box {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 11px 13px;
  margin: 9px 0;
}
.atlas-detail .box h4 { margin: 0 0 5px; font-size: 11px; letter-spacing: 0.1em; color: var(--faint); }
.atlas-detail .box p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.atlas-detail ol { margin: 6px 0 0; padding-left: 18px; }
.atlas-detail ol li { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(460px, calc(100% - 28px));
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 27, 50, 0.95);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
  animation: toastIn 0.22s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.voice-hint {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 130;
  width: min(520px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 176, 58, 0.4);
  background: rgba(27, 22, 12, 0.97);
  color: #f6e8cf;
  font-size: 11.5px;
  line-height: 1.6;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.voice-hint b { color: #ffd28a; }
.voice-hint span { display: block; color: #cbbfa9; margin-top: 3px; }
.voice-hint button {
  position: absolute;
  top: 8px; right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f6e8cf;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
}
body.is-race .voice-hint { display: none !important; }
@media (max-height: 520px) and (orientation: landscape) {
  .voice-hint {
    left: auto;
    right: 12px;
    bottom: 12px;
    transform: none;
    width: min(340px, 52vw);
    padding: 9px 11px;
    font-size: 10.5px;
  }
}

/* ---------- 2D 兜底 ---------- */
.fallback-note {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  font-size: 11px; color: var(--amber); white-space: nowrap; z-index: 2;
}
.stage .net { margin: auto; position: absolute; inset: 0; max-width: 240px; max-height: 240px; height: auto; }
.stage .net[hidden] { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  /* 比赛开始后先把 3D 舞台收起，保证计时和「我完成了」在屏幕里 */
  #view-race.hide-stage .race-stage { display: none; }
  .control-panel > .phase { order: 0; }
  .control-panel > .bigtime { order: 1; }
  .control-panel > .penalty { order: 2; }
  .control-panel > .action-wrap { order: 3; }
  .control-panel > .lanes { order: 4; }
  .control-panel > .hint { order: 5; }
  .hcap .num { min-width: 76px; }
}

@media (max-width: 520px) {
  .pair-row { flex-wrap: wrap; }
  .pair-row .sel { flex: 1 1 100%; }
  .pair-row > span { display: none; }
  .hcap { gap: 5px; }
  .hcap button { width: 30px; height: 32px; padding: 0; }
  .hcap .num { min-width: 62px; font-size: 22px; }
  .hcap .who { flex-basis: 100%; }
}

/* 横屏矮屏：比赛页直接收掉 3D，先看到打乱 / 计时 / 按钮 */
@media (max-height: 520px) and (orientation: landscape) {
  #view-race .race-stage { display: none; }
  #view-race .race-layout { display: flex; flex-direction: column; gap: 12px; }
  #view-race .control-panel { order: 1; }
  #view-race .scramble-panel { order: 2; }
  .control-panel > .phase { order: 0; }
  .control-panel > .bigtime { order: 1; }
  .control-panel > .penalty { order: 2; }
  .control-panel > .action-wrap { order: 3; }
  .control-panel > .lanes { order: 4; }
  .control-panel > .hint { order: 5; }
}

@media (max-width: 1080px) {
  .race-layout { grid-template-columns: 240px minmax(0, 1fr) 292px; }
  .lesson-layout { grid-template-columns: 190px minmax(0, 1fr) 300px; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

@media (max-width: 900px) {
  .race-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-areas:
      "stage control"
      "scramble scramble";
  }
  .race-stage { grid-area: stage; min-height: 380px; }
  .control-panel { grid-area: control; }
  .scramble-panel { grid-area: scramble; }
  .scramble { min-height: 0; }
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "stage panel"
      "list list";
  }
  .lesson-stage { grid-area: stage; }
  .lesson-panel { grid-area: panel; max-height: none; }
  .lesson-list { grid-area: list; display: flex; flex-wrap: wrap; gap: 4px; }
  .lesson-item { width: auto; flex: 1 1 44%; }
  .atlas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .learn-tab { white-space: nowrap; }
}

@media (max-width: 760px) {
  .wrap { padding: 14px 12px 44px; }
  .topbar { width: calc(100% - 16px); margin-top: 6px; }
  .brand p { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 22px 18px; order: 2; }
  .hero-stage { order: 1; min-height: 270px; }
  .hero-copy h2 { font-size: 30px; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { min-height: 116px; padding: 13px; }
  .home-grid { grid-template-columns: 1fr; }
  .mini-card { min-height: 0; }
  .race-layout {
    display: flex;
    flex-direction: column;
  }
  .race-stage { order: 1; min-height: 340px; }
  .control-panel { order: 2; }
  .scramble-panel { order: 3; }
  .bigtime { font-size: 56px; }
  .lesson-layout { display: flex; flex-direction: column; }
  .lesson-stage { order: 1; min-height: 300px; }
  .lesson-panel { order: 2; max-height: none; }
  .lesson-list { order: 3; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-row { grid-template-columns: 74px minmax(0, 1fr) 74px 62px; }
  .settings-grid { grid-template-columns: 1fr; }
  .record-grid { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
  .atlas-grid { grid-template-columns: 1fr; }
  .view-head { gap: 8px; }
  .view-title h2 { font-size: 20px; }
  .ghost-btn { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 520px) {
  .brand h1 { font-size: 15px; }
  .home, .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .hero-copy h2 { font-size: 26px; }
  .lead { font-size: 13px; }
  .entry-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .entry-body b { font-size: 13.5px; }
  .entry-body small { font-size: 10.5px; }
  .entry-go { font-size: 11px; }
  .bigtime { font-size: 48px; }
  .main-action { padding: 16px 12px; font-size: 15.5px; }
  .result-card { padding: 20px 16px; }
  .result-time { font-size: 38px; }
  .result-actions .btn { flex: 1 1 100%; }
  .sheet { padding: 10px; }
  .sheet-card { padding: 18px 15px; border-radius: 18px; }
  .robot-grid { grid-template-columns: 1fr; }
  .hist-row { grid-template-columns: 64px minmax(0, 1fr) 62px; }
  .hist-row .d { display: none; }
  .stat b { font-size: 20px; }
  .learn-tab { padding: 8px 12px; font-size: 12px; }
  .topbar { gap: 8px; padding: 7px 8px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .topbar { position: static; }
  .hero-stage { min-height: 220px; }
  .race-stage { min-height: 300px; }
  .view-head { margin-bottom: 10px; }
  .bigtime { font-size: 42px; }
}

@media (max-height: 620px) {
  .result { padding: 10px; }
  .result-card { max-height: 94vh; padding: 14px 18px; }
  .result-emoji { font-size: 24px; }
  .result-kicker { margin-top: 2px; font-size: 10px; }
  .result-title { margin-top: 2px; font-size: 19px; }
  .result-time { margin-top: 4px; font-size: 30px; }
  .result-sub { margin-top: 3px; font-size: 11.5px; line-height: 1.5; }
  .result-rows { margin-top: 8px; gap: 4px; }
  .result-row { padding: 5px 10px; font-size: 11.5px; }
  .result-row b { font-size: 12px; }
  .result-actions { margin-top: 10px; gap: 6px; }
  .result-actions .btn { padding: 8px 12px; font-size: 12px; }
  .result-note { display: none; }
  .pb-badge { margin-top: 4px; padding: 2px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 全屏 ---------- */
:fullscreen .wrap { width: 100%; max-width: 1400px; }
#fsTip {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 200;
  max-width: min(520px, calc(100% - 24px));
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 27, 50, 0.96);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  box-shadow: var(--shadow);
}
