/* ===== 哄睡电台 · 夜空主题 ===== */
.radio-page {
  --rd-bg: #0f0e1a;
  --rd-bg-soft: #16152a;
  --rd-surface: rgb(255 255 255 / 0.06);
  --rd-surface-hover: rgb(255 255 255 / 0.1);
  --rd-border: rgb(255 255 255 / 0.1);
  --rd-text: #f1f0ff;
  --rd-muted: rgb(241 240 255 / 0.55);
  --rd-accent: #a78bfa;
  --rd-accent-2: #f9a8d4;
  --rd-accent-3: #67e8f9;
  --rd-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  --rd-glow: 0 0 60px rgb(167 139 250 / 0.35);
  --rd-radius: 20px;

  background: var(--rd-bg);
  color: var(--rd-text);
  min-height: 100vh;
  min-height: 100dvh;
}

.rd-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgb(255 255 255 / 0.7), transparent),
    radial-gradient(1px 1px at 30% 65%, rgb(255 255 255 / 0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgb(255 255 255 / 0.6), transparent),
    radial-gradient(1px 1px at 72% 42%, rgb(255 255 255 / 0.45), transparent),
    radial-gradient(1px 1px at 88% 78%, rgb(255 255 255 / 0.55), transparent),
    radial-gradient(1.5px 1.5px at 15% 88%, rgb(255 255 255 / 0.4), transparent),
    radial-gradient(1px 1px at 45% 38%, rgb(255 255 255 / 0.35), transparent),
    radial-gradient(1px 1px at 92% 12%, rgb(255 255 255 / 0.5), transparent);
  animation: rd-twinkle 8s ease-in-out infinite alternate;
}

@keyframes rd-twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.rd-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgb(15 14 26 / 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--rd-border);
}

.rd-header .logo {
  color: var(--rd-text);
  text-decoration: none;
}

.rd-logo {
  cursor: default;
  pointer-events: none;
}

.rd-logo .logo-text {
  background: var(--rd-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rd-nav .nav-link {
  color: var(--rd-muted);
}

.rd-nav .nav-link:hover {
  color: var(--rd-accent);
}

.rd-nav .btn-outline {
  color: var(--rd-text);
  border-color: var(--rd-border);
  background: var(--rd-surface);
}

.rd-nav .btn-outline:hover {
  background: var(--rd-surface-hover);
  border-color: rgb(167 139 250 / 0.4);
}

.rd-hero {
  position: relative;
  z-index: 1;
  margin-top: var(--header-h);
  padding: clamp(32px, 6vw, 56px) 0 clamp(24px, 4vw, 40px);
  overflow: hidden;
}

.rd-hero-glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  background: radial-gradient(circle, rgb(167 139 250 / 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.rd-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.rd-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
  color: var(--rd-accent-2);
  margin-bottom: 14px;
}

.rd-hero-copy h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(120deg, #fff 0%, #c4b5fd 50%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rd-hero-copy p {
  font-size: clamp(14px, 2.5vw, 17px);
  line-height: 1.7;
  color: var(--rd-muted);
  max-width: 420px;
  margin-bottom: 20px;
}

.rd-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rd-hero-meta span {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
  color: var(--rd-muted);
}

.rd-now-card {
  background: linear-gradient(145deg, rgb(255 255 255 / 0.08), rgb(255 255 255 / 0.03));
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--rd-glow), 0 20px 50px rgb(0 0 0 / 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.rd-disc-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.rd-disc {
  width: clamp(88px, 18vw, 112px);
  height: clamp(88px, 18vw, 112px);
  border-radius: 50%;
  background: conic-gradient(from 0deg, #312e81, #6d28d9, #db2777, #312e81);
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgb(109 40 217 / 0.4);
}

.rd-disc-wrap.is-playing .rd-disc {
  animation: rd-spin 12s linear infinite;
}

@keyframes rd-spin {
  to { transform: rotate(360deg); }
}

.rd-disc-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1e1b4b, #0f0e1a 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgb(255 255 255 / 0.08);
}

.rd-disc-emoji {
  font-size: clamp(28px, 6vw, 36px);
}

.rd-eq {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.rd-disc-wrap.is-playing .rd-eq {
  opacity: 1;
}

.rd-eq span {
  display: block;
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--rd-grad);
}

.rd-disc-wrap.is-playing .rd-eq span {
  animation: rd-eq 0.8s ease-in-out infinite alternate;
}

.rd-eq span:nth-child(1) { animation-delay: 0s; }
.rd-eq span:nth-child(2) { animation-delay: 0.1s; }
.rd-eq span:nth-child(3) { animation-delay: 0.2s; }
.rd-eq span:nth-child(4) { animation-delay: 0.15s; }
.rd-eq span:nth-child(5) { animation-delay: 0.05s; }

@keyframes rd-eq {
  from { height: 8px; }
  to { height: 32px; }
}

.rd-now-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rd-muted);
  margin-bottom: 4px;
}

.rd-now-title {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.rd-now-sub {
  font-size: 13px;
  color: var(--rd-muted);
  margin-bottom: 16px;
}

.rd-progress-block {
  margin-bottom: 18px;
}

.rd-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  cursor: pointer;
  touch-action: none;
}

.rd-progress-bar:focus-visible {
  outline: 2px solid var(--rd-accent);
  outline-offset: 3px;
}

.rd-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--rd-grad);
  pointer-events: none;
}

