@font-face {
  font-family: "Gotham Display";
  src: url("./Gotham-Black.otf") format("opentype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #07101c;
  --bg-deep: #030811;
  --panel: rgba(10, 22, 38, 0.92);
  --panel-strong: #0b2038;
  --panel-soft: rgba(13, 38, 65, 0.74);
  --line: rgba(167, 220, 255, 0.15);
  --line-strong: rgba(66, 174, 255, 0.34);
  --text: #edf8ff;
  --text-soft: #b7d2e6;
  --muted: #7696b3;
  --mint: #3faeff;
  --mint-strong: #79d7ff;
  --mint-deep: #1676c3;
  --amber: #9be7ff;
  --danger: #ff8fa8;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 21px;
  --radius-md: 15px;
  color-scheme: dark;
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 5%, rgba(18, 111, 214, 0.17), transparent 27rem),
    radial-gradient(circle at 4% 94%, rgba(13, 65, 140, 0.16), transparent 25rem),
    linear-gradient(150deg, #081421 0%, #050d18 48%, #0b1728 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 25px;
  padding: 0 6px;
  border: 1px solid rgba(110, 205, 255, 0.25);
  border-bottom-color: rgba(110, 205, 255, 0.42);
  border-radius: 6px;
  color: var(--mint);
  background: rgba(63, 174, 255, 0.1);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1800px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px clamp(22px, 3.7vw, 64px) 22px;
}

.topbar,
.bottom-bar,
.hero-card-topline,
.phase-heading,
.progress-meta,
.panel-heading,
.timeline-heading,
.control-label-row,
.hero-actions,
.bottom-actions,
.session-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  min-height: 42px;
}

.home-button {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid rgba(135, 218, 255, 0.3);
  border-radius: 12px;
  color: var(--text-soft);
  background: rgba(8, 29, 51, 0.82);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.training-topbar {
  display: none;
}

.home-button:hover {
  border-color: var(--mint-strong);
  color: var(--text);
  background: rgba(63, 174, 255, 0.14);
  transform: translateY(-1px);
}

.home-button-icon {
  color: var(--mint-strong);
  font-size: 20px;
  line-height: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(63, 174, 255, 0.58);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8f7ff, #218fff 48%, #0b2e53 50%);
  box-shadow: 0 0 26px rgba(33, 143, 255, 0.23);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  display: block;
  width: 29px;
  height: 9px;
  border: 1px solid rgba(3, 17, 33, 0.82);
  border-radius: 50%;
  transform: rotate(-28deg);
  content: "";
}

.brand-mark::before {
  top: 7px;
  left: 8px;
}

.brand-mark::after {
  top: 13px;
  left: 5px;
  transform: rotate(17deg);
}

.brand-mark span {
  top: 19px;
  left: 4px;
  transform: rotate(-18deg);
}

.brand-title,
.brand-subtitle,
.eyebrow,
.timer-note,
.hero-footnote,
.cadence-note,
.cue-title,
.cue-body,
.timeline-heading h2,
.panel-heading h2,
.bottom-bar p {
  margin: 0;
}

.brand-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  letter-spacing: 0.14em;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 22px;
}

.session-status {
  gap: 8px;
  color: var(--text-soft);
  font-size: 15px;
}

.status-dot,
.footer-pulse,
.footnote-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.is-live,
.footer-pulse {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(63, 174, 255, 0.1), 0 0 16px rgba(63, 174, 255, 0.76);
}

.status-dot.is-complete {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(154, 230, 255, 0.08), 0 0 14px rgba(154, 230, 255, 0.55);
}

.keyboard-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(280px, 0.73fr) minmax(280px, 0.73fr);
  gap: 16px;
  margin-top: 24px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(10, 22, 38, 0.97), rgba(4, 11, 21, 0.95));
  box-shadow: var(--shadow);
}

.panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(63, 174, 255, 0.075), transparent 33%);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.hero-card {
  display: flex;
  flex-direction: column;
  min-height: 496px;
  padding: clamp(25px, 3.2vw, 50px);
  border-color: rgba(63, 174, 255, 0.3);
  background:
    radial-gradient(circle at 93% 6%, rgba(63, 174, 255, 0.18), transparent 18rem),
    linear-gradient(145deg, rgba(8, 29, 51, 0.98), rgba(24, 13, 11, 0.97));
}

