/* ============================================================
   NP ASCEND — 夜班生命徵象監視器 (Night-Shift Vitals) 視覺系統
   深墨藍 OLED 底 × ECG 格紋 × 生命徵象綠 × 監視器等寬數字
   ============================================================ */

@font-face {
  font-family: "Sora"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/sora-600.woff2") format("woff2");
}
@font-face {
  font-family: "Sora"; font-weight: 800; font-display: swap;
  src: url("/static/fonts/sora-800.woff2") format("woff2");
}
@font-face {
  font-family: "Spline Sans Mono"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/splinesansmono-500.woff2") format("woff2");
}
@font-face {
  font-family: "Spline Sans Mono"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/splinesansmono-700.woff2") format("woff2");
}

:root {
  --bg: #060a12;
  --panel: rgba(15, 22, 38, .78);
  --panel-solid: #0e1526;
  --panel-2: #101a2e;
  --line: rgba(125, 165, 255, .14);
  --line-soft: rgba(125, 165, 255, .07);
  --vital: #2ee6a6;            /* 生命徵象綠（主 accent） */
  --vital-dim: rgba(46, 230, 166, .16);
  --blue: #4da3ff;
  --amber: #ffb454;
  --red: #ff5d73;
  --text: #e9eef9;
  --mut: #93a0b9;
  --display: "Sora", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --body: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75);
  --green: var(--vital);       /* 舊變數名相容（home.html 內聯樣式使用） */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); line-height: 1.65;
  min-height: 100dvh;
}
/* 病房監視器氛圍：ECG 細格紋 + 頂部生命綠輝光 + 暗角 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -10%, rgba(46, 230, 166, .10), transparent 60%),
    radial-gradient(90% 40% at 85% 110%, rgba(77, 163, 255, .07), transparent 60%),
    repeating-linear-gradient(0deg, var(--line-soft) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 28px),
    var(--bg);
}

.wrap { max-width: 520px; margin: 0 auto; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }

h1, h2 { font-family: var(--display); letter-spacing: .5px; margin: .5em 0 .4em; }
h2 { font-size: 22px; }
a { color: var(--blue); text-decoration: none; }
a:active { opacity: .7; }

/* ---------- 進場動畫：卡片/按鈕梯次浮現 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card, .btn, .stat, .action, .pod, .lb-row {
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) backwards;
}
.card:nth-of-type(2), .btn:nth-of-type(2), .action:nth-of-type(2) { animation-delay: .05s; }
.card:nth-of-type(3), .btn:nth-of-type(3), .action:nth-of-type(3) { animation-delay: .1s; }
.card:nth-of-type(4), .btn:nth-of-type(4), .action:nth-of-type(4) { animation-delay: .15s; }
.card:nth-of-type(5), .btn:nth-of-type(5), .action:nth-of-type(5) { animation-delay: .2s; }
.btn:nth-of-type(6), .action:nth-of-type(6) { animation-delay: .25s; }
.btn:nth-of-type(7) { animation-delay: .3s; }
.btn:nth-of-type(8) { animation-delay: .35s; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card::before {            /* 頂部高光髮絲線 */
  content: ""; position: absolute; inset: 0 12% auto 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 238, 249, .22), transparent);
}

/* ---------- 按鈕 ---------- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 16px; margin: 10px 0;
  border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: .5px;
  text-align: center; text-decoration: none;
  background: linear-gradient(180deg, #16233e, #111a30);
  color: var(--text);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(233, 238, 249, .07);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(125, 165, 255, .35); }
.btn:active { transform: translateY(1px) scale(.985); filter: brightness(1.08); }
.btn.green {
  background: linear-gradient(135deg, #1ed492, #0fae8d 60%, #0c8f86);
  border-color: rgba(46, 230, 166, .55); color: #04261a;
  box-shadow: 0 14px 30px -12px rgba(46, 230, 166, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.amber {
  background: linear-gradient(135deg, #ffc46e, #f59e3d);
  border-color: rgba(255, 180, 84, .55); color: #2d1700;
  box-shadow: 0 14px 30px -12px rgba(255, 180, 84, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn.ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--mut); box-shadow: none; font-weight: 600;
}
.btn.ghost:hover { color: var(--text); border-color: rgba(125, 165, 255, .3); }
/* CTA 掃光 */
.btn.green::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 36%; left: -50%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); animation: sheen 3.2s ease-in-out 1s infinite;
}
@keyframes sheen { 0%, 55%, 100% { left: -50%; } 25% { left: 120%; } }

