:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1b1f24; --muted: #6a737d; --line: #e3e6ea;
  --accent: #2f6fde; --accent-soft: #e8f0fd; --ok: #1f883d; --warn: #b35900; --bad: #cf222e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --panel: #1a1e23; --text: #e6e8eb; --muted: #8b949e; --line: #2b3138;
    --accent: #5b93f0; --accent-soft: #1d2a3f; --ok: #3fb950; --warn: #d29922; --bad: #f85149;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; padding: 8px 14px;
  background: var(--accent); color: #fff; }
button.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
button.link { background: none; color: var(--accent); padding: 4px 6px; }
input[type=password], input[type=search] { font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus-visible, button:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.4em; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); padding: 24px; display: grid; gap: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.brand { font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; color: var(--muted); padding: 6px 12px; }
.tabs button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
#stats { margin-left: auto; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

.drop { display: grid; place-items: center; gap: 6px; text-align: center; padding: 48px 16px;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-size: 16px; font-weight: 600; }
.options { margin: 12px 0; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 8px 0; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.summary { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 12px; color: var(--muted); }
.summary b { color: var(--text); font-weight: 600; }
.verdict { font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.verdict.ok { color: var(--ok); } .verdict.none { color: var(--warn); }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.song { min-width: 16em; }
td[dir=auto], .title, .muted[dir=auto], .lyric { text-align: left; }
.title { font-weight: 600; }
.lyric { color: var(--muted); font-size: 13px; margin-top: 2px; }
.segment { color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--line);
  color: var(--text); white-space: nowrap; }
.tag.best { background: var(--accent-soft); color: var(--accent); }
.tag.yes { color: var(--ok); }
.scorebar { display: inline-block; vertical-align: middle; width: 60px; height: 6px; margin-left: 6px;
  background: var(--line); border-radius: 3px; overflow: hidden; }
.scorebar i { display: block; height: 100%; background: var(--accent); }

.searchbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.searchbar input { max-width: 480px; }
#more { margin: 12px auto 0; display: block; }

.detail { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); overflow-y: auto; z-index: 3; }
.detail-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
#detail-body { padding: 12px 16px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; text-align: left; }
.section { margin-top: 16px; font-weight: 600; }
pre.lrc { white-space: pre-wrap; font: 13px/1.5 inherit; max-height: 320px; overflow-y: auto; background: var(--bg);
  padding: 8px; border-radius: 6px; }

@media (max-width: 640px) {
  .top { padding: 10px 16px; gap: 10px; }
  #stats { display: none; }
  main { padding: 16px 16px 60px; }
}

.fileid { font-size: 12px; word-break: break-all; user-select: all; }
