/* TokenDance 管理端，和桌面端共用设计语言「四拍」（desktop/src/renderer/style.css）：同一组颜色变量，深色剪辑室底色，
   四拍色（分发、混剪、包装、发布）只表示数据属于哪个环节，语义色只表示状态。界面代码里不写死颜色值。 */
:root {
  --rail: #0b0c0e; --ground: #0e0f11; --sunken: #111316; --panel: #15171a; --control: #1a1d21; --hover: #22262b; --raised: #1e2125;
  --line: #1f2226; --line-2: #2a2e34; --line-3: #30353c; --line-4: #3a3f47;
  --ink: #eceef1; --ink-2: #a3aab4; --ink-3: #7e8691; --ink-4: #5e656f;
  /* 四拍 */
  --dist: #4cc9f0; --dist-bg: #102029; --dist-line: #1e4250;
  --mix: #9b8cff; --mix-bg: #1b1830; --mix-line: #3a3366; --mix-ink: #c2b8ff; --mix-on: #120e2a;
  --pack: #ff6fae; --pack-bg: #2a1520; --pack-line: #5c2a44; --pack-on: #2a0716;
  --pub: #c6f24e; --pub-bg: #1e2a12; --pub-hover: #d4f86e; --pub-on: #101204;
  /* 语义 */
  --run: #7fb2ff; --run-bg: #14263d;
  --warn: #ffc266; --warn-bg: #3a2a10;
  --bad: #ff8a80; --bad-bg: #3a1717; --bad-line: #5a2a2a; --bad-soft: #2a1414; --bad-fill: #e5484d;
  /* 加急：和桌面应用同一组颜色（CONTEXT「加急」） */
  --urgent: #ff9548; --urgent-bg: #33200f; --urgent-line: #5a3518;
  --scrim: rgba(6, 7, 8, .62);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --monof: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--sans);
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* hidden 属性一律隐藏，不被 .row、.bulk 等的 display 盖掉 */
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font-size: 13px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--pub); text-decoration: none; } a:hover { color: var(--pub-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--mix-line); }
:focus-visible { outline: 2px solid var(--pub); outline-offset: 2px; }
.mono { font-family: var(--monof); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); } .dim { color: var(--ink-3); } .small { font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
summary { cursor: pointer; color: var(--ink-2); }
pre { color: var(--ink-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 外框：左侧分组导航 + 内容 ---------- */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
nav.side { flex: 1 1 220px; max-width: 100%; background: var(--rail); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
nav.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 600; font-size: 14px; }
.logo { width: 24px; height: 24px; border-radius: 7px; background: var(--pub); color: var(--pub-on); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.tag { font-size: 11px; font-weight: 400; color: var(--ink-3); border: 1px solid var(--line-3); border-radius: 4px; padding: 0 5px; }
nav.side .group { font-size: 11px; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; padding: 14px 10px 4px; }
nav.side a { display: flex; align-items: center; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); }
nav.side a:hover { background: var(--panel); color: var(--ink); }
nav.side a.active { background: var(--hover); color: var(--ink); font-weight: 500; }
nav.side a::before { content: ''; width: 6px; height: 6px; border-radius: 50%; margin-right: 10px; flex: none; }
nav.side a.active::before { background: var(--pub); }
nav.side a.ext { margin-top: 8px; color: var(--ink-3); }
nav.side .who { display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; margin-top: 6px; border-top: 1px solid var(--line); }
nav.side .who .name { display: block; line-height: 1.3; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
main { flex: 999 1 560px; min-width: 0; padding: 20px 28px 48px; }
.wrap { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
#alert:empty { display: none; }
@media (min-width: 900px) { nav.side { flex: 0 0 232px; position: sticky; top: 0; height: 100vh; overflow-y: auto; } }

/* 顶部全局搜索 */
.topbar { max-width: 1240px; margin: 0 auto 14px; }
.gsearch { position: relative; max-width: 560px; }
.gs-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--sunken); color: var(--ink-3); }
.gs-box:focus-within { border-color: var(--pub); box-shadow: 0 0 0 3px rgba(198, 242, 78, .15); }
.gs-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); outline: none; }
.gs-box input::-webkit-search-cancel-button { display: none; }
kbd { font-family: var(--monof); font-size: 11px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-4); color: var(--ink-2); }
.gs-list { position: absolute; z-index: 25; left: 0; right: 0; top: 42px; max-height: 70vh; overflow-y: auto; padding: 4px 0; background: var(--raised); border: 1px solid var(--line-3); border-radius: 12px; box-shadow: 0 20px 48px rgba(0, 0, 0, .55); }
.gs-list[hidden] { display: none; }
.gs-group { display: flex; justify-content: space-between; padding: 10px 14px 4px; font-size: 11px; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.gs-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; color: var(--ink); }
.gs-row:hover { background: var(--hover); color: var(--ink); }
.gs-row.on { background: var(--line-3); color: var(--ink); box-shadow: inset 2px 0 0 var(--pub); }
.gs-empty { margin: 0; padding: 14px; color: var(--ink-3); }