.rd-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.rd-progress-bar:hover .rd-progress-thumb,
.rd-progress-bar.is-dragging .rd-progress-thumb {
  opacity: 1;
}

.rd-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--rd-muted);
  font-variant-numeric: tabular-nums;
}

.rd-controls-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
  margin-bottom: 14px;
}

.rd-ctrl {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--rd-surface);
  color: var(--rd-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.rd-ctrl:hover {
  background: var(--rd-surface-hover);
  transform: scale(1.05);
}

.rd-ctrl:active {
  transform: scale(0.96);
}

.rd-ctrl.is-active {
  background: rgb(167 139 250 / 0.25);
  color: var(--rd-accent);
  box-shadow: 0 0 0 1px rgb(167 139 250 / 0.35);
}

.rd-ctrl-lg {
  font-size: 18px;
}

.rd-ctrl-play {
  width: 58px;
  height: 58px;
  font-size: 22px;
  background: var(--rd-grad);
  box-shadow: 0 8px 24px rgb(109 40 217 / 0.45);
}

.rd-ctrl-play:hover {
  box-shadow: 0 12px 32px rgb(109 40 217 / 0.55);
}

.rd-ctrl-stop {
  font-size: 14px;
}

.rd-ctrl-stop:disabled,
.rd-ctrl-stop.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.rd-ctrl-stop:disabled:hover,
.rd-ctrl-stop.is-disabled:hover {
  background: var(--rd-surface);
  transform: none;
  box-shadow: none;
}

.rd-controls-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rd-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rd-ctrl-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.rd-volume input[type="range"] {
  width: min(100px, 22vw);
  accent-color: var(--rd-accent);
  cursor: pointer;
}

.rd-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rd-border);
  background: var(--rd-surface);
  color: var(--rd-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.rd-pill:hover {
  background: var(--rd-surface-hover);
  border-color: rgb(167 139 250 / 0.35);
}

.rd-pill.is-active {
  background: rgb(167 139 250 / 0.2);
  border-color: var(--rd-accent);
  color: var(--rd-accent);
}

.rd-main {
  position: relative;
  z-index: 1;
  padding-top: 8px;
  padding-bottom: clamp(48px, 8vw, 72px);
}

.rd-section-title {
  color: var(--rd-text);
  margin-bottom: 6px;
}

.rd-section-desc {
  font-size: 14px;
  color: var(--rd-muted);
  margin-bottom: 0;
}

.rd-section-desc code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
}

.rd-main-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.rd-search-wrap {
  position: relative;
  flex: 1;
  min-width: min(100%, 260px);
  max-width: 320px;
}