/* ---------- 輸入框 ---------- */
input {
  width: 100%; padding: 13px 14px; margin: 7px 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(8, 13, 24, .8); color: var(--text); font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: rgba(147, 160, 185, .55); }
input:focus {
  outline: none; border-color: rgba(46, 230, 166, .6);
  box-shadow: 0 0 0 3px rgba(46, 230, 166, .15);
}
:where(button, a, .opt):focus-visible {
  outline: 2px solid var(--vital); outline-offset: 2px;
}

/* ---------- 選項（題目作答） ---------- */
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; margin: 10px 0; cursor: pointer;
  background: rgba(12, 18, 32, .6);
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .2s;
}
.opt:hover { border-color: rgba(125, 165, 255, .4); background: rgba(18, 27, 47, .8); }
.opt:active { transform: scale(.985); }
.opt .k {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: 1px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  color: var(--mut); border: 1px solid var(--line); border-radius: 9px;
  background: rgba(8, 13, 24, .8);
  transition: all .15s ease;
}
.opt .ot { flex: 1; min-width: 0; }
@keyframes pop { 0% { transform: scale(.96); } 55% { transform: scale(1.015); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } 85% { transform: translateX(-2px); } }
.opt.correct {
  border-color: rgba(46, 230, 166, .8); background: rgba(46, 230, 166, .1);
  box-shadow: 0 0 0 1px rgba(46, 230, 166, .35), 0 8px 28px -10px rgba(46, 230, 166, .35);
  animation: pop .35s ease;
}
.opt.correct .k { background: var(--vital); border-color: var(--vital); color: #04261a; }
.opt.wrong {
  border-color: rgba(255, 93, 115, .75); background: rgba(255, 93, 115, .1);
  animation: shake .4s ease;
}
.opt.wrong .k { background: var(--red); border-color: var(--red); color: #2c0410; }

/* ---------- 解析 / 徽章 ---------- */
.expl {
  border-left: 3px solid var(--vital);
  background: rgba(10, 18, 32, .85); padding: 12px 14px;
  border-radius: 0 12px 12px 0; margin: 12px 0; font-size: 14px;
  animation: rise .4s ease backwards;
}
.badge {
  display: inline-block; font-size: 11.5px; font-family: var(--mono); font-weight: 500;
  padding: 3px 9px; border-radius: 20px; letter-spacing: .5px;
  background: rgba(125, 165, 255, .12); color: var(--mut);
  border: 1px solid var(--line); margin-left: 6px;
}
.badge.ai { background: rgba(77, 163, 255, .15); color: #aacdff; border-color: rgba(77, 163, 255, .35); }

.meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--mut); }
.meta a { color: var(--mut); } .meta a:hover { color: var(--text); }
#progress { font-family: var(--mono); font-weight: 500; letter-spacing: .5px; }

/* ---------- 答題進度條 ---------- */
.pbar {
  height: 3px; border-radius: 3px; margin: 10px 0 4px;
  background: rgba(125, 165, 255, .12); overflow: hidden;
}
.pbar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), var(--vital));
  box-shadow: 0 0 12px rgba(46, 230, 166, .6);
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--mut); padding: 8px; text-align: left;
  border-bottom: 1px solid var(--line);
}
td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: none; }

