/* Data Hub Studio — 网页界面样式（重设计版）
   方向：浅色纸面工作区 + 深色监看画面。一种强调色（钴蓝）只用于“下一步/当前”，
   琥珀色只表示“未保存”，绿色只表示“已完成”。成片视频版式在 composition.js，与本文件无关。 */

@font-face{font-family:"DataHubNoto";src:url("./assets/NotoSansSC.ttf") format("truetype");font-style:normal;font-weight:100 900;font-display:swap}

:root{
  --bg:#f3f2ee;
  --surface:#ffffff;
  --surface-2:#f8f7f4;
  --surface-3:#efeee9;
  --line:#e3e1da;
  --line-strong:#cfccc2;
  --ink:#16171b;
  --ink-2:#464951;
  --ink-3:#777a83;
  --ink-4:#a3a5ac;
  --accent:#2448d8;
  --accent-ink:#1a37b0;
  --accent-soft:#e9edfd;
  --accent-line:#c3cdf7;
  --ok:#17804f;
  --ok-soft:#e3f3ea;
  --warn:#a5650f;
  --warn-soft:#fbf0dc;
  --warn-line:#efd6a8;
  --danger:#c13a26;
  --danger-soft:#fbe9e5;
  --stage:#121317;
  --stage-2:#1c1e24;
  --stage-line:#2b2e36;
  --stage-ink:#e9eaee;
  --stage-ink-2:#9a9da8;
  --sidebar:#17181c;
  --sidebar-2:#202227;
  --sidebar-line:#2c2e35;
  --sidebar-ink:#eceef2;
  --sidebar-ink-2:#9598a3;
  --radius:12px;
  --radius-sm:8px;
  --shadow:0 1px 2px rgba(22,23,27,.05),0 1px 0 rgba(22,23,27,.02);
  --shadow-pop:0 18px 50px rgba(22,23,27,.18),0 2px 8px rgba(22,23,27,.08);
  --font:"DataHubNoto","PingFang SC","Microsoft YaHei UI","Microsoft YaHei",system-ui,sans-serif;
  --mono:ui-monospace,"SF Mono","Cascadia Mono",Menlo,Consolas,monospace;
  --focus:0 0 0 3px rgba(36,72,216,.28);
}

