:root {
  color-scheme: dark;
  --bg-page: #06080d;
  --bg-shell: #090d14;
  --bg-sidebar: #070a10;
  --bg-panel: #101722;
  --bg-panel-2: #151c27;
  --bg-panel-3: #1b2431;
  --bg-elevated: #111821;
  --bg-overlay: rgba(2, 6, 12, 0.72);
  --text-primary: #f6f8fc;
  --text-secondary: #b9c2d0;
  --text-muted: #7d8a9d;
  --text-disabled: #4e5a69;
  --border-subtle: #202936;
  --border-strong: #354154;
  --border-active: #4d8dff;
  --primary: #3f7fff;
  --primary-strong: #2f6df1;
  --primary-soft: rgba(63, 127, 255, 0.12);
  --cyan: #4fc3d7;
  --success: #21c995;
  --success-soft: rgba(33, 201, 149, 0.14);
  --warning: #f5b84b;
  --warning-soft: rgba(245, 184, 75, 0.14);
  --danger: #ff5c73;
  --danger-soft: rgba(255, 92, 115, 0.14);
  --info: #69a7ff;
  --info-soft: rgba(105, 167, 255, 0.14);
  --gradient-primary: linear-gradient(180deg, #4f8dff 0%, #2e69e8 100%);
  --gradient-card: linear-gradient(180deg, rgba(18, 25, 35, .98), rgba(11, 16, 24, .98));
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 999px;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .22);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, .34);
  --shadow-lg: 0 22px 64px rgba(0, 0, 0, .46);
  --shadow-glow: 0 0 0 1px rgba(79, 141, 255, .38), 0 10px 28px rgba(0, 0, 0, .22);
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 260ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --sidebar-width: 180px;
  --header-height: 84px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg-page); color: var(--text-primary); }