.hero-card::after {
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(63, 174, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(63, 174, 255, 0.024), 0 0 0 4rem rgba(63, 174, 255, 0.018);
  content: "";
  pointer-events: none;
}

.eyebrow {
  color: var(--mint-strong);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(15px, 0.7vw, 18px);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.session-label,
.phase-count,
.panel-status,
.guide-number,
.timeline-heading > span,
.control-help {
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(15px, 0.62vw, 18px);
  letter-spacing: 0.08em;
}

.phase-heading {
  align-items: flex-end;
  margin-top: clamp(38px, 6.2vh, 72px);
  gap: 18px;
}

.phase-heading h1 {
  max-width: 80%;
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 3.2vw, 54px);
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
}

.phase-count {
  padding-bottom: 5px;
  white-space: nowrap;
}

.real-time {
  display: none;
  align-items: center;
  justify-content: center;
  height: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0 16px;
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(17px, 1.05vw, 22px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.timer-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.03em, 0.065em, 0.09em);
  max-width: 100%;
  margin: clamp(28px, 3.4vh, 45px) 0 10px;
  color: var(--mint);
  font-family: "Gotham Display", "MiSans", "Microsoft YaHei", sans-serif;
  font-size: clamp(5rem, 7.6vw, 10rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0.028em;
  white-space: nowrap;
  line-height: 0.83;
  text-shadow: none;
}

#timerValue.is-long {
  font-size: clamp(4rem, 4.8vw, 7.8rem);
  letter-spacing: 0.018em;
  gap: clamp(0.02em, 0.045em, 0.07em);
}

.timer-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 1.8em;
  width: 1.8em;
  letter-spacing: 0;
}

.timer-digit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
  letter-spacing: 0;
}

.timer-separator {
  display: inline-flex;
  flex: 0 0 0.22em;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  width: 0.22em;
  color: currentColor;
}

.timer-separator i {
  display: block;
  width: 0.12em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
}

.timer-group[hidden],
.timer-separator[hidden] {
  display: none;
}

.timer-note {
  min-height: 20px;
  color: var(--text-soft);
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.6;
}

.immersive-cadence {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 28px;
  color: var(--text-soft);
  font-size: clamp(15px, 0.9vw, 20px);
}

.immersive-cadence-label {
  color: var(--muted);
}

.immersive-cadence strong {
  color: var(--mint);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

.immersive-cadence-unit {
  color: var(--text-soft);
  font-size: 15px;
}

.immersive-divider {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: var(--line);
}

.immersive-cadence #immersiveBeatStatus {
  color: var(--mint-strong);
}

.progress-wrap {
  margin-top: auto;
  padding-top: 36px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(134, 211, 255, 0.13);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint-deep), var(--mint));
  box-shadow: 0 0 18px rgba(63, 174, 255, 0.58);
  transition: width 180ms linear;
}

