/* ============================================================
   运营视频工作台 · Design System (2026)
   结构：App Shell（Sidebar + Topbar + Content） + shadcn 风格组件
   实时：SSE；切换：View Transitions；主题：data-theme
   ============================================================ */
:root {
  --bg: #f4f1e9;
  --bg-soft: #efe9dd;
  --surface: #fffdf8;
  --surface-2: #faf7f0;
  --surface-3: #efeae0;
  --text: #14161a;
  --text-2: #3b3d43;
  --muted: #797b80;
  --border: #e2dccf;
  --border-strong: #cfc6b5;
  --primary: #2447ff;
  --primary-hover: #1736d8;
  --primary-soft: #e8ecff;
  --primary-text: #1b37d0;
  --success: #16794a;
  --success-soft: #e7f7ee;
  --danger: #c22a2a;
  --danger-soft: #fdeeee;
  --warning: #b46a0a;
  --warning-soft: #fdf3df;
  --accent: #c9f25c;
  --accent-ink: #1c2500;
  --shadow-sm: 0 1px 2px rgba(24, 20, 12, .05);
  --shadow-md: 0 10px 30px rgba(24, 20, 12, .08);
  --shadow-lg: 0 24px 60px rgba(24, 20, 12, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 288px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b0c0e;
  --bg-soft: #101216;
  --surface: #15171c;
  --surface-2: #1a1d23;
  --surface-3: #22262e;
  --text: #f3f0e8;
  --text-2: #cfd1d6;
  --muted: #9b9ea4;
  --border: #2a2e37;
  --border-strong: #3a404c;
  --primary: #6d8bff;
  --primary-hover: #9aafff;
  --primary-soft: #1a2246;
  --primary-text: #aabaff;
  --success: #5cd69a;
  --success-soft: #102a1c;
  --danger: #ff8181;
  --danger-soft: #2d1515;
  --warning: #f3c063;
  --warning-soft: #2b2110;
  --accent: #c9f25c;
  --accent-ink: #1c2500;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .4);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 480px at 12% -12%, color-mix(in srgb, var(--primary) 9%, transparent), transparent),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  animation: page-in .28s ease both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .24s ease both; }
@keyframes vt-out { to { opacity: .35; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }
.page-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; background: transparent; }
.page-progress::after { content: ""; display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #60a5fa, #2f6fed); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.page-progress.show::after { transform: scaleX(.75); transition: transform 1.8s cubic-bezier(.2,.7,.2,1); }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; align-items: stretch; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  position: sticky; top: 0; height: auto; min-height: 100vh; min-height: 100dvh;
  align-self: stretch;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(14px);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav-group { margin: 4px 0 10px; }
.nav-label { font-size: 10px; color: var(--muted); letter-spacing: .12em; padding: 8px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; margin: 3px 0;
  border-radius: 10px; color: var(--text-2); text-decoration: none;
  font-size: 13.5px; line-height: 1; min-height: 42px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item svg { width: 19px; height: 19px; opacity: .78; flex: 0 0 auto; }
.nav-item:hover { background: var(--surface-3); color: var(--text); transform: translateX(1px); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.nav-item.quick-item { min-height: 56px; align-items: center; padding: 10px 12px; }
.nav-item.quick-item .nav-copy { min-width: 0; }
.nav-item.quick-item .nav-copy b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.nav-item.quick-item .nav-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.nav-item.quick-item.active .nav-copy small { color: var(--primary-text); opacity: .8; }
.quick-group { margin-top: 2px; }
.sidebar-spacer { flex: 1; }
.sidebar-user {
  border-top: 1px solid var(--border); padding: 12px 8px 2px; display: flex; align-items: center; gap: 9px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
}
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 12px; }
.user-meta span { display: block; font-size: 11px; color: var(--muted); }
.sidebar-user a { color: var(--muted); font-size: 11px; text-decoration: none; padding: 4px; border-radius: 6px; }
.sidebar-user a:hover { color: var(--danger); background: var(--danger-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  backdrop-filter: blur(12px);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; transition: .15s ease;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.crumb h1 { margin: 0; font-size: 17px; letter-spacing: .2px; }
.crumb p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.top-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.top-brand-logo { background: none; box-shadow: none; object-fit: contain; padding: 0; }
.brand-logo { background: none; box-shadow: none; object-fit: contain; width: 38px; height: 38px; }

.top-brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #7c3aed); color:#fff; display:grid; place-items:center; font-size:14px; flex:none; box-shadow: 0 6px 14px rgba(36,71,255,.22); }
.top-brand-text { display:flex; flex-direction:column; line-height:1.1; }
.top-brand-text b { font-size:14px; letter-spacing:.1px; }
.top-brand-text small { font-size:9px; color:var(--muted); letter-spacing:.14em; text-transform:uppercase; }
.top-nav { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.top-nav-btn { font-size:12px; font-weight:600; text-decoration:none; padding:9px 13px; border-radius:9px; border:1px solid transparent; white-space:nowrap; transition:.15s ease; }
.top-nav-btn:hover { transform: translateY(-1px); }
.top-nav-btn.work { color:#1759c9; background:#eef4ff; border-color:#d7e5ff; }
.top-nav-btn.download { color:#087b61; background:#e8fbf4; border-color:#c9f0e2; }
.top-nav-btn.water { color:#6941c6; background:#f4efff; border-color:#e4d8ff; }
.top-nav-btn.pick { color:#a75700; background:#fff3e0; border-color:#ffe0b5; }
.top-nav-btn.master { color:#fff; background:#243248; border-color:#243248; }
.top-nav-btn.active { outline:2px solid currentColor; outline-offset:1px; box-shadow:0 4px 12px rgba(20,50,110,.12); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.history-backdrop { position:fixed; inset:0; background:rgba(8,16,30,.28); z-index:140; opacity:0; pointer-events:none; transition:.18s ease; }
.history-backdrop.open { opacity:1; pointer-events:auto; }
.history-drawer { position:fixed; top:0; right:0; bottom:0; width:360px; max-width:92vw; background:#fff; z-index:150; transform:translateX(102%); transition:transform .2s ease; box-shadow:-14px 0 40px rgba(8,20,40,.18); display:flex; flex-direction:column; }
.history-drawer.open { transform:none; }
.drawer-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 14px 10px; border-bottom:1px solid #e5ecf6; }
.drawer-head b { font-size:14px; color:#1b2a40; }
.drawer-sub { font-size:10px; color:#7b8aa0; margin-top:2px; }
.drawer-body { padding:8px 10px 16px; overflow:auto; flex:1; }

@media (max-width: 1250px) { .top-brand-text small { display:none; } .top-nav-btn { padding:8px 10px; font-size:11px; } }
@media (max-width: 980px) { .top-brand-text { display:none; } .top-nav { gap:4px; } .top-nav-btn { padding:7px 8px; } .top-activity { display:none; } }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap:8px; }
  .top-nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .top-nav-btn { flex: 0 0 auto; }
  .topbar-actions { gap: 5px; }
}


.top-link { font-size: 12px; color: var(--muted); text-decoration: none; padding: 7px 9px; border-radius: 8px; white-space: nowrap; }
.top-link:hover { color: var(--text); background: var(--surface-soft, #f3f6fb); }
.top-link.active { color: var(--primary); background: #eef4ff; font-weight: 600; }
.top-user { display:flex; align-items:center; gap:7px; text-decoration:none; color:var(--text); padding:3px 5px; border-radius:8px; }
.top-user:hover { background: var(--surface-soft, #f3f6fb); }
.top-user-avatar { width:26px; height:26px; border-radius:50%; background: linear-gradient(135deg,#6ea8ff,#1769ff); color:#fff; display:grid; place-items:center; font-size:12px; font-weight:700; }
.top-user-meta { display:flex; flex-direction:column; line-height:1.15; }
.top-user-meta b { font-size:11px; max-width:72px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.top-user-meta small { font-size:9px; color:var(--muted); }
@media (max-width: 1180px) { .top-user-meta { display:none; } .top-link { font-size:11px; padding:6px; } }
.conn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 10px;
}
.conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.conn.offline i { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent); }
.cmd-trigger {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 10px; cursor: pointer;
  transition: .15s ease;
}
.cmd-trigger:hover { border-color: var(--primary); color: var(--primary); }
.cmd-trigger kbd { font-family: var(--font); font-size: 10px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.content { padding: 20px 22px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-weight: 400; color: var(--muted); font-size: 11px; }
.card-body { padding: 16px; }
.muted { color: var(--muted); font-size: 12px; }
.sub { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 1; padding: 5px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-text); white-space: nowrap;
}
.badge.gray { background: var(--surface-3); color: var(--muted); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 14px;
  font-size: 13px; font-family: var(--font); font-weight: 600; cursor: pointer;
  transition: .16s ease; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 24%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover:not(:disabled) { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 13px; font-family: var(--font);
  outline: none; transition: border .16s ease, box-shadow .16s ease;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.55; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.file-drop {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2);
  cursor: pointer; transition: .16s ease;
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input[type=file] { display: none; }
.file-drop svg { width: 20px; height: 20px; color: var(--primary); flex: 0 0 auto; }
.file-drop b { font-size: 13px; display: block; }
.file-drop span { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.file-name { font-size: 11px; color: var(--primary-text); margin-top: 6px; word-break: break-all; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.hint { font-size: 11px; color: var(--muted); line-height: 1.7; }
.hint b { color: var(--text-2); }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.seg { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-family: var(--font); padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: .16s ease; white-space: nowrap; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--surface); color: var(--primary-text); font-weight: 600; box-shadow: var(--shadow-sm); }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.empty { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 10px; }
.spinner { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--primary) 20%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- Workbench ---------- */
.page-intro { margin: 0 0 16px; }
.page-intro h2 { margin: 0 0 4px; font-size: 18px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.panel { padding: 16px; }
.rail { display: grid; gap: 16px; position: sticky; top: 82px; }
.job-card .card-body { display: grid; gap: 10px; }
.job-status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-status-row .status-text { font-size: 13px; font-weight: 600; }
.job-id { font-size: 10px; color: var(--muted); word-break: break-all; }
.log {
  margin: 0; background: #0a1020; color: #d7e6ff; border: 1px solid #1b2a44;
  border-radius: 10px; padding: 10px; font-size: 11px; line-height: 1.55;
  max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  font-family: "Cascadia Code", Consolas, monospace;
}
.results { display: grid; gap: 0; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12px; min-width: 0; }
.file-row:last-child { border-bottom: 0; }
.file-row a { color: var(--primary); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.file-row a:hover { text-decoration: underline; }
.file-size { color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.file-download-btn { display:inline-flex; align-items:center; justify-content:center; color:#1769ff; background:#eef4ff; border:1px solid #cfe0ff; border-radius:6px; padding:3px 7px; font-size:10px; text-decoration:none; white-space:nowrap; flex:0 0 auto; }
.file-download-btn:hover { background:#dfeaff; border-color:#9dbdff; }
.audit-file-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }

.zip-link { display: inline-flex; margin-top: 8px; font-size: 12px; color: var(--primary-text); background: var(--primary-soft); padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.history-list { display: grid; gap: 2px; }
.history-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; transition: .14s ease; }
.history-item:hover { background: var(--surface-3); }
.history-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.history-item.done .dot { background: var(--success); }
.history-item.warn .dot { background: #e6a700; box-shadow: 0 0 0 3px rgba(230,167,0,.13); }

.history-item.running .dot { background: var(--warning); animation: blink 1.2s infinite; }
.history-item.failed .dot { background: var(--danger); }
@keyframes blink { 50% { opacity: .25; } }
.history-item .meta { min-width: 0; flex: 1; }
.history-item .meta b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .meta span { font-size: 10px; color: var(--muted); }
.progress-bar { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, var(--primary)); transition: width .35s ease; }

/* ---------- Audit / Total control ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.6px; line-height: 1.15; }
.kpi span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.person { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); transition: .16s ease; }
.person.working { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: linear-gradient(180deg, var(--primary-soft), var(--surface)); }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.person-name { font-size: 13px; font-weight: 700; }
.person-task { margin-top: 8px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.person-meta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.person-log { margin-top: 8px; background: #0a1020; color: #cfe3ff; border-radius: 8px; padding: 8px; font-size: 10.5px; line-height: 1.45; max-height: 54px; overflow: hidden; word-break: break-all; }
.person-idle { color: var(--muted); font-size: 12px; margin-top: 10px; }
.live-strip { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 0%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.recent-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0a1020; cursor: pointer; transition: .16s ease; }
.recent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.recent-card img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: #111; }
.recent-card .ph { aspect-ratio: 9 / 16; display: grid; place-items: center; color: var(--muted); font-size: 11px; background: var(--surface-3); }
.recent-info { padding: 8px 9px; background: var(--surface); }
.recent-info b { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-info span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 760px; }
.table th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 9px 10px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--border); padding: 9px 10px; vertical-align: top; }
.table tr.row { cursor: pointer; transition: background .14s ease; }
.table tr.row:hover { background: var(--surface-2); }
.table tr.row:last-child td { border-bottom: 0; }
.input-cell { max-width: 360px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; display: inline-block; white-space: nowrap; }
.status-pill.done { background: var(--success-soft); color: var(--success); }
.status-pill.failed { background: var(--danger-soft); color: var(--danger); }
.status-pill.running { background: var(--warning-soft); color: var(--warning); }
.status-pill.queued { background: var(--surface-3); color: var(--muted); }
.filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filters .field { min-width: 130px; }
.section { margin-top: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 14px; }
.subnav { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-3); margin: 2px 0 14px; flex-wrap: wrap; }
.subnav a { font-size: 11px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 7px; transition: .14s ease; }
.subnav a:hover { color: var(--text); }
.subnav a.active { background: var(--surface); color: var(--primary-text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Drawer / modal / command ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border); z-index: 90;
  transform: translateX(102%); transition: transform .24s cubic-bezier(.22,.8,.3,1), visibility .24s;
  visibility: hidden; pointer-events: none;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; visibility: visible; pointer-events: auto; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.drawer-body { padding: 16px; overflow: auto; display: grid; gap: 14px; }
.drawer-thumb { border-radius: 12px; overflow: hidden; background: #0a1020; }
.drawer-thumb img { width: 100%; max-height: 260px; object-fit: contain; display: block; background: #0a1020; }
.cmdk { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(2,6,23,.55); backdrop-filter: blur(3px); }
.cmdk.show { display: flex; }
.cmdk-box { width: min(580px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: cmd-in .18s ease both; }
@keyframes cmd-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cmdk-input svg { width: 17px; height: 17px; color: var(--muted); }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; font-family: var(--font); }
.cmdk-list { max-height: 360px; overflow: auto; padding: 6px; }
.cmdk-group { font-size: 10px; color: var(--muted); padding: 8px 10px 4px; letter-spacing: .1em; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.cmdk-item:hover, .cmdk-item.active { background: var(--primary-soft); color: var(--primary-text); }
.cmdk-item kbd { margin-left: auto; font-size: 10px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: #0b1220; color: #fff; border: 1px solid #22314f; padding: 10px 14px; border-radius: 10px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 120; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dir-modal { position:fixed; inset:0; z-index:150; background:rgba(8,16,30,.62); display:none; align-items:center; justify-content:center; padding:24px; }
.dir-modal.open { display:flex; }
.dir-dialog { width:min(520px,94vw); background:#fff; border-radius:14px; padding:18px 20px; box-shadow:0 24px 70px rgba(6,20,45,.35); }
.dir-head { display:flex; align-items:center; justify-content:space-between; color:#17253b; font-size:16px; }
.dir-close { border:0; background:transparent; font-size:20px; color:#7b8799; cursor:pointer; line-height:1; }
.dir-tip { margin:8px 0 12px; font-size:12px; color:#66758a; line-height:1.7; }
.dir-dialog .input { width:100%; box-sizing:border-box; }
.dir-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.dir-current { margin-top:10px; font-size:11px; color:#7a8799; word-break:break-all; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .workbench { grid-template-columns: 1fr; }
  .rail { position: static; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .overlay { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 12px; }
  .content { padding: 14px 12px 30px; }
  .crumb p { display: none; }
  .cmd-trigger span { display: none; }
  .conn { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: 1fr 1fr; }
  .recent-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .drawer { width: 100vw; }
}
@media (max-width: 520px) {
  .people { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .segmented { width: 100%; overflow: auto; }
  .seg { flex: 1; text-align: center; }
  .topbar-actions .cmd-trigger { padding: 7px; }
}

/* ============================================================
   2026 Studio Refresh：深色侧栏 + 暖纸画布 + Bento 功能入口
   ============================================================ */
body {
  background:
    radial-gradient(900px 420px at 8% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    radial-gradient(900px 500px at 96% 0%, color-mix(in srgb, var(--primary) 7%, transparent), transparent),
    var(--bg);
}
.sidebar {
  background: #111318;
  border-right: 1px solid #22252c;
  color: #e9e7e1;
  box-shadow: 10px 0 40px rgba(20, 18, 12, .06);
}
.brand-name { color: #f7f5ef; font-size: 16px; letter-spacing: .1px; }
.brand-sub { color: #8d919a; font-size: 11.5px; }
.brand-mark { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(201, 242, 92, .18); }
.nav-label { color: #7e838d; font-size: 11px; letter-spacing: .16em; padding: 12px 10px 7px; }
.nav-item {
  color: #b9bdc6; font-size: 15px; min-height: 48px;
  padding: 12px 12px; gap: 12px; border-radius: 12px;
}
.nav-item svg { width: 21px; height: 21px; opacity: .72; }
.nav-item:hover { background: #1b1e24; color: #fff; transform: translateX(1px); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(36, 71, 255, .28); }
.nav-item.active svg { opacity: 1; }
.nav-badge { background: #23262e; color: #aeb4c0; }
.nav-item.quick-item { min-height: 64px; padding: 12px 12px; }
.nav-item.quick-item .nav-copy b { font-size: 15px; color: inherit; }
.nav-item.quick-item .nav-copy small { font-size: 11.5px; color: #858a94; margin-top: 3px; }
.nav-item.quick-item.active .nav-copy small { color: #dfe5ff; opacity: .85; }
.quick-group { margin-top: 8px; }
.sidebar-spacer { flex: 1; }
.sidebar-user { border-top: 1px solid #262a32; padding: 14px 8px 4px; }
.sidebar-user .avatar { background: var(--accent); color: var(--accent-ink); }
.sidebar-user .user-meta b { color: #f3f1eb; font-size: 13px; }
.sidebar-user .user-meta span { color: #8d929c; font-size: 11.5px; }
.sidebar-user a { color: #8d929c; font-size: 14px; }

.topbar { padding: 14px 26px; background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.crumb h1 { font-size: 22px; letter-spacing: -.3px; }
.crumb p { font-size: 12.5px; margin-top: 4px; }
.content { padding: 22px 26px 48px; max-width: 1520px; }
.card { border-radius: 18px; box-shadow: var(--shadow-sm); }
.card-head { padding: 17px 18px; }
.card-body { padding: 18px; }
.btn { border-radius: 11px; }
.btn-primary { background: var(--primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent); }
.input { border-radius: 11px; padding: 11px 13px; }
.segmented { border-radius: 12px; }

/* Hero + Bento */
.studio-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 26px 28px; border-radius: 22px; margin-bottom: 14px;
  background:
    radial-gradient(640px 300px at 92% 0%, rgba(201, 242, 92, .16), transparent),
    linear-gradient(120deg, #12151b, #1a1f2a 68%, #222836);
  color: #f6f3ec; box-shadow: 0 16px 40px rgba(20, 18, 12, .16);
}
.studio-hero .eyebrow { font-size: 10.5px; letter-spacing: .2em; color: var(--accent); font-weight: 700; }
.studio-hero h2 { margin: 8px 0 0; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.1; letter-spacing: -1px; font-weight: 800; }
.studio-hero p { margin: 8px 0 0; color: #aeb3bd; font-size: 12.5px; line-height: 1.6; }
.hero-aside { display: grid; gap: 8px; justify-items: end; flex: 0 0 auto; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #e9e6de; border-radius: 999px; padding: 7px 11px; font-size: 11px; white-space: nowrap; }
.hero-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(201,242,92,.14); }
.function-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.function-tile {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 9px;
  min-height: 154px; padding: 16px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: var(--font); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.function-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.function-tile .num { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.function-tile .tile-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.function-tile .tile-icon svg { width: 21px; height: 21px; }
.function-tile b { font-size: 16px; letter-spacing: -.2px; }
.function-tile small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.function-tile.active { background: var(--text); color: var(--surface); border-color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.function-tile.active .num { color: rgba(255,255,255,.55); }
.function-tile.active .tile-icon { background: var(--accent); color: var(--accent-ink); }
.function-tile.active small { color: rgba(255,255,255,.62); }
.function-tile.active::after {
  content: "正在编辑"; position: absolute; top: 12px; right: 12px;
  font-size: 9.5px; color: var(--accent-ink); background: var(--accent);
  border-radius: 999px; padding: 3px 7px; font-weight: 700;
}
.workbench { grid-template-columns: minmax(0, 1fr) 430px; }
.panel { padding: 18px; }
.card-head .segmented { display: none; }
.job-card { background: var(--surface); }
.job-card .card-head { background: var(--text); color: var(--surface); border-bottom: 0; border-radius: 18px 18px 0 0; }
.job-card .card-head .badge { background: rgba(255,255,255,.1); color: #fff; }
.rail { top: 88px; }
.kpis { gap: 12px; }
.kpi { border-radius: 16px; padding: 17px 18px; }
.kpi b { font-size: 40px; letter-spacing: -1.5px; }
.kpi span { font-size: 12px; }
.kpi:first-child { background: var(--text); color: var(--surface); border-color: var(--text); box-shadow: var(--shadow-md); }
.kpi:first-child span { color: rgba(255,255,255,.58); }
.kpi:first-child b { color: var(--accent); }
.people { gap: 12px; }
.person { padding: 15px; border-radius: 14px; }
.person-name { font-size: 14.5px; }
.person-working, .person.working { background: linear-gradient(160deg, var(--primary-soft), var(--surface)); }
.person-log { background: #16181d; color: #dfe6f7; }
.recent-card { border-radius: 14px; }
.recent-card:hover { box-shadow: var(--shadow-md); }
.recent-info b { font-size: 12px; }
.status-pill { font-size: 11px; }
.subnav { border-radius: 12px; }
.subnav a.active { color: var(--primary-text); }
.page-progress::after { background: linear-gradient(90deg, var(--accent), var(--primary)); }
@media (max-width: 1180px) { .function-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1120px) { .workbench { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .sidebar { width: min(300px, 86vw); }
  .studio-hero { padding: 20px; align-items: flex-start; flex-direction: column; }
  .hero-aside { justify-items: start; }
  .function-board { grid-template-columns: 1fr 1fr; gap: 9px; }
  .function-tile { min-height: 132px; padding: 13px; }
  .function-tile b { font-size: 14.5px; }
  .function-tile small { font-size: 10.5px; }
  .kpi b { font-size: 30px; }
}
@media (max-width: 520px) { .function-board { grid-template-columns: 1fr; } }

/* 侧栏字号再放大 + 总控 hero / 头像 */
:root { --sidebar: 296px; }
.nav-item { font-size: 15.5px; min-height: 50px; gap: 13px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.quick-item { min-height: 68px; }
.nav-item.quick-item .nav-copy b { font-size: 16px; }
.nav-item.quick-item .nav-copy small { font-size: 12px; }
.nav-label { font-size: 11.5px; }
.brand-name { font-size: 17px; }
.sidebar-user .user-meta b { font-size: 13.5px; }
.studio-hero.compact { padding: 20px 24px; margin-bottom: 14px; }
.studio-hero.compact h2 { font-size: clamp(22px, 2vw, 30px); }
.studio-hero.compact p { margin-top: 6px; }
.person-head .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.person-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--surface-3); color: var(--primary-text);
}
.person.working .person-avatar { background: var(--primary); color: #fff; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .sidebar { width: min(308px, 88vw); }
  .nav-item.quick-item { min-height: 62px; }
}

/* 侧栏收窄 + 字号继续放大 + 运营头像姓氏加大 */
:root { --sidebar: 260px; }
.nav-item { font-size: 16px; min-height: 49px; gap: 11px; padding: 12px 11px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-label { font-size: 12px; }
.nav-item.quick-item { min-height: 66px; padding: 12px 11px; }
.nav-item.quick-item .nav-copy b { font-size: 17px; }
.nav-item.quick-item .nav-copy small { font-size: 12.5px; }
.sidebar-user .avatar { width: 34px; height: 34px; font-size: 14px; }
.sidebar-user .user-meta b { font-size: 14px; }
.sidebar-user .user-meta span { font-size: 12px; }
.person-avatar { width: 34px; height: 34px; font-size: 15px; }
.person-name { font-size: 15px; }
.person { padding: 16px; }
.person-task { font-size: 13px; }
.person-meta { font-size: 12px; }
.person-idle { font-size: 13px; }
.person-log { font-size: 11.5px; }
@media (max-width: 820px) {
  .sidebar { width: min(270px, 86vw); }
  .nav-item.quick-item { min-height: 62px; }
}

/* 顶部实时状态条（谁在操作什么） */
.top-activity {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 420px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 11.5px;
}
.top-activity i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.top-activity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-activity.busy {
  color: var(--primary-text); border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: var(--primary-soft);
}
.top-activity.busy i { background: var(--primary); animation: pulse 1.4s infinite; }
@media (max-width: 820px) {
  .top-activity { max-width: 165px; font-size: 10.5px; padding: 5px 8px; }
  .top-activity span { max-width: 135px; }
}

/* 一刀不剪内嵌混剪选项 */
.post-box {
  margin-top: 12px; padding: 12px 13px;
  border: 1px dashed var(--border-strong); border-radius: 12px;
  background: var(--surface-2);
}
.post-options { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-options .field-grid { margin-top: 0; }

/* 一刀不剪：下载后处理三选一 */
.post-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.post-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.post-mode { position: relative; cursor: pointer; }
.post-mode input { position: absolute; opacity: 0; pointer-events: none; }
.post-mode span {
  display: flex; flex-direction: column; gap: 3px; min-height: 58px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); transition: .15s ease;
}
.post-mode span b { font-size: 12.5px; }
.post-mode span small { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.post-mode input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent); }
.post-mode input:checked + span b { color: var(--primary-text); }

/* 第 4 个：3 种各一套（推荐），和前三张同款，只加一个小推荐标签 */
.post-all3 .pa3-badge {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px;
  font-size: 9px; line-height: 1.6; font-style: normal; font-weight: 600;
  color: #0d7a55; background: #eafaf3; border: 1px solid #cdeee2; vertical-align: 1px;
}
#onecut-all3-note { font-size: 11px; line-height: 1.5; }
.post-options { margin-top: 10px; }
.post-options .field { max-width: 220px; }
@media (max-width: 1180px) { .post-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .post-modes { grid-template-columns: 1fr; } }

/* 下载/输出说明卡 */
.output-guide {
  margin-top: 12px; padding: 12px 13px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
}
.og-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.og-head span { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.og-path {
  margin-top: 7px; padding: 6px 8px; border-radius: 7px;
  background: var(--surface-3); color: var(--text-2);
  font-family: "Cascadia Code", Consolas, monospace; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.og-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 8px; }
.og-grid > div { display: flex; align-items: baseline; gap: 6px; font-size: 11px; }
.og-grid b { color: var(--text); min-width: 62px; }
.og-grid span { color: var(--muted); }
@media (max-width: 520px) { .og-grid { grid-template-columns: 1fr; } }

/* UI/UX 审计补丁：键盘焦点、异步状态播报、减少动效 */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* WCAG 2.2：固定顶栏不要遮住键盘焦点 */
html { scroll-padding-top: 88px; }