body {
  font-size: 14px;
  line-height: 22px;
  background:
    radial-gradient(circle at 82% -12%, rgba(63, 127, 255, .12), transparent 30%),
    linear-gradient(180deg, #070a10 0%, #05070b 100%),
    var(--bg-page);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); background: rgba(6, 8, 13, .92); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 12px;
  background: linear-gradient(180deg, rgba(10, 14, 21, .99), rgba(6, 8, 13, .99));
  border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; font-size: 19px; font-weight: 800; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #111a28; border: 1px solid #2c3a50; box-shadow: none; color: #83adff; }
.nav { display: grid; gap: 6px; }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.055); }
.nav-item { height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 14px; border-radius: var(--radius-md); color: var(--text-secondary); transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out); }
.nav-item:hover { background: var(--bg-panel-2); color: var(--text-primary); }
.nav-item.active { background: rgba(63, 127, 255, .12); color: var(--text-primary); box-shadow: inset 0 0 0 1px rgba(63, 127, 255, .22); }
.nav-icon { width: 18px; height: 18px; opacity: .95; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--primary); display: grid; place-items: center; font-size: 12px; line-height: 20px; }
.member-card { margin-top: auto; padding: 12px; border-radius: var(--radius-lg); background: var(--gradient-card); border: 1px solid var(--border-subtle); }
.member-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.avatar { width: 34px; height: 34px; border-radius: var(--radius-full); object-fit: cover; border: 1px solid var(--border-strong); }
.vip { color: #241600; background: linear-gradient(135deg, #ffe6a3, #d7a94d); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: var(--radius-xs); }

.main { min-width: 1180px; padding: 18px 24px 28px; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.title-block h1 { margin: 0; font-size: 30px; line-height: 38px; letter-spacing: 0; }
.subtitle { color: var(--text-muted); margin-top: 2px; }
.top-metrics { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.metric { min-width: 142px; height: 44px; padding: 6px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: rgba(15, 23, 34, .82); }
.metric small { display: block; color: var(--text-muted); font-size: 12px; line-height: 14px; }
.metric strong { font-size: 14px; line-height: 18px; }
.progress { height: 5px; overflow: hidden; border-radius: var(--radius-full); background: #263140; margin-top: 6px; }
.progress > span { display: block; height: 100%; width: var(--value, 60%); background: var(--gradient-primary); transition: width var(--duration-slow) var(--ease-out); }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) 360px; gap: 14px; align-items: stretch; }
.step-grid { display: grid; grid-template-columns: 1fr 350px; gap: 14px; }
.panel, .card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 12px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
}
.panel { padding: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(47, 62, 82, .55); margin-bottom: 14px; }
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.step-num { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 7px; background: #1a2d50; border: 1px solid rgba(79,141,255,.36); color: #a9c6ff; box-shadow: none; font-weight: 800; }
.section-title { margin: 0 0 12px; font-size: 18px; line-height: 26px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.divider { height: 1px; background: var(--border-subtle); margin: 14px 0; }

.btn {
  min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); padding: 0 14px; background: var(--bg-panel-2); color: var(--text-primary);
  border: 1px solid var(--border-subtle); font-weight: 650; transition: transform var(--duration-fast), background var(--duration-base), border-color var(--duration-base), box-shadow var(--duration-base);
}
.btn:hover { background: var(--bg-panel-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gradient-primary); border-color: rgba(118, 162, 255, .38); box-shadow: 0 8px 18px rgba(23, 75, 176, .24); }
.btn.primary:hover { box-shadow: 0 10px 22px rgba(23, 75, 176, .3); }
.btn.secondary { background: rgba(47, 123, 255, .12); color: #dce9ff; border-color: rgba(47, 123, 255, .28); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger-soft); color: #ffd7de; border-color: rgba(255, 92, 115, .32); }
.btn.large { height: 48px; padding: 0 26px; font-size: 17px; border-radius: var(--radius-md); }
.btn.icon { width: 36px; padding: 0; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin 900ms linear infinite; }

.input, .select, .textarea {
  width: 100%; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  background: rgba(10, 16, 26, .9); color: var(--text-primary); padding: 0 12px; outline: none;
  transition: border-color var(--duration-base), box-shadow var(--duration-base), background var(--duration-base);
}
.textarea { min-height: 116px; padding: 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(47, 123, 255, .16); }
.input.error, .textarea.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 115, .13); }
.field { display: grid; gap: 6px; }
.field label { color: var(--text-secondary); font-weight: 650; font-size: 13px; }
.field-note { font-size: 12px; color: var(--text-muted); }
.field-note.error { color: var(--danger); }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border-subtle); }
.tab { position: relative; height: 36px; display: inline-flex; align-items: center; color: var(--text-muted); font-weight: 650; background: none; padding: 0; }
.tab.active { color: #7eb0ff; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: var(--radius-full); background: var(--primary); }
.segmented { display: inline-flex; gap: 6px; padding: 4px; border-radius: var(--radius-md); background: rgba(10, 16, 26, .72); border: 1px solid var(--border-subtle); }
.segmented .seg { height: 30px; padding: 0 12px; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
.segmented .seg.active { background: var(--primary-soft); color: #dcebff; box-shadow: inset 0 0 0 1px rgba(47, 123, 255, .35); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-full); background: var(--bg-panel-3); color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.badge.primary { background: var(--primary-soft); color: #8ebaff; }
.badge.success { background: var(--success-soft); color: #70e5bd; }
.badge.warning { background: var(--warning-soft); color: #ffd17a; }
.badge.danger { background: var(--danger-soft); color: #ff9aaa; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: rgba(21, 31, 43, .75); color: var(--text-secondary); }
.tag.active { color: #dbeaff; border-color: rgba(79,141,255,.54); background: var(--primary-soft); }

.table { width: 100%; border-collapse: collapse; }
.table th { height: 42px; text-align: left; color: var(--text-muted); font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border-subtle); }
.table td { height: 56px; border-bottom: 1px solid rgba(30, 42, 56, .72); color: var(--text-secondary); }
.table tr:hover td { background: rgba(47, 123, 255, .05); }
.table strong { color: var(--text-primary); }

.empty, .error-state, .loading-state { min-height: 188px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); padding: 24px; background: rgba(10, 16, 26, .45); }
.empty h3, .error-state h3 { margin: 8px 0 4px; color: var(--text-primary); }
.skeleton { position: relative; overflow: hidden; background: #172232; border-radius: var(--radius-sm); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); animation: shimmer 1.2s infinite; }

.template-list, .avatar-list, .asset-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.thumb-card { position: relative; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-panel-2); min-height: 132px; transition: border-color var(--duration-base), box-shadow var(--duration-base), transform var(--duration-base); }
.thumb-card:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.thumb-card.active { border-color: rgba(79,141,255,.76); box-shadow: 0 0 0 1px rgba(79,141,255,.24); }
.thumb-card img { width: 100%; height: 116px; object-fit: cover; }
.thumb-card .thumb-info { padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.check-dot { position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: #3f7fff; display: grid; place-items: center; color: white; font-size: 12px; box-shadow: 0 6px 14px rgba(0,0,0,.3); }

.video-preview { overflow: hidden; border-radius: var(--radius-lg); background: #05070a; border: 1px solid var(--border-subtle); }
.video-preview img { width: 100%; aspect-ratio: 9 / 13; object-fit: cover; }
.video-controls { padding: 12px; background: #08090b; }
.timeline { height: 4px; border-radius: var(--radius-full); background: #303030; margin-top: 10px; }
.timeline span { display: block; width: 35%; height: 100%; background: var(--primary); border-radius: inherit; }

.footer-steps { position: sticky; bottom: 0; margin-top: 18px; padding: 12px 20px; border-top: 1px solid var(--border-subtle); background: rgba(7, 11, 18, .9); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.step-chain { display: flex; align-items: center; gap: 16px; }
.pill-step { height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: var(--radius-full); background: var(--bg-panel-2); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.pill-step.done .step-num { width: 22px; height: 22px; background: var(--success); border-radius: 50%; font-size: 0; }
.pill-step.done .step-num::before { content: "✓"; font-size: 14px; }

.toast-stack { position: fixed; right: 24px; top: 24px; display: grid; gap: 10px; z-index: 50; }
.toast, .alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-elevated); box-shadow: var(--shadow-md); }
.toast.success, .alert.success { border-color: rgba(33, 201, 149, .28); background: #0d211f; }
.toast.danger, .alert.danger { border-color: rgba(255, 92, 115, .28); background: #241219; }
.toast.info, .alert.info { border-color: rgba(105, 167, 255, .28); background: #101b2d; }
.modal-backdrop { position: fixed; inset: 0; background: var(--bg-overlay); display: none; align-items: center; justify-content: center; z-index: 40; padding: 24px; }
.modal-backdrop.open { display: flex; animation: fade-in var(--duration-slow) var(--ease-out); }
.modal { width: min(560px, 100%); background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px; animation: slide-up var(--duration-slow) var(--ease-spring); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-header h3 { margin: 0; font-size: 18px; }

.state-switcher { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.demo-state { display: none; }
.demo-state.active { display: block; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 18px 8px; }
  .brand span, .nav-item span:not(.nav-badge), .member-card { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .main { min-width: 0; padding: 16px; }
  .workbench-grid, .step-grid { grid-template-columns: 1fr; }
  .template-list, .avatar-list, .asset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
}

/* V2 high-fidelity primitives */
.page-kicker {
  display: inline-flex; align-items: center; gap: 8px; height: 22px; padding: 0 9px; margin-bottom: 6px;
  border-radius: var(--radius-full); border: 1px solid rgba(79, 141, 255, .22);
  background: rgba(79, 141, 255, .08); color: #94b8ff; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.hero-strip {
  position: relative; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 24, 34, .98), rgba(9, 13, 20, .98));
  padding: 18px; box-shadow: var(--shadow-sm);
}
.hero-strip::after { content: none; }
.hero-strip > * { position: relative; z-index: 1; }
.metric-card {
  min-height: 128px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(24, 35, 49, .96), rgba(10, 16, 26, .96));
  display: grid; align-content: space-between; gap: 12px;
}
.metric-card .metric-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text-muted); }
.metric-value { margin: 0; font-size: 30px; line-height: 34px; font-weight: 800; letter-spacing: 0; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 12px; }
.chart-grid {
  min-height: 280px; display: grid; grid-template-columns: 44px repeat(12, 1fr); grid-template-rows: repeat(4, 1fr) 24px;
  gap: 0 10px; padding: 14px 6px 0; border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(12, 19, 30, .72), rgba(8, 12, 20, .18));
}
.chart-axis { color: var(--text-muted); font-size: 11px; align-self: start; border-top: 1px solid rgba(47, 62, 82, .45); padding-top: 4px; }
.chart-bar { align-self: end; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, #45d8e2, #2f7bff); box-shadow: 0 12px 24px rgba(47, 123, 255, .22); min-height: 28px; }
.chart-label { align-self: center; text-align: center; color: var(--text-muted); font-size: 11px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.operations-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.insight-card {
  padding: 14px; border-radius: var(--radius-lg); border: 1px solid rgba(47, 123, 255, .2);
  background: linear-gradient(135deg, rgba(47, 123, 255, .13), rgba(24, 201, 210, .06));
}
.insight-card strong { display: block; margin-bottom: 4px; }
.mini-feed { display: grid; gap: 8px; }
.feed-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-md); background: rgba(10, 16, 26, .62); border: 1px solid rgba(30, 42, 56, .7); }
.feed-icon { width: 34px; height: 34px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-soft); color: #9cc2ff; font-weight: 900; }
.work-card {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; padding: 12px;
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: rgba(12, 18, 28, .72);
}
.work-cover { width: 76px; height: 54px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.quality-score { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) 0 82%, #263140 82% 100%); color: #fff; font-weight: 800; }
.template-tile {
  position: relative; overflow: hidden; min-height: 196px; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(21, 31, 43, .8), rgba(8, 12, 20, .96));
}
.template-tile img { width: 100%; height: 138px; object-fit: cover; }
.template-tile .template-meta { padding: 10px; display: grid; gap: 4px; }
.floating-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius-lg);
  background: rgba(7, 11, 18, .76); border: 1px solid var(--border-subtle); backdrop-filter: blur(12px);
}
.density-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(30, 42, 56, .64); }
.density-row:last-child { border-bottom: 0; }
.studio-stage { min-height: 500px; display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 14px; }
.step-panel { min-height: 0; }
.preview-shell {
  background: linear-gradient(180deg, rgba(15, 21, 30, .98), rgba(7, 9, 14, .99));
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px;
}
.caption-preview {
  position: absolute; left: 22px; right: 22px; bottom: 108px; text-align: center; font-size: 18px; line-height: 27px;
  font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 8px 22px rgba(0,0,0,.6);
}
.caption-preview mark { background: rgba(255, 221, 64, .92); color: #141414; border-radius: 3px; padding: 0 4px; box-decoration-break: clone; }
.video-preview.positioned { position: relative; }
.state-switcher.compact {
  margin: 0 0 10px auto;
  padding: 4px;
  width: max-content;
  background: rgba(10, 14, 21, .54);
  border: 1px solid rgba(32, 41, 54, .72);
  border-radius: 9px;
}
.state-switcher.compact .btn {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 620;
}
.page-note {
  margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px dashed rgba(47, 123, 255, .32);
  color: var(--text-muted); background: rgba(47, 123, 255, .08); font-size: 12px;
}

/* Lift older resource pages into the V2 system without changing their business structure. */
.main > .panel:has(.state-switcher),
.main > .panel:has(.asset-list),
.main > .panel:has(.avatar-list) {
  position: relative; overflow: hidden; margin-top: 14px;
  background:
    linear-gradient(180deg, rgba(18, 28, 42, .96), rgba(8, 13, 21, .98)),
    radial-gradient(circle at 85% 0%, rgba(47, 123, 255, .18), transparent 34%);
}
.main > .panel:has(.state-switcher)::after,
.main > .panel:has(.asset-list)::after,
.main > .panel:has(.avatar-list)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 38px 38px; opacity: .5;
}
.main > .panel:has(.state-switcher) > *,
.main > .panel:has(.asset-list) > *,
.main > .panel:has(.avatar-list) > * { position: relative; z-index: 1; }
.state-switcher:not(.compact) {
  padding: 6px; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  background: rgba(10, 16, 26, .64);
}
.grid.cols-3 > .panel,
.grid.cols-2 > .panel {
  background: linear-gradient(180deg, rgba(23, 34, 49, .9), rgba(10, 16, 26, .92));
}
.asset-list .thumb-card,
.avatar-list .thumb-card,
.template-list .thumb-card {
  background: linear-gradient(180deg, rgba(23, 34, 49, .92), rgba(9, 14, 22, .98));
}
.asset-list .thumb-card img,
.avatar-list .thumb-card img,
.template-list .thumb-card img {
  filter: saturate(1.04) contrast(1.02);
}
.title-block h1::after { content: none; }

/* Premium pass: reduce decorative noise and make the creation workspace feel like a serious tool. */
.q-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
  align-items: start;
}
.q-left-stack { display: grid; gap: 12px; }
.q-card {
  background: linear-gradient(180deg, rgba(17, 24, 34, .98), rgba(10, 14, 21, .99));
  border: 1px solid #202936;
  border-radius: 10px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(32, 41, 54, .9);
}
.q-title { display: flex; align-items: center; gap: 9px; font-weight: 720; font-size: 15px; }
.q-subtle { color: var(--text-muted); font-size: 12px; }
.q-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); gap: 12px; }
.q-avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.q-avatar {
  position: relative; overflow: hidden; border-radius: 8px; border: 1px solid #222c39; background: #121923;
}
.q-avatar img { width: 100%; height: 132px; object-fit: cover; filter: saturate(.94) contrast(1.02); }
.q-avatar strong { display: block; padding: 8px 9px 0; font-size: 13px; }
.q-avatar span:not(.check-dot) { display: block; padding: 0 9px 9px; color: var(--text-muted); font-size: 12px; }
.q-avatar.active { border-color: rgba(79,141,255,.72); box-shadow: inset 0 0 0 1px rgba(79,141,255,.18); }
.q-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-template {
  overflow: hidden; border-radius: 9px; border: 1px solid #222c39; background: #111821;
}
.q-template img { width: 100%; height: 118px; object-fit: cover; filter: saturate(.9) contrast(1.03); }
.q-template div { padding: 9px 10px; }
.q-template strong { display: block; font-size: 13px; }
.q-template span { color: var(--text-muted); font-size: 12px; }
.q-template.active { border-color: rgba(79,141,255,.72); }
.q-assets { display: grid; grid-template-columns: 1fr repeat(3, 92px); gap: 10px; }
.q-asset {
  min-height: 74px; border-radius: 8px; border: 1px solid #222c39; overflow: hidden; background: #0d131c;
}
.q-asset img { width: 100%; height: 74px; object-fit: cover; filter: saturate(.9); }
.q-asset.add { display: grid; place-items: center; color: var(--text-muted); border-style: dashed; font-size: 12px; }
.q-preview {
  position: sticky;
  top: 18px;
  background: linear-gradient(180deg, #101720, #07090d);
  border: 1px solid #202936;
  border-radius: 10px;
  padding: 14px;
}
.q-video {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #1e2631;
  background: #050608;
}
.q-video img { width: 100%; aspect-ratio: 9 / 13; object-fit: cover; filter: saturate(.94) contrast(1.02); }
.q-caption {
  position: absolute; left: 22px; right: 22px; bottom: 104px; text-align: center;
  color: #fff; font-size: 17px; line-height: 25px; font-weight: 780;
  text-shadow: 0 2px 4px rgba(0,0,0,.9), 0 8px 20px rgba(0,0,0,.55);
}
.q-caption mark { background: rgba(248, 220, 70, .94); color: #111; border-radius: 3px; padding: 0 4px; }
.q-controlbar { padding: 11px 12px; background: #07080a; border-top: 1px solid #171b22; }
.q-preview .density-row { padding: 9px 0; }
.q-preview .alert { padding: 10px 12px; box-shadow: none; }
.q-bottom {
  position: sticky; bottom: 0; margin-top: 14px; padding: 12px 18px;
  border: 1px solid #202936; border-radius: 12px 12px 0 0;
  background: rgba(8, 11, 17, .92); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

@media (min-width: 1200px) {
  .q-avatar img { height: 126px; }
}

/* Pro creator workspace direction: Runway/CapCut-style, quieter and more precise. */
body.pro-workspace {
  background:
    radial-gradient(circle at 82% -20%, rgba(63, 127, 255, .08), transparent 34%),
    linear-gradient(180deg, #05070b 0%, #06080c 100%);
}
.pro-workspace .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
  background: #05070b;
}
.pro-workspace .sidebar {
  padding: 18px 8px;
  align-items: center;
}
.pro-workspace .brand {
  justify-content: center;
  width: 100%;
  padding: 0 0 14px;
  margin-bottom: 4px;
}
.pro-workspace .brand span:not(.brand-mark),
.pro-workspace .brand strong,
.pro-workspace .nav-item span:not(.nav-badge),
.pro-workspace .member-card {
  display: none;
}
.pro-workspace .nav-item {
  width: 48px;
  padding: 0;
  justify-content: center;
  border-radius: 12px;
}
.pro-workspace .nav {
  gap: 8px;
}
.pro-workspace .nav-bottom {
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  padding-bottom: 2px;
  justify-items: center;
}
.pro-workspace .brand-mark {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #9fbcff;
  font-size: 18px;
}
.pro-workspace .main {
  min-width: 0;
  padding: 18px 20px 0 20px;
}
.pro-workspace .topbar {
  min-height: 58px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.pro-workspace .title-block h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 760;
}
.pro-workspace .subtitle {
  color: #8b95a6;
}
.pro-workspace .page-kicker {
  background: transparent;
  border-color: #263247;
  color: #8fa9d8;
}
.pro-workspace .top-metrics {
  gap: 6px;
}
.pro-workspace .metric {
  min-width: 130px;
  height: 42px;
  border-color: #1e2633;
  background: #0b111a;
}
.pro-workspace .state-switcher.compact {
  opacity: .72;
  transform: scale(.92);
  transform-origin: right center;
}
.pro-workspace .state-switcher.compact:hover {
  opacity: 1;
}
.pro-workspace .q-workspace {
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 12px;
  align-items: start;
}
.pro-workspace .q-left-stack {
  gap: 10px;
}
.pro-workspace .q-card,
.pro-workspace .q-preview {
  background: #0c1119;
  border-color: #1d2532;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.pro-workspace .q-card {
  padding: 13px;
}
.pro-workspace .q-card-header {
  min-height: 34px;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom-color: #1a222e;
}
.pro-workspace .q-title {
  font-size: 14px;
  font-weight: 730;
}
.pro-workspace .step-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 13px;
  background: #14223a;
  border-color: #2b4778;
  color: #adc8ff;
}
.pro-workspace .textarea,
.pro-workspace .input,
.pro-workspace .select {
  background: #080d14;
  border-color: #1b2430;
}
.pro-workspace .textarea {
  min-height: 122px;
  line-height: 23px;
}
.pro-workspace .btn {
  min-height: 34px;
  border-radius: 7px;
  background: #0d131d;
  border-color: #1f2937;
  box-shadow: none;
}
.pro-workspace .btn:hover {
  background: #111925;
}
.pro-workspace .btn.primary {
  background: #356fe8;
  border-color: #497eea;
  box-shadow: none;
}
.pro-workspace .btn.large {
  height: 44px;
  font-size: 15px;
}
.pro-workspace .segmented {
  width: 100%;
  background: #080d14;
  border-color: #1b2430;
}
.pro-workspace .segmented .seg {
  flex: 1;
}
.pro-workspace .tab {
  height: 32px;
}
.pro-workspace .tag {
  height: 27px;
  background: #0d131d;
  border-color: #1c2632;
}
.pro-workspace .badge {
  background: #111926;
}
.pro-workspace .q-avatar,
.pro-workspace .q-template,
.pro-workspace .q-asset {
  border-color: #1c2531;
  background: #0a0f16;
}
.pro-workspace .q-avatar img {
  height: 118px;
  object-position: center top;
}
.pro-workspace .q-avatar strong {
  font-size: 12px;
  padding-top: 7px;
}
.pro-workspace .q-avatar span:not(.check-dot) {
  font-size: 11px;
  padding-bottom: 8px;
}
.pro-workspace .q-template img {
  height: 104px;
}
.pro-workspace .q-assets {
  grid-template-columns: 1fr repeat(3, 86px);
}
.pro-workspace .q-asset,
.pro-workspace .q-asset img {
  min-height: 68px;
  height: 68px;
}
.pro-workspace .q-video {
  border-color: #1a222d;
  border-radius: 9px;
}
.pro-workspace .q-video img {
  aspect-ratio: 9 / 13.2;
}
.pro-workspace .q-controlbar {
  position: relative;
  padding: 10px 11px;
}
.q-safe-area {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 8%;
  bottom: 19%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  pointer-events: none;
  opacity: .55;
}
.q-safe-area::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 11%;
  height: 1px;
  background: rgba(255,255,255,.22);
}
.q-play {
  position: absolute;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 13, .58);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 16px;
  backdrop-filter: blur(10px);
  opacity: .82;
}
.q-play:hover {
  opacity: 1;
  background: rgba(20, 28, 40, .72);
}
.pro-workspace .density-row {
  border-bottom-color: #19212c;
}
.pro-workspace .q-bottom {
  margin-top: 12px;
  padding: 10px 18px;
  border-color: #1d2532;
  background: rgba(7, 10, 15, .94);
  align-items: center;
}
.pro-workspace .pill-step {
  height: 34px;
  background: #0d131d;
  border-color: #1d2532;
}
.pro-workspace .pill-step.done .step-num {
  background: #1c7f6a;
  border-color: #2aa88d;
  color: #fff;
}
.pro-workspace .step-num.optional {
  background: #151b26;
  border-color: #2b3647;
  color: #96a4ba;
}
.q-card-note {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

@media (max-width: 1280px) {
  .pro-workspace .q-workspace {
    grid-template-columns: minmax(0, 1fr) 336px;
  }
  .pro-workspace .q-two {
    grid-template-columns: 1fr;
  }
  .pro-workspace .q-avatar-grid {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .pro-workspace .q-template-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 9:16 poster thumbnails for avatar and video-template choices. */
.pro-workspace .q-avatar-grid {
  display: inline-flex;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  vertical-align: top;
}
.pro-workspace .q-avatar {
  flex: 0 0 136px;
}
.pro-workspace .q-avatar img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}
.pro-workspace .q-avatar::after,
.pro-workspace .q-template::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46px;
  height: 54px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5, 7, 11, .72));
}
.pro-workspace .q-template-grid {
  display: inline-flex;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  vertical-align: top;
}
.pro-workspace .q-template {
  flex: 0 0 150px;
  position: relative;
}
.pro-workspace .q-template img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}
.q-template-layout {
  display: grid;
  grid-template-columns: max-content 220px;
  gap: 12px;
  align-items: start;
  justify-content: start;
}
.q-template-area {
  min-width: 0;
  max-width: 100%;
}
.q-tune-panel {
  min-width: 0;
  padding: 9px;
  border: 1px solid #1c2531;
  border-radius: 9px;
  background: #090e15;
  display: grid;
  gap: 8px;
}
.q-switch {
  height: 28px;
  padding: 0 10px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #263244;
  border-radius: 999px;
  background: #101722;
  color: var(--text-muted);
  font-weight: 740;
  cursor: pointer;
}
.q-switch span {
  width: 22px;
  height: 14px;
  border-radius: 999px;
  background: #313a48;
  position: relative;
}
.q-switch span::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #c8d1df;
  transition: transform .18s ease, background .18s ease;
}
.q-switch.on {
  color: #80f0c9;
  border-color: #214d43;
  background: #0b1d1a;
}
.q-switch.on span {
  background: #1f8d73;
}
.q-switch.on span::after {
  transform: translateX(8px);
  background: #ecfff9;
}
.q-tune-title {
  color: var(--text-secondary);
  font-weight: 740;
  font-size: 13px;
  line-height: 18px;
}
.q-tune-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.q-tune-head .btn {
  min-height: 24px;
  padding: 0 4px;
  color: #9dbfff;
}
.q-tune-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(47, 62, 82, .55);
}
.q-tune-tabs button {
  min-height: 28px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 760;
  font-size: 12px;
  cursor: pointer;
}
.q-tune-tabs button.active {
  color: #72a7ff;
  border-bottom-color: var(--primary);
}
.q-tune-panel-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}
.q-tune-panel-body[hidden] {
  display: none;
}
.q-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.q-chip-grid .tag {
  justify-content: center;
  padding: 0 6px;
  height: 26px;
  font-size: 12px;
}
.q-range {
  padding: 0;
  min-height: 24px;
}
.q-compact-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #19212c;
  color: var(--text-muted);
  font-weight: 650;
}
.q-compact-row strong {
  color: var(--text-primary);
}
.voice-source-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 2px 0 10px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .45);
  border: 1px solid rgba(47, 62, 82, .48);
}
.voice-source-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 760;
  cursor: pointer;
}
.voice-source-tabs button.active {
  color: #d9e7ff;
  background: rgba(63, 127, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(63, 127, 255, .32);
}
.voice-source-panel {
  display: grid;
  gap: 8px;
}
.voice-source-panel[hidden] {
  display: none;
}
.clone-voice-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(47, 62, 82, .5);
}
.clone-voice-section.compact {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.clone-voice-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.clone-voice-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .6);
  border: 1px solid rgba(255,255,255,.055);
}
.clone-voice-card.active {
  border-color: rgba(63, 127, 255, .55);
  box-shadow: inset 2px 0 0 var(--primary);
}
.clone-voice-card .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.clone-voice-main strong {
  display: block;
  font-size: 13px;
  line-height: 18px;
}
.clone-voice-meta {
  display: grid;
  grid-template-columns: max-content minmax(72px, 120px);
  gap: 8px;
  align-items: center;
}
.clone-voice-main p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
}
.clone-voice-main .q-waveform {
  height: 14px;
  width: 100%;
  margin: 0;
}
.clone-voice-actions {
  display: flex;
  gap: 5px;
}
.clone-voice-actions .btn {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}
.subtitle-color-row {
  display: grid;
  grid-template-columns: 64px repeat(3, 24px) 42px;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}
