:root {
  color-scheme: dark;
  --bg: #070910;
  --panel: #0d111a;
  --panel-2: #111722;
  --panel-3: #171e2b;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #818b9d;
  --text: #eef2f7;
  --accent: #d9ff43;
  --accent-soft: rgba(217, 255, 67, 0.12);
  --cyan: #45ddff;
  --orange: #ff9f43;
  --red: #ff6577;
  --sidebar-width: 248px;
  --topbar-height: 76px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -20%, rgba(69, 221, 255, 0.1), transparent 32%),
    radial-gradient(circle at 0 70%, rgba(217, 255, 67, 0.045), transparent 28%),
    var(--bg);
}

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.app-shell { min-height: 100vh; }

.topbar {
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 16, 0.88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 22px;
  color: var(--text);
  text-decoration: none;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
  background: var(--accent);
  color: #090b0d;
  box-shadow: 0 0 24px rgba(217,255,67,.25);
}

.brand-mark svg { width: 25px; fill: currentColor; }
.brand strong { display: block; font-size: 16px; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font: 700 9px/1.4 "Bahnschrift", sans-serif; letter-spacing: .18em; }

.main-nav { display: flex; align-items: stretch; height: 100%; padding-left: 32px; gap: 30px; }
.nav-item {
  position: relative;
  border: 0;
  padding: 0 2px;
  background: none;
  color: #7f8999;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nav-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: .2s; }
.nav-item:hover, .nav-item.active { color: var(--text); }
.nav-item.active::after { transform: scaleX(1); }

.top-actions { display: flex; align-items: center; gap: 14px; padding-right: 24px; }
.home-link { color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.home-link:hover { color: var(--text); }
.streak-chip { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); font-size: 12px; color: #aab2bf; }
.streak-chip b { color: var(--text); }
.streak-flame { color: var(--orange); font-size: 11px; transform: rotate(45deg); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); cursor: pointer; }
.icon-button:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.04); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.workspace { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-height)); }
.sidebar { position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); display: flex; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: rgba(10, 13, 20, .72); overflow: hidden; }
.sidebar-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 8px 17px; }
.eyebrow { color: var(--accent); font: 700 10px/1.4 "Bahnschrift", sans-serif; letter-spacing: .18em; }
.sidebar-heading h2, .dialog-head h2 { margin: 2px 0 0; font-size: 18px; }
.count-badge { min-width: 26px; height: 22px; padding: 0 6px; display: grid; place-items: center; color: #8d97a7; background: #161c27; font: 700 11px "Barlow Condensed", sans-serif; }
.search-box { display: flex; align-items: center; gap: 8px; margin: 0 4px 17px; padding: 0 10px; height: 38px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.search-box:focus-within { border-color: rgba(69, 221, 255, .45); }
.search-box svg { width: 15px; fill: none; stroke: #717b8b; stroke-width: 1.6; }
.search-box input { flex: 1; min-width: 0; color: var(--text); background: none; border: 0; outline: 0; font-size: 12px; }
.search-box input::placeholder { color: #626b79; }
kbd { padding: 1px 5px; border: 1px solid #353c48; border-bottom-width: 2px; border-radius: 3px; color: #687180; font: 10px "Noto Sans SC"; }

.technique-list { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: #252c37 transparent; }
.technique-group { margin-bottom: 18px; }
.group-label { display: flex; align-items: center; gap: 8px; margin: 0 8px 7px; color: #596373; font: 700 10px "Barlow Condensed", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.group-label::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.045); }
.technique-item { width: 100%; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 6px; min-height: 39px; padding: 6px 8px; border: 0; border-left: 2px solid transparent; background: transparent; text-align: left; color: #858f9e; cursor: pointer; transition: .16s ease; }
.technique-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.technique-item.active { color: var(--text); border-left-color: var(--accent); background: linear-gradient(90deg, rgba(217,255,67,.1), rgba(217,255,67,.015)); }
.technique-item .number { color: #4e5868; font: 600 11px "Barlow Condensed", sans-serif; }
.technique-item .name { font-size: 12px; font-weight: 600; }
.technique-item .best { color: var(--accent); font: 700 11px "Barlow Condensed", sans-serif; }
.technique-item .chevron { font-size: 14px; color: #4f5969; }
.sidebar-foot { margin: 4px; padding: 14px 12px 2px; border-top: 1px solid var(--line); }
.weekly-copy { display: flex; justify-content: space-between; font-size: 11px; color: #778191; }
.weekly-copy b { color: var(--text); }
.mini-progress { height: 3px; margin: 9px 0 8px; background: #1f2631; }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .4s ease; }
.sidebar-foot small { color: #4f5866; font-size: 9px; }

.main-stage, .alternate-view { min-width: 0; padding: 30px 34px 40px; max-width: 1480px; width: 100%; margin: 0 auto; }
.technique-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: #687181; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.breadcrumb span:first-child { color: var(--cyan); }
.breadcrumb i { width: 16px; height: 1px; background: #424a56; }
.title-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.title-row h1, .alternate-heading h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; }
.level-badge { padding: 3px 8px; border: 1px solid rgba(217,255,67,.35); color: var(--accent); background: rgba(217,255,67,.07); font-size: 10px; font-weight: 700; }
.technique-header p { margin: 7px 0 0; color: #828c9c; font-size: 13px; }
.header-stats { display: flex; align-items: center; gap: 20px; padding-bottom: 3px; }
.header-stats div { min-width: 68px; }
.header-stats small { display: block; color: #667080; font-size: 9px; letter-spacing: .08em; }
.header-stats b { display: block; margin-top: 2px; font: 700 24px "Barlow Condensed", sans-serif; }
.header-stats span { width: 1px; height: 34px; background: var(--line); }

.trainer-grid { display: grid; grid-template-columns: minmax(580px, 1fr) 280px; gap: 18px; }
.trainer-panel, .score-card, .feedback-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17,23,34,.96), rgba(10,14,21,.96)); box-shadow: 0 18px 55px rgba(0,0,0,.16); }
.trainer-panel { min-width: 0; }
.panel-topline { display: flex; justify-content: space-between; align-items: center; height: 50px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.status-dot { display: flex; align-items: center; gap: 8px; color: #8791a0; font-size: 11px; }
.status-dot i { width: 6px; height: 6px; border-radius: 50%; background: #616a78; box-shadow: 0 0 0 3px rgba(97,106,120,.11); }
.status-dot.running i { background: var(--accent); box-shadow: 0 0 0 3px rgba(217,255,67,.12), 0 0 16px rgba(217,255,67,.45); animation: pulse 1s infinite; }
.status-dot.demo i { background: var(--cyan); box-shadow: 0 0 0 3px rgba(69,221,255,.12); }
.practice-controls { display: flex; align-items: center; gap: 8px; }
.loop-button { min-height: 29px; display: flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid rgba(255,255,255,.07); color: #6d7888; background: #090d14; font: 600 10px "Barlow Condensed", sans-serif; cursor: pointer; }
.loop-button .loop-icon { font-size: 15px; }
.loop-button b { padding-left: 7px; border-left: 1px solid rgba(255,255,255,.09); color: #8b96a5; font-size: 9px; }
.loop-button.active { color: var(--accent); border-color: rgba(217,255,67,.28); background: rgba(217,255,67,.07); }
.speed-selector { display: flex; gap: 2px; padding: 3px; background: #090d14; border: 1px solid rgba(255,255,255,.05); }
.speed-selector button { border: 0; padding: 5px 9px; color: #697383; background: transparent; font: 600 10px "Barlow Condensed", sans-serif; cursor: pointer; }
.speed-selector button.active { color: #10130d; background: var(--accent); }

.focus-zone { position: relative; min-height: 535px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 32px 32px; }
.focus-zone::before { content: ""; position: absolute; width: 320px; height: 220px; top: 30px; background: radial-gradient(ellipse, rgba(69,221,255,.09), transparent 66%); pointer-events: none; }
.drive-scene { position: relative; z-index: 1; width: min(620px, calc(100% - 36px)); height: 280px; margin: 18px auto 14px; overflow: hidden; border: 1px solid #293342; background: #14251f; box-shadow: inset 0 0 40px rgba(0,0,0,.35); }
.drive-scene canvas { display: block; width: 100%; height: 100%; }
.drive-hud { position: absolute; z-index: 2; top: 9px; left: 9px; right: 9px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.drive-hud-left { display: grid; gap: 4px; }
.drive-hud-left span { width: fit-content; padding: 4px 7px; color: #e6f0f4; background: rgba(5,9,14,.78); font-size: 11px; }
.drive-hud-left span:first-child { color: var(--accent); font-weight: 700; }
.drive-hud b { color: #fff; font: 700 26px "Barlow Condensed", sans-serif; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.drive-hud small { color: var(--accent); font-size: 10px; }
.drive-resources { position: absolute; z-index: 2; left: 10px; bottom: 29px; width: 124px; display: grid; gap: 5px; padding: 8px; background: rgba(5,9,14,.77); pointer-events: none; }
.drive-resources > div > span { display: flex; justify-content: space-between; gap: 6px; color: #b8cbd5; font-size: 10px; }
.drive-resources b { color: #fff; font-weight: 700; }
.drive-resources i { display: block; height: 4px; margin-top: 3px; background: rgba(255,255,255,.19); }
.drive-resources em { display: block; width: 0; height: 100%; background: #61e1ff; transition: width .12s linear; }
.drive-resources > div:nth-child(2) em { background: var(--accent); }
.drive-scene.offroad { border-color: #ff6262; }
.drive-legend { position: absolute; z-index: 2; left: 5px; right: 5px; bottom: 5px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.drive-legend span { padding: 2px 5px; color: #d4e2e8; background: rgba(5,9,14,.78); font-size: 9px; }
.next-cue { position: relative; z-index: 1; text-align: center; margin: 0 0 15px; }
.next-cue span { display: block; color: #626d7d; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.next-cue strong { display: block; margin-top: 4px; font-size: 17px; }
.next-cue small { display: block; height: 16px; margin-top: 2px; color: var(--accent); font: 600 10px "Barlow Condensed", sans-serif; }
.countdown { position: absolute; z-index: 5; inset: 0; display: none; place-items: center; background: rgba(7,10,16,.8); backdrop-filter: blur(5px); color: var(--accent); font: 800 96px "Barlow Condensed", sans-serif; text-shadow: 0 0 40px rgba(217,255,67,.3); }
.countdown.show { display: grid; }

.keyboard { position: relative; display: flex; align-items: stretch; gap: 18px; }
.direction-cluster { display: grid; grid-template-columns: repeat(3, 66px); grid-template-rows: repeat(2, 58px); gap: 7px; }
.action-cluster { display: grid; grid-template-columns: repeat(4, 62px); gap: 7px; }
.key-spacer { width: 66px; }
.keycap { position: relative; overflow: hidden; border: 1px solid #303846; border-bottom: 3px solid #262d38; background: linear-gradient(150deg, #1b2330, #111721); cursor: default; transition: transform .05s, border-color .12s, color .12s, box-shadow .12s; }
.keycap::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.035); pointer-events: none; }
.keycap small { display: block; color: #606a7a; font-size: 8px; letter-spacing: .08em; }
.keycap b { display: block; margin-top: 1px; font: 700 21px "Bahnschrift", sans-serif; }
.keycap em { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 2px; background: transparent; }
.keycap.active { transform: translateY(2px); border-color: var(--accent); border-bottom-width: 1px; color: var(--accent); background: linear-gradient(150deg, rgba(217,255,67,.18), #121912); box-shadow: 0 0 22px rgba(217,255,67,.1); }
.keycap.active em { background: var(--accent); }
.keycap.expected { border-color: rgba(69,221,255,.7); box-shadow: 0 0 18px rgba(69,221,255,.12); }
.action-key { min-height: 123px; }
.action-key b { margin-top: 7px; font-size: 22px; }
.focus-hint { margin: 17px 0 0; color: #596373; font-size: 9px; }
.focus-hint span { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #39414e; }

.timeline-section { padding: 19px 22px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(5,8,13,.32); }
.timeline-meta { display: flex; justify-content: space-between; align-items: center; color: #8791a1; font-size: 10px; }
.timeline-meta > span { font-weight: 600; letter-spacing: .06em; }
.timeline-meta div { font: 600 11px "Barlow Condensed", sans-serif; }
.timeline-meta b { color: var(--text); font-size: 14px; }
.timeline-meta small { color: #3e4652; }
.timeline-track { position: relative; height: 64px; margin-top: 6px; }
.track-line { position: absolute; top: 31px; left: 0; right: 0; height: 2px; background: #262d37; overflow: hidden; }
.track-line i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--accent)); box-shadow: 0 0 10px var(--accent); transition: width .03s linear; }
.timeline-events { position: absolute; inset: 0; }
.event-marker { position: absolute; top: 24px; transform: translateX(-50%); width: 16px; height: 16px; display: grid; place-items: center; border: 2px solid #414a57; border-radius: 50%; background: #111722; color: #778190; font: 700 7px "Barlow Condensed", sans-serif; transition: .15s; }
.event-marker.down { border-radius: 3px; transform: translateX(-50%) rotate(45deg); }
.event-marker.down b { transform: rotate(-45deg); }
.event-marker.next { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(69,221,255,.25); }
.event-marker.hit { border-color: var(--accent); color: #0b0e09; background: var(--accent); box-shadow: 0 0 10px rgba(217,255,67,.22); }
.event-marker.missed { border-color: var(--red); color: var(--red); opacity: .75; }
.event-label { position: absolute; top: 1px; transform: translateX(-50%); color: #626c7c; font: 600 8px "Barlow Condensed", sans-serif; white-space: nowrap; }
.event-label.bottom { top: 49px; }
.timeline-legend { display: flex; gap: 14px; color: #535c6b; font-size: 8px; }
.timeline-legend span { display: flex; align-items: center; gap: 5px; }
.timeline-legend i { width: 7px; height: 7px; border: 1px solid #555f6d; }
.timeline-legend .legend-down { transform: rotate(45deg); }
.timeline-legend .legend-up { border-radius: 50%; }
.timeline-legend .legend-hit { border-color: var(--accent); background: var(--accent); }

.trainer-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; }
.primary-button, .secondary-button { min-height: 42px; border: 0; font-weight: 700; cursor: pointer; transition: transform .15s, filter .15s; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.1); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.primary-button { min-width: 170px; display: flex; align-items: center; justify-content: center; gap: 18px; clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); color: #10130b; background: var(--accent); font-size: 12px; }
.primary-button small { padding-left: 12px; border-left: 1px solid rgba(0,0,0,.25); font: 700 9px "Barlow Condensed", sans-serif; }
.primary-button.stop { color: #fff; background: var(--red); }
.primary-button.small { min-width: 110px; }
.secondary-button { min-width: 128px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #303844; background: #171e29; font-size: 11px; }
.secondary-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.insight-panel { display: flex; flex-direction: column; gap: 14px; }
.score-card { padding: 17px; }
.score-heading, .feedback-title { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; }
.score-heading small { color: #636d7d; font-size: 9px; font-weight: 500; }
.score-ring { --score: 0; width: 118px; height: 118px; margin: 17px auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--score) * 1%), #222936 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #10151f; box-shadow: inset 0 0 20px rgba(0,0,0,.4); }
.score-ring div { z-index: 1; text-align: center; }
.score-ring b { display: block; font: 800 36px/1 "Barlow Condensed", sans-serif; }
.score-ring small { color: #667080; font-size: 8px; letter-spacing: .1em; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric-grid div { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid small { display: block; color: #657080; font-size: 8px; }
.metric-grid b { display: block; margin-top: 2px; font: 700 16px "Barlow Condensed", sans-serif; }
.coach-card { display: flex; gap: 12px; padding: 14px; border: 1px solid rgba(69,221,255,.18); background: linear-gradient(135deg, rgba(69,221,255,.08), rgba(17,23,34,.8)); }
.coach-icon { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(69,221,255,.28); color: var(--cyan); }
.coach-card span { color: var(--cyan); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.coach-card p { margin: 5px 0 0; color: #8791a1; font-size: 10px; line-height: 1.65; }
.feedback-card { flex: 1; min-height: 178px; padding: 15px; }
.feedback-title button { border: 0; background: none; color: #596373; font-size: 9px; cursor: pointer; }
.feedback-list { max-height: 210px; margin-top: 10px; overflow: auto; }
.empty-feedback { height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #4e5766; font-size: 9px; }
.empty-feedback i { font-style: normal; font-size: 22px; color: #323a46; }
.feedback-item { display: grid; grid-template-columns: 7px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 9px; }
.feedback-item i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.feedback-item.good i { background: var(--cyan); }
.feedback-item.bad i { background: var(--red); }
.feedback-item span { color: #9ca5b3; }
.feedback-item b { color: #667080; font: 600 9px "Barlow Condensed", sans-serif; }

.alternate-heading { max-width: 680px; margin-bottom: 28px; }
.alternate-heading h1 { margin-top: 4px; }
.alternate-heading p { color: var(--muted); font-size: 13px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.library-card { position: relative; min-height: 160px; padding: 18px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, #111722, #0b0f17); cursor: pointer; }
.library-card::after { content: attr(data-index); position: absolute; right: 12px; bottom: -18px; color: rgba(255,255,255,.025); font: 800 88px "Barlow Condensed", sans-serif; }
.library-card:hover { border-color: rgba(217,255,67,.35); transform: translateY(-2px); }
.library-card .card-group { color: var(--cyan); font: 700 9px "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.library-card h3 { margin: 9px 0 7px; font-size: 18px; }
.library-card p { max-width: 85%; margin: 0; color: #747f8f; font-size: 10px; line-height: 1.65; }
.library-card .card-meta { position: absolute; left: 18px; bottom: 16px; color: #5e6878; font: 600 9px "Barlow Condensed", sans-serif; }
.record-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-card { padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.summary-card small { color: #687282; font-size: 10px; }
.summary-card b { display: block; margin-top: 5px; font: 800 32px "Barlow Condensed", sans-serif; }
.record-list { border: 1px solid var(--line); background: var(--panel); }
.record-row { display: grid; grid-template-columns: 1fr 110px 110px 80px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 11px; }
.record-row:last-child { border-bottom: 0; }
.record-row small { display: block; color: #606a79; font-size: 8px; }
.record-row b { font: 700 15px "Barlow Condensed", sans-serif; }
.record-row .rank { color: var(--accent); font-size: 20px; }

dialog { width: min(480px, calc(100vw - 30px)); padding: 0; border: 1px solid #303845; color: var(--text); background: #0e141e; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(3,5,9,.78); backdrop-filter: blur(5px); }
.settings-card { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.dialog-head .icon-button { font-size: 22px; }
.dialog-intro { color: #768091; font-size: 11px; line-height: 1.6; }
.binding-list { margin: 20px 0; border-top: 1px solid var(--line); }
.binding-row { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.binding-row span { font-size: 12px; }
.binding-button { min-width: 110px; height: 34px; padding: 0 12px; border: 1px solid #333c49; background: #171e2a; color: var(--text); font: 600 11px "Barlow Condensed", sans-serif; cursor: pointer; }
.binding-button.listening { color: var(--accent); border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; }
.text-button { border: 0; background: none; color: #778191; font-size: 11px; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; padding: 10px 16px; opacity: 0; transform: translate(-50%, 14px); pointer-events: none; border: 1px solid rgba(217,255,67,.25); background: #11180f; color: var(--accent); font-size: 11px; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eaf0f6;
  --line: rgba(25, 43, 67, .12);
  --muted: #6d7b8e;
  --text: #17243a;
  --accent: #749b00;
  --accent-soft: rgba(116, 155, 0, .1);
  --cyan: #087f9c;
  --orange: #b85f00;
  --red: #cc3850;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 75% -20%, rgba(44, 171, 205, .13), transparent 34%),
    radial-gradient(circle at 0 70%, rgba(145, 188, 15, .08), transparent 30%),
    var(--bg);
}

html[data-theme="light"] .noise { opacity: .018; }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .9); box-shadow: 0 5px 22px rgba(37, 55, 77, .05); }
html[data-theme="light"] .sidebar { background: rgba(248, 250, 253, .88); }
html[data-theme="light"] .streak-chip,
html[data-theme="light"] .search-box { background: rgba(255, 255, 255, .72); }
html[data-theme="light"] .count-badge { color: #647287; background: #e8edf4; }
html[data-theme="light"] .search-box svg { stroke: #708095; }
html[data-theme="light"] .search-box input::placeholder { color: #8794a5; }
html[data-theme="light"] kbd { color: #69778a; border-color: #cbd4df; background: #fff; }
html[data-theme="light"] .group-label { color: #77869a; }
html[data-theme="light"] .technique-item { color: #647287; }
html[data-theme="light"] .technique-item:hover { background: rgba(23, 46, 74, .045); }
html[data-theme="light"] .technique-item.active { background: linear-gradient(90deg, rgba(116,155,0,.12), rgba(116,155,0,.02)); }
html[data-theme="light"] .technique-item .number,
html[data-theme="light"] .technique-item .chevron { color: #99a4b2; }
html[data-theme="light"] .mini-progress { background: #dce3eb; }
html[data-theme="light"] .trainer-panel,
html[data-theme="light"] .score-card,
html[data-theme="light"] .feedback-card { background: linear-gradient(145deg, #fff, #f7f9fc); box-shadow: 0 18px 55px rgba(31, 49, 72, .08); }
html[data-theme="light"] .speed-selector { background: #edf1f5; }
html[data-theme="light"] .speed-selector button { color: #69788b; }
html[data-theme="light"] .speed-selector button.active { color: #fff; }
html[data-theme="light"] .loop-button { color: #69788b; border-color: #d7dfe7; background: #edf1f5; }
html[data-theme="light"] .loop-button b { border-left-color: #cbd5df; color: #748296; }
html[data-theme="light"] .loop-button.active { color: #668500; border-color: rgba(116,155,0,.3); background: rgba(217,255,67,.22); }
html[data-theme="light"] .drive-scene { border-color: #bcc9d4; box-shadow: inset 0 0 35px rgba(28,48,69,.14); }
html[data-theme="light"] .focus-zone {
  background-color: #fbfcfe;
  background-image: linear-gradient(rgba(20,45,75,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20,45,75,.035) 1px, transparent 1px);
}
html[data-theme="light"] .focus-zone::before { background: radial-gradient(ellipse, rgba(34,167,201,.11), transparent 66%); }
html[data-theme="light"] .countdown { background: rgba(246, 249, 252, .86); }
html[data-theme="light"] .keycap { color: #253750; border-color: #c7d1dc; border-bottom-color: #b5c0cc; background: linear-gradient(150deg, #fff, #edf2f7); box-shadow: 0 5px 13px rgba(37, 55, 78, .07); }
html[data-theme="light"] .keycap::before { border-color: rgba(21,45,72,.055); }
html[data-theme="light"] .keycap small { color: #7c8999; }
html[data-theme="light"] .keycap.active { color: #5b7900; background: linear-gradient(150deg, #f4ffd4, #e7f2c1); }
html[data-theme="light"] .timeline-section { background: rgba(238, 243, 248, .52); }
html[data-theme="light"] .track-line { background: #d6dee7; }
html[data-theme="light"] .event-marker { color: #6d7c8e; border-color: #aab6c4; background: #fff; }
html[data-theme="light"] .event-label { color: #65758a; }
html[data-theme="light"] .secondary-button { color: #2d3d52; border-color: #cad3de; background: #f5f7fa; }
html[data-theme="light"] .score-ring::after { background: #fff; }
html[data-theme="light"] .coach-card { background: linear-gradient(135deg, rgba(15,148,180,.09), rgba(255,255,255,.9)); }
html[data-theme="light"] .library-card { background: linear-gradient(145deg, #fff, #f4f7fa); box-shadow: 0 10px 34px rgba(31,49,72,.06); }
html[data-theme="light"] .library-card::after { color: rgba(23,36,58,.04); }
html[data-theme="light"] .summary-card,
html[data-theme="light"] .record-list { background: #fff; box-shadow: 0 10px 34px rgba(31,49,72,.05); }
html[data-theme="light"] dialog { color: var(--text); border-color: #cbd5e0; background: #fff; box-shadow: 0 30px 100px rgba(31,45,65,.25); }
html[data-theme="light"] dialog::backdrop { background: rgba(36, 50, 68, .34); }
html[data-theme="light"] .binding-button { color: #24354b; border-color: #c8d2de; background: #f3f6f9; }
html[data-theme="light"] .toast { color: #567500; border-color: rgba(116,155,0,.3); background: #f5ffda; }

@keyframes pulse { 50% { opacity: .45; } }

@media (max-width: 1080px) {
  :root { --sidebar-width: 220px; }
  .trainer-grid { grid-template-columns: 1fr; }
  .insight-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .score-card { grid-row: span 2; }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar-height: 64px; }
  /* backdrop-filter 会让 fixed 子元素错误地以顶栏为定位容器。 */
  .topbar { grid-template-columns: 1fr auto; backdrop-filter: none; }
  .brand { border-right: 0; }
  .main-nav { position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; height: 58px; justify-content: space-around; gap: 0; padding: 0; border-top: 1px solid var(--line); background: #0b0f17; }
  html[data-theme="light"] .main-nav { background: rgba(255, 255, 255, .97); box-shadow: 0 -8px 24px rgba(31,49,72,.08); }
  .nav-item { flex: 1; }
  .nav-item::after { top: 0; bottom: auto; }
  .streak-chip { display: none; }
  .home-link { display: none; }
  .workspace { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading, .sidebar-foot, .group-label { display: none; }
  .search-box { margin-bottom: 10px; }
  .technique-list { display: flex; gap: 7px; overflow-x: auto; }
  .technique-group { display: contents; }
  .technique-item { flex: 0 0 auto; width: auto; min-height: 34px; grid-template-columns: auto; padding: 7px 12px; border: 1px solid var(--line); }
  .technique-item .number, .technique-item .best, .technique-item .chevron { display: none; }
  .technique-item.active { border: 1px solid var(--accent); }
  .main-stage, .alternate-view { padding: 22px 14px 82px; }
  .technique-header { align-items: start; }
  .header-stats { display: none; }
  .trainer-grid { display: block; }
  .insight-panel { display: grid; margin-top: 14px; }
  .panel-topline { height: auto; min-height: 50px; gap: 8px; padding-block: 8px; }
  .practice-controls { flex-wrap: wrap; justify-content: flex-end; }
  .loop-button { order: 2; }
  .keyboard { transform: scale(.83); margin: -5px -45px; }
  .trainer-actions { justify-content: stretch; }
  .trainer-actions button { flex: 1; min-width: 0; }
  .library-grid { grid-template-columns: 1fr; }
  .record-summary { grid-template-columns: 1fr; }
  .record-row { grid-template-columns: 1fr 70px 65px; }
  .record-row > :nth-child(3) { display: none; }
}

@media (max-width: 480px) {
  .brand { padding-left: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 14px; }
  .top-actions { padding-right: 14px; }
  .title-row h1 { font-size: 28px; }
  .panel-topline { align-items: stretch; flex-direction: column; }
  .status-dot { min-height: 20px; }
  .practice-controls { width: 100%; flex-wrap: nowrap; justify-content: space-between; }
  .loop-button { order: 0; flex: 0 0 auto; padding-inline: 7px; }
  .loop-button b { display: none; }
  .speed-selector { flex: 1; justify-content: space-between; }
  .speed-selector button { flex: 1; padding-inline: 4px; }
  .keyboard { transform: scale(.67); margin: -20px -95px; }
  .focus-zone { min-height: 490px; }
  .drive-scene { width: calc(100% - 20px); height: 230px; margin-top: 10px; }
  .drive-legend { gap: 3px; }
  .drive-legend span { font-size: 8px; }
  .insight-panel { grid-template-columns: 1fr; }
  .score-card { grid-row: auto; }
  .timeline-section { padding-left: 12px; padding-right: 12px; }
}

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