/* ============================================================
   广播直播页
   ============================================================ */

body.page-radio {
  --accent: #f5a623;
  --accent-2: #ff7a45;
  --accent-soft: rgba(245, 166, 35, 0.12);
  --accent-line: rgba(245, 166, 35, 0.3);
  --on-accent: #231704;

  background:
    radial-gradient(1000px 700px at 78% -14%, rgba(245, 166, 35, 0.12), transparent 62%),
    radial-gradient(850px 620px at 2% 30%, rgba(74, 112, 255, 0.08), transparent 60%),
    var(--bg);
}

[data-theme="light"] body.page-radio {
  background:
    radial-gradient(980px 640px at 78% -14%, rgba(245, 166, 35, 0.17), transparent 60%),
    radial-gradient(760px 540px at 2% 30%, rgba(74, 112, 255, 0.07), transparent 58%),
    var(--bg);
}

.radio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.radio-stage {
  min-width: 0;
  animation: rise-in 720ms 80ms var(--ease) both;
}

/* ---------- 电台卡片 ---------- */

.radio-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: clamp(540px, calc(100dvh - var(--header-h) - 196px), 660px);
  padding: 22px 30px 19px;
  overflow: hidden;
  color: #f8f6f1;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.03), transparent 46%),
    #0e1016;
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
}

.radio-card::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  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: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 20%, transparent 82%);
  mask-image: radial-gradient(70% 70% at 50% 45%, #000 20%, transparent 82%);
}

[data-theme="light"] .radio-card {
  color: #211e19;
  background:
    radial-gradient(80% 70% at 50% 8%, rgba(255, 255, 255, 0.8), transparent 58%),
    linear-gradient(150deg, #fffaf0, #f4ebdb);
  border-color: rgba(94, 70, 32, 0.12);
}

[data-theme="light"] .radio-card::after {
  background-image:
    linear-gradient(rgba(74, 58, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 58, 32, 0.035) 1px, transparent 1px);
}

.radio-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 52% at 50% 36%, rgba(245, 166, 35, 0.17), transparent 68%),
    radial-gradient(30% 42% at 88% 16%, rgba(255, 104, 68, 0.1), transparent 70%),
    radial-gradient(30% 44% at 10% 78%, rgba(72, 105, 255, 0.09), transparent 70%);
}

[data-theme="light"] .radio-ambient {
  background:
    radial-gradient(42% 52% at 50% 36%, rgba(245, 166, 35, 0.25), transparent 66%),
    radial-gradient(30% 42% at 88% 16%, rgba(255, 104, 68, 0.09), transparent 70%),
    radial-gradient(30% 44% at 10% 78%, rgba(72, 105, 255, 0.07), transparent 70%);
}

.radio-watermark {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 0;
  font-family: var(--font-mono);
  font-size: clamp(78px, 12vw, 168px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.08em;
  color: rgba(255, 255, 255, 0.022);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  -webkit-user-select: none;
  user-select: none;
}

[data-theme="light"] .radio-watermark {
  color: rgba(90, 67, 31, 0.045);
}

.radio-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.radio-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 620;
  color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.radio-fav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.radio-fav .icon {
  width: 16px;
  height: 16px;
}

.radio-top__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-trigger--radio {
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.09);
}

.share-trigger--radio:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.radio-fav.is-favorite {
  color: #ffc247;
  background: rgba(255, 194, 71, 0.1);
  border-color: rgba(255, 194, 71, 0.22);
}

.radio-fav.is-favorite .icon {
  fill: currentColor;
}

[data-theme="light"] .radio-fav {
  color: rgba(40, 34, 24, 0.55);
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(70, 54, 28, 0.11);
}

[data-theme="light"] .radio-fav:hover {
  color: #211e19;
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .radio-fav.is-favorite {
  color: #b77900;
  background: rgba(245, 166, 35, 0.14);
  border-color: rgba(245, 166, 35, 0.28);
}

.radio-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0 0;
}

/* 电台封面与波纹 */

.radio-visual {
  position: relative;
  display: grid;
  width: clamp(176px, 20vw, 224px);
  aspect-ratio: 1;
  margin-bottom: 22px;
  place-items: center;
}

.radio-orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  animation: orbit 22s linear infinite;
  animation-play-state: paused;
}

.radio-orbit--one {
  border-style: dashed;
}

.radio-orbit--two {
  inset: -28px;
  border-color: rgba(255, 255, 255, 0.045);
  animation-duration: 34s;
  animation-direction: reverse;
}

.radio-orbit::after {
  position: absolute;
  top: 13%;
  right: 9%;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.8);
}

.radio-orbit--two::after {
  top: auto;
  right: auto;
  bottom: 10%;
  left: 16%;
  width: 4px;
  height: 4px;
  opacity: 0.7;
}

[data-theme="light"] .radio-orbit {
  border-color: rgba(80, 60, 25, 0.14);
}

[data-theme="light"] .radio-orbit--two {
  border-color: rgba(80, 60, 25, 0.08);
}