.subtitle-color-row.compact {
  grid-template-columns: 64px repeat(3, 24px) minmax(34px, 1fr);
}
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--swatch);
  box-shadow: 0 0 0 3px rgba(255,255,255,.03);
}
.color-swatch.active {
  box-shadow: 0 0 0 3px rgba(63, 127, 255, .26);
  border-color: rgba(142, 186, 255, .72);
}
.subtitle-color-row input[type="color"] {
  width: 38px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(47, 62, 82, .72);
  border-radius: 8px;
  background: transparent;
}
.q-mini-tabs {
  gap: 12px;
  overflow: hidden;
}
.q-mini-tabs .tab {
  height: 28px;
  font-size: 12px;
}
.q-mix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  transition: opacity .18s ease, filter .18s ease;
}
.q-mix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pro-workspace .q-mix-assets {
  grid-template-columns: minmax(150px, 1.35fr) repeat(4, minmax(70px, 84px));
  align-items: stretch;
}
.pro-workspace .q-mix-assets .q-asset {
  position: relative;
}
.pro-workspace .q-mix-assets .q-asset small {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 11px;
}
.pro-workspace .q-mix-assets .q-asset.add {
  line-height: 20px;
}
.pro-workspace .q-mix-assets .q-asset.add span {
  color: var(--text-muted);
  font-size: 11px;
}
.q-insert-list {
  border: 1px solid #1c2531;
  border-radius: 9px;
  overflow: hidden;
  background: #090e15;
}
.q-insert-title {
  padding: 9px 10px;
  border-bottom: 1px solid #19212c;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 740;
}
.q-insert-row {
  display: grid;
  grid-template-columns: 92px 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid #19212c;
}
.q-insert-row:last-child {
  border-bottom: 0;
}
.q-insert-row strong {
  color: #83b1ff;
  font-size: 12px;
}
.q-insert-row span {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12px;
}
.q-insert-row em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-mix-off {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed #263244;
  border-radius: 9px;
  background: #080d14;
  color: var(--text-muted);
}
.q-mix-off strong {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.mix-disabled .q-mix-layout {
  display: none;
}
.mix-disabled .q-mix-off {
  display: block;
}
.mix-disabled .q-card-header .badge {
  background: #121820;
  color: var(--text-muted);
}
.q-preview-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid #1b2430;
  border-radius: 9px;
  background: #080d14;
}
.q-preview-tabs button {
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 720;
}
.q-preview-tabs button.active {
  background: #121c2d;
  color: #dbe8ff;
}
.q-video-status {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}
.q-video-status span,
.q-video-status strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(5, 8, 13, .58);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.86);
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.q-video-status strong {
  font-weight: 720;
  color: #b8cdf4;
}
.q-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.q-player-row span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.q-player-row div {
  display: flex;
  gap: 4px;
}
.q-player-row button {
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid #202a36;
  border-radius: 999px;
  background: #0c1119;
  color: var(--text-muted);
  font-size: 11px;
}
.q-generate-hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.pill-step.optional {
  color: var(--text-muted);
}

@media (max-width: 1280px) {
  .q-template-layout {
    grid-template-columns: max-content 204px;
  }
  .q-mix-layout {
    grid-template-columns: 1fr;
  }
}

.q-voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}
.q-audio-btn {
  padding: 0 10px;
  white-space: nowrap;
}
.q-audio-mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #1b2430;
  border-radius: 8px;
  background: #080d14;
  color: var(--text-muted);
  font-size: 12px;
}
.q-audio-mini strong {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}
.q-audio-range {
  width: 100%;
  min-height: 18px;
  padding: 0;
  accent-color: #76a8ff;
}
.q-audio-result {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #1c2531;
  border-radius: 9px;
  background: #080d14;
}
.q-audio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.q-audio-head strong {
  font-size: 12px;
  color: var(--text-secondary);
}
.q-audio-player {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
}
.q-audio-player span {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}
.q-round-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #13213a;
  border: 1px solid #2b4778;
  color: #c9dcff;
  font-size: 11px;
}
.q-waveform {
  height: 30px;
  position: relative;
  display: block;
  margin-top: 9px;
  opacity: .85;
}
.q-waveform::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/icons/waveform.svg") center / 100% 100% no-repeat;
}
.q-waveform i {
  display: none;
}

