/* 切片工具和 hub 共用的界面样式：三套主题（剪辑台 / 清爽 / 应援色）+ 按钮、输入框、分段按钮、标签、卡片、左侧导航。
   放在 asoul_hub 包里是因为 hub 服务器只部署 src/asoul_hub；客户端（审核页面）也从这里读，两边是同一份。
   主题切换：<html data-theme="studio|clean|cheer">，选择存在浏览器 localStorage 的 asoul.theme。
   不引任何外部字体、脚本（国内服务器、离线电脑都要能用）。 */

:root, [data-theme="studio"] {
  color-scheme: dark;
  --bg: #0e0f11; --chrome: #121316; --panel: #131417; --panel2: #1d1f24; --hover: #23262c;
  --line: #23262c; --line2: #2c2f36; --line3: #4a5060;
  --text: #e7e9ec; --text2: #cfd3d9; --dim: #9aa1ab; --faint: #5b6270;
  --accent: #3d7bf0; --accent-fg: #ffffff; --accent-soft: rgba(61, 123, 240, .16); --accent-line: rgba(61, 123, 240, .6); --accent-text: #8fb4ff;
  --ok: #1f8a57; --ok-text: #6fdca4; --ok-soft: #15281f; --ok-line: #2e6b4c;
  --bad: #c9434c; --bad-text: #ff8d93; --bad-soft: #2c1517; --bad-line: #5b2a30;
  --warn: #f2b33d; --warn-text: #f2c46a; --warn-soft: #2a2210; --warn-line: #6b5426;
  --info-text: #b9c2f0; --info-soft: #1e2138;
  --input-bg: #0e0f11; --video-bg: #000000; --overlay: rgba(0, 0, 0, .72);
  --r: 10px; --r-sm: 6px; --btn-r: 6px; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  /* 候选类别的颜色（审核页面的筛选、候选分布总览、话题时间轴的候选轨道）：按 categories.CATEGORIES 的顺序取 1~7，
     「其他」是灰、「未分类」是灰色斜纹；深色主题用暗底那一套（2026-11-01 用 dataviz 的校验脚本查过色盲区分度和对比度） */
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9;
  --cat-other: #80868f; --cat-none: #5b6270;
}
[data-theme="clean"] {
  color-scheme: light;
  --bg: #f3f4f6; --chrome: #ffffff; --panel: #ffffff; --panel2: #f4f5f8; --hover: #eceef2;
  --line: #e4e7ec; --line2: #d5dae1; --line3: #aab3bf;
  --text: #18202a; --text2: #2f3743; --dim: #5b6472; --faint: #aab3bf;
  --accent: #2156d9; --accent-fg: #ffffff; --accent-soft: #eaf0fd; --accent-line: #9db8f2; --accent-text: #2156d9;
  --ok: #16794a; --ok-text: #16794a; --ok-soft: #e3f5ea; --ok-line: #a7dcbd;
  --bad: #c23a43; --bad-text: #b4262f; --bad-soft: #fde8ea; --bad-line: #f5c2c6;
  --warn: #d68a00; --warn-text: #8a5200; --warn-soft: #fff4e0; --warn-line: #f3d9a6;
  --info-text: #3446a8; --info-soft: #eceffd;
  --input-bg: #ffffff; --video-bg: #0b0c0e; --overlay: rgba(16, 24, 40, .45);
  --r: 12px; --r-sm: 8px; --btn-r: 8px; --shadow: 0 12px 32px rgba(16, 24, 40, .16);
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6;
  --cat-other: #8b929c; --cat-none: #aab3bf;
}
[data-theme="cheer"] {
  color-scheme: dark;
  --bg: #15111b; --chrome: #18131f; --panel: #1d1725; --panel2: #271f31; --hover: #2e253a;
  --line: #2a2135; --line2: #3e3250; --line3: #5c4b74;
  --text: #f1ecf6; --text2: #e2d9ee; --dim: #b0a5c0; --faint: #6a5c7c;
  --accent: #f07aa6; --accent-fg: #2a0f1c; --accent-soft: #3a2236; --accent-line: #8a4a6c; --accent-text: #f5a3c4;
  --ok: #237a52; --ok-text: #9ff0c4; --ok-soft: #1d3a2c; --ok-line: #2f7a55;
  --bad: #c9434c; --bad-text: #ffa3a9; --bad-soft: #3d1d22; --bad-line: #6a3038;
  --warn: #f2b33d; --warn-text: #ffd98a; --warn-soft: #3a2e14; --warn-line: #6b5426;
  --info-text: #d4bfff; --info-soft: #2a2140;
  --input-bg: #15111b; --video-bg: #08060b; --overlay: rgba(8, 6, 11, .75);
  --r: 16px; --r-sm: 10px; --btn-r: 999px; --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9;
  --cat-other: #8a8196; --cat-none: #6a5c7c;
}
:root {
  --font: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "Microsoft YaHei UI", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent-text); }
code { font: 12px var(--mono); background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }

/* ---------- 按钮：所有 <button> 默认就是按钮的样子 ---------- */
button, .btn {
  font: inherit; font-size: 13px; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: var(--btn-r); border: 1px solid var(--line2); background: var(--panel2);
  color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { border-color: var(--line3); background: var(--hover); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
button svg, .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
button.ok:hover { filter: brightness(1.1); }
button.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-text); }
button.bad:hover { border-color: var(--bad-text); }
button.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
button.danger { background: transparent; color: var(--bad-text); }
button.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
button.ghost:hover, .btn.ghost:hover { background: var(--panel2); color: var(--text); border-color: transparent; }
button.link { background: transparent; border-color: transparent; color: var(--accent-text); padding: 0 4px; min-height: 0; }
button.on, button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
button.sm, .btn.sm { min-height: 26px; padding: 0 9px; font-size: 12px; }
button.xs { min-height: 22px; padding: 0 7px; font-size: 11px; gap: 4px; }
button.lg { min-height: 44px; padding: 0 18px; font-size: 14px; }
button.icon { padding: 0; width: 32px; }

