:root {
  --bg: #ffffff;
  --panel: #f7f8fa;
  --line: #e8eaee;
  --line-2: #dfe2e7;
  --ink: #15171c;
  --ink-2: #4b5260;
  --mute: #8a909c;
  --blue: #2e6cf6;
  --blue-soft: #eef3ff;
  --green: #22a06b;
  --amber: #e08a00;
  --red: #e5484d;
  --violet: #7c5cf0;
  --card-dark: #171923;
  --radius: 12px;
  --side: 200px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--ink-2); font-weight: 600; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }
.grow { flex: 1; }
.muted { color: var(--mute); }
.xs { font-size: 12px; }
.err { color: var(--red); font-size: 13px; min-height: 1em; margin: 8px 0 0; }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px 18px; white-space: nowrap; }
.fly { font-weight: 900; font-style: italic; font-size: 20px; letter-spacing: -.5px;
       background: linear-gradient(90deg, #111 0%, #111 55%, var(--blue) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.brand.big { justify-content: center; padding-bottom: 22px; }
.brand.big .fly { font-size: 34px; }
.brand.big .brand-sub { font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 7px 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #245de0; }
.btn.primary:disabled { background: #a9c0f7; border-color: #a9c0f7; cursor: default; }
.btn.danger { color: var(--red); border-color: #f3c6c7; }
.btn.danger:hover { background: #fff3f3; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--mute); font-size: 15px; }
.icon-btn:hover { background: var(--panel); color: var(--ink); }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--panel); }
.login-card { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px 30px 24px; box-shadow: 0 8px 30px rgba(20,25,40,.06); }
.login-card label { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.login-card .btn { width: 100%; padding: 10px; margin-top: 6px; }

/* ---------- 框架 ---------- */
.app { display: flex; height: 100vh; }
.side { width: var(--side); flex: none; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; background: #fff; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; margin-bottom: 4px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; text-align: left; }
.nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: var(--panel); }
.nav.on { background: var(--ink); color: #fff; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 6px; }
.me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.me b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, #c026d3, #e11d48); }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: #fff; }
.top { height: 58px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.seg { display: flex; background: var(--panel); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 4px 14px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.chip:hover { background: var(--panel); }
.chip.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chip .n { font-variant-numeric: tabular-nums; color: var(--mute); }
.chip.on .n { color: var(--blue); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); flex: none; }
.dot.active { background: var(--blue); } .dot.needs_user { background: var(--amber); } .dot.done { background: var(--green); }
.dot.failed { background: var(--red); } .dot.cancelled { background: #b5bac4; }
.today { font-size: 13px; color: var(--ink-2); display: flex; gap: 14px; }
.today b { font-variant-numeric: tabular-nums; color: var(--ink); }

.content { flex: 1; overflow: auto; padding: 18px 22px 260px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 14px; }
.card { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--card-dark); cursor: pointer;
        box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; isolation: isolate; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,25,40,.16); }
.card .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.card.dim::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(16,18,27,.74); backdrop-filter: blur(2px); }
.card.failed::before { background: linear-gradient(180deg, rgba(40,14,20,.82), rgba(16,18,27,.88)); }
.card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; z-index: -1; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.card.failed { box-shadow: inset 0 0 0 1px rgba(229,72,77,.45); }
.card.needs_user { box-shadow: inset 0 0 0 1px rgba(224,138,0,.55); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f2f4; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.queued, .badge.cancelled, .badge.cancelling { color: #6b7280; }
.badge.running, .badge.agent { color: var(--blue); background: var(--blue-soft); }
.badge.needs_user { color: #b26b00; background: #fff4e0; }
.badge.done { color: var(--green); background: #e7f7ef; }
.badge.failed { color: var(--red); background: #fdecec; }
.card .badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.card .badge.queued, .card .badge.cancelled, .card .badge.cancelling { background: #fff; }

.center { position: absolute; left: 14px; right: 14px; top: 50%; transform: translateY(-58%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: #fff; }
.center .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: rgba(255,255,255,.12); }
.card.failed .center .ico { background: rgba(229,72,77,.28); color: #ff9a9d; }
.card.needs_user .center .ico { background: rgba(224,138,0,.25); color: #ffc46b; }
.center b { font-size: 14px; }
.center .why { font-size: 12px; color: rgba(255,255,255,.72); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.center .act { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; border-radius: 8px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; }
.center .act:hover { background: rgba(255,255,255,.2); }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff; display: grid; place-items: center; font-size: 13px; opacity: .9; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { position: absolute; left: 10px; right: 10px; bottom: 9px; color: #fff; }
.foot .title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.foot .line { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.tag { padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.16); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.foot .owner { color: rgba(255,255,255,.6); font-size: 11px; margin-bottom: 2px; }

/* ---------- 列表 ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { white-space: nowrap; font-size: 12.5px; color: var(--mute); font-weight: 500; background: var(--panel); }
th.r, td.r { text-align: right; white-space: nowrap; }
td:nth-child(2), td:nth-child(4) { white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { font-size: 12px; color: var(--mute); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 70px 20px; }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px; background: var(--panel); display: grid; place-items: center; color: var(--blue); font-size: 20px; }
.empty p { max-width: 380px; margin: 6px auto 0; font-size: 13px; }

/* ---------- 底部提交栏 ---------- */
.composer { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(880px, calc(100% - 44px)); }
.modes { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.modes-in { display: contents; }
.mode.more { border-style: dashed; color: var(--mute); }
.mode.more:hover { color: var(--blue); border-color: var(--blue); }
.mode { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.mode.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.box { position: relative; background: #fff; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 10px 34px rgba(20,25,40,.10); padding: 12px 14px 12px; transition: border-color .15s, box-shadow .15s; }
.box.over { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft), 0 10px 34px rgba(20,25,40,.10); }
.upbar { position: absolute; left: 14px; right: 14px; top: 0; height: 3px; background: var(--blue-soft); border-radius: 3px; overflow: hidden; }
.upbar div { height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.placeholder { min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 2px 4px 8px; cursor: pointer; }
.placeholder b { font-weight: 500; color: var(--ink-2); }
.placeholder .muted { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; max-height: 120px; overflow: auto; }
.file-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 6px 8px 6px 10px; font-size: 13px; max-width: 280px; }
.file-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .sz { color: var(--mute); font-size: 12px; white-space: nowrap; }
.file-chip button { border: 0; background: transparent; cursor: pointer; color: var(--mute); padding: 0 2px; }
.file-chip.add { cursor: pointer; color: var(--blue); border-style: dashed; background: #fff; }
.bottom { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.params { display: flex; gap: 8px; flex-wrap: wrap; }
.param { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px 4px 3px 10px; font-size: 12.5px; color: var(--ink-2); }
.param input, .param select { border: 0; background: transparent; outline: none; font-size: 12.5px; color: var(--ink); font-weight: 600; padding: 2px 4px; }
.param input { width: 52px; }
.param select { cursor: pointer; }
#submit { padding: 8px 18px; border-radius: 10px; }

.dropmask { position: fixed; inset: 0; z-index: 30; background: rgba(46,108,246,.10); border: 3px dashed var(--blue); display: grid; place-items: center; pointer-events: none; }
.dropmask div { background: #fff; padding: 12px 22px; border-radius: 12px; color: var(--blue); font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.12); }

/* ---------- 详情 ---------- */
/* 任务详情：页面正中间的大弹窗，方便检查成片 */
.drawer { position: fixed; inset: 0; z-index: 20; background: rgba(15,18,28,.42); display: flex; justify-content: center; align-items: center; padding: 3vh 2vw; }
.sheet { width: min(1280px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 70px rgba(15,18,28,.28); animation: pop .16s ease-out; }
@keyframes pop { from { transform: scale(.98); opacity: .6; } }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.sheet-head .badge { margin-top: 3px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.meta span { font-size: 12px; color: var(--ink-2); background: var(--panel); border-radius: 6px; padding: 1px 8px; }
.sheet-body { flex: 1; overflow: auto; padding: 4px 20px 30px; }
.callout { border-radius: 12px; padding: 4px 14px 14px; margin-top: 14px; }
.callout.warn { background: #fff8eb; border: 1px solid #f6dca6; }
.callout.bad { background: #fff3f3; border: 1px solid #f3c6c7; }
.callout pre { max-height: 220px; overflow: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row input { border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; width: 150px; }
.files { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.file { flex: 0 0 calc((100% - 20px) / 3); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.file video { width: 100%; aspect-ratio: 9/16; display: block; background: #000; object-fit: contain; }
.file .name { padding: 7px 9px 2px; font-size: 12px; color: var(--ink-2); word-break: break-all; }
.file .name b { display: block; color: var(--ink); font-size: 12.5px; }
.file a { display: block; padding: 0 9px 8px; font-size: 12.5px; }
.file.report { flex-basis: 100%; }
.file.report .name { display: flex; justify-content: space-between; padding: 9px 12px; }
/* 成片和对比片并排、同一高度，按视频自身比例（不加黑边），一屏内对照检查 */
.file.final, .file.compare { flex: 0 1 auto; display: flex; flex-direction: column; }
.file.final video, .file.compare video { aspect-ratio: auto; width: auto; max-width: 100%; height: min(70vh, 860px); }
.file.final .name, .file.compare .name { max-width: 100%; width: 0; min-width: 100%; }
.file.trans .tbl { padding: 0 12px 12px; max-height: 420px; overflow: auto; }
.file.trans table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.file.trans th { position: sticky; top: 0; background: #f6f7f9; text-align: left; font-weight: 600; color: var(--ink); }
.file.trans th, .file.trans td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.file.trans td:nth-child(1), .file.trans td:nth-child(2), .file.trans td:nth-child(7) { white-space: nowrap; color: var(--mute); }
.file.trans tr.chg td { background: #fff8eb; }
.file.report pre { padding: 0 12px 12px; max-height: 260px; overflow: auto; color: var(--ink-2); }
.msg textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; resize: vertical; outline: none; }
.msg textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.log-head { display: flex; align-items: baseline; gap: 12px; }
.log-head label { margin-left: auto; cursor: pointer; }
.log { background: #12141b; color: #c9cdd6; border-radius: 12px; padding: 12px 14px; font: 12px/1.65 ui-monospace, "SF Mono", Menlo, monospace; max-height: 420px; overflow: auto; }
.log div { white-space: pre-wrap; word-break: break-word; }
.log .t { color: #6b7280; margin-right: 8px; }
.log .status { color: #8fd3a5; } .log .agent { color: #c4b5fd; } .log .user { color: #fcd34d; } .log .error { color: #fca5a5; }
.log.hide-log .log { display: none; }
.log.hide-log div.log { display: none; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; top: 14px; right: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; box-shadow: 0 6px 24px rgba(20,25,40,.12); font-size: 13.5px; max-width: 380px; animation: slide .18s ease-out; }
.toast::before { content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--ink-2); }
.toast.ok::before { content: "✓"; background: var(--green); }
.toast.bad::before { content: "!"; background: var(--red); }

@media (max-width: 760px) {
  :root { --side: 64px; }
  .brand-sub, .nav { font-size: 0; } .nav { justify-content: center; gap: 0; }
  .me div, #logout { display: none; }
  .today { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .drawer { padding: 0; } .sheet { border-radius: 0; }
  .file { flex-basis: 100%; }
}

/* ---------- API 余额 ---------- */
.nav { position: relative; }
.nav-dot { position: absolute; top: 9px; left: 26px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; }
.bal-head { display: flex; align-items: flex-end; gap: 12px; }
.bal-top { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 12px; margin-bottom: 12px; }
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bal-card, .bal-big { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bal-card.wide { grid-column: 1 / -1; }
.bal-card .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bal-card p { margin: 0; }
.bal-big .num { font-size: 34px; font-weight: 700; letter-spacing: -.5px; color: var(--ink); }
.bal-big.low { border-color: #f3c6c7; background: #fff6f6; }
.bal-big.low .num { color: #d93036; }
.warn-line { font-size: 12.5px; color: #c4262c; background: #fff0f0; border-radius: 8px; padding: 5px 9px; }
.kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 12px; font-size: 13px; align-items: baseline; }
.kv span { color: var(--mute); }
.bal-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.bal-tbl th { text-align: left; font-weight: 500; color: var(--mute); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.bal-tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.bal-tbl tr:last-child td { border-bottom: 0; }
.bal-tbl .r { text-align: right; white-space: nowrap; }
.bar-cell { width: 45%; }
.bar-cell i { display: block; height: 8px; border-radius: 4px; background: var(--blue); min-width: 2px; }
.days { display: flex; gap: 8px; align-items: flex-end; height: 150px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; height: 100%; }
.day .col { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.day .col i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--blue); min-height: 2px; }
.day b { font-weight: 600; color: var(--ink); }
.day span { color: var(--mute); }
@media (max-width: 900px) { .bal-top, .bal-grid { grid-template-columns: 1fr; } }

/* ---------- 任务费用 ---------- */
.meta .cost-pill { background: #e9f7ef; color: #13795b; font-weight: 600; }
.usage-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.usage-card p { margin: 0; }
.usage-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.usage-total b { font-size: 26px; margin-right: 6px; color: var(--ink); }
.usage-tbl tr.grp td { background: #f6f7f9; font-weight: 600; color: var(--ink); }
.usage-tbl td.muted { font-size: 12px; }

/* ---------- Skill 库 ---------- */
.skills-head { margin-bottom: 16px; }
.skills-head p { margin: 4px 0 0; font-size: 13px; }
.skill-group { margin-bottom: 24px; }
.skill-group > h3 { margin: 0 0 10px; font-size: 13px; color: var(--mute); font-weight: 500; }
.skill-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.skill-card { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.skill-card:hover { border-color: var(--line-2); box-shadow: 0 6px 22px rgba(20,25,40,.08); }
.skill-card.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.skill-card .hd { display: flex; align-items: center; gap: 12px; }
.skill-ico { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -.3px; }
.skill-ico.c0 { background: linear-gradient(135deg, #2e6cf6, #7c5cf0); }
.skill-ico.c1 { background: linear-gradient(135deg, #f97316, #e11d48); }
.skill-ico.c2 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.skill-card .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.skill-card .v { display: flex; gap: 6px; margin-top: 3px; }
.pilltag { font-size: 11px; padding: 0 7px; border-radius: 5px; background: var(--panel); color: var(--ink-2); line-height: 18px; }
.pilltag.rec { background: #fff1e6; color: #c2410c; font-weight: 600; }
.pilltag.off { background: #fdecec; color: var(--red); }
.skill-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.skill-card .ft { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.skill-card .ft .btn { margin-left: auto; }
.skill-card.on .ft .btn { pointer-events: none; }

/* ---------- 产品库 ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.prod-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.prod-card:hover { border-color: var(--line-2); box-shadow: 0 4px 14px rgba(20,23,28,.08); }
.pc-img { height: 180px; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.pc-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.pc-body b { font-size: 15px; }
.pc-body .badge { margin-top: 6px; }
.empty-note { padding: 40px 0; text-align: center; }
.prod-edit { max-width: 1100px; }
.pe-status { display: flex; align-items: center; gap: 14px; position: sticky; top: 0; background: #fff; padding: 8px 0; z-index: 2; border-bottom: 1px solid var(--line); }
.pe-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pi-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pi { margin: 0; width: 150px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pi-img { height: 150px; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.pi-img img { max-width: 150px; max-height: 150px; object-fit: contain; display: block; }
.pi figcaption { display: flex; align-items: center; justify-content: space-between; padding: 3px 4px 3px 8px; font-size: 12px; }
.pi.add { width: 220px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-style: dashed; }
.pi.add input { font-size: 12.5px; }
.pi.add input#pe-key { border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pf { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.pf.wide { grid-column: 1 / -1; }
.pf input, .pf textarea, .pe-rules { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font-size: 13.5px; color: var(--ink); background: #fff; resize: vertical; }
.pf input:disabled, .pf textarea:disabled, .pe-rules:disabled { background: var(--panel); color: var(--ink-2); }
.pe-rules { width: 100%; font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }
.req { font-style: normal; color: var(--red); font-size: 11px; margin-left: 4px; }
@media (max-width: 720px) { .pf-grid { grid-template-columns: 1fr; } }

/* 产品库：AI 生成参考图 */
.ai-tag { font-size: 10.5px; font-weight: 700; color: #7c3aed; background: #f3ecff; border-radius: 5px; padding: 0 5px; margin-left: 4px; }
.pi-note { width: calc(100% - 8px); margin: 0 4px 5px; font-size: 11.5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; box-sizing: border-box; }
div.pi-note { border: 0; padding: 0 4px; }
.rg { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.rg-shots { display: flex; flex-direction: column; gap: 6px; }
.rg-shot { display: flex; align-items: flex-start; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.rg-shot:hover { border-color: var(--line-2); }
.rg-shot:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.rg-shot > input { margin-top: 3px; }
.rg-txt { flex: 1; min-width: 0; }
.rg-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rg-shot select, .rg-cgrid select { border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 4px; }
.rg-custom { border: 1px dashed var(--line-2); border-radius: 9px; padding: 7px 9px; }
.rg-custom summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.rg-cgrid { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; }
.rg-cgrid input#rgc-title { border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; width: 220px; }
.rg-custom textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.rg-refs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.rg-bar { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--line); }
.rg-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rgc { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.rgc.taken { border-color: #9fd9bd; }
.rgc-img { height: 260px; background: var(--panel); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 8px; }
.rgc-img img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; }
.rgc-img .spin { border-color: rgba(0,0,0,.08); border-top-color: var(--blue); }
.rgc figcaption { padding: 7px 9px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.rgc-hd { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rgc-ok { display: flex; gap: 6px; }
.rgc-ok input, .rgc-note { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.rgc-act { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.rgc-act details { flex: 1; min-width: 0; }
.rgc-act pre { white-space: pre-wrap; font-size: 11px; background: var(--panel); padding: 6px; border-radius: 6px; max-height: 200px; overflow: auto; margin: 4px 0 0; }
.bad { color: var(--red); }

/* ---------- 飞书登录 / 成员用量 ---------- */
.login-card .btn.feishu { display: block; text-align: center; background: #3370ff; border-color: #3370ff; color: #fff; font-weight: 600; margin: 4px 0 10px; }
.login-card .btn.feishu:hover { background: #245bdb; }
.link-btn { border: 0; background: none; color: var(--mute); cursor: pointer; padding: 4px 0; display: block; margin: 0 auto 6px; }
.link-btn:hover { color: var(--ink-2); }
.pw-fields.folded { display: none; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.side-foot #bind-feishu { margin-top: 6px; width: 100%; text-align: center; }
.owner-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 12.5px; font-weight: 600; }
.owner-pill button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; }
.owner-pill button:hover { background: rgba(46,108,246,.12); }
.u-tbl td, .u-tbl th { vertical-align: middle; }
.u-tbl tr.click { cursor: pointer; }
.u-tbl tr.click:hover td { background: var(--panel); }
.u-who { display: flex; align-items: center; gap: 8px; }
.u-ava { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 12px; font-weight: 700; overflow: hidden; flex: none; }
.u-ava img { width: 100%; height: 100%; object-fit: cover; }
.u-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.u-sum .bal-card .num { font-size: 22px; font-weight: 700; margin-top: 4px; }
.u-ok { color: var(--green); } .u-bad { color: var(--red); }
.u-off td { opacity: .5; }
.side-foot { flex-wrap: wrap; }
.seg button, .pilltag, .u-who b, .u-tbl th { white-space: nowrap; }
#usage-body .bal-card.wide { overflow-x: auto; }
@media (max-width: 900px) { .u-sum { grid-template-columns: repeat(2, 1fr); } }
.owner-pill { white-space: nowrap; }