/* 页面标题和 tab */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 20px; border-bottom: 1px solid var(--line-2); }
.page-head h1 { padding-bottom: 8px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--pub); }
.tabs .n { margin-left: 5px; font-size: 11px; color: var(--ink-3); font-family: var(--monof); }
/* 一句话说明 + 「?」展开完整说明 */
.intro { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; }
.help { position: relative; display: inline-flex; }
.help-btn { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line-4); background: transparent; color: var(--ink-2); font-size: 11px; line-height: 1; cursor: help; }
.help .tip { display: none; position: absolute; z-index: 10; top: 24px; left: -8px; width: min(420px, 80vw); padding: 10px 12px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line-3); color: var(--ink-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.help:hover .tip, .help:focus-within .tip { display: block; }
.help:hover .help-btn, .help:focus-within .help-btn { border-color: var(--pub); color: var(--pub); }

/* ---------- 卡片、提示 ---------- */
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; }
.banner { padding: 12px 16px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); }
.banner.ok { background: var(--pub-bg); color: var(--pub); }
.banner a { margin-left: 8px; }

/* ---------- 按钮：S 26 行内，M 32 工具栏，L 40 确认；一个区域只有一个主按钮 ---------- */
.btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-3); background: var(--control); color: var(--ink); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn.s { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.l { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn.primary { background: var(--pub); border-color: var(--pub); color: var(--pub-on); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--pub-hover); color: var(--pub-on); }
.btn.dark { background: var(--control); }
.btn.ghost, .btn.link { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn.link { height: auto; padding: 0 2px; text-decoration: underline; text-decoration-color: var(--line-4); text-underline-offset: 3px; }
.btn.link:hover:not(:disabled) { background: transparent; color: var(--ink); }
.btn.warn, .btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn.warn:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.btn.danger-fill { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; font-weight: 600; }
.btn.danger-fill:hover:not(:disabled) { background: var(--bad-fill); color: #fff; filter: brightness(1.1); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
/* 文字按钮禁用时改成灰色，不像链接 */
.btn.link:disabled { opacity: 1; color: var(--ink-4); text-decoration: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; }
.field label, .field > legend { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea, input.inp, select.inp, textarea.inp { height: 32px; padding: 0 10px; border: 1px solid var(--line-3); border-radius: 8px; background: var(--sunken); color: var(--ink); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--ink-3); }
.field textarea, textarea.inp { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--pub); width: 15px; height: 15px; margin: 0; }
legend { padding: 0; }
/* 横排的筛选栏里 .field 要占宽度；竖排的卡片里不能撑高 */
.stack .field, .card > .field { flex: none; }

/* ---------- 统计数字 ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; }
.tile .n { font-size: 22px; font-weight: 600; font-family: var(--monof); font-variant-numeric: tabular-nums; }

/* ---------- 素材卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mcard { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); }
.mcard:hover { border-color: var(--line-4); color: var(--ink); }
.mcard .cover { position: relative; aspect-ratio: 9 / 13; background: var(--control) center / cover no-repeat; }
/* 封面上的标签（加急、状态、屏蔽、疑似同行）放在一个容器里依次排开，不互相盖住 */
.mcard .cover .pills { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
/* 封面上的标签要压得住画面：只有描边的「待处理」加深色底 */
.mcard .cover .pill.pending { background: rgba(10, 11, 13, .82); }
.mcard .cover .dur { position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(10, 11, 13, .8); color: var(--ink); font-size: 12px; }
.mcard .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mcard .body .t { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickable { position: relative; display: flex; flex-direction: column; }
.pickable .mcard { flex: 1; }
.pick { position: absolute; right: 8px; top: 8px; z-index: 1; display: flex; padding: 6px; border-radius: 6px; background: rgba(10, 11, 13, .82); cursor: pointer; }
.pick input { cursor: pointer; }

/* ---------- 状态标签：语义色 ---------- */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--hover); color: #c3c9d1; }
.pill.ready, .pill.selected { background: var(--pub-bg); color: var(--pub); }
.pill.processing { background: var(--run-bg); color: var(--run); }
.pill.pending { background: transparent; box-shadow: inset 0 0 0 1px var(--line-4); color: var(--ink-2); }
.pill.urgent { background: var(--urgent-bg); color: var(--urgent); }
.btn.urgent-on { border-color: var(--urgent-line); color: var(--urgent); }
.pill.failed, .pill.offline { background: var(--bad-bg); color: var(--bad); }
.pill.no_usable, .pill.excluded, .pill.peer { background: var(--warn-bg); color: var(--warn); }
.pill.admin { background: var(--ink); color: var(--ground); }
.pill.editor { background: var(--hover); color: #c3c9d1; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3); background: var(--sunken); white-space: nowrap; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child > td { border-bottom: 0; }
tbody tr:nth-child(even) > td { background: rgba(255, 255, 255, .015); }
tr.sel > td { background: var(--pub-bg) !important; }
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: var(--raised); }
tr.off > td { color: var(--ink-3); }
/* 混剪页：展开的任务里的混剪，除失败原因外不换行 */
tr.sub > td { background: var(--sunken) !important; }
tr.sub table th, tr.sub table td { white-space: nowrap; }
tr.sub table td.note { white-space: normal; min-width: 240px; }
tr.sub .tbl-wrap { background: var(--panel); }

/* ---------- 总览 ---------- */
.block { display: block; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { margin: 0; }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--raised); color: var(--ink); }
.todo .n { font-size: 22px; font-weight: 600; min-width: 56px; text-align: right; }
.sev { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.sev.bad { background: var(--bad); } .sev.warn { background: var(--warn); }
.n.bad { color: var(--bad); } .n.warn { color: var(--warn); }
.all-clear { display: flex; align-items: center; gap: 16px; background: var(--pub-bg); border-color: #33461a; }
.ok-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--ground); color: var(--pub); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex: none; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.ov-grid table { font-size: 12.5px; }
.day-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.day-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; color: var(--ink); border-bottom: 3px solid var(--line-3); }
.day-tile:hover { background: var(--raised); color: var(--ink); }
.day-tile b { font-size: 26px; font-weight: 600; }
.day-tile.dist { border-bottom-color: var(--dist); } .day-tile.mix { border-bottom-color: var(--mix); } .day-tile.pub { border-bottom-color: var(--pub); }

/* ---------- 右侧抽屉（drawer.js）：固定在右边，打开时内容让出位置，列表还看得见 ---------- */
.drawer { position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -12px 0 32px rgba(0, 0, 0, .35); }
.drawer[hidden] { display: none; }
@media (min-width: 1360px) { body.drawer-open main { margin-right: 460px; } }
.drawer .dh { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); min-height: 48px; }
.drawer .dh .crumb { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .db { flex: 1; overflow-y: auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsec { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.dsec:last-child { border-bottom: 0; }
.dsec h3 { margin: 0; font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.dsec dl.kv { grid-template-columns: 76px 1fr; font-size: 12.5px; }
.dactions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.chip-link { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--hover); color: var(--ink); font-size: 12px; border: 1px solid var(--line-2); }
.chip-link:hover { border-color: var(--line-4); color: var(--ink); }
.hrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); padding: 4px 0; }
a.hrow:hover { color: var(--pub); }
.sk-lines { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; }
.sk-lines span { height: 12px; border-radius: 4px; background: var(--hover); }
.sk-lines span:nth-child(2) { width: 70%; } .sk-lines span:nth-child(3) { width: 45%; }
/* 换页时的灰色占位 */
.page-sk { padding: 8px 0; gap: 14px; }
.page-sk span { height: 18px; } .page-sk span:first-child { width: 160px; height: 26px; } .page-sk span:last-child { height: 220px; border-radius: 12px; }
.beat { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.beat.dist { background: var(--dist-bg); color: var(--dist); } .beat.mix { background: var(--mix-bg); color: var(--mix-ink); } .beat.pack { background: var(--pack-bg); color: var(--pack); }

/* ---------- 列表 ---------- */
/* 统计数字可以点：按这个状态筛选，再点一次取消 */
a.tile.stat { color: var(--ink); }
a.tile.stat:hover { border-color: var(--line-4); color: var(--ink); }
a.tile.stat.on { border-color: var(--pub); background: var(--pub-bg); }
a.tile.stat.failed .n { color: var(--bad); }
/* 列表在自己的区域里滚动，表头固定在顶上，翻页留在下面看得见 */
.tbl-wrap.scroll { max-height: calc(100vh - 300px); min-height: 240px; overflow: auto; }
table.list thead th { position: sticky; top: 0; z-index: 1; }
/* 列表不换行，抽屉打开、变窄时横向滚动；素材集名称太长就截断 */
table.list td { white-space: nowrap; }
table.list td.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cov { width: 28px; height: 40px; border-radius: 4px; flex: none; background: var(--control) center / cover no-repeat; }
tr.picked > td { background: rgba(198, 242, 78, .05); }
.pickable.open .mcard { border-color: var(--pub); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn.disabled { opacity: .42; pointer-events: none; }
.warn-ink { color: var(--warn); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; border: 1px dashed var(--line-3); border-radius: 12px; text-align: center; }
/* 抽屉里的视频和混剪 → 发布视频一行一条 */
.dvideo { width: 100%; max-height: 360px; border-radius: 10px; background: var(--rail); }
.dvideo.ph { height: 200px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); border: 1px dashed var(--line-3); }
.mixrow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 14px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mixrow:last-child { border-bottom: 0; }
.mixcell { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.mixcell .note { flex-basis: 100%; color: var(--bad); font-size: 11.5px; overflow-wrap: anywhere; }

/* ---------- 处理页 ---------- */
.card.alerting { border-color: var(--bad-line); }
.bad-ink { color: var(--bad); } .ok-ink { color: var(--ink); }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.inst { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); }
.inst.warn { border-color: #4a3a1a; } .inst.bad { border-color: var(--bad-line); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--ink-3); }
.dot.ok { background: var(--pub); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }

/* ---------- 设备页：最低版本 + 版本分布 ---------- */
.version-strip { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 760px) { .version-strip { grid-template-columns: 1fr; } }
.ver-min, .ver-dist { display: flex; flex-direction: column; gap: 8px; }
.vbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.vbar > * { background: var(--pub); } .vbar > .below { background: var(--bad); } .vbar > a:hover, .vbar > a.on { filter: brightness(1.25); }
.vleg { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; color: var(--ink); border: 1px solid transparent; }
.vleg:hover { background: var(--hover); color: var(--ink); }
.vleg.on { border-color: var(--pub); }
.vleg i { width: 10px; height: 10px; border-radius: 3px; background: var(--pub); display: inline-block; } .vleg i.below { background: var(--bad); }

/* 分段选择也可以是链接（筛选写进地址） */
.seg a.seg-a { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 6px; color: var(--ink-2); font-size: 12.5px; }
.seg a.seg-a.on { background: var(--line-2); color: var(--ink); font-weight: 500; }
/* 账号抽屉：最近 7 天的产出 */
.out-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.out-tiles .day-tile { border-radius: 8px; background: var(--sunken); padding: 10px 12px; }
.out-tiles .day-tile b { font-size: 20px; }

/* ---------- 混剪与包装：分组表单 + 右边示意和修改历史 + 底部保存栏 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.setting-group { display: flex; flex-direction: column; gap: 12px; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-head h2 { margin: 0; font-size: 14px; }
.pill.editable { background: var(--pub-bg); color: var(--pub); }
.pill.locked { background: transparent; box-shadow: inset 0 0 0 1px var(--line-4); color: var(--ink-2); }
.settings-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.hist { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.hist-list { max-height: 240px; overflow-y: auto; }
.save-bar { z-index: 5; }
/* 比后面 .bulk.bottom 的 display:flex 更具体，hidden 才生效 */
.bulk.bottom.save-bar[hidden] { display: none; }
/* 包装示意画面（CSS 画的，不是实际渲染） */
.pkg-preview { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #1a1410; border: 1px solid var(--line-2); }
.pkg-frame { position: absolute; inset: 0; background: radial-gradient(circle at 40% 35%, #b0603a, #5a2a18 45%, #1a0e08 80%); transition: transform .2s; }
.pkg-tint { position: absolute; inset: 0; }
.pkg-text { position: absolute; left: 8%; right: 8%; text-align: center; color: #fff; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); transition: top .2s; }
.pkg-cta { position: absolute; left: 8%; right: 8%; bottom: 9%; display: flex; align-items: center; gap: 6px; }
.pkg-cta span:first-child { flex: 1; padding: 8px 10px; border-radius: 8px; font-weight: 800; font-size: 12px; line-height: 1.3; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.pkg-arrow { font-size: 28px; color: #fff; }
.pkg-note { position: absolute; left: 8px; top: 8px; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: rgba(10, 11, 13, .7); color: var(--ink-2); }

/* 批量操作栏：固定在内容顶部 */
.bulk { position: sticky; top: 8px; z-index: 2; background: var(--hover); border-color: var(--line-4); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
/* 勾选后从底部出现的批量操作栏 */
.bulk.bottom { top: auto; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line-4); border-radius: 12px; }

/* ---------- 素材详情 ---------- */
.detail { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.detail .preview { flex: 1 1 300px; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.detail .preview video, .detail .preview .ph { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--rail); }
.detail .preview .ph { display: flex; align-items: center; justify-content: center; color: var(--ink-3); border: 1px dashed var(--line-3); }
.detail .info { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--ink-3); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.plain li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; background: var(--sunken); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line-2); }
.seg button { height: 26px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 12.5px; }
.seg button.on { background: var(--line-2); color: var(--ink); font-weight: 500; }
.seg button:disabled { opacity: .42; cursor: not-allowed; }
img.thumb { width: 56px; height: 56px; object-fit: contain; background: var(--sunken); border-radius: 4px; display: block; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.login .logo { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
/* 通用的 .field 在横排的筛选栏里要占宽度（flex: 1 1 160px）；竖排的登录表单里会变成每项至少 160px 高 */
.login .field { flex: none; }
.login .field input { height: 40px; border-radius: 10px; font-size: 14px; }
.login .error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bad-soft); border: 1px solid var(--bad-line); }
.login .error:empty { display: none; }
.login a { text-align: center; }
.error { color: var(--bad); }

/* ---------- 浮层 ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line-4); color: var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.key-once { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--pub); background: var(--pub-bg); overflow-wrap: anywhere; }
/* 输入框下拉建议 */
.combo-list { position: fixed; z-index: 20; margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto; background: var(--raised); border: 1px solid var(--line-3); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.combo-list[hidden] { display: none; }
.combo-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.combo-list li:hover, .combo-list li.on { background: var(--hover); color: var(--ink); }
.combo-list li .meta { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.combo-list li.empty { color: var(--ink-3); cursor: default; background: none; }
/* 应用内对话框（原生 <dialog>，showModal 打开：焦点留在框内，Esc 关闭） */
dialog.dialog { width: min(480px, calc(100vw - 32px)); padding: 22px 24px; border: 1px solid var(--line-3); border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 48px rgba(0, 0, 0, .55); }
dialog.dialog::backdrop { background: var(--scrim); }
dialog.dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog.dialog h2 { margin: 0; font-size: 17px; }
dialog.dialog textarea { resize: vertical; }
dialog.dialog video { display: block; width: 100%; max-height: 70vh; border-radius: 10px; background: var(--rail); }
.off-list { max-height: 220px; overflow-y: auto; margin-top: 8px; gap: 4px; }
ul.off-list li { padding: 6px 10px; }

@media (max-width: 640px) { main { padding: 16px 16px 40px; } dl.kv { grid-template-columns: 1fr; } }