.radio-halo {
  position: absolute;
  width: 74%;
  height: 74%;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(54px);
  opacity: 0.18;
  transition: opacity 500ms ease;
}

.radio-card.is-playing .radio-halo {
  opacity: 0.3;
}

.radio-logo {
  position: relative;
  z-index: 1;
  width: 72%;
  aspect-ratio: 1;
  padding: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30%;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
  transition: transform 500ms var(--ease);
}

.radio-card.is-playing .radio-logo {
  animation: radio-breathe 5s ease-in-out infinite;
}

[data-theme="light"] .radio-logo {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(95, 71, 30, 0.13);
  box-shadow: 0 24px 54px rgba(96, 71, 28, 0.19);
}

.radio-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26%;
}

.radio-card.is-playing .radio-orbit {
  animation-play-state: running;
}

/* 文案 */

.radio-copy {
  text-align: center;
}

.radio-kicker {
  margin: 0 0 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--accent);
}

.radio-copy h2 {
  margin: 0;
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.radio-subtitle {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: 0.015em;
  color: rgba(255, 255, 255, 0.46);
}

[data-theme="light"] .radio-subtitle {
  color: rgba(47, 40, 28, 0.55);
}

/* 波形 */

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  margin: 18px 0 15px;
}

.waveform span {
  width: 3px;
  height: 14px;
  background: linear-gradient(to top, var(--accent-2), var(--accent));
  border-radius: 999px;
  opacity: 0.4;
  transform-origin: center;
  animation: radio-wave 1.1s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.waveform span:nth-child(3n + 1) { height: 10px; animation-delay: -0.2s; }
.waveform span:nth-child(3n + 2) { height: 24px; animation-delay: -0.6s; }
.waveform span:nth-child(3n + 3) { height: 17px; animation-delay: -0.85s; }
.waveform span:nth-child(4n + 2) { height: 31px; animation-delay: -0.4s; }
.waveform span:nth-child(5n + 4) { height: 12px; animation-delay: -0.75s; }
.waveform span:nth-child(7n + 3) { height: 20px; animation-delay: -0.55s; }
.waveform span:nth-child(11n + 6) { height: 35px; animation-delay: -0.15s; }

.radio-card.is-playing .waveform span {
  opacity: 0.92;
  animation-play-state: running;
}

/* 控制区 */

.radio-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100%, 430px);
  margin-top: 1px;
}

.radio-volume {
  display: flex;
  align-items: center;
  justify-self: start;
}

.radio-control-btn {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border-radius: 11px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.radio-control-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.radio-control-btn:active {
  transform: scale(0.94);
}

.radio-control-btn .icon {
  width: 19px;
  height: 19px;
}

[data-theme="light"] .radio-control-btn {
  color: rgba(50, 42, 28, 0.58);
}

[data-theme="light"] .radio-control-btn:hover {
  color: #211e19;
  background: rgba(70, 54, 28, 0.06);
}

.radio-volume-bar {
  --seek: 80%;
  width: 78px;
  height: 22px;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.radio-volume-bar::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.76) 0%,
    rgba(255, 255, 255, 0.76) var(--seek),
    rgba(255, 255, 255, 0.16) var(--seek),
    rgba(255, 255, 255, 0.16) 100%
  );
  border-radius: 999px;
}

.radio-volume-bar::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.radio-volume-bar::-moz-range-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
}

.radio-volume-bar::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -3.5px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.radio-volume-bar::-moz-range-thumb {
  width: 9px;
  height: 9px;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

[data-theme="light"] .radio-volume-bar::-webkit-slider-runnable-track {
  background: linear-gradient(
    90deg,
    rgba(65, 51, 28, 0.7) 0%,
    rgba(65, 51, 28, 0.7) var(--seek),
    rgba(65, 51, 28, 0.14) var(--seek),
    rgba(65, 51, 28, 0.14) 100%
  );
}

[data-theme="light"] .radio-volume-bar::-webkit-slider-thumb {
  background: #5e4b2e;
}

[data-theme="light"] .radio-volume-bar::-moz-range-thumb {
  background: #5e4b2e;
}

.radio-play {
  display: grid;
  width: 74px;
  height: 74px;
  padding: 0;
  place-items: center;
  justify-self: center;
  color: #261a04;
  background: linear-gradient(145deg, #ffc65c, var(--accent) 58%, #e58a07);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  box-shadow:
    0 18px 42px rgba(245, 166, 35, 0.27),
    0 0 0 9px rgba(245, 166, 35, 0.08);
  transition: transform 220ms var(--ease), box-shadow 220ms ease;
}

.radio-play:hover {
  box-shadow:
    0 22px 52px rgba(245, 166, 35, 0.37),
    0 0 0 13px rgba(245, 166, 35, 0.09);
  transform: scale(1.045);
}

.radio-play:active {
  transform: scale(0.97);
}

.radio-play .icon {
  width: 27px;
  height: 27px;
  margin-left: 3px;
}

.radio-play.is-playing .icon {
  margin-left: 0;
}

.radio-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.44);
  white-space: nowrap;
}