/* Shared polish for all non-creation admin pages, matched to the auto-create workspace. */
.pro-admin .main {
  padding-bottom: 28px;
}
.pro-admin .topbar {
  padding-bottom: 10px;
  border-bottom: 1px solid #141d2a;
}
.pro-admin .title-block h1 {
  font-size: 26px;
  line-height: 32px;
}
.pro-admin .panel,
.pro-admin .card,
.pro-admin .hero-strip,
.pro-admin .metric-card,
.pro-admin .work-card,
.pro-admin .template-tile,
.pro-admin .feed-item,
.pro-admin .insight-card {
  border-color: #1c2531;
  background: linear-gradient(180deg, rgba(14, 20, 30, .98), rgba(7, 11, 17, .99));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.026);
}
.pro-admin .panel {
  padding: 13px;
}
.pro-admin .panel-header {
  min-height: 34px;
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom-color: #1a222e;
}
.pro-admin .panel-title {
  font-size: 15px;
  font-weight: 740;
}
.pro-admin .hero-strip {
  padding: 14px;
  margin-top: 14px;
}
.pro-admin .metric-card {
  min-height: 108px;
  padding: 13px;
}
.pro-admin .metric-value {
  font-size: 27px;
  line-height: 31px;
}
.pro-admin .floating-toolbar {
  background: #070b12;
  border-color: #1b2430;
  border-radius: 9px;
}
.pro-admin .state-switcher:not(.compact) {
  display: inline-flex;
  width: max-content;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 9px;
  background: #080d14;
  border-color: #1b2430;
}
.pro-admin .state-switcher:not(.compact) .btn {
  min-height: 30px;
  font-size: 12px;
}
.pro-admin .split-layout {
  grid-template-columns: minmax(0, 1fr) 336px;
}
.pro-admin .workbench-grid {
  grid-template-columns: minmax(0, 1fr) 336px;
}
.pro-admin .operations-grid {
  grid-template-columns: minmax(0, 1fr) 380px;
}
.pro-admin .work-card {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  padding: 10px;
}
.pro-admin .work-cover {
  width: 64px;
  height: 82px;
  aspect-ratio: 9 / 12;
  object-fit: cover;
}
.pro-admin .quality-score {
  width: 40px;
  height: 40px;
  font-size: 13px;
}
.pro-admin .feed-item {
  min-height: 66px;
}
.pro-admin .feed-icon {
  background: #14223a;
  border: 1px solid #2b4778;
}
.pro-admin .grid.cols-3,
.pro-admin .grid.cols-4,
.pro-admin .grid.cols-2 {
  gap: 12px;
}
.pro-admin .template-tile {
  min-height: 0;
  border-radius: 9px;
}
.pro-admin .template-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
  filter: saturate(.96) contrast(1.02);
}
.pro-admin .template-tile .template-meta {
  min-height: 104px;
  padding: 10px;
  background: #070b12;
  border-top: 1px solid #17202b;
}
.pro-admin .avatar-list,
.pro-admin .asset-list,
.pro-admin .template-list {
  display: grid;
  gap: 12px;
}
.pro-admin .avatar-list {
  grid-template-columns: repeat(5, minmax(128px, 1fr)) !important;
}
.pro-admin .asset-list {
  grid-template-columns: repeat(6, minmax(120px, 1fr)) !important;
}
.pro-admin .avatar-list .thumb-card,
.pro-admin .asset-list .thumb-card {
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid #1c2531;
  background: #080d14;
}
.pro-admin .avatar-list .thumb-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}
.pro-admin .asset-list .thumb-card img {
  width: 100%;
  height: 116px;
  object-fit: cover;
}
.pro-admin .thumb-card.active {
  border-color: rgba(79,141,255,.72);
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.2);
}
.pro-admin .thumb-info {
  padding: 9px 10px 10px;
  display: grid;
  gap: 3px;
  color: var(--text-secondary);
}
.pro-admin .thumb-info strong,
.pro-admin .thumb-info:first-line {
  color: var(--text-primary);
  font-weight: 740;
}
.pro-admin .video-preview {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid #1a222d;
  background: #050608;
}
.pro-admin .video-preview > img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
  filter: saturate(.95) contrast(1.02);
}
.pro-admin .video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 11px;
  background: linear-gradient(180deg, transparent, rgba(3,5,8,.94) 32%);
}
.pro-admin .caption-preview {
  bottom: 88px;
  font-size: 16px;
  line-height: 24px;
}
.pro-admin .table th {
  height: 38px;
}
.pro-admin .table td {
  height: 52px;
}
.pro-admin .input,
.pro-admin .select,
.pro-admin .textarea {
  background: #080d14;
  border-color: #1b2430;
}
.pro-admin .alert {
  box-shadow: none;
}
.pro-admin .modal {
  background: #0b111a;
  border-color: #243044;
}
.pro-admin .page-note {
  border-color: #263247;
  background: #080d14;
}

@media (max-width: 1280px) {
  .pro-admin .split-layout,
  .pro-admin .workbench-grid,
  .pro-admin .operations-grid {
    grid-template-columns: 1fr;
  }
  .pro-admin .grid.cols-4,
  .pro-admin .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pro-admin .avatar-list,
  .pro-admin .asset-list {
    grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
  }
}