.progress-meta {
  margin-top: 10px;
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.hero-actions {
  justify-content: flex-start;
  gap: 10px;
  margin-top: 25px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.utility-button:hover,
.duration-option:hover,
.segmented-control button:hover {
  transform: translateY(-1px);
}

.button-primary {
  min-width: 163px;
  color: #031322;
  background: var(--mint);
  box-shadow: 0 8px 24px rgba(25, 137, 255, 0.23);
  font-size: 15px;
  font-weight: 800;
}

.button-primary:hover {
  background: #8cdeff;
  box-shadow: 0 11px 28px rgba(25, 137, 255, 0.34);
}

.button-primary kbd {
  color: #06325a;
  border-color: rgba(107, 50, 26, 0.27);
  background: rgba(121, 51, 20, 0.12);
}

.button-symbol {
  font-size: 15px;
}

.button-secondary {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 15px;
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.hero-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 15px;
}

.footnote-dot {
  width: 5px;
  height: 5px;
  background: var(--mint-strong);
}

.cadence-card,
.guide-card {
  display: flex;
  flex-direction: column;
  min-height: 496px;
  padding: clamp(23px, 2.5vw, 36px);
}

.panel-heading {
  align-items: flex-start;
}

.panel-heading h2,
.timeline-heading h2 {
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 650;
  letter-spacing: -0.05em;
}

.panel-status {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  white-space: nowrap;
}

.panel-status.is-live {
  color: var(--mint);
  border-color: rgba(63, 174, 255, 0.34);
  background: rgba(63, 174, 255, 0.1);
}

.cadence-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: min(22vw, 266px);
  aspect-ratio: 1;
  margin: clamp(24px, 4.3vh, 50px) auto 22px;
  isolation: isolate;
}

.orb-halo,
.orb-ring,
.orb-core {
  position: absolute;
  border-radius: 50%;
}

.orb-halo {
  inset: 4%;
  border: 1px solid rgba(63, 174, 255, 0.1);
  transition: transform 120ms ease, opacity 120ms ease;
}

.orb-halo-one {
  inset: -6%;
}

.orb-halo-two {
  inset: -17%;
  border-color: rgba(63, 174, 255, 0.07);
}

.orb-ring {
  inset: 13%;
  border: 1px solid rgba(63, 174, 255, 0.32);
  background: radial-gradient(circle at 35% 28%, rgba(63, 174, 255, 0.18), rgba(63, 174, 255, 0.01) 58%, transparent 60%);
  box-shadow: inset 0 0 30px rgba(63, 174, 255, 0.05), 0 0 38px rgba(63, 174, 255, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.orb-core {
  inset: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(63, 174, 255, 0.42);
  background: radial-gradient(circle at 50% 35%, rgba(63, 174, 255, 0.2), rgba(19, 75, 128, 0.28) 56%, rgba(3, 12, 23, 0.94) 100%);
  box-shadow: 0 0 30px rgba(63, 174, 255, 0.16), inset 0 0 28px rgba(63, 174, 255, 0.1);
}

.orb-core strong {
  color: var(--mint);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(31px, 3.2vw, 52px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.orb-core span {
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.cadence-orb.is-pulsing .orb-halo-one {
  opacity: 0.8;
  transform: scale(1.1);
}

.cadence-orb.is-pulsing .orb-halo-two {
  opacity: 0.65;
  transform: scale(1.07);
}

.cadence-orb.is-pulsing .orb-ring {
  border-color: rgba(63, 174, 255, 0.7);
  box-shadow: inset 0 0 30px rgba(63, 174, 255, 0.11), 0 0 45px rgba(63, 174, 255, 0.24);
  transform: scale(1.035);
}

.cadence-orb.is-pulsing .orb-core {
  box-shadow: 0 0 42px rgba(63, 174, 255, 0.29), inset 0 0 28px rgba(63, 174, 255, 0.15);
  transform: scale(1.025);
}

.beat-meter {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
  width: min(100%, 230px);
  margin: 0 auto;
}

.beat-meter span {
  height: 3px;
  border-radius: 99px;
  background: rgba(63, 174, 255, 0.18);
  transition: background 120ms ease, box-shadow 120ms ease;
}

.beat-meter span.is-active {
  background: var(--mint);
  box-shadow: 0 0 10px rgba(63, 174, 255, 0.78);
}

.cadence-note {
  min-height: 37px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.control-group {
  margin-top: auto;
  padding-top: 24px;
}

.control-label-row {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 15px;
}

.control-help {
  color: var(--muted);
  font-size: 15px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(3, 11, 20, 0.46);
}

.segmented-control button,
.duration-option {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.segmented-control button {
  height: 35px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}

.segmented-control button.is-selected {
  color: #05111f;
  background: var(--mint);
  box-shadow: 0 4px 14px rgba(63, 174, 255, 0.24);
  font-weight: 800;
}

.guide-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(72, 185, 255, 0.16), transparent 16rem),
    linear-gradient(145deg, rgba(8, 28, 49, 0.97), rgba(4, 14, 26, 0.95));
}

.guide-number {
  color: var(--amber);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.cue-content {
  min-height: 150px;
  margin-top: clamp(32px, 5vh, 55px);
}

.cue-title {
  max-width: 15em;
  color: var(--amber);
  font-size: clamp(24px, 2.15vw, 36px);
  font-weight: 650;
  letter-spacing: -0.07em;
  line-height: 1.12;
}

.cue-body {
  max-width: 28em;
  margin-top: 17px;
  color: var(--text-soft);
  font-size: clamp(15px, 1.05vw, 20px);
  line-height: 1.8;
}

.tip-list {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tip-list div {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-soft);
  font-size: 15px;
}

.tip-list span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(154, 230, 255, 0.25);
  border-radius: 6px;
  color: var(--amber);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}

.duration-group {
  padding-top: 19px;
}

.duration-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.duration-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 57px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.duration-option strong {
  color: var(--text-soft);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.duration-option span {
  margin-top: 5px;
  font-size: 15px;
}

.duration-option.is-selected {
  border-color: rgba(154, 230, 255, 0.42);
  background: rgba(154, 230, 255, 0.09);
}

.duration-option.is-selected strong,
.duration-option.is-selected span {
  color: var(--amber);
}

.timeline-card {
  margin-top: 16px;
  padding: 20px clamp(22px, 2.5vw, 38px) 24px;
  border-radius: var(--radius-lg);
  background: rgba(5, 18, 32, 0.82);
}

.timeline-heading {
  align-items: flex-end;
}

.timeline-heading h2 {
  margin-top: 6px;
  font-size: 18px;
}

.timeline-heading > span {
  padding-bottom: 2px;
}

.timeline {
  display: flex;
  gap: 8px;
  height: 64px;
  margin-top: 17px;
}

.timeline-segment {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 92px;
  padding: 11px 13px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.timeline-segment::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  opacity: 0.42;
  background: var(--phase-color, var(--mint));
}

.timeline-segment.is-current {
  border-color: color-mix(in srgb, var(--phase-color, var(--mint)) 44%, transparent);
  background: color-mix(in srgb, var(--phase-color, var(--mint)) 9%, rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 10px 26px rgba(0, 0, 0, 0.12);
}

.timeline-segment.is-done {
  opacity: 0.55;
}

.timeline-segment p,
.timeline-segment span {
  margin: 0;
}

.timeline-segment p {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 650;
}

.timeline-segment span {
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}

.bottom-bar {
  min-height: 40px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 15px;
}

.bottom-bar p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-pulse {
  width: 5px;
  height: 5px;
}

.copyright {
  color: var(--muted);
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.bottom-actions {
  gap: 8px;
}

@media (min-width: 1181px) {
  .hero-card .progress-wrap {
    position: relative;
    top: clamp(12px, 1.35vh, 22px);
  }

  .guide-card .tip-list {
    position: relative;
    top: clamp(18px, 2vh, 32px);
  }
}

.utility-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.utility-button:hover {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.utility-icon {
  color: var(--mint-strong);
  font-size: 15px;
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  z-index: 5;
  max-width: min(90vw, 500px);
  padding: 12px 18px;
  border: 1px solid rgba(63, 174, 255, 0.34);
  border-radius: 11px;
  color: var(--text);
  background: rgba(5, 22, 40, 0.94);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 训练开始后切换为沉浸式单屏，只保留阶段、倒计时、进度和暂停入口。 */
body.is-running {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 111, 214, 0.12), transparent 34rem),
    linear-gradient(150deg, #06111f 0%, #030910 52%, #07192c 100%);
}

body.is-running .app-shell {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

body.is-running .topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  height: clamp(62px, 8vh, 96px);
  min-height: 0;
  padding: clamp(14px, 2.4vh, 28px) clamp(20px, 3.2vw, 64px);
}

body.is-running .brand-lockup {
  display: none;
}

body.is-running .training-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  position: fixed;
  top: clamp(14px, 2.4vh, 28px);
  left: clamp(20px, 3.2vw, 64px);
  z-index: 12;
}

body.is-running .home-button {
  display: inline-flex;
  position: static;
  height: 46px;
}

body.is-running .brand-subtitle,
body.is-running .keyboard-hint,
body.is-running .session-status,
body.is-running .session-label,
body.is-running .phase-count,
body.is-running .hero-footnote,
body.is-running .cadence-card,
body.is-running .guide-card,
body.is-running .timeline-card,
body.is-running .bottom-bar {
  display: none;
}

body.is-running .dashboard {
  flex: 1;
  min-height: 0;
  display: block;
  height: 100%;
  margin-top: 0;
}

body.is-running .hero-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: clamp(92px, 11vh, 142px) clamp(28px, 6vw, 160px) clamp(28px, 5vh, 64px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-color: transparent;
  background:
    radial-gradient(circle at 50% 35%, rgba(63, 174, 255, 0.12), transparent 32rem),
    linear-gradient(145deg, rgba(7, 27, 48, 0.98), rgba(3, 10, 18, 0.98));
  text-align: center;
}

body.is-running .hero-card::after {
  right: 50%;
  bottom: -28vmin;
  width: 66vmin;
  height: 66vmin;
  border-color: rgba(63, 174, 255, 0.2);
  box-shadow:
    0 0 0 1.4rem rgba(63, 174, 255, 0.055),
    0 0 0 3.5rem rgba(63, 174, 255, 0.035),
    0 0 90px rgba(63, 174, 255, 0.16);
  opacity: 0.72;
  transform: translateX(50%);
  animation: orbit-breathe 5.8s ease-in-out infinite;
}

body.is-running .hero-card::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(63, 174, 255, 0.16), transparent 22rem),
    radial-gradient(circle at 50% 42%, transparent 25%, rgba(63, 174, 255, 0.08) 25.2%, transparent 25.8%),
    radial-gradient(circle at 50% 42%, transparent 42%, rgba(63, 174, 255, 0.045) 42.2%, transparent 42.8%);
  animation: ambient-breathe 4.6s ease-in-out infinite;
}

body.is-running .hero-card-topline {
  justify-content: center;
  width: 100%;
}

body.is-running .phase-heading {
  flex-direction: column;
  align-items: center;
  margin-top: clamp(26px, 5vh, 68px);
  gap: 0;
}

body.is-running .phase-heading h1 {
  max-width: none;
  font-size: clamp(38px, 5vw, 82px);
}

body.is-running .real-time {
  display: flex;
  height: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0 16px;
  color: var(--text-soft);
  font-size: clamp(18px, 1.25vw, 24px);
  letter-spacing: 0.1em;
}

body.is-running .timer-wrap {
  margin-top: clamp(18px, 3.1vh, 44px);
  font-size: clamp(6.5rem, 17vw, 24rem);
  letter-spacing: 0.043em;
  line-height: 0.78;
}

body.is-running #timerValue.is-long {
  font-size: clamp(4.8rem, 11vw, 15rem);
  letter-spacing: 0.023em;
  gap: clamp(0.02em, 0.045em, 0.07em);
}

body.is-running .timer-wrap::before,
body.is-running .timer-wrap::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  border: 1px solid rgba(63, 174, 255, 0.16);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

body.is-running .timer-wrap::before {
  width: min(72vw, 74rem);
  aspect-ratio: 1;
  box-shadow: 0 0 70px rgba(63, 174, 255, 0.08), inset 0 0 70px rgba(63, 174, 255, 0.04);
  animation: timer-ring-breathe 4.2s ease-in-out infinite;
}

body.is-running .timer-wrap::after {
  width: min(46vw, 48rem);
  aspect-ratio: 1;
  border-color: rgba(135, 218, 255, 0.12);
  box-shadow: 0 0 46px rgba(63, 174, 255, 0.1);
  animation: timer-ring-breathe 3.2s ease-in-out -1.1s infinite reverse;
}

body.is-running .timer-wrap > * {
  position: relative;
  z-index: 1;
}

body.is-running .timer-note {
  margin-top: clamp(22px, 3.5vh, 42px);
  font-size: clamp(15px, 1.2vw, 21px);
}

body.is-running .immersive-cadence {
  display: flex;
}

body.is-running .progress-wrap {
  width: min(1180px, 100%);
  margin-top: clamp(34px, 6vh, 86px);
  padding-top: 0;
}

body.is-running .progress-track {
  height: 14px;
  border: 1px solid rgba(135, 218, 255, 0.24);
  background: rgba(130, 208, 255, 0.15);
  box-shadow: 0 0 28px rgba(63, 174, 255, 0.12);
  animation: progress-breathe 3.8s ease-in-out infinite;
}

body.is-running .progress-meta {
  margin-top: 14px;
  color: rgba(203, 236, 255, 0.75);
  font-size: clamp(15px, 0.9vw, 20px);
}

body.is-running .hero-actions {
  justify-content: center;
  margin-top: clamp(30px, 5vh, 60px);
}

body.is-running .hero-actions .button-secondary {
  display: none;
}

body.is-running .button-primary {
  min-width: 210px;
  height: 60px;
  font-size: 16px;
}

body.is-running .status-dot {
  animation: live-blink 1.8s ease-in-out infinite;
}

body.is-paused .status-dot {
  animation: none;
  opacity: 0.68;
}

@keyframes live-blink {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(63, 174, 255, 0.07), 0 0 10px rgba(63, 174, 255, 0.48);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(63, 174, 255, 0.025), 0 0 18px rgba(63, 174, 255, 0.86);
  }
}

@keyframes ambient-breathe {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@keyframes orbit-breathe {
  0%,
  100% {
    opacity: 0.48;
    transform: translateX(50%) scale(0.94);
  }
  50% {
    opacity: 0.9;
    transform: translateX(50%) scale(1.06);
  }
}

@keyframes timer-ring-breathe {
  0%,
  100% {
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(0.86);
  }
  50% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes progress-breathe {
  0%,
  100% {
    box-shadow: 0 0 22px rgba(63, 174, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 34px rgba(63, 174, 255, 0.28);
  }
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  }

  .guide-card {
    grid-column: 1 / -1;
    min-height: 300px;
  }

  .guide-card .cue-content {
    min-height: 0;
    margin-top: 26px;
  }

  .guide-card .tip-list {
    grid-template-columns: repeat(3, 1fr);
    margin-top: auto;
  }

  .guide-card .duration-group {
    max-width: 420px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 17px 14px 16px;
  }

  .topbar-tools {
    gap: 0;
  }

  .keyboard-hint {
    display: none;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
    margin-top: 17px;
  }

  .hero-card,
  .cadence-card,
  .guide-card {
    min-height: 0;
  }

  .hero-card {
    min-height: 475px;
    padding: 24px 21px;
  }

  .phase-heading {
    margin-top: 43px;
  }

  .timer-wrap {
    margin-top: 34px;
    font-size: clamp(5.5rem, 24vw, 9rem);
  }

  .cadence-card {
    min-height: 460px;
    padding: 24px 21px;
  }

  .cadence-orb {
    width: min(62vw, 266px);
    margin-top: 43px;
  }

  .guide-card {
    padding: 24px 21px;
  }

  .guide-card .tip-list {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    padding: 20px 18px;
  }

  .timeline {
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .timeline-segment {
    flex: 1 0 130px !important;
  }

  .bottom-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
  }
}

/* 手机训练态优先使用横屏：横屏锁定成功时直接铺满，锁定不可用时保留可读的旋转提示。 */
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  body.is-running .training-topbar {
    top: max(8px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    gap: 8px;
  }

  body.is-running .home-button {
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
  }

  body.is-running .home-button-icon {
    font-size: 18px;
  }

  body.is-running .real-time {
    height: 38px;
    min-height: 38px;
    padding: 0 8px;
    font-size: clamp(12px, 2.4vw, 18px);
    letter-spacing: 0.02em;
  }

  body.is-running .hero-card {
    padding: max(48px, calc(env(safe-area-inset-top) + 42px))
      max(14px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  body.is-running .hero-card-topline {
    display: none;
  }

  body.is-running .phase-heading {
    margin-top: 0;
  }

  body.is-running .phase-heading h1 {
    font-size: clamp(26px, 5.5vw, 44px);
  }

  body.is-running .timer-wrap {
    margin-top: clamp(6px, 1.5vh, 12px);
    font-size: clamp(3.5rem, 17vw, 7rem);
    line-height: 0.72;
  }

  body.is-running #timerValue.is-long {
    font-size: clamp(3rem, 10vw, 5.8rem);
  }

  body.is-running .timer-note {
    margin-top: clamp(6px, 1.5vh, 13px);
    font-size: clamp(12px, 2.2vw, 17px);
  }

  body.is-running .immersive-cadence {
    gap: 7px;
    margin-top: clamp(7px, 1.6vh, 14px);
    font-size: clamp(12px, 1.9vw, 16px);
  }

  body.is-running .immersive-cadence strong {
    font-size: clamp(19px, 3.5vw, 28px);
  }

  body.is-running .immersive-cadence-unit {
    font-size: 12px;
  }

  body.is-running .immersive-divider {
    height: 16px;
    margin: 0 3px;
  }

  body.is-running .progress-wrap {
    width: min(92vw, 720px);
    margin-top: clamp(8px, 1.8vh, 17px);
  }

  body.is-running .progress-track {
    height: 9px;
  }

  body.is-running .progress-meta {
    margin-top: 7px;
    font-size: clamp(12px, 1.8vw, 16px);
  }

  body.is-running .hero-actions {
    margin-top: clamp(8px, 1.8vh, 17px);
  }

  body.is-running .button-primary {
    min-width: 160px;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  body.is-running .button-primary kbd {
    min-width: 24px;
    height: 22px;
    font-size: 12px;
  }
}

@media (orientation: portrait) and (max-width: 900px) and (pointer: coarse) {
  body.is-running::after {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--text);
    background: rgba(3, 9, 16, 0.94);
    content: "请将手机横向旋转后使用";
    font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: clamp(22px, 6vw, 34px);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
  }
}

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