:root {
  --bg: #0f0c1d;
  --bg2: #171329;
  --card: #1e1934;
  --card2: #272042;
  --line: #342b55;
  --text: #f4f1ff;
  --muted: #a69fc4;
  --dim: #6f6893;
  --pink: #ff4d8d;
  --violet: #8b5cf6;
  --gold: #ffc857;
  --ok: #34d399;
  --grad: linear-gradient(135deg, var(--pink), var(--violet));
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --top: 60px;
  --tab: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(255, 77, 141, .12), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 24px; padding: 0 20px;
  background: rgba(15, 12, 29, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(52, 43, 85, .6);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; letter-spacing: .3px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.topnav a:hover { color: var(--text); background: var(--card); }
.topnav a.on { color: var(--text); background: var(--card2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- tab bar (mobile) ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav { display: none; }
  .topbar { padding: 0 16px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 12, 29, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--dim); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.tab-main svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--grad); color: #fff; margin-top: -18px; box-shadow: 0 6px 20px rgba(255, 77, 141, .4); }
  main { padding-bottom: calc(var(--tab) + 24px + env(safe-area-inset-bottom)) !important; }
}

main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; outline: none; }
@media (max-width: 760px) { main { padding: 16px 16px 0; } }

/* ---------- common ---------- */
h1 { font-size: 26px; margin: 0 0 4px; font-weight: 900; }
h2 { font-size: 19px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.section { margin-top: 32px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow p { margin: 2px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .12s, background .2s, opacity .2s;
}
.btn:hover { background: var(--card2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border: 0; box-shadow: 0 6px 20px rgba(255, 77, 141, .28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 17px; }
.btn.icon { width: 42px; padding: 0; }
.btn.on { border-color: var(--pink); color: var(--pink); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.lg svg { width: 22px; height: 22px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--violet); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.7; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--pink); width: 16px; height: 16px; }
.err { color: #ff8fa8; font-size: 14px; min-height: 1em; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--card2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 77, 141, .35); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 77, 141, .35); cursor: pointer; }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--card2); flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; overflow: hidden; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.cover { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card2); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.cover .ph svg { width: 38%; height: 38%; fill: rgba(255, 255, 255, .85); }

.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 56px; height: 56px; stroke: var(--dim); fill: none; stroke-width: 1.5; margin: 0 auto 12px; display: block; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--card2); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); z-index: 99;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 760px) { #toast { bottom: calc(var(--tab) + 20px); } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 34px 30px; margin-bottom: 26px;
  background: linear-gradient(120deg, rgba(255, 77, 141, .22), rgba(139, 92, 246, .28)), var(--card);
  border: 1px solid var(--line);
}
.hero h1 { font-size: 30px; line-height: 1.25; }
.hero p { color: var(--muted); max-width: 460px; margin: 8px 0 20px; }
.hero > :not(.eq) { position: relative; z-index: 1; }
.hero .eq { position: absolute; right: 30px; bottom: 0; display: flex; gap: 6px; align-items: flex-end; height: 120px; opacity: .55; }
.hero .eq i { width: 10px; border-radius: 6px 6px 0 0; background: var(--grad); animation: eq 1.2s ease-in-out infinite alternate; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
@media (max-width: 760px) { .hero { padding: 24px 20px; } .hero h1 { font-size: 23px; } .hero > :not(.eq) { position: relative; z-index: 1; }
.hero .eq { right: 12px; height: 70px; } }

/* ---------- recording cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.rcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .18s, border-color .18s; }
.rcard:hover { transform: translateY(-3px); border-color: #4a3d78; }
.rcard .cover { border-radius: 0; }
.rcard .play { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid; place-items: center; backdrop-filter: blur(6px); }
.rcard .play svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
.rcard .badge { position: absolute; left: 10px; top: 10px; background: rgba(0, 0, 0, .55); padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--gold); backdrop-filter: blur(6px); }
.rcard .body { padding: 12px 14px 14px; }
.rcard .t { font-weight: 700; }
.rcard .meta { display: flex; gap: 12px; color: var(--dim); font-size: 12px; margin-top: 8px; }
.rcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.rcard .meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.rcard .who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .rcard .body { padding: 10px; } .rcard .meta { gap: 8px; } }

/* ---------- song list ---------- */
.slist { display: flex; flex-direction: column; gap: 2px; }
.srow { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; transition: background .15s; }
.srow:hover { background: var(--card); }
.srow .cover { width: 56px; flex: none; border-radius: 10px; }
.srow .rank { width: 22px; text-align: center; font-weight: 900; color: var(--dim); font-size: 16px; }
.srow:nth-child(-n+3) .rank { color: var(--pink); }
.searchbar { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--dim); fill: none; stroke-width: 2; }
.searchbar .input { padding-left: 42px; border-radius: 999px; }

/* ---------- song page ---------- */
.song-hero { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: end; margin-bottom: 28px; }
.song-hero .cover { border-radius: 18px; box-shadow: var(--shadow); }
.song-hero h1 { font-size: 32px; }
@media (max-width: 640px) { .song-hero { grid-template-columns: 1fr; text-align: center; } .song-hero .cover { width: 200px; margin: 0 auto; } .song-hero .row { justify-content: center; } }
.lyrics-preview { max-height: 320px; overflow: auto; white-space: pre-line; color: var(--muted); line-height: 2; }

/* ---------- sing stage ---------- */
.stage { position: relative; border-radius: 24px; overflow: hidden; min-height: calc(100vh - var(--top) - 60px); display: flex; flex-direction: column; background: #0b0917; border: 1px solid var(--line); }
@media (max-width: 760px) { .stage { min-height: calc(100vh - var(--top) - var(--tab) - 40px); margin: -4px -6px 0; border-radius: 18px; } }
.stage .bgart { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.35) saturate(1.3); transform: scale(1.1); }
.stage > *:not(.bgart) { position: relative; }
.stage-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.stage-head .cover { width: 46px; border-radius: 10px; }
.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 20px; }
.stage-foot { padding: 16px 18px 20px; }
.lyrics-box { height: 300px; overflow: hidden; position: relative; mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.lyrics-track { transition: transform .45s cubic-bezier(.2, .8, .2, 1); text-align: center; }
.lyrics-track p { margin: 0; height: 50px; line-height: 50px; font-size: 19px; color: rgba(244, 241, 255, .38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s, transform .3s; }
.lyrics-track p.on { color: #fff; font-size: 25px; font-weight: 900; transform: scale(1.02); text-shadow: 0 0 22px rgba(255, 77, 141, .55); }
.lyrics-track p.on span { background: var(--grad); -webkit-background-clip: text; background-clip: text; }
.lyrics-static { max-height: 300px; overflow: auto; text-align: center; white-space: pre-line; line-height: 2.1; font-size: 18px; color: rgba(244, 241, 255, .8); }
@media (max-width: 520px) { .lyrics-track p { font-size: 16px; } .lyrics-track p.on { font-size: 20px; } }
.pitch-wrap { position: relative; height: 90px; border-radius: 14px; background: rgba(0, 0, 0, .3); overflow: hidden; margin-bottom: 14px; }
.pitch-wrap canvas { width: 100%; height: 100%; display: block; }
.pitch-wrap .note { position: absolute; right: 12px; top: 8px; font-weight: 900; font-size: 20px; color: var(--gold); }
.progress { height: 5px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--grad); }
.stage > .countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 900; z-index: 5; background: rgba(11, 9, 23, .6); }
.countdown span { animation: pop .9s ease-out; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.meter { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--gold), var(--pink)); transition: width .06s; }
.setup { max-width: 520px; margin: 0 auto; }
.tip { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(139, 92, 246, .14); border: 1px solid rgba(139, 92, 246, .35); font-size: 14px; }
.tip svg { width: 22px; height: 22px; stroke: #c4b5fd; fill: none; stroke-width: 2; }
.ctrl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctrl-row .vol { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- review ---------- */
.score-ring { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; font-weight: 900; }
.score-ring .v small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; text-align: center; margin-top: -6px; }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 520px) { .presets { grid-template-columns: repeat(3, 1fr); } }
.preset { padding: 12px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; text-align: center; font-weight: 700; font-size: 14px; }
.preset.on { border-color: var(--pink); background: rgba(255, 77, 141, .12); color: #fff; }
.slider { display: grid; grid-template-columns: 76px 1fr 54px; align-items: center; gap: 12px; font-size: 14px; }
.slider output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.review-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .review-grid { grid-template-columns: 1fr; } }
.player-bar { display: flex; align-items: center; gap: 12px; }
.player-bar .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 40px; }
.playbtn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--grad); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 6px 20px rgba(255, 77, 141, .35); }
.playbtn svg { width: 22px; height: 22px; fill: #fff; }
.bar-prog { position: relative; height: 6px; border-radius: 99px; background: var(--card2); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--grad); }