/* Page-level refinement pass: make library/market pages feel designed, not merely styled. */
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel {
  position: relative;
  overflow: hidden;
  min-height: 174px;
  padding: 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(16, 24, 36, .98), rgba(7, 11, 17, .99)),
    radial-gradient(circle at 88% 0%, rgba(79, 141, 255, .16), transparent 38%);
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel::before {
  content: "";
  display: block;
  height: 48px;
  margin: 14px 0 12px;
  background: url("../assets/icons/waveform.svg") center / 100% 100% no-repeat;
  opacity: .78;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel::after {
  content: "试听 00:08 · 可拖动试听 · 已通过降噪检测";
  display: block;
  margin-top: -2px;
  color: var(--text-muted);
  font-size: 12px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .avatar {
  width: 44px;
  height: 44px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .divider {
  display: none;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .row:last-child {
  margin-top: 10px;
}

.pro-admin .panel:has([data-state="asset"]) .asset-list {
  grid-template-columns: repeat(5, minmax(118px, 1fr)) 300px !important;
  align-items: stretch;
}
.pro-admin .panel:has([data-state="asset"]) .asset-list::after {
  content: "当前素材\\A产品展示.jpg\\A\\A类型  JPG 图片\\A尺寸  1080 x 1920\\A标签  产品 / 展示 / 混剪\\A引用  3 个视频草稿\\A\\A智能建议\\A适合插入 00:05 - 00:08 产品展示段";
  white-space: pre-line;
  padding: 14px;
  border: 1px solid #1c2531;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(13, 20, 31, .98), rgba(7, 11, 17, .99));
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 22px;
  text-align: left;
}
.pro-admin .panel:has([data-state="asset"]) .asset-list .empty {
  min-height: 170px !important;
}
.pro-admin .panel:has([data-state="asset"]) .asset-list .thumb-card {
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.pro-admin .panel:has([data-state="asset"]) .asset-list .thumb-card:hover {
  transform: translateY(-2px);
  border-color: #2b4778;
}

.pro-admin .panel:has([data-state="tpl"]) .template-tile {
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.pro-admin .panel:has([data-state="tpl"]) .split-layout > .grid.cols-3 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pro-admin .panel:has([data-state="tpl"]) .template-tile:hover {
  transform: translateY(-2px);
  border-color: #2b4778;
}
.pro-admin .panel:has([data-state="tpl"]) .template-tile::after {
  content: "9:16 · 口播 · 可微调";
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(5, 8, 13, .62);
  border: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.86);
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.pro-admin .panel:has([data-state="tpl"]) .template-tile.active {
  border-color: rgba(79,141,255,.78);
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.18);
}
.pro-admin .panel:has([data-state="tpl"]) aside.panel {
  position: sticky;
  top: 18px;
}
.pro-admin .panel:has([data-state="tpl"]) .template-tile .template-meta {
  min-height: 92px;
}

.pro-admin .panel:has([data-state="works"]) .work-card,
.pro-admin .sample-stack .work-card {
  position: relative;
  overflow: hidden;
}
.pro-admin .panel:has([data-state="works"]) .work-card::before,
.pro-admin .sample-stack .work-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: #3f7fff;
  opacity: .58;
}
.pro-admin .panel:has([data-state="works"]) .work-card:hover,
.pro-admin .sample-stack .work-card:hover {
  border-color: #2b4778;
  background: linear-gradient(180deg, rgba(17, 25, 38, .98), rgba(8, 13, 20, .99));
}

.pro-admin .panel:has([data-state="settings"]) .grid.cols-2 > .panel {
  min-height: 190px;
}
.pro-admin .panel:has([data-state="settings"]) .table td {
  height: 62px;
}

@media (max-width: 1280px) {
  .pro-admin .panel:has([data-state="asset"]) .asset-list {
    grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
  }
  .pro-admin .panel:has([data-state="tpl"]) .split-layout > .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pro-admin .panel:has([data-state="asset"]) .asset-list::after {
    grid-column: 1 / -1;
  }
}

/* Surface parity: admin pages use the same solid, precise card treatment as auto-create. */
.pro-admin .panel,
.pro-admin .card,
.pro-admin .hero-strip,
.pro-admin .preview-shell {
  background: #0c1119;
  border-color: #1d2532;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  backdrop-filter: none;
}
.pro-admin .metric-card,
.pro-admin .work-card,
.pro-admin .template-tile,
.pro-admin .feed-item,
.pro-admin .insight-card,
.pro-admin .avatar-list .thumb-card,
.pro-admin .asset-list .thumb-card,
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel {
  background: #080d14;
  border-color: #1c2531;
  box-shadow: none;
}
.pro-admin .main > .panel:has(.state-switcher),
.pro-admin .main > .panel:has(.asset-list),
.pro-admin .main > .panel:has(.avatar-list) {
  background: #0c1119;
}
.pro-admin .main > .panel:has(.state-switcher)::after,
.pro-admin .main > .panel:has(.asset-list)::after,
.pro-admin .main > .panel:has(.avatar-list)::after {
  content: none;
}
.pro-admin .panel-header {
  border-bottom-color: #1a222e;
}
.pro-admin .template-tile .template-meta,
.pro-admin .thumb-info,
.pro-admin .panel:has([data-state="asset"]) .asset-list::after,
.pro-admin .state-switcher:not(.compact),
.pro-admin .floating-toolbar {
  background: #080d14;
  border-color: #1b2430;
}
.pro-admin .grid.cols-3 > .panel,
.pro-admin .grid.cols-2 > .panel,
.pro-admin .grid.cols-4 > .panel {
  background: #080d14;
  border-color: #1c2531;
}
.pro-admin .empty,
.pro-admin .error-state,
.pro-admin .loading-state {
  background: #080d14;
  border-color: #243044;
}

/* Compact resource management density: voice/avatar libraries should scan like assets, not promos. */
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel {
  min-height: 0;
  padding: 9px;
  border-radius: 8px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel > .row:first-child {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel > .row:first-child strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 18px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel > .row:first-child .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .avatar {
  width: 34px;
  height: 34px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel::before {
  height: 18px;
  margin: 7px 0 5px;
  opacity: .86;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel::after {
  content: "00:08 · 降噪通过";
  margin-top: 0;
  font-size: 11px;
  line-height: 16px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .row:last-child {
  margin-top: 6px;
  gap: 6px;
}
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .row:last-child .btn {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.pro-admin .panel:has([data-state="avatar"]) .avatar-list {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .thumb-card {
  border-radius: 9px;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .thumb-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .thumb-info {
  min-height: 92px;
  padding: 10px;
  gap: 5px;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .thumb-info strong {
  font-size: 13px;
  line-height: 18px;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .thumb-info .badge {
  width: max-content;
  height: 20px;
  font-size: 11px;
}
.pro-admin .panel:has([data-state="avatar"]) .avatar-list .empty {
  min-height: 404px !important;
  padding: 18px;
}

@media (max-width: 1280px) {
  .pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pro-admin .panel:has([data-state="avatar"]) .avatar-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Quiet premium pass: fewer default outlines, clearer active/focus states. */
.pro-workspace .btn,
.pro-admin .btn {
  border-color: rgba(255,255,255,.045);
  background: #0d131d;
}
.pro-workspace .btn.ghost,
.pro-admin .btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}
.pro-workspace .btn.secondary,
.pro-admin .btn.secondary {
  border-color: rgba(79,141,255,.14);
  background: rgba(79,141,255,.09);
}
.pro-workspace .btn:hover,
.pro-admin .btn:hover {
  border-color: rgba(126,176,255,.26);
  background: #111925;
}
.pro-workspace .btn.primary,
.pro-admin .btn.primary {
  border-color: rgba(126,176,255,.28);
  box-shadow: 0 8px 18px rgba(28, 87, 206, .18);
}
.pro-workspace .tag,
.pro-admin .tag {
  border-color: transparent;
  background: #0f1621;
}
.pro-workspace .tag.active,
.pro-admin .tag.active {
  border-color: rgba(79,141,255,.34);
  background: rgba(79,141,255,.12);
}
.pro-workspace .badge,
.pro-admin .badge {
  box-shadow: none;
}
.pro-workspace .input,
.pro-workspace .select,
.pro-workspace .textarea,
.pro-admin .input,
.pro-admin .select,
.pro-admin .textarea {
  border-color: rgba(255,255,255,.055);
  background: #080d14;
}
.pro-workspace .input:hover,
.pro-workspace .select:hover,
.pro-workspace .textarea:hover,
.pro-admin .input:hover,
.pro-admin .select:hover,
.pro-admin .textarea:hover {
  border-color: rgba(126,176,255,.18);
}
.pro-workspace .input:focus,
.pro-workspace .select:focus,
.pro-workspace .textarea:focus,
.pro-admin .input:focus,
.pro-admin .select:focus,
.pro-admin .textarea:focus {
  border-color: rgba(79,141,255,.66);
  box-shadow: 0 0 0 3px rgba(47,123,255,.12);
}
.pro-workspace .q-card,
.pro-workspace .q-preview,
.pro-admin .panel,
.pro-admin .card,
.pro-admin .hero-strip,
.pro-admin .preview-shell {
  border-color: rgba(255,255,255,.06);
}
.pro-workspace .q-avatar,
.pro-workspace .q-template,
.pro-workspace .q-asset,
.pro-admin .metric-card,
.pro-admin .work-card,
.pro-admin .template-tile,
.pro-admin .feed-item,
.pro-admin .insight-card,
.pro-admin .avatar-list .thumb-card,
.pro-admin .asset-list .thumb-card,
.pro-admin .grid.cols-3 > .panel,
.pro-admin .grid.cols-2 > .panel,
.pro-admin .grid.cols-4 > .panel,
.pro-admin .panel:has([data-state="voice"]) .demo-state[data-name="default"] .grid.cols-3 > .panel {
  border-color: transparent;
}
.pro-workspace .q-avatar:hover,
.pro-workspace .q-template:hover,
.pro-workspace .q-asset:hover,
.pro-admin .work-card:hover,
.pro-admin .template-tile:hover,
.pro-admin .avatar-list .thumb-card:hover,
.pro-admin .asset-list .thumb-card:hover,
.pro-admin .feed-item:hover {
  border-color: rgba(126,176,255,.22);
}
.pro-workspace .q-avatar.active,
.pro-workspace .q-template.active,
.pro-admin .thumb-card.active,
.pro-admin .template-tile.active,
.pro-admin .avatar-list .thumb-card.active,
.pro-admin .asset-list .thumb-card.active {
  border-color: rgba(79,141,255,.58);
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.14);
}
.pro-workspace .q-card-header,
.pro-admin .panel-header {
  border-bottom-color: rgba(255,255,255,.055);
}
.pro-admin .table th {
  border-bottom-color: rgba(255,255,255,.06);
}
.pro-admin .table td,
.pro-workspace .density-row,
.pro-admin .density-row {
  border-bottom-color: rgba(255,255,255,.045);
}
.pro-admin .table tr:hover td {
  background: rgba(79,141,255,.035);
}
.pro-workspace .segmented,
.pro-admin .segmented,
.pro-workspace .q-audio-mini,
.pro-workspace .q-audio-result,
.pro-workspace .q-tune-panel,
.pro-workspace .q-insert-list,
.pro-workspace .q-preview-tabs,
.pro-admin .state-switcher:not(.compact),
.pro-admin .floating-toolbar,
.pro-admin .template-tile .template-meta,
.pro-admin .thumb-info,
.pro-admin .panel:has([data-state="asset"]) .asset-list::after {
  border-color: rgba(255,255,255,.055);
}
.pro-workspace .q-video,
.pro-admin .video-preview {
  border-color: rgba(255,255,255,.055);
}
.pro-workspace .q-bottom {
  border-color: rgba(255,255,255,.065);
}

/* Works page density: keep list rows compact and give the review rail breathing room. */
.pro-admin .panel:has([data-state="works"]) .split-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.pro-admin .panel:has([data-state="works"]) .sample-stack {
  display: grid;
  gap: 6px;
  align-self: start;
}
.pro-admin .panel:has([data-state="works"]) .work-card {
  grid-template-columns: 58px minmax(0, 1fr) 194px;
  min-height: 82px;
  padding: 8px 10px;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
}
.pro-admin .panel:has([data-state="works"]) .work-card::before {
  top: 8px;
  bottom: 8px;
  width: 2px;
}
.pro-admin .panel:has([data-state="works"]) .work-cover {
  width: 58px;
  height: 64px;
  border-radius: 7px;
}
.pro-admin .panel:has([data-state="works"]) .work-card > div:nth-child(2) {
  min-width: 0;
}
.pro-admin .panel:has([data-state="works"]) .work-card > div:nth-child(2) .row {
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.pro-admin .panel:has([data-state="works"]) .work-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
}
.pro-admin .panel:has([data-state="works"]) .work-card .muted {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 18px;
}
.pro-admin .panel:has([data-state="works"]) .work-card > .row:last-child {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
.pro-admin .panel:has([data-state="works"]) .quality-score {
  width: 34px;
  height: 34px;
  font-size: 12px;
  flex: 0 0 auto;
}
.pro-admin .panel:has([data-state="works"]) .work-card .btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}
.pro-admin .panel:has([data-state="works"]) aside.panel {
  padding: 12px;
}
.pro-admin .panel:has([data-state="works"]) aside.panel .video-preview > img {
  max-height: 420px;
}

@media (max-width: 1280px) {
  .pro-admin .panel:has([data-state="works"]) .split-layout {
    grid-template-columns: 1fr;
  }
}

/* Spec-driven pages generated from ui-spec-for-codex.md */
.spec-page {
  --bg-primary: #090d13;
  --bg-card: linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)), #11161e;
  --border-card: rgba(255,255,255,0.09);
  --border-divider: rgba(255,255,255,0.06);
  --accent-blue: #2f73ff;
  --accent-blue-light: #4a88ff;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-yellow: #fbbf24;
  --accent-purple: #a855f7;
  --accent-teal: #16b99b;
}

.spec-page .main.spec-main {
  min-width: 1220px;
  padding: 20px 28px 36px;
}

.spec-page .brand {
  justify-content: center;
  padding-inline: 0;
}

.spec-page .brand strong {
  display: none;
}

.spec-route {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  color: #8db7ff;
  background: rgba(47, 115, 255, .1);
  border: 1px solid rgba(47, 115, 255, .2);
  font-size: 12px;
  font-weight: 700;
}

.spec-page .spec-topbar { margin-bottom: 16px; }

.spec-panel {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.034), rgba(255,255,255,.012)), #0c1119;
  border: 1px solid rgba(255,255,255,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 50px rgba(0,0,0,.18);
}

.spec-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.spec-panel-head h2,
.spec-hero h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0;
}

.spec-panel-head p,
.spec-hero p {
  margin: 3px 0 0;
  color: var(--text-muted);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.spec-grid .span-4 { grid-column: span 4; }
.spec-grid .span-5 { grid-column: span 5; }
.spec-grid .span-6 { grid-column: span 6; }
.spec-grid .span-7 { grid-column: span 7; }
.spec-grid .span-8 { grid-column: span 8; }
.spec-grid .span-12 { grid-column: span 12; }

.spec-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 14px;
}

.spec-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-height: 210px;
}

.spec-hero-preview {
  min-height: 210px;
  padding: 12px;
  border-radius: 14px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.spec-app-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 14px;
  margin-bottom: 14px;
}

.spec-work-area,
.spec-side-panel {
  min-height: 420px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.034), rgba(255,255,255,.012)), #0c1119;
  border: 1px solid rgba(255,255,255,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 50px rgba(0,0,0,.18);
}

.spec-work-area {
  display: grid;
  align-content: start;
  gap: 16px;
}

.spec-side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  background: #080d14;
}

.spec-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.spec-section-head.slim {
  padding-bottom: 10px;
}

.spec-section-head h2 {
  margin: 8px 0 4px;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0;
}

.spec-section-head p {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
}

.spec-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spec-metric-card {
  min-height: 92px;
  padding: 13px;
  border-radius: 13px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}

.spec-metric-card small,
.spec-metric-card span {
  display: block;
  color: #7f8b9d;
  font-size: 12px;
  line-height: 18px;
}

.spec-metric-card strong {
  display: block;
  margin: 7px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f6f8ff;
  font-size: 20px;
  line-height: 26px;
}

.spec-data-list {
  display: grid;
  gap: 8px;
}

.spec-data-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.045);
}

.spec-data-row.active {
  border-color: rgba(47,115,255,.28);
  background: linear-gradient(90deg, rgba(47,115,255,.08), rgba(8,13,20,1) 50%);
}

.spec-row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #9ec0ff;
  background: rgba(47,115,255,.11);
  border: 1px solid rgba(47,115,255,.22);
  font-weight: 800;
}

.spec-data-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.spec-data-row p {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.spec-form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.spec-side-panel .spec-work-row {
  grid-template-columns: 76px minmax(0, 1fr);
}

.spec-side-panel .spec-work-row .badge {
  grid-column: 2;
  justify-self: start;
}

.spec-side-panel .api-list.compact {
  grid-template-columns: 1fr;
}

.spec-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1fr);
  gap: 14px;
}

.spec-flow-grid > .spec-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.spec-handoff {
  margin-top: 4px;
}

.spec-handoff .spec-panel-head h2::after {
  content: "（交付明细）";
  margin-left: 6px;
  color: #657185;
  font-size: 12px;
  font-weight: 650;
}

.spec-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.055);
  background: rgba(5, 9, 15, .56);
}

.spec-table-wrap + .spec-table-wrap { margin-top: 10px; }

.spec-caption {
  padding: 10px 12px;
  color: #eaf1ff;
  font-weight: 750;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.spec-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.spec-table th {
  color: #8f9bac;
  font-size: 12px;
  font-weight: 750;
  background: rgba(255,255,255,.018);
  white-space: nowrap;
}

.spec-table td {
  color: #c5cfde;
  font-size: 13px;
}

.spec-table tr:last-child td { border-bottom: 0; }

.spec-table code,
.api-list code {
  color: #9ec0ff;
  background: rgba(47, 115, 255, .095);
  border: 1px solid rgba(47, 115, 255, .16);
  border-radius: 6px;
  padding: 1px 5px;
}

.spec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.spec-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.spec-form-grid .field {
  padding: 10px;
  border-radius: 12px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}

.spec-form-grid .field span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #dce5f4;
}

