:root {
  --bg: #141416;
  --surface: #1f2023;
  --surface-2: #2a2b2f;
  --text: #f2f2f2;
  --text-dim: #9a9ba0;
  --accent: #f2b544;
  --accent-text: #141416;
  --disabled: #55565b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  padding: max(16px, env(safe-area-inset-top)) 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.02em;
}

main {
  padding: 0 16px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.now-playing {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.np-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.4;
}

.np-progress input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.np-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0 12px;
}

.ctrl-btn {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.ctrl-btn--main {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
  background: var(--accent);
  color: var(--accent-text);
}

.ctrl-btn:active { opacity: 0.7; }

.np-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-btn {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 8px;
  cursor: pointer;
}

.rate-select {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rate-select select {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.playlist h2 {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 10px;
}

#episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ep-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
}

.ep-item[data-disabled="true"] {
  cursor: default;
  opacity: 0.5;
}

.ep-num {
  font-weight: 700;
  color: var(--text-dim);
  min-width: 28px;
}

.ep-info {
  flex: 1;
  min-width: 0;
}

.ep-title {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.ep-item.playing {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ep-item.playing .ep-num {
  color: var(--accent);
}
