:root {
  --ink: #e8f7f4;
  --muted: #8bb5b0;
  --paper: #061618;
  --card: rgba(12, 42, 45, 0.72);
  --line: rgba(90, 230, 210, 0.16);
  --accent: #1ad4c0;
  --accent-deep: #0e8a86;
  --glow: rgba(46, 230, 197, 0.38);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --tab: 5.6rem;
  --radius: 1.5rem;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  min-height: 100dvh;
  background:
    radial-gradient(920px 520px at 12% -10%, rgba(26, 212, 192, 0.22), transparent 58%),
    radial-gradient(780px 460px at 108% 8%, rgba(14, 138, 134, 0.28), transparent 52%),
    radial-gradient(640px 380px at 50% 118%, rgba(8, 70, 78, 0.55), transparent 60%),
    linear-gradient(180deg, #082022 0%, #061618 48%, #041314 100%);
  font-family: "SF Pro Text", "PingFang HK", "Noto Sans TC", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
}
button, select, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(0.95rem + env(safe-area-inset-top)) 0 0.35rem;
}
.brand {
  color: inherit; text-decoration: none; font-weight: 700;
  letter-spacing: -0.05em; font-size: 1.02rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.brand .mark {
  width: 0.72rem; height: 0.72rem; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7ff6e4, var(--accent) 45%, var(--accent-deep));
  box-shadow: 0 0 18px var(--glow);
}
.kicker {
  margin: 0; color: var(--muted); font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
}
main { width: min(980px, calc(100% - 2rem)); margin: 0 auto; }
h1, h2 {
  font-family: "SF Pro Display", "PingFang HK", "Noto Sans TC", -apple-system, sans-serif;
  font-weight: 650;
  letter-spacing: -0.045em;
}
h1 { font-size: clamp(1.75rem, 6.4vw, 2.45rem); line-height: 1.12; margin: 0.4rem 0 0.4rem; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; margin: 1.5rem 0 0.55rem; }
.now {
  text-align: center;
  margin-top: 0.55rem;
  padding: 1.25rem 1rem 1.15rem;
  border-radius: 1.85rem;
  background: linear-gradient(180deg, rgba(18, 58, 62, 0.72), rgba(8, 28, 30, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(160%);
}
.cover-stage {
  position: relative;
  width: min(68vw, 236px);
  margin: 0.35rem auto 1.35rem;
  perspective: 920px;
  padding-right: 10px;
}
.cover-stage::before {
  content: "";
  position: absolute;
  inset: 18% 4% auto;
  height: 72%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  filter: blur(18px);
  z-index: 0;
}
.cover, .mini {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 2px 6px 6px 2px;
  overflow: hidden;
  background: #1a1410;
  transform-origin: left center;
  transform: rotateY(-8deg);
  transform-style: preserve-3d;
  transition: transform 180ms var(--ease-out);
  box-shadow:
    1px 0 0 #2a221c,
    2px 0 0 #d8d0be,
    3px 0 0 #f3ecde,
    4px 0 0 #b7ae9c,
    10px 16px 22px rgba(0, 0, 0, 0.42);
}
.cover::before, .mini::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 12%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.14) 42%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
  z-index: 2;
  border-radius: 2px 0 0 2px;
}
.cover img, .mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #1a1410;
  border-radius: 2px 6px 6px 2px;
  transform: scale(1.08);
}
.yt-rail img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.read {
  margin-top: 1.15rem;
  padding: 1rem 1rem 0.4rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.read h2 { font-size: 1.08rem; margin-top: 0; }
.read p { margin: 0.35rem 0; }
.read .current {
  background: rgba(26, 212, 192, 0.18);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(26, 212, 192, 0.22);
}
.by { margin: 0 0 0.35rem; color: var(--muted); }
main > h2 { margin: 1.8rem 0 0.35rem; font-size: 1.12rem; }
main > p, .copy { color: var(--muted); }
.transport { display: flex; justify-content: center; align-items: center; gap: 1.15rem; margin-top: 0.35rem; }
.play {
  width: 4.85rem; height: 4.85rem; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #7ff6e4, var(--accent) 42%, var(--accent-deep));
  color: #042221; font: inherit;
  box-shadow: 0 12px 28px rgba(26, 212, 192, 0.32);
  display: grid; place-items: center; position: relative;
}
.play svg { width: 1.5rem; height: 1.5rem; fill: #042221; display: block; }
.play:not(.is-playing) svg { margin-left: 0.14rem; }
.skip {
  width: 3.15rem; height: 3.15rem; border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink); font: inherit; font-size: 0.78rem; font-weight: 650;
  letter-spacing: -0.04em;
}
.play, .skip, .text-btn, .rail-btn, .yt-form button, .channel-card, .yt-episode, .shelf a {
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.play:active, .skip:active, .text-btn:active, .rail-btn:active, .yt-form button:active,
.channel-card:active, .yt-episode:active, .shelf a:active {
  transform: scale(0.97);
}
.scrub {
  display: grid; grid-template-columns: 3.2rem 1fr 3.2rem; gap: 0.45rem; align-items: center;
  margin-top: 1rem; font-variant-numeric: tabular-nums; font-size: 0.75rem; color: var(--muted);
}
input[type="range"] {
  width: 100%; accent-color: var(--accent); height: 0.35rem;
}
.row {
  display: flex; justify-content: center; gap: 0.55rem; align-items: center;
  flex-wrap: wrap; margin: 0.95rem 0 0.15rem;
}
.row label { color: var(--muted); font-size: 0.82rem; display: flex; gap: 0.4rem; align-items: center; }
select, .text-btn {
  font: inherit; color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.48rem 0.85rem; text-decoration: none;
}
.series-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin: 1.35rem 0 0.55rem;
}
.series-head h2 { margin: 0; font-size: 1.12rem; }
.series-head span { color: var(--accent); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; }
.shelf, .yt-rail {
  display: flex;
  gap: 0.95rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  list-style: none;
  padding: 0.55rem 0.35rem 1.05rem;
  margin: 0;
  perspective: 900px;
}
.shelf::-webkit-scrollbar, .yt-rail::-webkit-scrollbar { display: none; }
.shelf li { flex: 0 0 8.4rem; scroll-snap-align: start; padding-right: 0.4rem; }
.shelf a, .yt-rail a { color: inherit; text-decoration: none; display: grid; gap: 0.45rem; }
.shelf small, .yt-rail small {
  color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 3.3em;
  font-size: 0.8rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.02em;
}
.steps { display: grid; gap: 0.7rem; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 0.9rem 1rem 0.9rem 3.1rem; position: relative; backdrop-filter: blur(12px);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0.85rem; top: 0.9rem; width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #042221; font-size: 0.78rem; font-weight: 700;
}
.tabs {
  position: fixed; left: 0.85rem; right: 0.85rem;
  bottom: calc(0.65rem + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(8, 28, 30, 0.7);
  backdrop-filter: saturate(1.8) blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.45rem;
  padding: 0.28rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.tabs a {
  text-align: center; text-decoration: none; color: var(--muted);
  padding: 0.48rem 0.15rem 0.42rem; font-size: 0.68rem; font-weight: 650;
  letter-spacing: 0.02em; border-radius: 1.1rem;
  display: grid; gap: 0.18rem; justify-items: center;
}
.tabs svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] {
  color: #042221;
  background: linear-gradient(180deg, #7ff6e4, var(--accent));
  box-shadow: 0 8px 18px rgba(26, 212, 192, 0.28);
}
.rail-wrap {
  display: grid;
  grid-template-columns: 2.4rem 1fr 2.4rem;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.rail-btn {
  width: 2.4rem; height: 2.4rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font-size: 1.4rem; line-height: 1;
}
.yt-form {
  display: grid; gap: 0.7rem; margin: 1rem 0 1.4rem;
  padding: 1rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.yt-form label { display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--ink); }
.yt-form input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(4, 18, 20, 0.55); color: var(--ink); padding: 0.85rem 0.95rem; font: inherit;
}
.yt-form button {
  justify-self: start; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #7ff6e4, var(--accent));
  color: #042221; font: inherit; font-weight: 700;
  min-height: 2.85rem; padding: 0.45rem 1.2rem;
}
.channel-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.channel-item { position: relative; }
.channel-card {
  width: 100%; display: grid; grid-template-columns: 7.4rem 1fr; gap: 0.85rem; align-items: center;
  border: 1px solid var(--line); border-radius: 1.15rem; background: var(--card); padding: 0.7rem 4.4rem 0.7rem 0.7rem;
  text-align: left; font: inherit; color: inherit;
}
.channel-remove {
  position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(4, 18, 20, 0.88); color: var(--ink);
  font: inherit; font-size: 0.82rem; line-height: 1;
  min-height: 2rem; padding: 0.25rem 0.8rem;
}
.channel-thumb {
  aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #041314; display: block;
}
.channel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-meta { display: grid; gap: 0.25rem; }
.channel-meta strong { font-size: 1.05rem; }
.channel-meta small { color: var(--muted); }
.yt-room { margin-top: 0.4rem; }
.yt-player {
  margin: 0.8rem 0 1.1rem;
  border-radius: 18px;
  overflow: hidden;
  background: #041314;
  box-shadow: var(--shadow);
  min-height: 12rem;
}
.yt-player iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #041314; }
.yt-episodes {
  list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.55rem;
  max-height: 58vh; overflow-y: auto; overscroll-behavior: contain;
}
.yt-episode {
  width: 100%; display: grid; grid-template-columns: 7.2rem 1fr; gap: 0.75rem; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  padding: 0.45rem 0.6rem; text-align: left; font: inherit; color: inherit;
}
.yt-episode img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #041314; }
.yt-episode span { color: var(--ink); font-size: 0.92rem; }
.yt-episode[aria-current="page"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (hover: hover) and (pointer: fine) {
  .shelf a:hover .mini, .cover-stage:hover .cover {
    transform: rotateY(-3deg) translateY(-5px);
  }
  .channel-card:hover, .yt-episode:hover { transform: translateY(-2px); }
  .channel-remove:hover { border-color: rgba(26, 212, 192, 0.4); }
  .text-btn:hover, .skip:hover { border-color: rgba(26, 212, 192, 0.4); }
}
@media (min-width: 720px) {
  .shelf li { flex-basis: 9.4rem; }
  .cover-stage { width: 248px; }
  .yt-rail li { flex-basis: 17rem; }
  .tabs { left: max(0.85rem, calc(50% - 490px)); right: max(0.85rem, calc(50% - 490px)); }
}
@media (prefers-reduced-motion: reduce) {
  .play, .skip, .text-btn, .rail-btn, .yt-form button, .channel-card, .yt-episode, .shelf a, .cover, .mini {
    transition: none;
  }
  .cover, .mini { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .now, .read, .tabs, .yt-form, .steps li, .channel-card, .yt-episode {
    background: #0c2a2d;
    backdrop-filter: none;
  }
}