.spec-form-grid .field small { color: #768396; }

.required {
  color: #ff8191;
  font-style: normal;
}

.status-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.status-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--chip-color) 9%, #080d14);
  border: 1px solid color-mix(in srgb, var(--chip-color) 24%, transparent);
}

.status-chip strong { color: color-mix(in srgb, var(--chip-color) 70%, #fff); }
.status-chip span { color: #8b96a8; font-size: 12px; }

.api-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.api-list.compact code {
  font-size: 12px;
  line-height: 18px;
}

.api-list code {
  display: block;
  padding: 9px 10px;
  color: #b9ccff;
  white-space: normal;
}

.spec-list {
  margin: 0;
  padding-left: 18px;
  color: #c5cfde;
}

.spec-list li + li { margin-top: 6px; }
.spec-copy p { margin: 0 0 8px; color: #c5cfde; }

.spec-empty-line,
.spec-note {
  padding: 12px;
  border-radius: 12px;
  color: #8f9bac;
  background: #080d14;
  border: 1px dashed rgba(255,255,255,.09);
}

.spec-state-preview {
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}

.loader {
  width: 26px;
  height: 26px;
  display: inline-block;
  border-radius: 50%;
  border: 3px solid rgba(47,115,255,.2);
  border-top-color: #2f73ff;
  animation: spin .9s linear infinite;
}

.switch {
  width: 42px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
}

.switch::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms var(--ease-out);
}

.switch.is-on { background: #2f73ff; }
.switch.is-on::after { transform: translateX(18px); }

.spec-work-row {
  width: 100%;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: #060a10;
  border: 1px solid rgba(255,255,255,.055);
}

.spec-work-row img {
  width: 74px;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
}

.spec-preview-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.spec-preview-cards .thumb-card { min-height: 0; }
.spec-preview-cards .thumb-card img {
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}

.voice-card.compact {
  width: 100%;
  min-height: 170px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  border-radius: 14px;
  background: #060a10;
  border: 1px solid rgba(255,255,255,.055);
}

.voice-card.compact .q-waveform,
.voice-card.compact .spec-actions { grid-column: 1 / -1; }

@media (max-width: 1280px) {
  .spec-page .main.spec-main { min-width: 980px; }
  .spec-hero { grid-template-columns: 1fr; }
  .spec-app-surface,
  .spec-flow-grid { grid-template-columns: 1fr; }
  .spec-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-grid .span-4,
  .spec-grid .span-5,
  .spec-grid .span-6,
  .spec-grid .span-7,
  .spec-grid .span-8 { grid-column: span 12; }
}

/* Core product pages: real UI, not spec-table pages. */
.core-page .brand strong { display: none; }
.core-page .main {
  min-width: 1180px;
}
.core-page .panel {
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(12,17,25,.99), rgba(8,12,18,.99));
  border-color: rgba(255,255,255,.058);
}
.core-page .topbar {
  align-items: flex-start;
}
.core-page .top-metrics {
  flex-wrap: nowrap;
}
.core-page .metric {
  min-width: 112px;
}
.core-page .panel-header {
  min-height: 32px;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.core-page .panel-title {
  font-size: 14px;
  line-height: 20px;
}
.core-page .btn {
  min-height: 32px;
  border-radius: 7px;
}
.core-page .btn.large {
  height: 40px;
  font-size: 14px;
}
.core-hero,
.dashboard-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  min-height: 260px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.034), rgba(255,255,255,.012)), #0c1119;
}
.core-hero h2 { margin: 12px 0 8px; font-size: 34px; line-height: 42px; letter-spacing: 0; }
.core-hero p { max-width: 620px; color: var(--text-muted); }
.dashboard-command {
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.dashboard-hero-panel {
  min-height: 278px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79,141,255,.10), rgba(33,201,149,.04)), #0b1018;
}
.dashboard-hero-panel h2 {
  max-width: 820px;
  margin: 14px 0 8px;
  font-size: 30px;
  line-height: 38px;
  letter-spacing: 0;
}
.dashboard-hero-panel p {
  max-width: 760px;
  color: var(--text-muted);
}
.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.dashboard-preview-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 14px;
  background: #080d14;
}
.dashboard-preview-card img {
  width: 100%;
  height: 214px;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}
.dashboard-preview-meta {
  padding: 12px;
  background: #070b12;
}
.dashboard-preview-meta strong {
  color: #eef5ff;
}
.dashboard-preview-meta p {
  margin: 4px 0 0;
}
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-card {
  min-height: 86px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.055);
  background: linear-gradient(180deg, rgba(13,18,27,.96), rgba(7,11,17,.98));
}
.kpi-card span {
  display: block;
  color: #7f8b9d;
  font-size: 12px;
}
.kpi-card strong {
  display: block;
  margin-top: 8px;
  color: #eef5ff;
  font-size: 26px;
  line-height: 28px;
}
.kpi-card p {
  margin: 6px 0 0;
  color: #7f8b9d;
  font-size: 12px;
}
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.dashboard-left,
.dashboard-right {
  display: grid;
  gap: 14px;
}
.dense-list .core-row {
  min-height: 70px;
}
.formula-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.formula-card.blue {
  border-color: rgba(79,141,255,.22);
}
.quick-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quick-grid.compact a {
  min-height: 68px;
}
.dashboard-template-list,
.notification-mini-list {
  display: grid;
  gap: 8px;
}
.dashboard-template-list article,
.notification-mini-list article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border-radius: 9px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.045);
}
.dashboard-template-list img {
  width: 46px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
}
.dashboard-template-list span,
.notification-mini-list p {
  display: block;
  margin: 2px 0 0;
  color: #7f8b9d;
  font-size: 12px;
}
.notification-mini-list article {
  grid-template-columns: 30px minmax(0, 1fr);
}
.core-preview-mini {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}
.core-preview-mini img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; object-position: center top; border-radius: 10px; }
.core-preview-mini div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.core-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.core-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.core-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.core-grid .span-2 { grid-column: span 2; }
.core-list { display: grid; gap: 8px; }
.core-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.05);
}
.core-row > img { width: 58px; height: 64px; object-fit: cover; border-radius: 8px; }
.core-row strong, .task-row strong { color: var(--text-primary); }
.core-row p, .task-row p { margin: 2px 0 0; color: var(--text-muted); }
.danger-line { border-color: rgba(239,68,68,.18); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-grid a, .formula-card {
  min-height: 82px;
  padding: 12px;
  border-radius: 10px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}
.quick-grid span, .formula-card p { display: block; margin-top: 5px; color: var(--text-muted); }
.formula-card { border-color: rgba(245,158,11,.22); }
.formula-card.pink { border-color: rgba(236,72,153,.22); }
.formula-card.red { border-color: rgba(239,68,68,.22); }
.waiting-layout, .detail-layout, .edit-layout, .publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.waiting-main {
  min-height: 560px;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
}
.progress-ring {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: conic-gradient(#3f7fff 0 65%, #202936 65% 100%);
  position: relative;
}
.progress-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #080d14; }
.progress-ring span { position: relative; z-index: 1; font-size: 34px; font-weight: 800; }
.step-timeline { display: grid; gap: 10px; }
.step-timeline > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}
.step-timeline b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #121a25;
  color: var(--text-muted);
}
.step-timeline .done b { background: #1c7f6a; color: #fff; }
.step-timeline .running { border-color: rgba(47,115,255,.32); }
.step-timeline .running b { background: #2f73ff; color: #fff; }
.task-board { display: grid; gap: 8px; }
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 88px;
  padding: 12px;
  border-radius: 10px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}
.task-row.running { border-color: rgba(47,115,255,.24); }
.task-row.success { border-color: rgba(34,197,94,.2); }
.drawer { justify-content: flex-end; }
.drawer-panel { height: 100%; max-height: none; width: 460px; border-radius: 0; }
.detail-video .video-preview.detail img { max-height: 620px; object-fit: contain; background: #050608; }
.spec-actions.vertical { display: grid; }
.script-block {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
  line-height: 26px;
}
.platform-dot {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}
.platform-dot.red { background: #ff2442; }
.platform-dot.black { background: #020204; border: 1px solid rgba(255,255,255,.2); }
.platform-dot.green { background: #22c55e; }
.platform-dot.orange { background: #ff7a1a; }
.template-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.template-strip .template-tile img { aspect-ratio: 9 / 16; height: auto; }
.edit-layout .q-preview, .publish-layout .q-preview { position: sticky; top: 18px; }
.platform-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.platform-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.065);
  background: #080d14;
  color: var(--text-secondary);
}
.platform-card.active { border-color: rgba(47,115,255,.52); box-shadow: inset 0 0 0 1px rgba(47,115,255,.16); }
.platform-card.disabled { opacity: .45; }
.span-full { grid-column: 1 / -1; }
/* PC deliverable: keep desktop composition even in narrow preview panes. */
@media (max-width: 1280px) {
  .core-page .main { min-width: 1180px; }
}

.media-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(156px, 204px));
  justify-content: start;
  gap: 9px;
}
.media-dashboard a {
  min-height: 154px;
  display: grid;
  grid-template-rows: 78px auto auto;
  align-content: start;
  gap: 5px;
  padding: 9px;
  border-radius: 8px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.05);
}
.media-dashboard img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  object-position: center top;
  border-radius: 7px;
  order: -1;
}
.media-dashboard .q-waveform {
  order: -1;
  height: 78px;
  margin: 0;
  border-radius: 8px;
  background: #060a10;
}
.media-dashboard strong { font-size: 13px; line-height: 19px; }
.media-dashboard span { color: var(--text-muted); font-size: 12px; line-height: 18px; }
.upload-zone {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 14px 0;
  padding: 24px;
  border-radius: 12px;
  background: #080d14;
  border: 1px dashed rgba(79,141,255,.32);
  color: var(--text-muted);
}
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  justify-content: start;
  gap: 10px;
}
.voice-tile {
  min-height: 158px;
  padding: 9px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px 10px;
  align-content: start;
  border-radius: 8px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.055);
}
.voice-tile > .avatar {
  width: 38px;
  height: 38px;
}
.voice-tile > .q-waveform,
.voice-tile > .q-audio-player,
.voice-tile > .row {
  grid-column: 1 / -1;
}
.voice-tile .q-waveform { height: 24px; margin-top: 0; }
.voice-tile .row { flex-wrap: nowrap; }
.voice-tile .btn { min-height: 28px; padding: 0 9px; font-size: 12px; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 360px));
  justify-content: start;
  gap: 14px;
}
.plan-card {
  min-height: 300px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.034), rgba(255,255,255,.012)), #0c1119;
  border: 1px solid rgba(255,255,255,.075);
}
.plan-card.hot {
  border-color: rgba(251,191,36,.34);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.08);
}
.plan-card h2 { margin: 8px 0 0; font-size: 24px; }
.plan-card > strong { font-size: 36px; line-height: 42px; }
.plan-card p { color: var(--text-muted); }
.qr-box {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  margin: 12px auto;
  border-radius: 14px;
  background: #fff;
  color: #0b111a;
  font-weight: 900;
  font-size: 32px;
}
.unread {
  background: rgba(47,115,255,.04);
  border-color: rgba(47,115,255,.16);
}
.platform-card { min-height: 82px; border-radius: 8px; }
.template-list {
  grid-template-columns: repeat(auto-fill, minmax(140px, 156px)) !important;
  justify-content: start;
  gap: 10px !important;
}
.template-tile .btn {
  width: max-content;
}
.avatar-list {
  grid-template-columns: repeat(auto-fill, minmax(140px, 156px)) !important;
  justify-content: start;
  gap: 10px !important;
}
.avatar-list .thumb-info {
  min-height: 78px;
}
.asset-list {
  grid-template-columns: repeat(auto-fill, minmax(140px, 156px)) !important;
  justify-content: start;
  gap: 10px !important;
}
.table th,
.table td {
  height: 46px;
}