.err { color: var(--red); font-size: 14px; }
.qimg { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; background: #fff; padding: 4px; }

/* ---------- 登入/註冊 Hero ---------- */
.hero { text-align: center; margin: 34px 0 20px; }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-size: 36px; margin: 8px 0 0;
  letter-spacing: 4px;
  background: linear-gradient(95deg, var(--blue) 10%, var(--vital) 60%, #9ff5d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(46, 230, 166, .25));
}
.hero p { margin: 8px 0 0; color: var(--mut); font-size: 13.5px; letter-spacing: 2px; }
/* 自繪心跳：stroke 描邊動畫 */
.ecg { width: min(300px, 80%); height: 56px; margin: 0 auto; display: block; overflow: visible; }
.ecg polyline {
  fill: none; stroke: var(--vital); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 560; stroke-dashoffset: 560;
  filter: drop-shadow(0 0 6px rgba(46, 230, 166, .8));
  animation: ecgdraw 2.6s cubic-bezier(.4, 0, .2, 1) .2s forwards;
}
@keyframes ecgdraw { to { stroke-dashoffset: 0; } }

/* ---------- 首頁：生命徵象儀表板 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat {
  position: relative; padding: 14px 12px 12px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.stat b {
  display: block; font-family: var(--mono); font-weight: 700;
  font-size: 26px; line-height: 1.15; color: var(--vital);
  text-shadow: 0 0 18px rgba(46, 230, 166, .45);
}
.stat span { font-size: 11.5px; color: var(--mut); letter-spacing: 1px; }
.stat.blue b { color: var(--blue); text-shadow: 0 0 18px rgba(77, 163, 255, .45); }
.stat.amber b { color: var(--amber); text-shadow: 0 0 18px rgba(255, 180, 84, .45); }
@keyframes blip { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 230, 166, .5); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(46, 230, 166, 0); } }
.stat .dot {
  position: absolute; top: 10px; right: 10px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--vital); animation: blip 1.6s ease infinite;
}

/* 主功能卡 */
.action {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; margin: 10px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .2s ease;
}
.action:hover { transform: translateY(-1px); border-color: rgba(125, 165, 255, .35); }
.action:active { transform: scale(.985); }
.action .ic {
  flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; background: rgba(77, 163, 255, .12);
  border: 1px solid rgba(77, 163, 255, .25); color: var(--blue);
}
.action.vital .ic { background: var(--vital-dim); border-color: rgba(46, 230, 166, .35); color: var(--vital); }
.action.warn .ic { background: rgba(255, 180, 84, .12); border-color: rgba(255, 180, 84, .3); color: var(--amber); }
.action .tx { flex: 1; min-width: 0; }
.action .tx b { display: block; font-family: var(--display); font-size: 15.5px; letter-spacing: .5px; }
.action .tx span { font-size: 12.5px; color: var(--mut); }
.action .arr { color: var(--mut); flex: 0 0 auto; transition: transform .15s; }
.action:hover .arr { transform: translateX(3px); color: var(--text); }
.action.primary {
  background: linear-gradient(135deg, rgba(46, 230, 166, .16), rgba(15, 22, 38, .8) 55%);
  border-color: rgba(46, 230, 166, .45);
}

/* ---------- 排行榜 ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 16px 0 14px; }
.pod {
  text-align: center; padding: 14px 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
}
.pod .medal { font-size: 22px; display: block; }
.pod .nm { display: block; font-weight: 700; font-size: 14px; margin: 4px 0 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { font-family: var(--mono); font-weight: 700; color: var(--vital); font-size: 18px; }
.pod .sc { display: block; }
.pod .ac { display: block; font-size: 10.5px; color: var(--mut); font-family: var(--mono); white-space: nowrap; }
.pod.first { padding-top: 20px; border-color: rgba(255, 200, 90, .45);
  background: linear-gradient(180deg, rgba(255, 200, 90, .1), var(--panel) 65%); }
.pod.me { border-color: rgba(46, 230, 166, .55); box-shadow: 0 0 0 1px rgba(46, 230, 166, .25); }
.pod.first .sc { font-size: 22px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; margin: 8px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.lb-row.me { border-color: rgba(46, 230, 166, .55); box-shadow: 0 0 0 1px rgba(46, 230, 166, .25); }
.lb-row .rank {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  border-radius: 9px; background: rgba(125, 165, 255, .1); color: var(--mut);
  border: 1px solid var(--line);
}
.lb-row .who { flex: 1; min-width: 0; }
.lb-row .who b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .who .bar { height: 4px; border-radius: 4px; background: rgba(125, 165, 255, .12); margin-top: 5px; overflow: hidden; }
.lb-row .who .bar i { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), var(--vital)); }
.lb-row .num { flex: 0 0 auto; text-align: right; font-family: var(--mono); }
.lb-row .num b { display: block; color: var(--vital); font-size: 16px; font-weight: 700; }
.lb-row .num span { font-size: 11px; color: var(--mut); }
.lb-row .num b small, .pod .sc small { font-size: 10px; font-weight: 600; color: var(--mut); margin-left: 1px; }
.lb-row.dim { opacity: .55; }
/* 排行榜分頁切換 */
.lb-tabs { display: flex; gap: 4px; padding: 4px; margin: 14px 0 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.lb-tab { flex: 1; padding: 9px 6px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--mut); font-size: 13px; font-weight: 700;
  font-family: inherit; transition: background .15s, color .15s; }
.lb-tab.active { background: rgba(46, 230, 166, .14); color: var(--vital);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 166, .35); }
.lb-panel.hidden { display: none; }
.lb-note { text-align: center; color: var(--mut); font-size: 12px; margin-top: 14px; }