.radio-status .live-dot {
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.35);
}

.radio-status .live-dot::after {
  display: none;
}

.radio-card.is-playing .radio-status {
  color: rgba(255, 255, 255, 0.7);
}

.radio-card.is-playing .radio-status .live-dot {
  background: #ff5c57;
  box-shadow: 0 0 10px rgba(255, 92, 87, 0.7);
}

[data-theme="light"] .radio-status {
  color: rgba(51, 43, 29, 0.46);
}

[data-theme="light"] .radio-card.is-playing .radio-status {
  color: rgba(51, 43, 29, 0.7);
}

.radio-note {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 430px;
  margin: 17px 0 0;
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
  color: rgba(255, 255, 255, 0.34);
}

.radio-note .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.8;
}

[data-theme="light"] .radio-note {
  color: rgba(51, 43, 29, 0.46);
}

/* ---------- 加载 / 错误蒙层 ---------- */

.radio-loading,
.radio-error {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #fff;
  text-align: center;
  background: rgba(7, 8, 12, 0.84);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.radio-loading p,
.radio-error p {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.radio-loading #loadingText {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.radio-error {
  z-index: 12;
  background:
    radial-gradient(58% 66% at 50% 28%, rgba(245, 166, 35, 0.12), transparent 72%),
    rgba(7, 8, 12, 0.94);
}

.radio-error__icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  place-items: center;
  color: #ffc46a;
  background: rgba(245, 166, 35, 0.11);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: 16px;
}

.radio-error__icon .icon {
  width: 24px;
  height: 24px;
}

.radio-error h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.radio-error p {
  max-width: 360px;
  margin: 7px 0 18px;
  font-size: 12px;
  line-height: 1.7;
}

.radio-error__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.radio-error .btn {
  min-height: 42px;
  font-size: 12px;
}

.radio-error .btn-ghost {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.radio-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--faint);
}

.radio-caption .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* 无障碍音频元素 */

.audio-source {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 动效 ---------- */

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes radio-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@keyframes radio-wave {
  from { transform: scaleY(0.32); }
  to { transform: scaleY(1); }
}

/* ---------- 响应式 ---------- */

@media (min-width: 1081px) {
  .radio-layout {
    grid-template-columns: minmax(0, 1fr) 356px;
  }

  .radio-layout .channel-panel {
    position: sticky;
    top: calc(var(--header-h) + 22px);
    height: clamp(540px, calc(100dvh - var(--header-h) - 196px), 660px);
  }
}

@media (max-width: 1080px) {
  .radio-layout {
    display: block;
  }
}

@media (max-width: 720px) {
  .radio-card {
    min-height: 0;
    padding: 16px 18px 17px;
    border-radius: 24px;
  }

  .radio-top {
    gap: 10px;
  }

  .radio-fav {
    width: 44px;
    padding: 0;
    border-radius: 11px;
  }

  .radio-fav span {
    display: none;
  }

  .radio-content {
    padding-top: 14px;
  }

  .radio-visual {
    width: clamp(146px, 42vw, 180px);
    margin-bottom: 20px;
  }

  .radio-orbit--two {
    inset: -20px;
  }

  .radio-copy h2 {
    font-size: 29px;
  }

  .radio-subtitle {
    margin-top: 6px;
    font-size: 11px;
  }

  .waveform {
    height: 34px;
    margin: 14px 0 10px;
  }

  .radio-play {
    width: 68px;
    height: 68px;
    box-shadow:
      0 15px 36px rgba(245, 166, 35, 0.27),
      0 0 0 8px rgba(245, 166, 35, 0.075);
  }

  .radio-play .icon {
    width: 24px;
    height: 24px;
  }

  .radio-volume-bar {
    width: 58px;
  }

  .radio-note {
    margin-top: 14px;
    font-size: 9.5px;
  }

  .radio-loading,
  .radio-error {
    padding: 18px;
  }

  .radio-error__icon {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    border-radius: 13px;
  }

  .radio-error h2 {
    font-size: 17px;
  }

  .radio-error p {
    margin: 5px 0 12px;
    font-size: 11px;
  }

  .radio-error .btn {
    min-height: 40px;
    padding: 0 13px;
    font-size: 11px;
  }

  .radio-caption {
    align-items: flex-start;
    font-size: 9.5px;
  }
}

@media (max-width: 400px) {
  .radio-status span:last-child {
    display: none;
  }

  .radio-volume-bar {
    width: 46px;
  }

  .radio-controls {
    grid-template-columns: 1fr auto 1fr;
  }

  .radio-note {
    max-width: 260px;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 540px) {
  .page {
    padding-top: 12px;
  }

  .page-head {
    display: none;
  }

  .radio-card {
    min-height: calc(100dvh - var(--header-h) - 26px);
  }

  .radio-visual {
    width: 140px;
    margin-bottom: 14px;
  }

  .radio-content {
    padding-top: 4px;
  }

  .radio-caption {
    display: none;
  }
}