.rd-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.rd-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rd-border);
  background: var(--rd-surface);
  color: var(--rd-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.rd-cat-btn:hover {
  background: var(--rd-surface-hover);
  color: var(--rd-text);
}

.rd-cat-btn.is-active {
  border-color: rgb(167 139 250 / 0.5);
  background: rgb(167 139 250 / 0.18);
  color: var(--rd-text);
}

.rd-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgb(255 255 255 / 0.08);
  color: inherit;
}

.rd-cat-btn.is-active .rd-cat-count {
  background: rgb(255 255 255 / 0.14);
}

.rd-search {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--rd-border);
  background: var(--rd-surface);
  color: var(--rd-text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rd-search::placeholder {
  color: var(--rd-muted);
}

.rd-search:focus {
  border-color: rgb(167 139 250 / 0.5);
  box-shadow: 0 0 0 3px rgb(167 139 250 / 0.15);
}

.rd-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--rd-muted);
  font-size: 18px;
  cursor: pointer;
}

.rd-search-clear:hover {
  background: var(--rd-surface-hover);
  color: var(--rd-text);
}

.rd-loading,
.rd-error {
  text-align: center;
  padding: 48px 20px;
  color: var(--rd-muted);
}

.rd-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--rd-border);
  border-top-color: var(--rd-accent);
  border-radius: 50%;
  animation: rd-spin 0.8s linear infinite;
}

.rd-error .btn {
  margin-top: 12px;
}

.rd-track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rd-track-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--rd-surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.rd-track-item:hover {
  background: var(--rd-surface-hover);
  border-color: var(--rd-border);
}

.rd-track-item.is-active {
  background: rgb(167 139 250 / 0.15);
  border-color: rgb(167 139 250 / 0.35);
  box-shadow: 0 4px 20px rgb(109 40 217 / 0.15);
}

.rd-track-item.is-playing .rd-track-play-icon {
  color: var(--rd-accent-2);
}