/* ---------- 每日新題彈窗 ---------- */
#ai-notice-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 6, 12, .65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { opacity: 0; transform: scale(.92) translateY(10px); } }
#ai-notice {
  background: var(--panel-solid); border: 1px solid rgba(46, 230, 166, .5);
  border-radius: 20px; padding: 24px; max-width: 360px; width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7), 0 0 40px -18px rgba(46, 230, 166, .5);
  animation: popin .35s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 模擬考設定 ---------- */
#subj-pick { display: flex; gap: 10px; }
.subj {
  flex: 1; padding: 14px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(8, 13, 24, .6);
  color: var(--mut); font-family: var(--display); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.subj:active { transform: scale(.97); }
.subj.active {
  border-color: rgba(46, 230, 166, .7); background: var(--vital-dim);
  color: var(--vital); box-shadow: 0 0 0 1px rgba(46, 230, 166, .3);
}
input[type=range] { accent-color: var(--vital); height: 30px; padding: 0; border: none; background: transparent; }
#qn-val { font-family: var(--mono); color: var(--vital); }

/* ---------- AI 助教 ---------- */
#ai-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50; border: 1px solid rgba(77, 163, 255, .5); border-radius: 30px;
  padding: 12px 18px; cursor: pointer;
  background: linear-gradient(135deg, #2a6fd6, #1c4fa8);
  color: #eaf3ff; font-weight: 700; font-family: var(--display); letter-spacing: .5px;
  box-shadow: 0 14px 34px -10px rgba(38, 99, 196, .65);
  transition: transform .15s ease;
}
#ai-fab:hover { transform: translateY(-2px); }
#ai-fab:active { transform: scale(.95); }
#ai-panel {
  display: none; position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(380px, 92vw); height: min(70vh, 520px); z-index: 51;
  background: rgba(13, 19, 33, .92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px;
  flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .75);
  animation: panelup .3s cubic-bezier(.22, 1, .36, 1);
}
@keyframes panelup { from { opacity: 0; transform: translateY(18px) scale(.98); } }
#ai-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 15px; font-weight: 700; font-family: var(--display); letter-spacing: .5px;
  background: rgba(8, 13, 24, .8); border-bottom: 1px solid var(--line-soft);
}
#ai-head button { background: none; border: none; color: var(--mut); font-size: 22px; line-height: 1; cursor: pointer; }
#ai-head button:hover { color: var(--text); }
#ai-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.ai-bubble {
  max-width: 85%; padding: 9px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  animation: rise .25s ease backwards;
}
.ai-user { align-self: flex-end; background: linear-gradient(135deg, #2a6fd6, #1c4fa8);
  color: #eaf3ff; border-bottom-right-radius: 5px; }
.ai-assistant { align-self: flex-start; background: rgba(125, 165, 255, .1);
  border: 1px solid var(--line-soft); color: var(--text); border-bottom-left-radius: 5px; }
#ai-note { text-align: center; font-size: 11px; color: var(--mut); opacity: .7; padding: 2px; }
#ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); }
#ai-input input { flex: 1; margin: 0; }
#ai-input button {
  border: none; border-radius: 11px; padding: 0 16px; cursor: pointer;
  background: linear-gradient(135deg, #1ed492, #0fae8d); color: #04261a; font-weight: 700;
}

/* ---------- 內建閱讀 BGM ---------- */
#bgm-holder { position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
#bgm-pill {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 30px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(13, 19, 33, .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--mut); font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .5px; box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .8);
  transition: all .2s ease;
}
#bgm-pill.playing { border-color: rgba(46, 230, 166, .5); color: var(--vital); }
#bgm-pill .eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
#bgm-pill .eq i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
#bgm-pill.playing .eq i { animation: eq 1s ease-in-out infinite; }
#bgm-pill.playing .eq i:nth-child(2) { animation-delay: .25s; }
#bgm-pill.playing .eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 12px; } }
#bgm-link {
  position: fixed; left: 16px; z-index: 50;
  bottom: calc(16px + env(safe-area-inset-bottom) + 40px);
  font-family: var(--mono); font-size: 11px; letter-spacing: .5px;
  color: var(--mut); opacity: .72; text-decoration: none;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line); background: rgba(13, 19, 33, .8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: opacity .2s ease, color .2s ease, border-color .2s ease;
}
#bgm-link:hover { opacity: 1; color: var(--vital); border-color: rgba(46, 230, 166, .5); }