/* 分段按钮：一组挨着的按钮（筛选、±秒数、日志来源） */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--btn-r); overflow: hidden; background: var(--panel); flex-shrink: 0; }
.seg > button { border: 0; border-radius: 0; border-right: 1px solid var(--line2); background: transparent; min-height: 30px; padding: 0 10px; font-size: 12px; color: var(--text2); }
.seg > button:last-child { border-right: 0; }
.seg > button:hover { background: var(--hover); }
.seg > button.on { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.seg.mono > button { font-family: var(--mono); padding: 0 8px; }

/* 下划线标签页 */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.tabs > button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; min-height: 40px; padding: 0 2px; color: var(--dim); }
.tabs > button:hover { background: transparent; color: var(--text); }
.tabs > button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs > button .n { width: 18px; height: 18px; border-radius: 9px; background: var(--panel2); color: var(--dim); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tabs > button.on .n { background: var(--accent); color: var(--accent-fg); }

/* ---------- 输入框 ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--input-bg); border: 1px solid var(--line2);
  border-radius: var(--r-sm); min-height: 32px; padding: 4px 10px;
}
[data-theme="cheer"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), [data-theme="cheer"] select { border-radius: 10px; }
textarea { padding: 8px 10px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.tc, input.tc { font-family: var(--mono); font-variant-numeric: tabular-nums; }

kbd, .kbd { font: 11px/16px var(--mono); padding: 0 5px; border-radius: 4px; border: 1px solid var(--line2); color: var(--dim); background: var(--bg); }
button.ok kbd, button.primary kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .75; }

/* ---------- 标签、圆点、卡片 ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 999px;
  background: var(--panel2); color: var(--dim); white-space: nowrap; border: 1px solid transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); }
/* 转圈：正在做的事（投稿中、出片中、试一下……）前面放一个；系统设置了「减少动画」时不转，只是一个点 */
.spin { display: inline-block; width: 1em; height: 1em; margin-right: 6px; vertical-align: -0.15em; flex-shrink: 0; box-sizing: border-box;
        border-radius: 50%; border: 2px solid var(--line3); border-top-color: var(--accent); animation: asoul-spin .8s linear infinite; }
@keyframes asoul-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-color: var(--accent); } }
.busy { color: var(--text); font-weight: 600; }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad-text); }
.chip.info { background: var(--info-soft); color: var(--info-text); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.chip.line { background: transparent; border-color: var(--line2); color: var(--text2); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot.ok { background: var(--ok-text); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad-text); } .dot.accent { background: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
[data-theme="clean"] .card { box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.dim { color: var(--dim); } .ok-text { color: var(--ok-text); } .bad-text { color: var(--bad-text); } .warn-text { color: var(--warn-text); }
.sp { flex: 1; }
.mono { font-family: var(--mono); }
.hide { display: none !important; }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 页面骨架：左边一列导航 + 右边内容 ---------- */
.shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); min-height: 100vh; }
.shell.fixed { height: 100vh; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; background: var(--chrome);
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 5; }
.rail .logo { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 17px; margin-bottom: 12px; text-decoration: none; flex-shrink: 0; }
.rail .nav { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; min-height: 0; padding: 9px 0 7px;
  border-radius: var(--r-sm); border: 0; background: transparent; color: var(--dim); font-size: 11px; line-height: 1.2;
  text-decoration: none; position: relative; white-space: normal; text-align: center; flex-shrink: 0; }
[data-theme="cheer"] .rail .nav { border-radius: 14px; }
.rail .nav:hover { background: var(--panel2); color: var(--text); border-color: transparent; }
.rail .nav.on { background: var(--panel2); color: var(--text); }
[data-theme="clean"] .rail .nav.on, [data-theme="cheer"] .rail .nav.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.rail .nav svg { width: 20px; height: 20px; }
.rail .badge { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn);
  color: #1a1408; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.rail .badge.bad { background: var(--bad); color: #fff; }
.rail .grow { flex: 1; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 56px; padding: 8px 16px;
  background: var(--chrome); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; }
.page { padding: 20px 24px 40px; max-width: 1180px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }

/* 主题选择 */
.themepick { position: fixed; left: 84px; bottom: 12px; z-index: 30; width: 240px; padding: 8px; background: var(--panel);
  border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); display: none; }
.themepick.show { display: block; }
.themepick .k { font-size: 12px; color: var(--dim); padding: 2px 6px 6px; }
.themepick button { width: 100%; justify-content: flex-start; gap: 10px; background: transparent; border-color: transparent; min-height: 40px; }
.themepick button:hover { background: var(--panel2); }
.themepick button.on { background: var(--accent-soft); border-color: var(--accent-line); }
.themepick .sw { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--line2); }
.themepick .sw i { width: 12px; height: 22px; }

/* ---------- 弹窗、提示 ---------- */
.modal { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; z-index: 40; }
.modal.show { display: flex; }
.mbox { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); max-width: 94vw; }
.mhead { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-weight: 600; }
.mhead button { margin-left: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line2);
  box-shadow: var(--shadow); padding: 9px 16px; border-radius: var(--r-sm); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }
.empty { padding: 40px; text-align: center; color: var(--dim); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 6px; }
  .rail .logo { margin: 0 8px 0 0; }
  .rail .grow { display: none; }
  .page { padding: 16px; }
}