.rd-track-index {
  width: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rd-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rd-track-item.is-playing .rd-track-index {
  color: var(--rd-accent);
}

.rd-track-title {
  font-size: 15px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-track-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rd-track-times {
  font-size: 11px;
  color: var(--rd-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-track-item.is-active .rd-track-times {
  color: rgb(167 139 250 / 0.85);
}

.rd-track-ext {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.06);
  color: var(--rd-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.rd-track-cat {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.rd-track-cat-radio {
  background: rgb(167 139 250 / 0.18);
  color: #c4b5fd;
}

.rd-track-cat-music {
  background: rgb(249 168 212 / 0.15);
  color: #f9a8d4;
}

.rd-track-dur {
  font-size: 13px;
  color: var(--rd-muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.rd-track-play-icon {
  font-size: 14px;
  color: var(--rd-muted);
  width: 20px;
  text-align: center;
}

.rd-empty {
  text-align: center;
  padding: 32px;
  color: var(--rd-muted);
}

.rd-history {
  position: relative;
  z-index: 1;
  padding-top: 0;
}

.rd-history-count {
  font-size: 13px;
  color: var(--rd-muted);
  white-space: nowrap;
}

.rd-history-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rd-history-clear-btn {
  border: 1px solid rgb(248 113 113 / 0.35);
  background: rgb(248 113 113 / 0.1);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  font-family: inherit;
}

.rd-history-clear-btn:hover {
  background: rgb(248 113 113 / 0.18);
}

.rd-history-clear-btn[hidden] {
  display: none !important;
}

.rd-history-clear-btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.rd-history-guest {
  text-align: center;
  padding: 28px 16px;
  color: var(--rd-muted);
  background: var(--rd-surface);
  border-radius: 14px;
  border: 1px dashed var(--rd-border);
}

.rd-history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px;
  color: var(--rd-muted);
}

.rd-history-loading[hidden] {
  display: none !important;
}

.rd-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rd-history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--rd-surface);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.rd-history-item:hover {
  background: var(--rd-surface-hover);
  border-color: var(--rd-border);
}

.rd-history-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 15px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-history-meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 11px;
  color: var(--rd-muted);
  line-height: 1.35;
}

.rd-history-progress {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  overflow: hidden;
  margin-top: 4px;
}

.rd-history-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rd-accent), var(--rd-accent-2));
  border-radius: inherit;
}

.rd-history-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.rd-history-replay {
  border: 1px solid rgb(167 139 250 / 0.35);
  background: rgb(167 139 250 / 0.12);
  color: var(--rd-accent-2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}

.rd-history-replay:hover {
  background: rgb(167 139 250 / 0.22);
  transform: translateY(-1px);
}

.rd-history-delete {
  border: 1px solid rgb(248 113 113 / 0.3);
  background: transparent;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.rd-history-delete:hover {
  background: rgb(248 113 113 / 0.12);
  color: #fecaca;
}

.rd-login-modal .modal-desc[hidden] {
  display: none !important;
}

/* 弹窗使用全局文字色，避免继承电台页浅色字导致看不清 */
.rd-login-modal.modal-content {
  color: var(--text, #1e293b);
}

.rd-login-modal.modal-content h3,
.rd-login-modal .rd-modal-history-head h4,
.rd-login-modal .rd-history-title {
  color: var(--text, #1e293b);
}

.rd-login-modal .modal-desc,
.rd-login-modal .rd-modal-history-count,
.rd-login-modal .rd-history-meta,
.rd-login-modal .rd-modal-history-empty {
  color: var(--text-muted, #64748b);
}

.rd-modal-history {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.rd-login-modal .rd-modal-history {
  border-top-color: var(--border, #e2e8f0);
}

.rd-modal-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rd-modal-history-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.rd-modal-history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rd-modal-history-count {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.rd-modal-history-empty {
  margin: 0 0 12px;
  padding: 20px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  background: var(--bg, #f8fafc);
  border-radius: 12px;
}

.rd-login-modal .rd-history-item {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}

.rd-login-modal .rd-history-item:hover {
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, var(--bg-card, #fff));
  border-color: color-mix(in srgb, var(--primary, #2563eb) 25%, var(--border, #e2e8f0));
}

.rd-login-modal .rd-history-progress {
  background: var(--border, #e2e8f0);
}

.rd-login-modal .rd-history-replay {
  color: var(--primary-dark, #1d4ed8);
  background: var(--primary-light, #dbeafe);
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border, #e2e8f0));
}

.rd-login-modal .rd-history-replay:hover {
  background: color-mix(in srgb, var(--primary, #2563eb) 16%, var(--primary-light, #dbeafe));
  color: var(--primary-dark, #1d4ed8);
}

.rd-login-modal .rd-history-delete {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 30%, var(--border, #e2e8f0));
}

.rd-login-modal .rd-history-delete:hover {
  background: color-mix(in srgb, #dc2626 10%, var(--bg-card, #fff));
  color: #b91c1c;
}

.rd-login-modal .rd-history-clear-btn {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 30%, var(--border, #e2e8f0));
  background: color-mix(in srgb, #dc2626 8%, var(--bg-card, #fff));
}

.rd-login-modal .rd-history-clear-btn:hover {
  background: color-mix(in srgb, #dc2626 14%, var(--bg-card, #fff));
}

.rd-modal-history-list {
  max-height: min(42vh, 320px);
  overflow-y: auto;
  padding-right: 4px;
}

.rd-modal-history-list .rd-history-item {
  padding: 12px 14px;
}

.rd-modal-history-list .rd-history-title {
  font-size: 14px;
}

.rd-footer {
  position: relative;
  z-index: 1;
  background: rgb(15 14 26 / 0.9);
  border-top: 1px solid var(--rd-border);
  color: var(--rd-muted);
}

.rd-footer p {
  font-size: 13px;
}

.rd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.rd-modal-overlay.is-open {
  display: flex;
  pointer-events: auto;
}

.rd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}

.rd-modal {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 24px;
  border-radius: var(--rd-radius);
  background: #1a1830;
  border: 1px solid var(--rd-border);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
  pointer-events: auto;
}

.rd-modal h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.rd-modal-desc {
  font-size: 13px;
  color: var(--rd-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.rd-timer-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.rd-timer-opt {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--rd-border);
  background: var(--rd-surface);
  color: var(--rd-text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.rd-timer-opt:hover {
  background: var(--rd-surface-hover);
}

.rd-timer-opt.is-selected {
  border-color: var(--rd-accent);
  background: rgb(167 139 250 / 0.2);
  color: var(--rd-accent);
}

.rd-timer-status {
  font-size: 13px;
  color: var(--rd-accent-2);
  min-height: 20px;
  margin-bottom: 12px;
}

.rd-modal-close {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--rd-accent);
  background: rgb(167 139 250 / 0.15);
  color: var(--rd-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.rd-modal-close:hover {
  background: rgb(167 139 250 / 0.28);
  border-color: var(--rd-accent-2);
}

@media (max-width: 768px) {
  .rd-hero-inner {
    grid-template-columns: 1fr;
  }

  .rd-hero-copy {
    text-align: center;
  }

  .rd-hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .rd-hero-meta {
    justify-content: center;
  }

  .rd-disc-wrap {
    justify-content: center;
  }

  .rd-now-info {
    text-align: center;
  }

  .rd-main-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .rd-search-wrap {
    max-width: none;
  }

  .rd-history-count {
    align-self: flex-start;
  }

  .rd-history-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .rd-history-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .rd-category-bar {
    margin-bottom: 12px;
  }

  .rd-cat-btn {
    flex: 1;
    justify-content: center;
    min-width: calc(33.333% - 6px);
    padding: 10px 8px;
    font-size: 12px;
  }

  .rd-track-item {
    grid-template-columns: auto 1fr auto auto auto;
    gap: 10px;
  }

  .rd-track-ext {
    display: none;
  }

  .rd-track-times {
    font-size: 10px;
    white-space: normal;
  }

  .rd-history-item {
    padding: 12px 14px;
    gap: 6px 10px;
  }

  .rd-history-meta {
    font-size: 10px;
    white-space: normal;
  }

  .rd-history-replay {
    padding: 8px 12px;
    font-size: 12px;
  }

  .rd-login-modal.modal-content {
    width: calc(100% - 24px);
    max-width: none;
    margin: 12px;
    padding: 24px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
  }

  .rd-modal-history-list {
    max-height: min(48dvh, 320px);
  }

  .rd-modal-history-list .rd-history-title {
    font-size: 13px;
  }

  .rd-modal-history-list .rd-history-meta {
    font-size: 10px;
  }
}

/* ===== 手机版布局（.is-mobile） ===== */
.is-mobile .rd-nav {
  display: none;
}

.is-mobile .rd-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.is-desktop .rd-mobile-actions {
  display: none;
}

.is-mobile .rd-header .header-inner {
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  gap: 8px;
}

.is-mobile .rd-header .logo-text {
  font-size: 15px;
}

.is-mobile .rd-mobile-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--rd-text);
  border-color: var(--rd-border);
  background: var(--rd-surface);
  text-decoration: none;
}

.is-mobile .rd-hero {
  margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: 20px;
}

.is-mobile .rd-main,
.is-mobile .rd-history {
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
}

.is-mobile .rd-footer {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.is-mobile .modal.active {
  align-items: flex-end;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.is-mobile .rd-login-modal.modal-content {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  max-height: min(92dvh, 720px);
}

.is-mobile .rd-login-modal .rd-history-item {
  padding: 12px;
}

.is-mobile .rd-login-modal .rd-history-replay {
  padding: 7px 11px;
  font-size: 12px;
}

.is-mobile .rd-login-modal .modal-close {
  top: max(12px, env(safe-area-inset-top, 0px));
  color: var(--text-muted);
}

@media (max-width: 400px) {
  .rd-ctrl {
    width: 40px;
    height: 40px;
  }

  .rd-ctrl-play {
    width: 52px;
    height: 52px;
  }

  .rd-ctrl-stop {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }
}

[data-theme="dark"] .radio-page {
  --rd-bg: #0a0912;
}