/* ---------- 完成一份試題：正向英文金句 + 導流卡 ---------- */
.card.endquote { text-align: center; }
.endquote .eq-quote {
  font-size: 15px; line-height: 1.6; font-style: italic;
  color: var(--vital); margin: 4px 0 14px;
}
.endquote .eq-link {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  letter-spacing: .5px; color: var(--mut); text-decoration: none;
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line);
  transition: color .2s ease, border-color .2s ease;
}
.endquote .eq-link:hover { color: var(--vital); border-color: rgba(46, 230, 166, .5); }

/* ---------- 小頻道導流卡（排行榜等）---------- */
.channel-card {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 4px;
  padding: 12px 16px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--line); background: rgba(13, 19, 33, .7);
  transition: border-color .2s ease, transform .2s ease;
}
.channel-card:hover { border-color: rgba(46, 230, 166, .5); transform: translateY(-1px); }
.channel-card .cc-ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(46, 230, 166, .12); color: var(--vital); font-size: 16px;
}
.channel-card .cc-tx { display: flex; flex-direction: column; line-height: 1.35; }
.channel-card .cc-tx b { color: var(--text); font-size: 14px; letter-spacing: .3px; }
.channel-card .cc-tx span { color: var(--mut); font-size: 11px; }
.channel-card .cc-go { margin-left: auto; color: var(--mut); font-size: 16px; }
.channel-card:hover .cc-go { color: var(--vital); }

/* ---------- 捲軸與動效偏好 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(125, 165, 255, .2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
