/* 視覺方向:深色光暈首屏、斜切底邊、傾斜拼貼,接白底大圖卡片格 */
:root {
  color-scheme: light;
  --night: #1c1b22;
  --teal: #0f4a57;
  --plum: #5a1f4c;
  --rose: #e8184f;
  --ink: #17151f;
  --muted: #6b6876;
  --mist: #f4f4f7;
  --line: #e4e3e9;
  --display: Jost, "Noto Sans TC", "Noto Sans JP", "Microsoft JhengHei", sans-serif;
}
:root:lang(ja) { --display: Jost, "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; }
:root:lang(ko) { --display: Jost, "Noto Sans KR", "Malgun Gothic", sans-serif; }
:lang(ko) body { word-break: keep-all; }
.languages { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.languages button { padding: 4px 10px; font-size: 13px; background: transparent; color: #fff; border-color: #ffffff4d; }
.languages button[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font: 15px/1.6 var(--display); }
a { color: var(--rose); }
input, select, button { font: inherit; }
input[type="checkbox"] { accent-color: var(--rose); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

button, .ghost {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
}
button:disabled { cursor: default; opacity: .45; }
button.primary { background: var(--rose); border-color: var(--rose); color: #fff; font-weight: 500; }

/* ---------- 首屏 ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(38% 55% at 20% 30%, var(--teal), transparent 70%),
    radial-gradient(35% 45% at 92% 4%, var(--plum), transparent 70%),
    radial-gradient(24% 32% at 24% 8%, #5c3a33, transparent 70%),
    var(--night);
}
.hero { position: relative; overflow: hidden; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6vw), 0 100%); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; padding: 22px max(16px, 5.5vw); }
.nav a { color: #fff; text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.nav .brand { font-size: 22px; font-weight: 700; margin-right: 28px; text-decoration: none !important; }

.intro { position: relative; z-index: 1; text-align: center; padding: 36px 16px 0; }
.intro h1 { margin: 0; font-size: clamp(36px, 6.4vw, 76px); line-height: 1.12; font-weight: 700; }
.intro em { font-style: italic; margin-left: .15em; }
.intro p { margin: 16px 0 26px; color: #d6d4de; font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; align-items: center; }
.actions button.primary { padding: 14px 36px; font-size: 16px; }
.actions .ghost { padding: 13px 24px; background: transparent; color: #fff; border-color: #ffffff66; }

/* 傾斜拼貼:本季影片縮圖,點了從該社團開始播 */
.stage { height: clamp(260px, 36vw, 520px); perspective: 1800px; }
#collage {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.2vw;
  width: 112%; margin-left: -6%; padding-top: 2vw;
  transform: rotateX(50deg) rotateZ(-34deg) translate(2%, -12%);
  transform-style: preserve-3d;
}
#collage button {
  padding: 0; border: 0; border-radius: 2px; background: #000; aspect-ratio: 16 / 9; overflow: hidden;
  box-shadow: -18px 24px 36px #0009; opacity: 1; transition: transform .2s;
  animation: rise .7s ease-out backwards; animation-delay: calc(var(--i) * 45ms);
}
#collage button:nth-child(even) { translate: 0 36%; }
#collage button:hover:not(:disabled), #collage button:focus-visible { transform: translateZ(40px); }
#collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes rise { from { opacity: 0; transform: translateZ(-120px); } }

/* ---------- Popular Artist:真的是排名,所以用序號 ---------- */
#popular { max-width: 1160px; margin: 0 auto; padding: 36px max(16px, 3vw) 48px; text-align: center; }
#popular h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.2; }
#popular h2 em { font-style: italic; }
#popularNote { margin: 6px 0 28px; color: var(--muted); }
#popularList {
  list-style: none; margin: 0 0 28px; padding: 0; counter-reset: rank; text-align: left;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 4px 36px;
}
#popularList li { display: flex; align-items: center; gap: 12px; min-width: 0; border-bottom: 1px solid var(--line); }
#popularList li::before {
  counter-increment: rank; content: counter(rank); width: 34px; flex: none;
  font-size: 24px; font-weight: 700; text-align: right; color: var(--muted);
}
#popularList li:nth-child(-n + 3)::before { color: var(--rose); }
#popularList li > * {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 10px 0;
  border: 0; background: none; color: inherit; text-align: left; text-decoration: none; opacity: 1;
}
#popularList img, #popularList .noart { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; flex: none; }
#popularList .noart { background: var(--night); }
#popularList .who { display: block; min-width: 0; }
#popularList .name { display: block; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
#popularList .count { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
#popularList li > :hover .name { color: var(--rose); }