.core-page .avatar-list,
.core-page .template-list,
.core-page .asset-list {
  grid-template-columns: repeat(auto-fill, minmax(140px, 156px)) !important;
  justify-content: start;
}
.core-page .avatar-list .thumb-card,
.core-page .template-list .template-tile,
.core-page .asset-list .thumb-card {
  width: 100%;
  border-radius: 8px;
  background: #080d14;
  border-color: rgba(255,255,255,.05);
  box-shadow: none;
}
.core-page .avatar-list .thumb-card img,
.core-page .template-list .template-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
}
.core-page .asset-list .thumb-card img {
  height: 94px;
  object-fit: cover;
}
.core-page .thumb-info,
.core-page .template-tile .template-meta {
  min-height: 78px;
  padding: 8px 9px;
  gap: 3px;
  background: #070b12;
}
.core-page .thumb-info strong,
.core-page .template-tile strong {
  font-size: 13px;
  line-height: 18px;
}
.core-page .thumb-info span,
.core-page .template-tile span {
  font-size: 11px;
  line-height: 17px;
  color: #7f8b9d;
}
.core-page .thumb-info .row,
.core-page .template-meta .row {
  gap: 5px;
}
.core-page .thumb-info .btn,
.core-page .template-meta .btn {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}
.core-page .template-tile.active,
.core-page .thumb-card.active {
  border-color: rgba(79,141,255,.52);
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.13);
}
.core-page .template-tile:hover,
.core-page .thumb-card:hover,
.voice-tile:hover,
.media-dashboard a:hover {
  transform: translateY(-1px);
  border-color: rgba(111,168,255,.22);
  background: #0a1018;
}
.core-page .table th {
  height: 36px;
}
.core-page .table td {
  height: 44px;
  font-size: 13px;
}

.template-market-layout,
.task-center-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}
.template-inspector,
.task-inspector {
  position: sticky;
  top: 18px;
}
.template-inspector .compact-preview img,
.task-inspector .compact-preview img {
  max-height: 360px;
  object-fit: cover;
  object-position: center top;
}
.template-spec-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.template-spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #080d14;
  border: 1px solid rgba(255,255,255,.045);
}
.template-spec-list span {
  color: var(--text-muted);
}
.template-spec-list strong {
  font-size: 12px;
}
.task-center-layout .task-row {
  min-height: 74px;
  padding: 10px 12px;
  border-radius: 9px;
}
.task-center-layout .task-row .progress {
  width: min(640px, 100%);
  margin-top: 8px;
}
.task-center-layout .task-row .btn {
  min-height: 30px;
  padding: 0 11px;
}
.step-timeline.compact {
  margin-top: 10px;
  gap: 6px;
}
.step-timeline.compact > div {
  min-height: 44px;
  padding: 7px 8px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
}
.step-timeline.compact b {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.step-timeline.compact strong,
.step-timeline.compact span {
  font-size: 12px;
}
.core-page .panel:has([data-state="tpl"]) {
  min-height: 0;
}
.core-page .panel:has([data-state="tpl"]) .template-list {
  min-height: 0;
}
.core-page .panel[data-state="works"] .split-layout {
  grid-template-columns: minmax(0, 1fr) 290px;
}
.core-page .panel[data-state="works"] .work-card {
  min-height: 78px;
  grid-template-columns: 50px minmax(0, 1fr) 168px;
  padding: 7px 9px;
}
.core-page .panel[data-state="works"] .work-cover {
  width: 50px;
  height: 58px;
}
.core-page .panel[data-state="works"] .quality-score {
  width: 32px;
  height: 32px;
}
.core-page .panel[data-state="works"] .work-card .btn {
  min-height: 27px;
  padding: 0 8px;
  font-size: 12px;
}
.core-page .panel[data-state="works"] aside.panel {
  padding: 10px;
}
.core-page .panel[data-state="works"] aside.panel .video-preview img {
  max-height: 360px;
}

/* Final works-list refinement: dense desktop management rows, not stretched cards. */
.core-page .panel[data-state="works"] {
  padding: 14px 16px;
}
.core-page .panel[data-state="works"] > .panel-header {
  padding-bottom: 10px;
  margin-bottom: 8px;
}
.core-page .panel[data-state="works"] .split-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}
.core-page .panel[data-state="works"] .sample-stack {
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(5, 9, 15, .38);
}
.core-page .panel[data-state="works"] .sample-stack .work-card {
  min-height: 88px;
  grid-template-columns: 56px minmax(0, 1fr) 218px;
  gap: 14px;
  padding: 12px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.045);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.core-page .panel[data-state="works"] .sample-stack .work-card:last-child {
  border-bottom: 0;
}
.core-page .panel[data-state="works"] .sample-stack .work-card::before {
  display: none;
}
.core-page .panel[data-state="works"] .sample-stack .work-card:hover {
  background: rgba(14, 22, 34, .82);
  transform: none;
}
.core-page .panel[data-state="works"] .work-cover {
  width: 56px;
  height: 64px;
  border-radius: 8px;
}
.core-page .panel[data-state="works"] .work-card strong {
  font-size: 13px;
  line-height: 18px;
}
.core-page .panel[data-state="works"] .work-card .muted {
  margin-top: 3px;
  font-size: 12px;
  line-height: 17px;
}
.core-page .panel[data-state="works"] .sample-stack .work-card > .row:last-child {
  display: grid;
  grid-template-columns: 74px minmax(48px, auto) minmax(48px, auto);
  justify-content: end;
  align-items: center;
  gap: 7px;
}
.core-page .panel[data-state="works"] .quality-score {
  width: 74px;
  height: 34px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(63, 127, 255, .11);
  border: 1px solid rgba(63, 127, 255, .22);
  color: #cfe0ff;
  font-size: 11px;
  box-shadow: none;
}
.core-page .panel[data-state="works"] .quality-score b {
  font-size: 14px;
  line-height: 14px;
  color: #f4f7ff;
}
.core-page .panel[data-state="works"] .quality-score small {
  font-size: 10px;
  line-height: 12px;
  color: var(--text-muted);
}
.core-page .panel[data-state="works"] .quality-score.muted-score {
  background: rgba(125, 138, 157, .08);
  border-color: rgba(125, 138, 157, .18);
}
.core-page .panel[data-state="works"] .work-card .btn {
  min-height: 29px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
  white-space: nowrap;
}
.core-page .panel[data-state="works"] aside.panel {
  padding: 10px;
  min-height: 0;
}
.core-page .panel[data-state="works"] aside.panel .video-preview img {
  max-height: 338px;
}