/* ---------- recording page ---------- */
.rec-page { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .rec-page { grid-template-columns: 1fr; } }
.disc-wrap { position: relative; border-radius: 24px; overflow: hidden; padding: 30px 20px 24px; background: #0b0917; border: 1px solid var(--line); }
.disc { width: min(240px, 60vw); aspect-ratio: 1; margin: 0 auto 20px; border-radius: 50%; padding: 14px; background: repeating-radial-gradient(circle, #15121f 0 2px, #1f1b2d 2px 4px); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: spin 14s linear infinite; animation-play-state: paused; }
.disc.spin { animation-play-state: running; }
.disc .cover { border-radius: 50%; width: 100%; }
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.like.on { color: var(--pink); border-color: var(--pink); }
.like.on svg { fill: var(--pink); }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border: 0; }
.comment .b { white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 10px; }
.comment-form .input { border-radius: 999px; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 22px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.stats { display: flex; gap: 22px; margin-top: 10px; }
.stats b { display: block; font-size: 19px; }
.stats span { color: var(--muted); font-size: 12px; }

/* ---------- upload / sync ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .upload-grid { grid-template-columns: 1fr; } }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--violet); background: rgba(139, 92, 246, .06); }
.drop svg { width: 34px; height: 34px; stroke: var(--violet); fill: none; stroke-width: 1.8; }
.drop b { color: var(--text); }
.cover-pick { width: 110px; flex: none; cursor: pointer; }
.sync-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.sync-line { display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid rgba(52, 43, 85, .5); font-size: 14px; cursor: pointer; }
.sync-line:last-child { border: 0; }
.sync-line .ts { width: 72px; flex: none; font-family: ui-monospace, Consolas, monospace; color: var(--dim); font-size: 13px; }
.sync-line.done .ts { color: var(--ok); }
.sync-line.cur { background: rgba(255, 77, 141, .14); }
.sync-line.cur .ts { color: var(--pink); }
.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--card2); font-size: 12px; font-family: ui-monospace, monospace; }
.upbar { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.upbar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 30px auto; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tabs2 button { border: 0; background: none; padding: 9px; border-radius: 999px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs2 button.on { background: var(--card2); color: var(--text); }

.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 40px 0 10px; }

/* ---------- featured / admin ---------- */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 16px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 26px; scrollbar-width: thin; }
@media (max-width: 520px) { .strip { grid-auto-columns: 150px; gap: 12px; } }
.rcard .badge.feat { left: auto; right: 10px; color: #fff; background: var(--grad); }
.tag { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: rgba(139, 92, 246, .2); color: #c4b5fd; }
.tag.red { background: rgba(255, 59, 92, .18); color: #ff8fa8; }
.tag.gold { background: rgba(255, 200, 87, .18); color: var(--gold); }
.btn.danger { border-color: rgba(255, 59, 92, .5); color: #ff8fa8; }
.btn.danger:hover { background: rgba(255, 59, 92, .12); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat small { color: var(--ok); font-size: 12px; margin-left: 6px; }
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 10px; border-bottom: 1px solid rgba(52, 43, 85, .5); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable .cover { width: 40px; border-radius: 8px; }
.atable .acts { text-align: right; white-space: nowrap; }
.atable .acts .btn { vertical-align: middle; }
.atable .acts .btn + .btn { margin-left: 6px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cbody { max-width: 380px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 歌詞時間軸編輯 ---------- */
.sync-line.edit { align-items: center; gap: 4px; padding: 5px 8px; cursor: default; }
.sync-line.playing { background: rgba(139, 92, 246, .18); }
.sync-line .ib { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.sync-line .ib:hover { background: var(--card2); color: var(--text); border-color: var(--line); }
.sync-line .ib.del:hover { color: #ff8fa8; }
.sync-line input { background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 6px; outline: none; color: var(--text); min-width: 0; }
.sync-line input:hover { border-color: var(--line); }
.sync-line input:focus { border-color: var(--violet); background: var(--bg); }
.sync-line .ts-in { width: 78px; flex: none; font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--dim); }
.sync-line.done .ts-in { color: var(--ok); }
.sync-line .ts-in.bad { border-color: #ff3b5c; color: #ff8fa8; }
.sync-line .tx-in { flex: 1; font-size: 14px; }
@media (max-width: 520px) { .sync-line [data-act="minus"], .sync-line [data-act="plus"] { display: none; } }

/* ---------- 延遲校正 ---------- */
.beats { display: flex; gap: 8px; justify-content: center; }
.beats i { width: 22px; height: 22px; border-radius: 50%; background: var(--card2); border: 2px solid var(--line); transition: background .08s, transform .08s; }
.beats i.pre { border-style: dashed; }
.beats i.on { background: var(--grad); border-color: transparent; transform: scale(1.15); }
.beats i.pre.on { background: var(--muted); }

@media (max-width: 760px) { .top-right a[href="#/admin"] { display: none; } }

/* ---------- 自動封面 ---------- */
.cover-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cchoice { width: 54px; height: 54px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--card2); cursor: pointer; flex: none; }
.cchoice img { width: 100%; height: 100%; object-fit: cover; }
.cchoice.on { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(255, 77, 141, .3); }
.cchoice.none { color: var(--muted); font-size: 16px; }

.cchoice { position: relative; }
.cchoice .src { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-size: 9px; font-weight: 900; line-height: 1; padding: 2px 3px; border-radius: 4px; background: rgba(0, 0, 0, .65); color: #fff; }
/* 下拉選單 */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--card); }

.badge-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; }
a.stat { display: block; }
a.stat:hover { border-color: #4a3d78; }

.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.logrow > td { background: var(--bg2); padding: 6px 10px 10px !important; }
.atable.logs th { font-size: 11px; }
.atable.logs td { padding: 7px 10px; }
