:root {
  color-scheme: dark;
  --car-stage-min-height: 520px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #080a0f;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(20, 184, 166, 0.14), transparent 30%),
    linear-gradient(160deg, #06080d 0%, #111827 52%, #07111f 100%);
}

.shell {
  width: min(1880px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 28px 24px;
  display: grid;
  grid-template-rows: auto auto auto minmax(var(--car-stage-min-height), 1fr) auto;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.player {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.4fr) auto;
  align-items: center;
  gap: 16px;
}

.primary-playback,
.player-tools,
.delay-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-playback {
  gap: 12px;
}

.play-button,
.stop-button {
  min-height: 72px;
  min-width: 168px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  font-size: 28px;
  letter-spacing: 0;
  box-shadow: 0 18px 46px rgba(8, 13, 23, 0.42);
}

.play-button {
  color: #06231f;
  background: #5eead4;
}

.play-button:hover {
  background: #99f6e4;
}

.stop-button {
  color: #fee2e2;
  background: #991b1b;
  border-color: rgba(248, 113, 113, 0.52);
}

.stop-button:hover {
  background: #b91c1c;
}

button:disabled,
button:disabled:hover {
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.78);
  border-color: #334155;
  cursor: default;
  box-shadow: none;
}

.audio-strip {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.now-playing {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.now-playing-label {
  flex: 0 0 auto;
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.now-playing-title {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 780;
}

.delay-control {
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: rgba(8, 13, 23, 0.72);
}

.delay-control button {
  min-height: 32px;
  width: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

#delay-label {
  min-width: 82px;
  text-align: center;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.podcast-panel {
  display: grid;
  gap: 10px;
}

.program-drawer {
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  padding: 0;
}

.program-drawer summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #e5e7eb;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 760;
}

.program-drawer summary::-webkit-details-marker {
  display: none;
}

.program-drawer summary::after {
  content: "+";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #0f172a;
  background: #7dd3fc;
  font-size: 24px;
  line-height: 1;
}

.program-drawer[open] {
  padding-bottom: 12px;
}

.program-drawer[open] summary::after {
  content: "-";
}

.program-summary {
  min-width: 0;
  overflow: hidden;
  color: #94a3b8;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preset-button {
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid #1f2937;
}

.preset-button:hover {
  border-color: #14b8a6;
  background: rgba(15, 118, 110, 0.28);
}

.preset-name,
.preset-description {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-name {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 760;
  white-space: nowrap;
}

.preset-description {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.podcast-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.podcast-form input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #243244;
  border-radius: 8px;
  padding: 0 14px;
  color: #f8fafc;
  background: rgba(8, 13, 23, 0.78);
  font: inherit;
}

.podcast-form input:focus {
  border-color: #14b8a6;
  outline: 2px solid rgba(20, 184, 166, 0.18);
}

.podcast-meta {
  color: #9fb0c7;
  font-size: 15px;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 132px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.episode-button {
  width: 100%;
  height: 62px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid #1f2937;
}

.episode-button:hover {
  border-color: #14b8a6;
  background: rgba(15, 118, 110, 0.28);
}

.episode-title,
.episode-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-title {
  font-size: 15px;
  font-weight: 750;
}

.episode-detail {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 4px;
  color: #9fb0c7;
  font-size: 16px;
}

h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 760;
}

.status {
  min-width: 96px;
  text-align: center;
  color: #111827;
  background: #7dd3fc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
}

audio {
  width: min(760px, 100%);
  accent-color: #14b8a6;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #f8fafc;
  background: #0f766e;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #0d9488;
}

.lyric-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--car-stage-min-height);
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  padding: 38px 0;
}

.line-marker {
  position: absolute;
  left: 0;
  width: 4px;
  height: min(160px, 44%);
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 32px rgba(20, 184, 166, 0.42);
}

.current {
  width: min(1040px, calc(100% - 42px));
  margin-left: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.current-en,
.current-zh {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.12;
  text-wrap: balance;
}

.current-en {
  font-size: 64px;
  font-weight: 780;
}

.current-zh {
  color: #cbd5e1;
  font-size: 42px;
  font-weight: 650;
}

.recent {
  min-height: 150px;
}

.recent h2 {
  margin: 0 0 10px;
  color: #9fb0c7;
  font-size: 16px;
  font-weight: 650;
}

.recent ol {
  display: grid;
  gap: 8px;
  max-height: 180px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.recent li {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 0;
  border-top: 1px solid #172033;
  opacity: 0.72;
}

.recent .en {
  margin: 0;
  color: #e5e7eb;
  font-size: 17px;
  line-height: 1.35;
}

.recent .zh {
  margin: 0;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  :root {
    --car-stage-min-height: 330px;
  }

  .shell {
    padding: 18px;
  }

  .topbar,
  .player,
  .player-tools,
  .podcast-form {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .primary-playback {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .play-button,
  .stop-button {
    min-width: 0;
    min-height: 64px;
    font-size: 24px;
  }

  .delay-control {
    justify-content: space-between;
  }

  .lyric-stage {
    padding: 30px 0;
  }

  .current {
    width: calc(100% - 28px);
    margin-left: 28px;
  }

  .line-marker {
    width: 3px;
  }

  .recent li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .episode-list {
    grid-template-columns: 1fr;
    max-height: 160px;
  }

  .preset-list {
    grid-template-columns: 1fr;
  }

  .now-playing {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
  }

  .now-playing-title {
    font-size: 18px;
  }

  button,
  audio {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  :root {
    --car-stage-min-height: 600px;
  }

  .shell {
    padding-left: 34px;
    padding-right: 34px;
  }

  .current {
    width: min(1640px, calc(100% - 54px));
    margin-left: 54px;
  }

  .current-en {
    font-size: 82px;
  }

  .current-zh {
    font-size: 52px;
  }
}

@media (min-width: 1600px) and (min-height: 900px) {
  :root {
    --car-stage-min-height: 680px;
  }

  .current-en {
    font-size: 92px;
  }

  .current-zh {
    font-size: 58px;
  }
}