*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
[hidden]{display:none!important}
h1,h2,h3,p{margin:0}
h1{font-size:26px;line-height:1.25;font-weight:700;letter-spacing:-.01em}
h2{font-size:16px;line-height:1.35;font-weight:650}
h3{font-size:14px;font-weight:650}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--accent)}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.timecode{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.kicker{display:block;font-size:11px;font-weight:650;letter-spacing:.08em;color:var(--ink-3);text-transform:uppercase;margin-bottom:4px}
:focus-visible{outline:none;box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
input:focus-visible,select:focus-visible,textarea:focus-visible{box-shadow:var(--focus)}

/* ——— 按钮 ——— */
.button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 15px;border-radius:var(--radius-sm);border:1px solid transparent;background:var(--surface);color:var(--ink);font-weight:600;font-size:13.5px;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,color .15s,box-shadow .15s}
.button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.button.primary:hover:not(:disabled){background:var(--accent-ink);border-color:var(--accent-ink)}
.button.secondary{background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
.button.secondary:hover:not(:disabled){border-color:var(--ink-3);background:var(--surface-2)}
.button.small{min-height:30px;padding:4px 11px;font-size:12.5px}
.button.large{min-height:46px;font-size:15px}
.button.block{width:100%}
.button:disabled{opacity:.42;cursor:not-allowed}
.button.ghost-dark{background:transparent;color:var(--sidebar-ink);border-color:var(--sidebar-line)}
.button.ghost-dark:hover:not(:disabled){background:var(--sidebar-2)}
.text-button{background:none;border:0;padding:4px 2px;color:var(--accent);font-weight:600;font-size:13px;cursor:pointer;border-radius:6px}
.text-button:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}
.text-button:disabled{color:var(--ink-4);cursor:not-allowed}
.text-button.on-dark{color:#aebfff}
.icon-button{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink-2);font-size:16px;line-height:1;cursor:pointer}
.icon-button:hover:not(:disabled){border-color:var(--ink-3);color:var(--ink)}
.icon-button:disabled{opacity:.35;cursor:not-allowed}
.icon-button.danger:hover:not(:disabled){color:var(--danger);border-color:var(--danger);background:var(--danger-soft)}

/* ——— 框架 ——— */
.app-shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;background:var(--sidebar);color:var(--sidebar-ink);padding:18px 14px 16px;overflow:hidden}
.brand{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none;padding:4px 6px 18px}
.brand-mark{width:30px;height:30px;border-radius:8px;background:#fff;display:grid;place-items:center;flex-shrink:0}
.brand-mark i{width:11px;height:11px;border-radius:50%;background:#e2402b;box-shadow:0 0 0 3px rgba(226,64,43,.18)}
.brand-text{display:flex;flex-direction:column;line-height:1.25}
.brand-text strong{font-size:14.5px;font-weight:700;letter-spacing:-.005em}
.brand-text small{font-size:11.5px;color:var(--sidebar-ink-2)}
.sidebar-actions{display:grid;gap:8px}
.sidebar-heading{display:flex;justify-content:space-between;align-items:center;margin:22px 8px 8px;font-size:11.5px;font-weight:600;color:var(--sidebar-ink-2);letter-spacing:.04em}
.sidebar-count{font-family:var(--mono);font-size:11px;background:var(--sidebar-2);border-radius:20px;padding:1px 8px}
.project-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:2px;margin:0 -4px;padding:0 4px}
.project-link{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:9px 10px;border-radius:var(--radius-sm);border:0;background:transparent;color:var(--sidebar-ink-2);font-size:13.5px;cursor:pointer}
.project-link span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.project-link:hover{background:var(--sidebar-2);color:var(--sidebar-ink)}
.project-link.active{background:#2a2d35;color:#fff}
.project-icon{flex-shrink:0;width:22px;height:22px;border-radius:6px;display:grid;place-items:center;font-size:8px;background:var(--sidebar-2);color:var(--sidebar-ink-2)}
.project-link.active .project-icon{background:var(--accent);color:#fff}
.sidebar-empty{font-size:12.5px;color:var(--sidebar-ink-2);padding:6px 10px;line-height:1.7}
.sidebar-bottom{border-top:1px solid var(--sidebar-line);padding-top:14px;margin-top:12px;display:grid;gap:10px}
.sidebar-privacy{font-size:11.5px;line-height:1.7;color:var(--sidebar-ink-2);display:flex;gap:8px}
.lock-glyph{display:inline-block;width:9px;height:8px;border-radius:2px;background:currentColor;position:relative;margin-top:7px;flex-shrink:0;opacity:.8}
.lock-glyph:before{content:"";position:absolute;left:1.5px;top:-5px;width:6px;height:6px;border:1.5px solid currentColor;border-bottom:0;border-radius:4px 4px 0 0;box-sizing:border-box}
.browser-note{font-size:11px;line-height:1.65;color:#7b7e89;margin:0}
.browser-note.unsupported{color:#fbe2b8;background:#3a2a12;border:1px solid #6b4a1a;border-radius:var(--radius-sm);padding:9px 10px;font-size:12px}
noscript .browser-note.unsupported{position:fixed;inset:auto 16px 16px;z-index:50}

.main-shell{min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 28px;border-bottom:1px solid var(--line);background:rgba(243,242,238,.92);backdrop-filter:blur(8px);position:sticky;top:0;z-index:20}
.breadcrumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-3);min-width:0}
.breadcrumb strong{color:var(--ink);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.breadcrumb-sep{color:var(--ink-4)}
.connection-status{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--ink-2);padding:4px 10px;border-radius:20px;background:var(--surface);border:1px solid var(--line);white-space:nowrap}
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--ok);flex-shrink:0}
.status-dot.neutral{background:var(--warn)}

/* ——— 开始页 ——— */
.welcome{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:40px;padding:44px 40px 48px;max-width:1360px;width:100%;align-items:start}
.welcome h1{font-size:32px;line-height:1.3;max-width:20em;margin-bottom:12px}
.welcome-lead{color:var(--ink-2);font-size:15px;max-width:40em;line-height:1.75}
.start-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:28px 0 30px}
.start-tile{display:flex;align-items:center;gap:14px;text-align:left;padding:18px;border-radius:var(--radius);border:1px solid var(--line-strong);background:var(--surface);cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
.start-tile:hover:not(:disabled){border-color:var(--ink-3);box-shadow:var(--shadow-pop);transform:translateY(-1px)}
.start-tile:disabled{opacity:.5;cursor:not-allowed}
.start-tile.primary-tile{background:var(--accent);border-color:var(--accent);color:#fff}
.tile-icon{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;font-size:20px;background:var(--surface-3);flex-shrink:0}
.primary-tile .tile-icon{background:rgba(255,255,255,.16)}
.tile-text{display:flex;flex-direction:column;flex:1;min-width:0}
.tile-text strong{font-size:15.5px}
.tile-text small{font-size:12.5px;opacity:.75}
.tile-arrow{font-size:18px;opacity:.7}
.flow-overview{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden}
.flow-overview li{display:flex;flex-direction:column;gap:10px;padding:16px 14px;border-left:1px solid var(--line)}
.flow-overview li:first-child{border-left:0}
.flow-overview b{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-family:var(--mono);background:var(--surface-3);color:var(--ink-2)}
.flow-overview strong{display:block;font-size:13.5px;margin-bottom:3px}
.flow-overview span{font-size:12px;color:var(--ink-3);line-height:1.6}
.welcome-side{display:grid;gap:14px;padding-top:6px}
.theme-sample{background:#0f1720;border-radius:14px;padding:16px 16px 14px;box-shadow:var(--shadow-pop)}
.sample-screen{display:grid;grid-template-columns:22% 1fr;aspect-ratio:16/9.4;border-radius:8px;overflow:hidden;background:#cdd6dd}
.sample-nav{background:#2f4a46;padding:10px 8px;display:flex;flex-direction:column;gap:7px}
.sample-nav b{height:6px;width:60%;background:#e4ece9;border-radius:3px;margin-bottom:6px}
.sample-nav span{height:3px;width:80%;background:#7f9894;border-radius:3px}
.sample-body{position:relative;padding:10px;display:flex;flex-direction:column;gap:8px;background:#c4ccd3}
.sample-title{height:6px;width:52%;background:#59636c;border-radius:3px}
.sample-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.sample-cards i{height:20px;background:#eef1f3;border-radius:3px}
.sample-table{display:grid;gap:3px}
.sample-table div{height:9px;background:#dfe4e8;border-radius:2px}
.sample-focus{position:absolute;left:28%;top:60%;width:34%;height:15%;border-radius:6px;border:2px solid #9be4ff;background:#eef7ff;box-shadow:0 0 0 999px rgba(15,23,32,.25)}
.sample-caption{color:#fff;text-align:center;font-weight:700;font-size:15px;margin:12px 0 10px}
.sample-footer{display:flex;align-items:center;gap:10px;font-size:9.5px;color:#9fb0bf;letter-spacing:.05em}
.sample-footer span:first-child{background:#24384a;border-radius:20px;padding:2px 8px;color:#d2e1ec}
.sample-footer i{flex:1;height:2px;background:linear-gradient(90deg,#4f8fb2 30%,#2b3a48 30%);border-radius:2px}
.sample-label{font-size:12.5px;color:var(--ink-3);line-height:1.7}
.sample-label strong{display:block;color:var(--ink);font-size:13px;margin-bottom:2px}

/* ——— 项目头部与流程 ——— */
.workspace{padding:22px 28px 40px;display:flex;flex-direction:column;gap:16px;min-width:0}
.project-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.project-heading{min-width:0}
.project-heading h1{overflow-wrap:anywhere}
.project-heading p{color:var(--ink-3);font-size:13.5px;margin-top:4px;max-width:70ch}
.heading-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;flex-shrink:0}
.save-state{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;color:var(--ok);padding:5px 11px;border-radius:20px;background:var(--ok-soft);white-space:nowrap}
.save-state:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.save-state.dirty{color:var(--warn);background:var(--warn-soft)}
.save-state:empty{display:none}

.flow-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,380px);gap:12px;align-items:stretch}
.tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:4px;gap:4px}
.tab{display:flex;align-items:center;gap:11px;text-align:left;padding:9px 12px;border-radius:var(--radius-sm);border:0;background:transparent;cursor:pointer;min-width:0;color:var(--ink-2);transition:background .15s}
.tab:hover{background:var(--surface-2)}
.tab.active{background:var(--ink);color:#fff}
.tab-num{width:26px;height:26px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;font-family:var(--mono);font-size:12px;font-weight:700;border:1.5px solid var(--line-strong);color:var(--ink-3)}
.tab.done .tab-num{background:var(--ok);border-color:var(--ok);color:transparent;position:relative}
.tab.done .tab-num:after{content:"";position:absolute;width:9px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.tab.active .tab-num{border-color:rgba(255,255,255,.4);color:#fff}
.tab.active.done .tab-num{border-color:var(--ok)}
.tab-text{display:flex;flex-direction:column;min-width:0;line-height:1.35}
.tab-text strong{font-size:14px;font-weight:650}
.tab-text small{font-size:12px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tab.active .tab-text small{color:#b9bcc6}
.next-step{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:10px 12px 10px 16px;border-radius:var(--radius);background:var(--accent-soft);border:1px solid var(--accent-line);min-width:0}
.next-step.busy{background:var(--warn-soft);border-color:var(--warn-line)}
.next-step.done{background:var(--ok-soft);border-color:#bfe1cd}
.next-copy{display:flex;flex-direction:column;min-width:0;line-height:1.4}
.next-kicker{font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--accent)}
.next-step.busy .next-kicker{color:var(--warn)}
.next-step.done .next-kicker{color:var(--ok)}
.next-copy strong{font-size:14px}
.next-copy small{font-size:12px;color:var(--ink-2)}
.next-step .button{flex-shrink:0}
.metrics-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.project-metrics{display:flex;align-items:center;gap:24px}
.metric{display:flex;align-items:baseline;gap:8px;font-size:13px}
.metric small{color:var(--ink-3);font-size:12px}
.metric strong{font-family:var(--mono);font-variant-numeric:tabular-nums;font-weight:600}
.metric-sep{color:var(--ink-4)}
#target-label{color:var(--ink-3);font-weight:500}
#runtime.over-target{color:var(--danger)}
.runtime-metric{align-items:center}
.runtime-bar{display:inline-block;width:120px;height:5px;border-radius:5px;background:var(--surface-3);overflow:hidden}
.runtime-bar i{display:block;height:100%;width:0;background:var(--ink);border-radius:5px;transition:width .25s}
.runtime-bar i.over{background:var(--danger)}
.theme-switch{display:flex;align-items:center;gap:4px;margin:0;padding:3px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface)}
.theme-switch legend{float:left;font-size:12px;color:var(--ink-3);padding:0 8px 0 6px}
.theme-option{position:relative;cursor:pointer}
.theme-option input{position:absolute;opacity:0;pointer-events:none}
.theme-option span{display:inline-flex;align-items:center;gap:7px;padding:4px 10px;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--ink-2)}
.theme-option input:checked+span{background:var(--ink);color:#fff}
.theme-option input:focus-visible+span{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.theme-option input:disabled+span{opacity:.5;cursor:not-allowed}
.theme-swatch{display:inline-block;width:22px;height:13px;border-radius:3px;flex-shrink:0}
.theme-swatch.datahub{background:linear-gradient(180deg,#0b0e14 0 68%,#38bdf8 68% 78%,#0b0e14 78%);border:1px solid #2a3344}
.theme-swatch.graphite{background:linear-gradient(180deg,#111216 0 66%,#ffb224 66% 76%,#111216 76%);border:1px solid #3a3d46}
.export-theme{font-size:13px;color:var(--ink-2);margin:-4px 0 12px;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline}
.export-theme span{font-size:12px;color:var(--ink-3)}

/* ——— 卡片与表单 ——— */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);min-width:0}
.section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.section-sub{font-size:12.5px;color:var(--ink-3);margin-top:3px;line-height:1.6}
.count-badge{font-size:12px;color:var(--ink-2);background:var(--surface-3);padding:3px 10px;border-radius:20px;white-space:nowrap;font-variant-numeric:tabular-nums}
.field{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:600;color:var(--ink-2);min-width:0}
.field-hint{font-weight:400;color:var(--ink-4);margin-left:4px}
input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{width:100%;padding:8px 11px;border-radius:var(--radius-sm);border:1px solid var(--line-strong);background:var(--surface);font-size:14px;font-weight:400;color:var(--ink);transition:border-color .15s,box-shadow .15s}
textarea{resize:vertical;line-height:1.65}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:var(--focus)}
input::placeholder,textarea::placeholder{color:var(--ink-4)}
input[readonly],textarea[readonly]{background:var(--surface-2)}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%);background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%;background-size:5px 5px;background-repeat:no-repeat;padding-right:28px!important}
input[type=checkbox],input[type=radio],input[type=range]{accent-color:var(--accent)}
.code-text{font-family:var(--mono);font-size:12.5px!important;line-height:1.6}
.helper{font-size:12px;color:var(--ink-3);line-height:1.7}
.inline-error{font-size:13px;color:var(--danger);background:var(--danger-soft);border:1px solid #f1c8bf;border-radius:var(--radius-sm);padding:10px 12px;white-space:pre-line;overflow-wrap:anywhere}
.empty-state{padding:22px 14px;text-align:center;font-size:13.5px;font-weight:600;color:var(--ink-2);border:1px dashed var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-2)}
.empty-state p{font-weight:400;color:var(--ink-3);font-size:12.5px;margin-top:3px}

/* ——— 素材与要求 ——— */
.source-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:16px;align-items:start}
.brief-column{display:grid;gap:16px}
.upload-drop{display:flex;flex-direction:column;align-items:center;gap:4px;padding:30px 20px;border:1.5px dashed var(--line-strong);border-radius:var(--radius);background:var(--surface-2);text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.upload-drop:hover,.upload-drop.dragover{border-color:var(--accent);background:var(--accent-soft)}
.upload-drop.disabled{opacity:.55;cursor:wait}
.upload-icon{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--ink);color:#fff;font-size:20px;margin-bottom:8px}
.upload-drop strong{font-size:14.5px}
.upload-drop span{font-size:12.5px;color:var(--ink-2)}
.upload-drop small{font-size:12px;color:var(--ink-3)}
.upload-status{display:grid;gap:6px;margin-top:12px;font-size:12.5px;color:var(--ink-2)}
progress{appearance:none;-webkit-appearance:none;width:100%;height:6px;border:0;border-radius:6px;background:var(--surface-3);overflow:hidden}
progress::-webkit-progress-bar{background:var(--surface-3);border-radius:6px}
progress::-webkit-progress-value{background:var(--accent);border-radius:6px;transition:width .3s}
progress::-moz-progress-bar{background:var(--accent);border-radius:6px}
.source-list{display:grid;gap:8px;margin-top:14px}
.source-item{display:grid;grid-template-columns:112px minmax(0,1fr) auto;gap:14px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface)}
.source-thumb{width:112px;aspect-ratio:16/9;object-fit:contain;border-radius:6px;background:var(--stage);display:block}
.source-details{display:flex;flex-direction:column;min-width:0;gap:2px}
.source-details strong{font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.source-details span{font-size:12px;color:var(--ink-3);font-family:var(--mono);font-variant-numeric:tabular-nums}
.source-action{font-size:12.5px;font-weight:600;text-decoration:none;padding:5px 10px;border-radius:6px;border:1px solid var(--line)}
.source-action:hover{border-color:var(--accent)}
#brief-form{display:grid;gap:14px}
.brief-import{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;color:var(--ink-3);margin-top:-6px}
.brief-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.target-field{max-width:160px}
.mini-steps{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:8px}
.mini-steps li{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--ink-2)}
.mini-steps b{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-family:var(--mono);background:var(--surface-3);color:var(--ink-2);flex-shrink:0}
.copilot-actions{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}

/* ——— 分镜工作台 ——— */
.notice{display:flex;gap:12px;align-items:flex-start;padding:11px 14px;border-radius:var(--radius);background:var(--warn-soft);border:1px solid var(--warn-line);margin-bottom:14px}
.notice-icon{width:20px;height:20px;border-radius:50%;background:var(--warn);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:800;flex-shrink:0;margin-top:1px}
.notice strong{display:block;font-size:13.5px;margin-bottom:1px}
.notice span{font-size:12.5px;color:var(--ink-2);white-space:pre-line}
.editor-layout{display:grid;grid-template-columns:250px minmax(0,1fr) 360px;gap:16px;align-items:start}
.scene-rail{padding:0;position:sticky;top:66px;max-height:calc(100vh - 82px);display:flex;flex-direction:column;overflow:hidden}
.rail-heading{display:flex;justify-content:space-between;align-items:center;padding:14px 14px 12px;border-bottom:1px solid var(--line)}
.scene-list{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:4px}
.scene-list .empty-state{margin:6px}
.scene-item{display:flex;gap:10px;align-items:flex-start;text-align:left;width:100%;padding:10px;border-radius:var(--radius-sm);border:1px solid transparent;background:transparent;cursor:pointer;transition:background .12s}
.scene-item:hover{background:var(--surface-2)}
.scene-item.active{background:var(--accent-soft);border-color:var(--accent-line)}
.scene-index{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--ink-3);padding-top:1px;width:20px;flex-shrink:0}
.scene-item.active .scene-index{color:var(--accent)}
.scene-item-content{min-width:0;flex:1}
.scene-item-content strong{display:block;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scene-item-content p{font-size:12px;color:var(--ink-3);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:2px}
.scene-meta{display:flex;justify-content:space-between;gap:8px;margin-top:6px;font-size:11.5px;color:var(--ink-3);font-family:var(--mono);font-variant-numeric:tabular-nums}
.locked-mark{color:var(--ink);font-family:var(--font);font-weight:600;background:var(--surface-3);border-radius:4px;padding:0 6px}
.rail-footer{display:flex;align-items:center;gap:8px;padding:10px 14px;border-top:1px solid var(--line);font-size:11.5px;color:var(--ink-3)}
.rail-footer .lock-glyph{margin-top:2px}
.editor-main{display:grid;gap:12px;min-width:0}
.viewer{background:var(--stage);border-radius:var(--radius);overflow:hidden;color:var(--stage-ink);box-shadow:var(--shadow)}
.viewer-top,.viewer-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px}
.viewer-bottom{border-top:1px solid var(--stage-line);font-size:12px;color:var(--stage-ink-2);min-height:42px}
.viewer-label{font-size:13px;font-weight:600;font-family:var(--mono);letter-spacing:-.01em}
.viewer-actions{display:flex;align-items:center;gap:10px}
.silent-chip{font-size:11px;color:var(--stage-ink-2);border:1px solid var(--stage-line);border-radius:20px;padding:2px 9px}
.viewer-button{background:#fff;color:var(--ink);border-color:#fff}
.viewer-button:hover:not(:disabled){background:#e4e6ec}
.preview-stage{aspect-ratio:16/9;background:#000;display:grid;place-items:center;overflow:hidden}
.preview-stage img:not([src]){visibility:hidden}
.preview-stage img,.preview-stage video{width:100%;height:100%;object-fit:contain;display:block;background:#000}
.preview-stage .empty-state{background:transparent;border:0;color:var(--stage-ink)}
.preview-stage .empty-state p{color:var(--stage-ink-2)}
.empty-preview{display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--stage-ink-2);text-align:center}
.empty-preview span{width:48px;height:48px;border-radius:50%;border:1.5px solid var(--stage-line);display:grid;place-items:center;font-size:16px;margin-bottom:6px}
.empty-preview strong{color:var(--stage-ink);font-size:15px}
.empty-preview p{font-size:12.5px}
.timeline-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px 12px}
.timeline-meta{display:flex;justify-content:space-between;font-size:11.5px;color:var(--ink-3);margin-bottom:8px}
.timeline{position:relative;display:flex;gap:2px;height:30px;border-radius:6px;background:repeating-linear-gradient(90deg,var(--surface-3) 0 1px,var(--surface-2) 1px 8px);overflow:hidden}
.timeline-seg{position:relative;height:100%;min-width:3px;background:#d7dae4;border-radius:3px;cursor:pointer;display:flex;align-items:center;padding:0 6px;font-size:10.5px;font-family:var(--mono);font-weight:700;color:var(--ink-2);overflow:hidden;white-space:nowrap;transition:background .12s}
.timeline-seg:hover{background:#c4c9d8}
.timeline-seg.locked{background-image:repeating-linear-gradient(135deg,transparent 0 5px,rgba(22,23,27,.07) 5px 7px)}
.timeline-seg.active{background:var(--accent);color:#fff}
.timeline-seg.over{background:#f1c1b8;color:var(--danger)}
.timeline-seg.over.active{background:var(--danger);color:#fff}
.timeline-limit{position:absolute;top:0;bottom:0;width:2px;background:var(--danger);z-index:2}
.timeline-empty{font-size:12px;color:var(--ink-3);padding:6px 10px;align-self:center}
.annotate-card .section-heading{flex-wrap:wrap}
#focus-summary{color:var(--ink-2);font-weight:600;margin-left:6px}
.focus-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mode-switch select{min-height:30px;padding:4px 10px;font-size:12.5px;width:auto}
.annotate-card .helper{margin:-6px 0 12px}
.frame-scrub{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;font-size:12.5px;color:var(--ink-2);font-weight:600;margin-bottom:10px}
.frame-scrub input{width:100%}
.frame-scrub output{font-size:12.5px;min-width:44px;text-align:right}
/* 画面按素材原始比例显示（含 21:9 超宽录屏），叠加层与图片同尺寸，框选坐标不变形。 */
.frame-editor{position:relative;border-radius:var(--radius-sm);overflow:hidden;background:var(--stage);min-height:160px;cursor:crosshair;user-select:none;touch-action:none}
.frame-editor img{width:100%;height:auto;display:block}
.frame-editor img:not([src]){visibility:hidden;aspect-ratio:16/9}
.frame-editor.loading:after{content:"正在读取画面…";position:absolute;inset:0;display:grid;place-items:center;background:rgba(18,19,23,.55);color:#fff;font-size:12.5px;cursor:wait}
.frame-overlays{position:absolute;inset:0;pointer-events:none}
.focus-box{position:absolute;border:2px solid #4fd1ff;border-radius:8px;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 0 0 9999px rgba(10,14,22,.18)}
.focus-box:before{content:attr(data-index);position:absolute;top:-1px;left:-1px;transform:translateY(-100%);background:#4fd1ff;color:#06202c;font-size:10.5px;font-weight:800;padding:0 6px;border-radius:4px 4px 0 0;font-family:var(--mono)}
.focus-box.redaction{border-color:#fff;border-radius:3px;background:repeating-linear-gradient(135deg,#2a2d35 0 6px,#3a3e48 6px 12px);box-shadow:0 0 0 1px rgba(0,0,0,.4)}
.focus-box.redaction:before{background:#fff;color:var(--ink)}
.focus-box.drawing{border-style:dashed}
.focus-list{display:grid;gap:6px;margin-top:10px}
.focus-list:empty{display:none}
.focus-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:7px 10px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--line);font-size:12.5px}
.focus-row>span{font-weight:600;min-width:72px}
.focus-row label{display:flex;align-items:center;gap:6px;color:var(--ink-3)}
.focus-row input{width:84px!important;padding:4px 8px!important;font-size:13px!important;font-family:var(--mono)}
.focus-row .text-button{margin-left:auto;color:var(--danger)}
.inspector{display:grid;gap:16px;position:sticky;top:66px;max-height:calc(100vh - 82px);overflow-y:auto;border-radius:var(--radius)}
.inspector-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:14px}
.scene-actions{display:flex;gap:6px}
.editor-fields{display:grid;gap:14px}
.field-group{border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;margin:0;display:grid;gap:12px;background:var(--surface-2)}
.field-group legend{font-size:11.5px;font-weight:700;color:var(--ink-3);letter-spacing:.06em;padding:0 4px}
.timing-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.timing-fields input,.timing-fields select{font-family:var(--mono);font-size:13.5px}
.scene-duration{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;color:var(--ink-3)}
.scene-duration strong{font-size:18px;color:var(--ink)}
.check-row{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:var(--radius-sm);border:1px solid var(--line);cursor:pointer}
.check-row:has(input:checked){border-color:var(--ink);background:var(--surface-2)}
.check-row input{margin-top:3px;width:16px;height:16px}
.check-row strong{display:block;font-size:13.5px}
.check-row small{font-size:12px;color:var(--ink-3)}
.revision-card h2{margin-bottom:2px}
.revision-card textarea{margin-top:12px}
.revision-bottom{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px;font-size:11.5px;color:var(--ink-3);flex-wrap:wrap}

/* ——— 版本与导出 ——— */
.delivery-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:16px;align-items:start}
.export-card{grid-row:span 2}
.versions-card{grid-column:1/-1}
.delivery-side{display:grid;gap:16px}
.quality-options{margin-bottom:14px}
.quality-option{display:flex;gap:14px;align-items:center;padding:14px 16px;border-radius:var(--radius-sm);border:1.5px solid var(--ink);background:var(--surface-2);cursor:pointer}
.quality-option input{width:18px;height:18px}
.quality-option strong{font-size:15px}
.quality-option strong span{font-family:var(--mono);font-size:12px;background:var(--ink);color:#fff;border-radius:4px;padding:1px 6px;margin-left:6px;vertical-align:2px}
.quality-option small{display:block;font-size:12.5px;color:var(--ink-3);font-family:var(--mono)}
.export-card>.helper{margin-top:10px}
.list-title{font-size:12px;font-weight:700;letter-spacing:.06em;color:var(--ink-3);margin:20px 0 8px}
.download-list{display:grid;gap:6px}
.download-list .helper{padding:2px 0}
.download-link{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink);text-decoration:none;font-size:13.5px;font-weight:500;transition:border-color .12s,background .12s}
.download-link:first-of-type{border-color:var(--ok);background:var(--ok-soft);font-weight:650}
.download-link span:last-child{font-weight:700;color:var(--ink-3)}
.download-link:hover{border-color:var(--accent);background:var(--accent-soft)}
.handoff-list{list-style:none;margin:14px 0;padding:0;display:grid;gap:8px;font-size:13px;color:var(--ink-2)}
.handoff-list li{display:flex;gap:10px;align-items:center}
.handoff-list .yes,.handoff-list .no{font-size:11px;font-weight:700;padding:1px 7px;border-radius:4px;flex-shrink:0}
.handoff-list .yes{background:var(--ok-soft);color:var(--ok)}
.handoff-list .no{background:var(--surface-3);color:var(--ink-3)}
.handoff-card>.helper{margin-top:10px}
.export-checklist h2{margin-bottom:10px}
.export-checklist ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.export-checklist li{font-size:13px;color:var(--ink-2);display:flex;gap:10px;align-items:center}
.export-checklist li:before{content:"";width:14px;height:14px;border-radius:4px;border:1.5px solid var(--line-strong);flex-shrink:0}
.version-list{display:grid;gap:0;position:relative}
.version-item{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 16px;padding:12px 14px 12px 34px;border-radius:var(--radius-sm)}
.version-item:before{content:"";position:absolute;left:13px;top:18px;width:9px;height:9px;border-radius:50%;background:var(--surface);border:2px solid var(--line-strong);z-index:1}
.version-item:after{content:"";position:absolute;left:18px;top:0;bottom:0;width:1px;background:var(--line)}
.version-item:first-child:after{top:22px}
.version-item:last-child:after{bottom:calc(100% - 22px)}
.version-item:only-child:after{display:none}
.version-item.active{background:var(--accent-soft)}
.version-item.active:before{background:var(--accent);border-color:var(--accent)}
.version-heading{display:flex;gap:12px;align-items:baseline;min-width:0;grid-column:1}
.version-heading strong{font-size:13.5px}
.version-heading time{font-size:12px;color:var(--ink-3);font-family:var(--mono)}
.version-item>p{grid-column:1;font-size:12.5px;color:var(--ink-2);white-space:pre-line;overflow-wrap:anywhere}
.version-item>.version-meta{grid-column:1;font-size:12px;color:var(--ink-3)}
.version-actions{grid-column:2;grid-row:1/span 3;display:flex;flex-direction:column;align-items:flex-end;gap:6px;justify-content:center}
.version-actions .version-meta{font-size:11.5px;color:var(--ink-4)}
.version-current{font-size:11.5px;font-weight:700;color:var(--accent)}
.version-actions .button{min-height:30px;padding:4px 12px;font-size:12.5px}

/* ——— 任务、提示、弹窗 ——— */
.job-panel{position:fixed;right:20px;bottom:20px;z-index:60;width:min(380px,calc(100vw - 32px));background:var(--ink);color:#fff;border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow-pop)}
.job-heading{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:650}
.job-heading #job-title{flex:1}
.job-heading .text-button{color:#ffb4a6}
.job-spinner{width:14px;height:14px;border-radius:50%;border:2px solid rgba(255,255,255,.25);border-top-color:#fff;animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.job-panel progress{margin:12px 0 8px;background:#33363f}
.job-panel progress::-webkit-progress-bar{background:#33363f}
.job-panel progress::-webkit-progress-value{background:#7d97ff}
.job-panel progress::-moz-progress-bar{background:#7d97ff}
.job-info{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#c3c6cf}
.job-info span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.job-warning{font-size:11px;color:#f2c47a;margin-top:10px;padding-top:9px;border-top:1px solid #33363f}
.toast-area{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:70;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;width:min(560px,calc(100vw - 32px))}
.toast{pointer-events:auto;background:var(--ink);color:#fff;padding:10px 16px;border-radius:var(--radius-sm);font-size:13px;box-shadow:var(--shadow-pop);animation:toast-in .2s ease;max-width:100%;overflow-wrap:anywhere;border-left:4px solid #7d97ff}
.toast.success{border-left-color:#4cc38a}
.toast.error{border-left-color:#ff7a62;background:#2a1714}
@keyframes toast-in{from{opacity:0;transform:translateY(6px)}}
dialog{border:0;padding:0;border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-pop);max-width:calc(100vw - 32px)}
dialog::backdrop{background:rgba(18,19,23,.48);backdrop-filter:blur(2px)}
.small-dialog{width:480px}
.copilot-dialog{width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 40px)}
.dialog-form{padding:24px;display:grid;gap:16px}
.dialog-form>p{font-size:13px;color:var(--ink-2);line-height:1.7}
.dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.dialog-heading h2{font-size:20px}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px}
.copilot-intro{font-size:13px;color:var(--ink-2);background:var(--surface-2);border-radius:var(--radius-sm);padding:10px 12px}
.exchange-step{display:grid;gap:12px;padding:16px;border:1px solid var(--line);border-radius:var(--radius)}
.exchange-heading{display:flex;gap:12px;align-items:flex-start}
.exchange-heading p{font-size:12.5px;color:var(--ink-3);margin-top:2px}
.step-number{width:26px;height:26px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-family:var(--mono);font-weight:700;font-size:12.5px;flex-shrink:0}
.step-number.ok{background:var(--ok)}
.source-sharing-note{display:grid;gap:2px;font-size:12.5px;padding:10px 12px;border-radius:var(--radius-sm);background:var(--warn-soft);border:1px solid var(--warn-line);color:var(--ink-2)}
.source-sharing-note strong{color:var(--ink)}
.exchange-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.import-review{border-color:#bfe1cd;background:#f6fbf8}
.import-changes,.import-notes{font-size:13px}
.import-changes strong,.import-notes strong{display:block;font-size:12.5px;margin-bottom:4px}
.import-changes ul,.import-notes ul{margin:0;padding-left:18px;display:grid;gap:3px;color:var(--ink-2)}
.import-notes{background:var(--warn-soft);border-radius:var(--radius-sm);padding:10px 12px}
.import-notes:empty{display:none}

/* ——— 响应式 ——— */
@media (max-width:1600px){
  /* 两栏时把字段放在画面正下方，框选画面放最后，减少来回滚动。 */
  .editor-layout{grid-template-columns:236px minmax(0,1fr);grid-template-areas:"rail viewer" "rail timeline" "rail inspector" "rail annotate";row-gap:12px}
  .scene-rail{grid-area:rail;align-self:start}
  .editor-main{display:contents}
  .viewer{grid-area:viewer}
  .timeline-wrap{grid-area:timeline}
  .annotate-card{grid-area:annotate}
  .inspector{grid-area:inspector;position:static;max-height:none;overflow:visible;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);align-items:start}
}
@media (max-width:1180px){
  .project-header{flex-direction:column;gap:12px}
  .heading-actions{justify-content:flex-start}
  .flow-bar{grid-template-columns:1fr}
  .welcome{grid-template-columns:1fr}
  .welcome-side{max-width:520px}
  .flow-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
  .flow-overview li{border-left:0;border-top:1px solid var(--line)}
  .flow-overview li:last-child:nth-child(odd){grid-column:1/-1}
  .source-layout,.delivery-layout{grid-template-columns:1fr}
  .export-card{grid-row:auto}
  .inspector{grid-template-columns:1fr}
}
@media (max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:static;height:auto;display:grid;grid-template-columns:1fr auto;gap:10px;padding:12px 16px}
  .brand{padding:0}
  .sidebar-actions{grid-auto-flow:column}
  .sidebar-heading,.project-list,.sidebar-bottom{grid-column:1/-1}
  .sidebar-heading{margin:4px 0 0}
  .project-list{flex-direction:row;overflow-x:auto;max-height:none}
  .project-link{width:auto;max-width:240px;flex-shrink:0}
  .sidebar-bottom{margin-top:0}
  .editor-layout{grid-template-columns:1fr;grid-template-areas:"viewer" "timeline" "rail" "inspector" "annotate"}
  .scene-rail{position:static;max-height:420px}
  .workspace,.welcome{padding-left:16px;padding-right:16px}
  .topbar{padding:10px 16px}
}
@media (max-width:720px){
  .project-header{flex-direction:column}
  .heading-actions{justify-content:flex-start}
  .tabs{grid-template-columns:1fr}
  .start-tiles,.flow-overview{grid-template-columns:1fr}
  .timing-fields{grid-template-columns:1fr 1fr}
  .welcome h1{font-size:25px}
  .source-item{grid-template-columns:84px minmax(0,1fr)}
  .source-thumb{width:84px}
  .source-action{grid-column:1/-1;justify-self:start}
  .project-metrics{flex-wrap:wrap;gap:12px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
