:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #a7b1c2;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(10, 18, 28, 0.78);
  --panel-strong: rgba(15, 24, 37, 0.94);
  --red: #ff3d3d;
  --teal: #23c7b7;
  --amber: #f6b84a;
  --bg: #080d13;
  --focus: #f6d36a;
  font-family:
    Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(35, 199, 183, 0.2), transparent 28%),
    linear-gradient(315deg, rgba(255, 61, 61, 0.2), transparent 30%),
    radial-gradient(circle at 50% 0%, rgba(246, 184, 74, 0.12), transparent 36%),
    var(--bg);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 36px);
}

.showcase {
  min-height: calc(100vh - clamp(32px, 5vw, 72px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(14px, 2vw, 24px);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.channel-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: 0;
}

.mark-dot {
  width: clamp(34px, 4.8vw, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--amber));
  box-shadow: 0 14px 40px rgba(255, 61, 61, 0.34);
  flex: 0 0 auto;
}

.channel-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}

.player-panel,
.playlist-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.player-panel {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto;
  min-width: 0;
}

.video-frame {
  position: relative;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.now-playing {
  padding: clamp(18px, 2.6vw, 32px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(28px, 4.6vw, 70px);
  line-height: 1.04;
  letter-spacing: 0;
}

.now-playing p:last-child {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.7;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(18px, 2.6vw, 32px) clamp(18px, 2.6vw, 32px);
}

.icon-button,
.play-toggle {
  min-height: 46px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.icon-button {
  width: 46px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
}

#toggleIcon {
  width: 20px;
  text-align: center;
  font-size: 0.86rem;
}

button:hover,
.channel-link:hover,
.video-card:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.13);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.playlist-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel-strong);
}

.playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.playlist-head p,
.playlist-head span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.playlist {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.video-card {
  width: 100%;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.video-card.is-active {
  border-color: rgba(35, 199, 183, 0.62);
  background: rgba(35, 199, 183, 0.12);
}

.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #111;
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.28));
}

.video-card h2 {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .showcase {
    min-height: auto;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .playlist-panel {
    max-height: none;
  }

  .playlist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .video-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 12px;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .channel-mark {
    font-size: 40px;
  }

  .channel-link {
    width: 100%;
  }

  .player-panel,
  .playlist-panel {
    border-radius: 0;
  }

  .player-panel {
    grid-template-rows: auto auto auto;
  }

  .video-frame {
    min-height: 0;
  }

  .controls {
    justify-content: space-between;
  }

  .play-toggle {
    flex: 1;
    justify-content: center;
  }

  .playlist {
    grid-template-columns: 1fr;
  }
}