/* shadcn-inspired component baseline: one stable language for all generated product pages. */
.core-page {
  --surface-0: #05070b;
  --surface-1: #090d14;
  --surface-2: #0c111a;
  --surface-3: #101722;
  --line-1: rgba(255,255,255,.055);
  --line-2: rgba(255,255,255,.085);
  --ring: rgba(79,141,255,.18);
}
.core-page .main {
  background: var(--surface-0);
}
.core-page .topbar {
  border-bottom: 1px solid var(--line-1);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.core-page .title-block h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 760;
}
.core-page .subtitle {
  font-size: 13px;
  line-height: 20px;
  color: #8a95a6;
}
.core-page .panel,
.core-page .card,
.core-page .metric,
.core-page .modal,
.core-page .toast,
.core-page .alert {
  background: linear-gradient(180deg, rgba(13,18,27,.98), rgba(8,12,18,.98));
  border: 1px solid var(--line-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.026), 0 8px 24px rgba(0,0,0,.14);
}
.core-page .panel {
  border-radius: 10px;
  padding: 14px;
}
.core-page .panel-header {
  border-bottom-color: var(--line-1);
}
.core-page .panel-title {
  color: #f1f5fb;
  font-weight: 720;
}
.core-page .metric {
  height: 42px;
  min-width: 108px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #0b111a;
}
.core-page .metric small {
  color: #778294;
}
.core-page .metric strong {
  font-size: 14px;
}
.core-page .btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border-color: var(--line-1);
  background: #0d1420;
  color: #e7edf7;
  box-shadow: none;
  font-weight: 660;
}
.core-page .btn:hover {
  background: #121b2a;
  border-color: rgba(126,176,255,.22);
}
.core-page .btn.primary {
  background: linear-gradient(180deg, #4f86f7, #2f6de9);
  border-color: rgba(126,176,255,.35);
  box-shadow: 0 8px 18px rgba(32,86,196,.18);
}
.core-page .btn.secondary {
  background: rgba(79,141,255,.10);
  border-color: rgba(79,141,255,.18);
  color: #d9e7ff;
}
.core-page .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: #a8b3c4;
}
.core-page .btn.danger {
  background: rgba(255,92,115,.09);
  border-color: rgba(255,92,115,.18);
  color: #ffc2cb;
}
.core-page .input,
.core-page .select,
.core-page .textarea {
  min-height: 34px;
  border-radius: 8px;
  border-color: var(--line-1);
  background: #070b12;
  color: #e7edf7;
}
.core-page .input::placeholder,
.core-page .textarea::placeholder {
  color: #667285;
}
.core-page .input:hover,
.core-page .select:hover,
.core-page .textarea:hover {
  border-color: rgba(126,176,255,.18);
}
.core-page .input:focus,
.core-page .select:focus,
.core-page .textarea:focus {
  border-color: rgba(79,141,255,.58);
  box-shadow: 0 0 0 3px var(--ring);
}
.core-page .segmented,
.core-page .state-switcher:not(.compact) {
  padding: 3px;
  gap: 3px;
  border-radius: 9px;
  border-color: var(--line-1);
  background: #070b12;
}
.core-page .segmented .seg {
  height: 28px;
  border-radius: 7px;
  color: #8792a3;
}
.core-page .segmented .seg.active {
  background: rgba(79,141,255,.14);
  color: #dce9ff;
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.30);
}
.core-page .badge {
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #121a26;
  color: #9ba7b8;
  font-size: 11px;
  font-weight: 680;
}
.core-page .badge.primary { background: rgba(79,141,255,.13); color: #93bbff; }
.core-page .badge.success { background: rgba(33,201,149,.12); color: #77dfbd; }
.core-page .badge.warning { background: rgba(245,184,75,.12); color: #ffd27d; }
.core-page .badge.danger { background: rgba(255,92,115,.12); color: #ff9aaa; }
.core-page .table th,
.core-page .table td {
  border-bottom-color: rgba(255,255,255,.045);
}
.core-page .table th {
  height: 34px;
  color: #778294;
  font-size: 11px;
}
.core-page .table td {
  height: 42px;
  color: #a8b3c4;
}
.core-page .table tr:hover td {
  background: rgba(79,141,255,.035);
}
.core-page .template-tile,
.core-page .thumb-card,
.core-page .voice-tile,
.core-page .work-card,
.core-page .task-row,
.core-page .core-row,
.core-page .platform-card,
.core-page .plan-card,
.core-page .formula-card {
  border-color: var(--line-1);
  background: linear-gradient(180deg, rgba(13,18,27,.96), rgba(7,11,17,.98));
  box-shadow: none;
}
.core-page .template-tile:hover,
.core-page .thumb-card:hover,
.core-page .voice-tile:hover,
.core-page .work-card:hover,
.core-page .task-row:hover,
.core-page .core-row:hover,
.core-page .platform-card:hover {
  border-color: rgba(126,176,255,.20);
  background: #0d1420;
}
.core-page .template-tile.active,
.core-page .thumb-card.active {
  border-color: rgba(79,141,255,.48);
  box-shadow: inset 0 0 0 1px rgba(79,141,255,.12);
}
.core-page .modal-backdrop {
  background: rgba(2,6,12,.72);
  backdrop-filter: blur(8px);
}
.core-page .modal {
  border-radius: 12px;
  padding: 16px;
}
.core-page .toast {
  border-radius: 10px;
}

/* Page state switcher, shared by all static deliverable pages. */
.page-state-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-1, rgba(255,255,255,.055));
  border-radius: 10px;
  background: rgba(8, 12, 18, .72);
}
.page-state-switcher > span {
  flex: 0 0 auto;
  color: #7f8b9d;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}
.page-state-switcher .segmented {
  flex: 1;
  min-width: 0;
}
.page-state-switcher .segmented .seg {
  flex: 1;
  white-space: nowrap;
}
.page-state-panel {
  display: none;
  margin-bottom: 14px;
}
.page-state-panel .state-card {
  min-height: 360px;
}
body[data-page-state="loading"] .page-state-content,
body[data-page-state="empty"] .page-state-content,
body[data-page-state="error"] .page-state-content {
  display: none;
}
body[data-page-state="loading"] [data-state-view="loading"],
body[data-page-state="empty"] [data-state-view="empty"],
body[data-page-state="error"] [data-state-view="error"] {
  display: block;
}
body:not([data-page-state]),
body[data-page-state="default"] {
  --state-active: default;
}

/* Smart edit page */
.smart-edit-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}
.edit-template-market {
  position: sticky;
  top: 18px;
}
.edit-template-list {
  display: grid;
  gap: 9px;
}
.edit-template-list .template-tile {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 86px;
}
.edit-template-list .template-tile img {
  height: 100%;
  min-height: 86px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}
.edit-template-list .template-meta {
  padding: 9px;
}
.edit-player-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}
.edit-player-grid .video-preview img {
  aspect-ratio: 9 / 13;
  max-height: 470px;
}
.edit-playhead {
  position: absolute;
  left: 12px;
  top: 12px;
  height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  color: #dce7f7;
  font-size: 12px;
}
.edit-inspector {
  margin: 0;
}
.edit-timeline {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #070b12;
  border: 1px solid rgba(255,255,255,.055);
}
.timeline-ruler {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  color: #6f7b8e;
  font-size: 11px;
}
.timeline-track {
  position: relative;
  height: 34px;
  padding-left: 54px;
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.timeline-track b {
  position: absolute;
  left: 10px;
  top: 7px;
  color: #8995a8;
  font-size: 12px;
}
.clip {
  position: absolute;
  left: calc(54px + var(--x));
  width: calc(var(--w) - 8px);
  top: 6px;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(79,141,255,.22);
  color: #dce9ff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-b { background: rgba(33,201,149,.20); color: #a9efd8; }
.clip-c { background: rgba(245,184,75,.18); color: #ffe0a3; }
.clip.subtitle { background: rgba(168,85,247,.20); color: #dfc6ff; }
.clip.asset { background: rgba(79,195,215,.18); color: #b7f3fb; }
.timeline-cursor {
  position: absolute;
  top: 30px;
  bottom: 10px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,141,255,.18);
}
.ai-suggest-panel {
  position: sticky;
  top: 18px;
}
.ai-suggestion {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.055);
  background: #080d14;
  margin-bottom: 8px;
}
.ai-suggestion.active {
  border-color: rgba(79,141,255,.36);
  background: rgba(79,141,255,.08);
}
.ai-suggestion p {
  margin: 0;
  color: #8792a3;
  font-size: 12px;
  line-height: 18px;
}
.edit-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  margin-top: 14px;
}
.subtitle-editor {
  display: grid;
  gap: 8px;
}
.subtitle-mini-timeline {
  position: relative;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: rgba(7, 12, 20, .7);
  border: 1px solid rgba(47, 62, 82, .48);
  overflow: hidden;
}
.subtitle-mini-timeline span {
  position: absolute;
  left: var(--x);
  width: var(--w);
  top: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  padding-left: 9px;
  border-radius: 7px;
  background: rgba(63, 127, 255, .2);
  color: #cfe0ff;
  font-size: 12px;
  font-weight: 700;
}
.subtitle-editor > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.subtitle-editor span {
  color: #7f8b9d;
  font-size: 12px;
}
.subtitle-editor .active {
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  background: rgba(79,141,255,.07);
}
.wide-modal {
  width: min(880px, 100%);
}
.modal-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ai-template-entry {
  min-height: 224px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  background:
    radial-gradient(circle at 20% 10%, rgba(63,127,255,.24), transparent 30%),
    rgba(7, 12, 20, .72);
}
.ai-template-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(63,127,255,.18);
  border: 1px solid rgba(63,127,255,.35);
  color: #a9c9ff;
  font-weight: 900;
}
.render-progress-overview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.render-ring {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #07101a 58%, transparent 59%),
    conic-gradient(var(--primary) var(--progress), rgba(47,62,82,.7) 0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.22);
}
.render-ring strong {
  font-size: 24px;
}
.render-ring span {
  color: var(--text-muted);
  font-size: 12px;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

/* Publish page */
.publish-main {
  display: grid;
  gap: 14px;
}
.publish-platforms {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.publish-form {
  margin-top: 0;
}
.publish-form .span-full {
  grid-column: span 2;
}
.ai-title-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.publish-schedule {
  display: grid;
  grid-template-columns: 150px 180px 150px auto;
  gap: 10px;
  align-items: end;
}
.publish-preview {
  align-self: start;
}
.confirm-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.confirm-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #080d14;
}
.confirm-summary span {
  color: #8792a3;
}

/* Template market additions */
.template-tabs .seg {
  min-width: 82px;
}
.market-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 156px)) !important;
}
.fav-btn {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0,0,0,.48);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
}
.fav-btn.active {
  color: #ffd17a;
}

/* P0 precise additions */
.mode-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
  color: var(--text-muted);
}
.mode-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.mode-entry {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(47, 62, 82, .78);
  background: rgba(13, 20, 31, .78);
  color: var(--text-secondary);
  transition: border-color var(--duration-base), background var(--duration-base), box-shadow var(--duration-base);
}
.mode-entry strong {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mode-entry span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mode-entry.active {
  border-color: rgba(79, 141, 255, .9);
  background: linear-gradient(180deg, rgba(27, 48, 86, .84), rgba(16, 27, 45, .84));
  box-shadow: inset 0 0 0 1px rgba(79, 141, 255, .22), 0 10px 24px rgba(0, 0, 0, .18);
}
.script-mode-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .5);
  border: 1px solid rgba(47, 62, 82, .42);
  color: var(--text-muted);
  font-size: 12px;
}
.script-mode-summary strong {
  color: #bcd5ff;
  font-size: 13px;
}
.mode-drawer {
  display: none;
  margin: 10px 0 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79, 141, 255, .28);
  background: linear-gradient(180deg, rgba(22, 34, 53, .96), rgba(13, 20, 31, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 14px 30px rgba(0, 0, 0, .2);
}
.mode-drawer.open {
  display: block;
  animation: drawer-down var(--duration-slow) var(--ease-spring);
}
.mode-drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.mode-drawer-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}
.mode-drawer-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
}
.mode-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(7, 12, 20, .46);
}
.mode-drawer-footer span {
  color: var(--text-muted);
}
.chip-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-field > span {
  width: 44px;
  color: var(--text-secondary);
  font-weight: 650;
}
.script-editor-wrap {
  position: relative;
  margin-top: 2px;
}
.script-main-textarea {
  min-height: 142px;
  padding-bottom: 34px;
}
.script-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
  pointer-events: none;
}
.creator-type-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.mode-form-grid { margin: 10px 0; }
.mode-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(47, 62, 82, .58);
  background: rgba(7, 12, 20, .52);
}
.mode-panel[hidden] { display: none; }
.mode-panel .span-full { grid-column: 1 / -1; }
.textarea.small { min-height: 72px; }
.q-bgm-control {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(47, 62, 82, .55);
  background: rgba(6, 10, 17, .48);
}
.q-bgm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}
.q-tune-panel .q-bgm-control {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.q-tune-panel .q-bgm-control .field {
  margin: 0;
}
.q-mix-switches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.q-mix-switches .q-compact-row {
  min-width: 128px;
  padding: 0 10px;
  border: 1px solid rgba(47, 62, 82, .55);
  border-radius: var(--radius-full);
  background: rgba(7, 12, 20, .45);
}
.titlebar-control {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(47, 62, 82, .55);
}
.media-tabs .media-tab-panel { min-height: 520px; }
.media-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.media-toolbar .input { max-width: 420px; }
.media-works-list .core-row {
  min-height: 82px;
}
.media-avatar-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 220px));
}
.compact-voice-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}
.ip-analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.ip-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ip-summary-grid article {
  min-height: 124px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .58);
  border: 1px solid rgba(47, 62, 82, .55);
}
.ip-summary-grid span,
.template-spec-list span {
  color: var(--text-muted);
  font-size: 12px;
}
.ip-summary-grid strong {
  display: block;
  margin: 4px 0 6px;
  font-size: 16px;
}
.ip-summary-grid p { margin: 0; color: var(--text-secondary); }
.ip-analysis-detail {
  margin-bottom: 14px;
}
.analysis-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.analysis-detail-grid article {
  min-height: 126px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .56);
  border: 1px solid rgba(255,255,255,.052);
}
.analysis-detail-grid span {
  color: var(--text-muted);
  font-size: 12px;
}
.analysis-detail-grid strong {
  display: block;
  margin: 5px 0 7px;
  font-size: 15px;
}
.analysis-detail-grid p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
}
.analysis-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 12px;
  margin: 14px 0;
}
.analysis-split h4 {
  margin: 0 0 10px;
  font-size: 14px;
}
.analysis-loading {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(245, 184, 75, .08);
  border: 1px solid rgba(245, 184, 75, .22);
}
.analysis-loading p {
  margin: 4px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}
.topic-table {
  margin-top: 8px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgba(63, 127, 255, .1);
  color: #bfd7ff;
}
.render-modal { width: min(680px, 100%); }
.render-progress {
  margin: 14px 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 20, .58);
  border: 1px solid rgba(63, 127, 255, .2);
}
.render-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.render-step-list { display: grid; gap: 8px; margin-bottom: 14px; }
.render-step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(9, 14, 22, .72);
  border: 1px solid rgba(47, 62, 82, .5);
}
.render-step > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #121b29;
}
.render-step strong { display: block; }
.render-step p { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }
.render-step em { font-style: normal; color: var(--text-muted); font-size: 12px; text-align: right; }
.render-step.done > span { background: var(--success); border-color: rgba(112, 229, 189, .45); }
.render-step.done > span::before { content: "✓"; display: grid; place-items: center; height: 100%; font-size: 12px; color: #05261b; font-weight: 900; }
.render-step.running { border-color: rgba(63, 127, 255, .45); background: rgba(63, 127, 255, .1); }
.render-step.running > span { background: var(--primary); border-color: rgba(142, 186, 255, .55); box-shadow: 0 0 0 4px rgba(63, 127, 255, .12); }

@media (max-width: 1200px) {
  .q-bgm-grid,
  .mode-entry-grid,
  .creator-type-row,
  .mode-panel,
  .smart-edit-layout,
  .render-progress-overview,
  .ip-analysis-layout,
  .ip-summary-grid,
  .analysis-detail-grid,
  .analysis-split { grid-template-columns: 1fr; }
}

@keyframes drawer-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
