/* Podcast player — audio + synced subtitles */
:root {
  --pod-ink: #1c1917;
  --pod-muted: #78716c;
  --pod-amber: #b45309;
  --pod-amber-soft: #ffedd5;
  --pod-line: #e7e5e4;
  --pod-bg: #fafaf9;
  --pod-card: #ffffff;
  --pod-active: #fff7ed;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ffedd5 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #fef3c7 0%, transparent 50%),
    var(--pod-bg);
  color: var(--pod-ink);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.pod-app { min-height: 100vh; max-width: 820px; margin: 0 auto; padding-bottom: 24px; }
.hidden { display: none !important; }

.pod-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 249, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pod-line); padding: 10px 14px 12px;
}
.pod-top-row { display: flex; align-items: center; gap: 8px; }
.pod-home, .pod-icon {
  border: 0; background: transparent; font-size: 1.15rem; cursor: pointer;
  text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 8px;
}
.pod-home:hover, .pod-icon:hover { background: var(--pod-amber-soft); }
.pod-titles { flex: 1; min-width: 0; }
.pod-show-title {
  display: block; font-weight: 700; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pod-ep-title {
  display: block; color: var(--pod-muted); font-size: 0.8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pod-library { padding: 20px 16px; }
.pod-library-title { margin: 0 0 16px; font-size: 1.25rem; }
.pod-library-list { display: grid; gap: 12px; }
.pod-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--pod-card); border: 1px solid var(--pod-line);
  border-left: 4px solid var(--pod-amber); border-radius: 12px;
  padding: 16px 18px; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.pod-card:hover { box-shadow: 0 6px 20px rgba(180, 83, 9, 0.12); transform: translateY(-1px); }
.pod-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.pod-card .pod-card-zh { color: var(--pod-amber); font-size: 0.85rem; margin: 0 0 8px; }
.pod-card p { margin: 0; color: var(--pod-muted); font-size: 0.88rem; line-height: 1.45; }
.pod-card .pod-card-meta { margin-top: 8px; font-size: 0.78rem; color: var(--pod-muted); }

.pod-player-wrap { display: flex; flex-direction: column; min-height: calc(100vh - 70px); }

.pod-player-bar {
  position: sticky; top: 54px; z-index: 15;
  background: #431407; color: #ffedd5;
  padding: 12px 14px 14px; border-bottom: 1px solid #7c2d12;
}
.pod-player-controls {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pod-ctrl {
  border: 0; background: #7c2d12; color: #fff; border-radius: 8px;
  min-width: 40px; height: 40px; cursor: pointer; font-size: 0.85rem; font-weight: 700;
  padding: 0 8px;
}
.pod-play { background: var(--pod-amber); width: 52px; font-size: 1.1rem; }
.pod-loop.is-on {
  background: #fbbf24;
  color: #431407;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45);
}
.pod-rate-label {
  margin-left: auto; font-size: 0.78rem; display: flex; align-items: center; gap: 6px;
}
.pod-rate-label select {
  border-radius: 6px; border: 0; padding: 4px 6px; background: #fff7ed; color: var(--pod-ink);
}
.pod-seek-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
}
.pod-time { font-size: 0.75rem; font-variant-numeric: tabular-nums; min-width: 2.6rem; }
.pod-seek {
  flex: 1;
  height: 28px;
  margin: 0;
  cursor: pointer;
  accent-color: #fbbf24;
  /* taller hit area for dragging on mobile */
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.pod-seek::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #7c2d12;
}
.pod-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #fffbeb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  cursor: grab;
}
.pod-seek:active::-webkit-slider-thumb { cursor: grabbing; }
.pod-seek::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #7c2d12;
}
.pod-seek::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #fffbeb;
  cursor: grab;
}
.pod-active-cue {
  margin: 10px 0 0; font-size: 0.95rem; line-height: 1.4; font-weight: 600;
  color: #fffbeb; min-height: 2.6em;
}