/* ---------- 篩選列 ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center;
  padding: 14px 16px; background: #fff; box-shadow: 0 6px 18px #17151f12;
}
.toolbar select, .toolbar input[type="search"] {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--mist); color: var(--ink);
}
.toolbar input[type="search"] { width: min(100%, 260px); }

/* ---------- 社團卡片 ---------- */
.listen main { max-width: 1320px; margin: 0 auto; padding: 20px max(16px, 3vw) 40px; }
#pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 44px; }
#pager button { min-width: 40px; }
#pager button[aria-current="page"] { background: var(--rose); border-color: var(--rose); color: #fff; }
footer { padding: 28px 16px 40px; background: var(--night); color: #d6d4de; text-align: center; }
footer p { margin: 0; }
#updated { margin-top: 8px; font-size: 13px; }
footer a { color: #fff; margin-left: 8px; overflow-wrap: anywhere; }
/* 播放器開著時多留空間,頁尾和分頁鈕不會被蓋住 */
body:has(#dock.open) footer { padding-bottom: 370px; }
#status { margin: 0 0 20px; text-align: center; color: var(--muted); }
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 44px 32px;
}
.card { min-width: 0; text-align: center; content-visibility: auto; contain-intrinsic-size: auto 300px; padding: 4px; }
.art {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0;
  border-radius: 4px; overflow: hidden; background: var(--night);
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
button.art:hover:not(:disabled) img { transform: scale(1.04); }
button.art:disabled { opacity: 1; }
button.art::after {
  content: "▶"; position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 3px; background: var(--rose); color: #fff;
}
/* 沒有可播影片:用攤位號做一張色塊海報 */
.poster {
  display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 700;
  background:
    radial-gradient(60% 80% at 20% 100%, hsl(var(--hue) 70% 52%), transparent 70%),
    radial-gradient(55% 70% at 90% 10%, hsl(calc(var(--hue) + 60) 60% 40%), transparent 70%),
    var(--night);
}
.card.playing .art { outline: 4px solid var(--rose); outline-offset: 3px; }
.card .name { margin: 14px 0 2px; font-size: 18px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 0 12px; justify-content: center; color: var(--muted); font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: center; margin-top: 6px; font-size: 13px; }
.links a { overflow-wrap: anywhere; }
.card .sc { margin-top: 8px; font-size: 13px; padding: 3px 10px; }

/* ---------- 浮動播放器 ---------- */
#dock {
  position: fixed; right: 20px; bottom: 20px; z-index: 5; width: 384px; padding: 12px;
  border-radius: 6px; background: var(--night); color: #fff; box-shadow: 0 20px 60px #0006;
  visibility: hidden; translate: 0 calc(100% + 40px); transition: translate .25s, visibility .25s;
}
#dock.open { visibility: visible; translate: 0 0; transition: translate .25s; }
#dock #playerBox { height: 203px; background: #000; }
#dock #playerBox > * { width: 100%; height: 100%; display: block; border: 0; }
#sc { width: 100%; height: 166px; border: 0; display: block; }
#now { margin: 8px 0; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#dock button { background: transparent; color: #fff; border-color: #ffffff4d; }
#dock #close { margin-left: auto; }

@media (max-width: 760px) {
  .nav { gap: 6px 18px; padding-top: 16px; }
  .nav .brand { flex-basis: 100%; }
  #collage { grid-template-columns: repeat(3, 1fr); width: 140%; margin-left: -20%; }
  #collage button:nth-child(n + 10) { display: none; }
  .toolbar { position: static; justify-content: flex-start; }
  #dock { right: 0; left: 0; bottom: 0; width: auto; border-radius: 0; }
  #dock #playerBox { height: 210px; }
  body:has(#dock.open) footer { padding-bottom: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