.pod-cues {
  flex: 1; padding: 12px 14px 40px;
}
.pod-loading { color: var(--pod-muted); text-align: center; padding: 40px; }
.pod-cue {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; margin: 0 0 4px; border-radius: 10px;
  color: inherit; font: inherit; line-height: 1.45;
  transition: background 0.12s ease;
}
.pod-cue:hover { background: #f5f5f4; }
.pod-cue.is-active {
  background: var(--pod-active);
  box-shadow: inset 3px 0 0 var(--pod-amber);
}
.pod-cue-ts {
  display: block; font-size: 0.72rem; color: var(--pod-muted);
  font-variant-numeric: tabular-nums; margin-bottom: 2px;
}
.pod-cue-en { font-size: 0.98rem; }
.pod-cue-en .w,
.pod-active-cue .w {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 1px;
}
.pod-cue-en .w:hover,
.pod-active-cue .w:hover { background: rgba(180, 83, 9, 0.16); }
.pod-cue-en .w.is-active,
.pod-active-cue .w.is-active {
  background: var(--pod-amber);
  color: #fff;
}

.pod-pop-backdrop {
  position: fixed; inset: 0; background: rgba(28, 25, 23, 0.4); z-index: 50;
}
.pod-pop {
  position: fixed; left: 50%; top: 10vh; transform: translateX(-50%);
  width: min(520px, 94vw); max-height: 78vh; overflow: auto;
  background: var(--pod-card); border-radius: 14px; z-index: 55;
  box-shadow: 0 16px 48px rgba(28, 25, 23, 0.22);
  border: 1px solid var(--pod-line);
}
.pod-pop-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; padding: 14px 16px 8px; border-bottom: 1px solid var(--pod-line);
  position: sticky; top: 0; background: var(--pod-card);
}
.pod-pop-actions { display: flex; gap: 4px; }
.pod-pop-body { padding: 14px 16px 20px; }
.pod-word-head { font-size: 1.3rem; font-weight: 800; }
.pod-word-phon { color: var(--pod-muted); margin-left: 8px; font-size: 0.9rem; }
.pod-word-note { margin: 0 0 10px; font-size: 0.85rem; color: var(--pod-muted); }
.pod-sense { padding: 8px 0; border-top: 1px solid var(--pod-line); }
.pod-sense:first-of-type { border-top: none; }
.pod-sense.is-best {
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
}
.pod-sense-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 800;
  color: var(--pod-amber); background: var(--pod-amber-soft);
  border-radius: 999px; padding: 1px 8px; margin: 0 6px 4px 0;
}
.pod-sense-badge.muted { color: var(--pod-muted); background: #f5f5f4; font-weight: 600; }
.pod-pos {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  color: var(--pod-amber); margin-right: 6px; text-transform: uppercase;
}
.pod-def { line-height: 1.45; }
.pod-word-ex { margin-top: 6px; font-size: 0.88rem; color: var(--pod-muted); }
.pod-word-ex .en { display: block; color: var(--pod-ink); }
.pod-word-ex .zh { display: block; }
.pod-word-ctx {
  margin: 0 0 12px; padding: 8px 10px; border-radius: 8px;
  background: #fafaf9; border: 1px solid var(--pod-line);
  font-size: 0.85rem; color: var(--pod-muted); line-height: 1.4;
}
.pod-word-ctx strong { color: var(--pod-ink); font-weight: 600; }
.pod-ex-empty { color: var(--pod-muted); font-size: 0.9rem; }

.pod-toc {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 92vw);
  background: var(--pod-card); z-index: 40; box-shadow: -8px 0 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; padding: 12px;
}
.pod-toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 12px; border-bottom: 1px solid var(--pod-line);
}
.pod-toc-list { overflow: auto; padding: 8px 0; }
.pod-toc-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 12px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit;
}
.pod-toc-item:hover, .pod-toc-item.is-on { background: var(--pod-amber-soft); }
.pod-toc-item strong { display: block; font-size: 0.9rem; }
.pod-toc-item span { display: block; color: var(--pod-muted); font-size: 0.78rem; margin-top: 2px; }
.pod-backdrop {
  position: fixed; inset: 0; background: rgba(28, 25, 23, 0.35); z-index: 30;
}

@media (max-width: 520px) {
  .pod-player-bar { top: 52px; }
  .pod-active-cue { font-size: 0.9rem; }
}
