:root {
  color-scheme: light;
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --ink: #17221d;
  --muted: #66736c;
  --faint: #8b9690;
  --line: #d9e1dd;
  --line-strong: #b8c6bf;
  --green: #137653;
  --green-dark: #0e5b41;
  --green-soft: #e6f4ed;
  --blue: #2569a8;
  --blue-soft: #edf4fb;
  --amber: #8b6000;
  --amber-soft: #fff4d7;
  --red: #aa3d37;
  --red-soft: #fcedeb;
  --shadow: 0 14px 36px rgba(25, 48, 37, 0.1);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); letter-spacing: 0; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.8; }
.icon-sm { width: 15px; height: 15px; }
.hidden { display: none !important; }

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; z-index: 30; top: 0; display:flex; height:100vh; flex-direction:column; border-right:1px solid #26312c; padding:24px 16px 16px; background:#18211d; color:#ecf2ef; }
.brand { display:flex; align-items:center; gap:10px; min-height:42px; padding:0 10px; color:#fff; text-decoration:none; }
.brand-mark { position:relative; width:29px; height:29px; flex:0 0 auto; border:1px solid #92a59c; border-radius:6px; }
.brand-mark::before { position:absolute; inset:6px; border:2px solid #50b98c; border-radius:50%; content:""; }
.brand-mark::after { position:absolute; top:13px; left:3px; width:21px; border-top:1px solid #d5e2dc; content:""; }
.brand strong { font-size:15px; }
.brand small { display:block; margin-top:1px; color:#91a198; font-size:9px; font-weight:650; text-transform:uppercase; }
.main-nav { display:grid; gap:4px; margin-top:32px; }
.nav-link { display:flex; min-height:43px; align-items:center; gap:11px; border:0; border-radius:6px; padding:0 11px; background:transparent; color:#acbbb4; font-size:13px; font-weight:650; text-align:left; text-decoration:none; }
.nav-link:hover { background:#222d28; color:#f2f6f4; }
.nav-link.active { background:#293a32; color:#fff; box-shadow:inset 3px 0 #51b98d; }
.nav-link .nav-count { min-width:22px; margin-left:auto; border-radius:10px; padding:2px 6px; background:#35473f; color:#c5d2cc; font-size:10px; text-align:center; }
.sidebar-foot { margin-top:auto; border-top:1px solid #2b3732; padding:16px 8px 0; }
.account { display:flex; align-items:center; gap:9px; }
.avatar { display:grid; width:32px; height:32px; flex:0 0 auto; place-items:center; border-radius:50%; background:#30483d; color:#d9eee4; font-size:10px; font-weight:800; }
.account-copy { min-width:0; }
.account-copy strong { display:block; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.account-copy small { display:block; margin-top:2px; color:#899a91; font-size:10px; }
.prototype-link { display:flex; align-items:center; gap:7px; margin-top:14px; color:#83938b; font-size:10px; text-decoration:none; }
.prototype-link:hover { color:#d6e2dc; }

.workspace { min-width:0; }
.topbar { position:sticky; z-index:25; top:0; display:flex; height:64px; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); padding:0 30px; background:rgba(255,255,255,.96); backdrop-filter:blur(12px); }
.breadcrumb { display:flex; min-width:0; align-items:center; gap:8px; color:var(--muted); font-size:12px; }
.breadcrumb strong { overflow:hidden; color:var(--ink); text-overflow:ellipsis; white-space:nowrap; }
.top-actions { display:flex; align-items:center; gap:8px; }
.mobile-menu { display:none; }
.viewport { width:min(100% - 56px, 1240px); margin:0 auto; padding:38px 0 72px; }

.page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:28px; margin-bottom:26px; }
.page-title { min-width:0; }
.page-title h1 { margin:0; font-size:28px; line-height:1.25; }
.page-title p { max-width:700px; margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.65; }
.header-actions { display:flex; flex:0 0 auto; align-items:center; gap:8px; }
.btn { display:inline-flex; min-height:38px; align-items:center; justify-content:center; gap:7px; border:1px solid var(--line-strong); border-radius:6px; padding:7px 13px; background:var(--surface); color:var(--ink); font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; }
.btn:hover { border-color:#8fa098; background:#fafcfb; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible, .video-choice:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.btn-primary { border-color:var(--green); background:var(--green); color:#fff; }
.btn-primary:hover { border-color:var(--green-dark); background:var(--green-dark); }
.btn-danger { border-color:#d4aaa6; color:var(--red); }
.btn-danger:hover { border-color:var(--red); background:var(--red-soft); }
.btn:disabled { cursor:not-allowed; border-color:#d8dfdc; background:#eef1f0; color:#9aa49f; }
.icon-btn { display:grid; width:36px; height:36px; flex:0 0 auto; place-items:center; border:1px solid var(--line); border-radius:6px; background:#fff; color:#56635c; }
.icon-btn.mobile-menu { display:none; }
.icon-btn:hover { border-color:#98a79f; color:var(--ink); }
.icon-btn.danger:hover { border-color:#d7aaa6; background:var(--red-soft); color:var(--red); }

.stats-strip { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); border:1px solid var(--line); border-radius:8px; margin-bottom:20px; overflow:hidden; background:var(--surface); }
.stat { min-width:0; border-right:1px solid var(--line); padding:16px 18px; }
.stat:last-child { border-right:0; }
.stat span { display:block; overflow:hidden; color:var(--muted); font-size:10px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.stat strong { display:block; margin-top:7px; font-size:22px; }
.stat.attention strong { color:var(--red); }
.stat.available strong { color:var(--green); }

.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.toolbar-group { display:flex; min-width:0; align-items:center; gap:8px; }
.field-shell { display:flex; width:280px; min-height:38px; align-items:center; gap:8px; border:1px solid var(--line-strong); border-radius:6px; padding:0 10px; background:#fff; color:var(--muted); }
.field-shell:focus-within { border-color:var(--green); box-shadow:0 0 0 2px rgba(19,118,83,.1); }
.field-shell input { width:100%; min-width:0; border:0; outline:0; background:transparent; font-size:12px; }
.select-control, .text-control { width:100%; min-height:38px; border:1px solid var(--line-strong); border-radius:6px; padding:8px 10px; outline:0; background:#fff; font-size:12px; }
.select-control { width:auto; min-width:136px; }
.select-control:focus, .text-control:focus { border-color:var(--green); box-shadow:0 0 0 2px rgba(19,118,83,.1); }
.text-control::placeholder, .field-shell input::placeholder { color:#a0aaa5; }
textarea.text-control { min-height:88px; resize:vertical; }

.list-panel { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--surface); }
.list-head, .group-row { display:grid; grid-template-columns:minmax(260px,1.7fr) minmax(126px,.75fr) minmax(112px,.68fr) minmax(130px,.8fr) 104px 38px; gap:18px; align-items:center; }
.list-head { min-height:42px; border-bottom:1px solid var(--line); padding:0 18px; background:#f0f3f1; color:#6e7b74; font-size:9px; font-weight:800; text-transform:uppercase; }
.group-row { min-height:100px; border-bottom:1px solid var(--line); padding:14px 18px; }
.group-row:last-child { border-bottom:0; }
.group-row:hover { background:#fbfcfb; }
.group-main { display:grid; min-width:0; grid-template-columns:94px minmax(0,1fr); gap:13px; align-items:center; }
.thumb { position:relative; width:94px; aspect-ratio:16/10; overflow:hidden; border-radius:5px; background:#dce3df; }
.thumb img { width:100%; height:100%; object-fit:cover; }
.thumb::after { position:absolute; inset:0; background:linear-gradient(transparent 55%,rgba(0,0,0,.42)); content:""; }
.thumb-time { position:absolute; z-index:1; right:5px; bottom:4px; color:#fff; font-size:9px; font-weight:750; }
.group-copy { min-width:0; }
.group-copy a { display:block; overflow:hidden; color:var(--ink); font-size:13px; font-weight:750; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
.group-copy a:hover { color:var(--green); }
.group-copy span { display:block; overflow:hidden; margin-top:5px; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.data-cell { min-width:0; }
.data-cell strong { display:block; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.data-cell span, .data-cell small { display:block; margin-top:5px; color:var(--muted); font-size:10px; }
.status-stack { display:flex; flex-wrap:wrap; gap:5px; }
.status { display:inline-flex; min-height:23px; align-items:center; gap:5px; border-radius:999px; padding:3px 8px; background:#edf1ef; color:#5b6861; font-size:9px; font-weight:800; white-space:nowrap; }
.status::before { width:6px; height:6px; flex:0 0 auto; border-radius:50%; background:currentColor; content:""; }
.status.complete, .status.unbound { background:var(--green-soft); color:var(--green); }
.status.processing { background:var(--blue-soft); color:var(--blue); }
.status.pending { background:var(--amber-soft); color:var(--amber); }
.status.failed { background:var(--red-soft); color:var(--red); }
.status.bound { background:#e8edf1; color:#526579; }
.meter { height:4px; overflow:hidden; border-radius:2px; margin-top:7px; background:#e4e9e6; }
.meter span { display:block; height:100%; margin:0; border-radius:inherit; background:var(--green); }
.meter.failed span { background:var(--red); }

.empty { display:grid; min-height:280px; place-items:center; padding:40px; text-align:center; }
.empty-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:50%; margin:0 auto 12px; background:#edf2ef; color:#6f7d75; }
.empty h3 { margin:0; font-size:15px; }
.empty p { margin:7px 0 16px; color:var(--muted); font-size:12px; }

.form-layout { display:grid; grid-template-columns:minmax(0,760px) 260px; gap:24px; align-items:start; }
.form-panel { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#fff; }
.form-section { border-bottom:1px solid var(--line); padding:24px; }
.form-section h2 { margin:0; font-size:16px; }
.form-section > p { margin:6px 0 0; color:var(--muted); font-size:11px; line-height:1.6; }
.form-field { margin-top:21px; }
.form-field > label { display:block; margin-bottom:7px; font-size:11px; font-weight:750; }
.required { margin-left:3px; color:var(--red); }
.field-hint { margin:6px 0 0; color:var(--muted); font-size:10px; }
.field-error { margin:6px 0 0; color:var(--red); font-size:10px; }
.form-actions { display:flex; justify-content:flex-end; gap:8px; padding:17px 24px; background:#fafbfa; }
.flow-aside { border:1px solid var(--line); border-radius:8px; padding:19px; background:#fff; }
.flow-aside h2 { margin:0 0 15px; font-size:13px; }
.aside-step { display:grid; grid-template-columns:26px 1fr; gap:10px; padding:11px 0; border-top:1px solid var(--line); }
.aside-step b { display:grid; width:24px; height:24px; place-items:center; border-radius:50%; background:var(--green-soft); color:var(--green); font-size:9px; }
.aside-step strong { display:block; font-size:11px; }
.aside-step span { display:block; margin-top:3px; color:var(--muted); font-size:9px; line-height:1.5; }
.upload-zone { display:grid; min-height:210px; place-items:center; border:1px dashed #9aaba2; border-radius:7px; margin-top:17px; padding:24px; background:#f9fbfa; text-align:center; }
.upload-zone:hover { border-color:var(--green); background:#f3f9f6; }
.upload-zone input { position:absolute; width:1px; height:1px; opacity:0; }
.upload-icon { display:grid; width:44px; height:44px; place-items:center; border-radius:50%; margin:0 auto 12px; background:var(--green-soft); color:var(--green); }
.upload-zone strong { display:block; font-size:13px; }
.upload-zone p { margin:5px 0 13px; color:var(--muted); font-size:10px; }
.selected-file { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:7px; margin-top:17px; padding:14px; background:#fafcfb; }
.file-symbol { display:grid; width:40px; height:40px; flex:0 0 auto; place-items:center; border-radius:6px; background:var(--green-soft); color:var(--green); }
.selected-file-copy { min-width:0; flex:1; }
.selected-file-copy strong, .selected-file-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.selected-file-copy strong { font-size:11px; }
.selected-file-copy span { margin-top:4px; color:var(--muted); font-size:9px; }

.detail-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; border-bottom:1px solid var(--line); padding-bottom:23px; }
.detail-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.detail-title-row h1 { margin:0; font-size:26px; }
.detail-meta { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:9px; color:var(--muted); font-size:10px; }
.detail-actions { display:flex; gap:8px; }
.workflow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-bottom:1px solid var(--line); margin-bottom:0; }
.workflow-step { position:relative; display:flex; min-width:0; min-height:78px; align-items:center; gap:10px; border:0; padding:0 16px; background:transparent; color:var(--muted); text-align:left; }
.workflow-step + .workflow-step::before { position:absolute; top:50%; left:-12px; width:24px; border-top:1px solid var(--line-strong); content:""; }
.step-dot { position:relative; z-index:1; display:grid; width:27px; height:27px; flex:0 0 auto; place-items:center; border:1px solid var(--line-strong); border-radius:50%; background:var(--canvas); font-size:9px; font-weight:800; }
.workflow-step strong { display:block; overflow:hidden; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.workflow-step span:last-child small { display:block; overflow:hidden; margin-top:4px; color:var(--faint); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.workflow-step.done .step-dot { border-color:var(--green); background:var(--green-soft); color:var(--green); }
.workflow-step.done strong { color:var(--green-dark); }
.workflow-step.active .step-dot { border-color:var(--amber); background:var(--amber-soft); color:var(--amber); }
.workflow-step.active strong { color:var(--amber); }
.detail-section { border-bottom:1px solid var(--line); padding:30px 0; scroll-margin-top:72px; }
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; }
.section-title { display:flex; gap:11px; }
.section-number { display:grid; width:27px; height:27px; flex:0 0 auto; place-items:center; border-radius:50%; background:#eaf0ed; color:#516159; font-size:9px; font-weight:800; }
.section-title h2 { margin:2px 0 0; font-size:16px; }
.section-title p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.55; }
.section-actions { display:flex; flex:0 0 auto; gap:7px; }
.source-layout { display:grid; grid-template-columns:minmax(280px,1.25fr) minmax(220px,.75fr); gap:20px; }
.media-frame { position:relative; aspect-ratio:16/9; overflow:hidden; border-radius:7px; background:#d9e2dd; }
.media-frame img { width:100%; height:100%; object-fit:cover; }
.media-overlay { position:absolute; inset:0; display:grid; place-items:center; background:rgba(18,29,24,.12); }
.play-btn { display:grid; width:44px; height:44px; place-items:center; border:0; border-radius:50%; background:rgba(255,255,255,.9); color:var(--green); box-shadow:0 4px 14px rgba(0,0,0,.15); }
.media-time { position:absolute; right:8px; bottom:7px; border-radius:3px; padding:3px 5px; background:rgba(0,0,0,.64); color:#fff; font-size:8px; }
.meta-list { border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#fff; }
.meta-row { display:flex; min-height:43px; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); padding:10px 13px; }
.meta-row:last-child { border:0; }
.meta-row span { color:var(--muted); font-size:9px; }
.meta-row strong { overflow:hidden; max-width:65%; font-size:10px; text-align:right; text-overflow:ellipsis; white-space:nowrap; }
.notice { display:flex; align-items:flex-start; gap:9px; border:1px solid #b9d8ca; border-radius:7px; margin-bottom:16px; padding:11px 13px; background:#f0f8f4; color:#286147; font-size:10px; line-height:1.55; }
.notice.warning { border-color:#e6cc8c; background:var(--amber-soft); color:#755400; }
.notice.danger { border-color:#e1b1ad; background:var(--red-soft); color:#8c3732; }
.notice .icon { margin-top:1px; }
.clip-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
.clip { position:relative; min-width:0; border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#fff; }
.clip-image { position:relative; aspect-ratio:16/10; overflow:hidden; background:#d9e1dd; }
.clip-image img { width:100%; height:100%; object-fit:cover; }
.clip-image .play-btn { position:absolute; top:50%; left:50%; width:32px; height:32px; transform:translate(-50%,-50%); }
.clip-image .play-btn .icon { width:14px; height:14px; }
.clip-body { padding:9px; }
.clip-copy { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
.clip-copy strong { font-size:9px; }
.clip-copy span { color:var(--muted); font-size:8px; }
.clip-actions { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:8px; }
.clip-actions .btn { min-height:29px; padding:5px 8px; font-size:9px; }
.clip.selected { border-color:var(--green); box-shadow:0 0 0 1px var(--green); }
.clip.selected::after { position:absolute; top:7px; right:7px; display:grid; width:20px; height:20px; place-items:center; border-radius:50%; background:var(--green); color:#fff; font-size:9px; content:"✓"; }
.clip.failed { border-color:#dfa9a4; }
.current-frame { display:grid; grid-template-columns:170px minmax(0,1fr); gap:18px; border:1px solid var(--line); border-radius:7px; margin-bottom:17px; padding:13px; background:#fff; }
.current-frame img { width:170px; aspect-ratio:16/10; border-radius:5px; object-fit:cover; }
.current-frame h3 { margin:3px 0 6px; font-size:13px; }
.current-frame p { margin:0; color:var(--muted); font-size:10px; line-height:1.55; }
.frame-meta { display:flex; gap:12px; margin-top:12px; color:var(--muted); font-size:9px; }
.progress-panel { display:grid; grid-template-columns:1fr auto; gap:18px; align-items:center; border:1px solid var(--line); border-radius:7px; margin-bottom:16px; padding:16px; background:#fff; }
.progress-panel h3 { margin:0; font-size:12px; }
.progress-panel p { margin:5px 0 0; color:var(--muted); font-size:9px; }
.progress-bar { height:7px; overflow:hidden; border-radius:5px; margin-top:11px; background:#e5eae7; }
.progress-bar span { display:block; height:100%; border-radius:inherit; background:var(--green); transition:width .3s ease; }
.progress-stats { display:flex; gap:17px; }
.progress-stats div { text-align:right; }
.progress-stats strong { display:block; font-size:16px; }
.progress-stats span { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.binding-panel { display:flex; align-items:center; justify-content:space-between; gap:18px; border:1px solid var(--line); border-radius:7px; padding:17px; background:#fff; }
.binding-main { display:flex; min-width:0; align-items:center; gap:12px; }
.binding-icon { display:grid; width:38px; height:38px; flex:0 0 auto; place-items:center; border-radius:50%; background:var(--green-soft); color:var(--green); }
.binding-main strong { display:block; font-size:12px; }
.binding-main span { display:block; overflow:hidden; margin-top:4px; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.binding-actions { display:flex; flex:0 0 auto; gap:7px; }

.role-list-head, .role-row { display:grid; grid-template-columns:minmax(240px,1.5fr) minmax(180px,1fr) 96px 110px 38px; gap:18px; align-items:center; }
.role-list-head { min-height:42px; border-bottom:1px solid var(--line); padding:0 18px; background:#f0f3f1; color:#6e7b74; font-size:9px; font-weight:800; text-transform:uppercase; }
.role-row { min-height:84px; border-bottom:1px solid var(--line); padding:13px 18px; }
.role-row:last-child { border:0; }
.role-main { display:flex; min-width:0; align-items:center; gap:11px; }
.role-photo { width:52px; height:52px; flex:0 0 auto; overflow:hidden; border-radius:6px; background:#dbe3df; }
.role-photo img { width:100%; height:100%; object-fit:cover; }
.role-copy { min-width:0; }
.role-copy a { display:block; overflow:hidden; font-size:12px; font-weight:750; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
.role-copy span { display:block; overflow:hidden; margin-top:4px; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.picker { margin-top:16px; border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.picker-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--line); padding:10px; background:#f8faf9; }
.picker-toolbar .field-shell { width:240px; background:#fff; }
.picker-toolbar span { color:var(--muted); font-size:9px; }
.video-choice { display:grid; width:100%; grid-template-columns:74px minmax(0,1fr) auto; gap:11px; align-items:center; border:0; border-bottom:1px solid var(--line); padding:10px; background:#fff; text-align:left; }
.video-choice:last-child { border:0; }
.video-choice:hover { background:#fafcfb; }
.video-choice.selected { background:#eff8f4; box-shadow:inset 3px 0 var(--green); }
.video-choice img { width:74px; aspect-ratio:16/10; border-radius:4px; object-fit:cover; }
.video-choice-copy { min-width:0; }
.video-choice-copy strong, .video-choice-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.video-choice-copy strong { font-size:10px; }
.video-choice-copy span { margin-top:4px; color:var(--muted); font-size:8px; }
.choice-check { display:grid; width:22px; height:22px; place-items:center; border:1px solid var(--line-strong); border-radius:50%; color:transparent; }
.video-choice.selected .choice-check { border-color:var(--green); background:var(--green); color:#fff; }
.selection-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid #b7d7c8; border-radius:7px; margin-top:13px; padding:12px; background:#f0f8f4; }
.selection-summary strong { display:block; font-size:10px; }
.selection-summary span { display:block; margin-top:4px; color:var(--muted); font-size:8px; }
.role-detail-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; }
.detail-panel { border:1px solid var(--line); border-radius:8px; padding:20px; background:#fff; }
.detail-panel-header { display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); padding-bottom:14px; }
.detail-panel-header h2 { margin:0; font-size:14px; }
.role-identity { display:flex; align-items:center; gap:13px; padding:17px 0; }
.role-identity .role-photo { width:72px; height:72px; }
.role-identity h3 { margin:0; font-size:16px; }
.role-identity p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.55; }
.group-summary-image { position:relative; aspect-ratio:16/8; overflow:hidden; border-radius:6px; margin:16px 0; }
.group-summary-image img { width:100%; height:100%; object-fit:cover; }

.modal-backdrop { position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:20px; background:rgba(17,27,22,.56); }
.modal { width:min(100%,520px); max-height:min(86vh,760px); overflow:auto; border-radius:8px; background:#fff; box-shadow:var(--shadow); }
.modal.wide { width:min(100%,680px); }
.modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); padding:19px 20px; }
.modal-header h2 { margin:0; font-size:16px; }
.modal-header p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.55; }
.modal-body { padding:20px; }
.modal-footer { display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--line); padding:14px 20px; background:#fafbfa; }
.confirm-preview { display:grid; grid-template-columns:180px minmax(0,1fr); gap:16px; align-items:start; }
.confirm-preview img { width:180px; aspect-ratio:16/10; border-radius:6px; object-fit:cover; }
.confirm-preview h3 { margin:0; font-size:13px; }
.confirm-preview p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.65; }
.switch-compare { display:grid; grid-template-columns:1fr 24px 1fr; gap:10px; align-items:center; }
.switch-item { min-width:0; border:1px solid var(--line); border-radius:7px; padding:12px; }
.switch-item span { display:block; color:var(--muted); font-size:8px; font-weight:750; text-transform:uppercase; }
.switch-item strong { display:block; overflow:hidden; margin-top:6px; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.switch-item small { display:block; overflow:hidden; margin-top:4px; color:var(--muted); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.switch-arrow { color:var(--green); }
.toast-region { position:fixed; z-index:150; right:22px; bottom:22px; display:grid; width:min(360px,calc(100% - 32px)); gap:8px; }
.toast { display:flex; align-items:flex-start; gap:10px; border:1px solid #a8cdbb; border-radius:7px; padding:12px 14px; background:#f1f9f5; color:#245e45; box-shadow:0 8px 24px rgba(22,43,33,.14); font-size:10px; line-height:1.5; animation:toast-in .18s ease-out; }
.toast.error { border-color:#deb0ac; background:var(--red-soft); color:#8c3832; }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } }

@media (max-width: 1100px) {
  .list-head, .group-row { grid-template-columns:minmax(240px,1.5fr) minmax(112px,.7fr) minmax(120px,.8fr) 94px 38px; }
  .list-head > :nth-child(3), .group-row > :nth-child(3) { display:none; }
  .clip-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .form-layout { grid-template-columns:minmax(0,1fr) 230px; }
}

@media (max-width: 860px) {
  .shell { display:block; }
  .sidebar { position:fixed; left:0; width:224px; transform:translateX(-100%); transition:transform .2s ease; }
  .shell.menu-open .sidebar { transform:translateX(0); box-shadow:12px 0 32px rgba(0,0,0,.22); }
  .icon-btn.mobile-menu { display:grid; }
  .topbar { padding:0 20px; }
  .viewport { width:min(100% - 36px,760px); padding-top:28px; }
  .stats-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .stat { border-bottom:1px solid var(--line); }
  .stat:nth-child(3) { border-right:0; }
  .stat:nth-child(n+4) { border-bottom:0; }
  .form-layout, .role-detail-layout { grid-template-columns:1fr; }
  .flow-aside { order:-1; }
  .role-list-head, .role-row { grid-template-columns:minmax(220px,1.4fr) minmax(150px,1fr) 96px 38px; }
  .role-list-head > :nth-child(4), .role-row > :nth-child(4) { display:none; }
}

@media (max-width: 650px) {
  .topbar { height:58px; padding:0 14px; }
  .breadcrumb span { display:none; }
  .top-actions .btn { display:none; }
  .viewport { width:min(100% - 28px,600px); padding:23px 0 50px; }
  .page-header, .detail-hero, .section-heading { display:block; }
  .header-actions, .detail-actions, .section-actions { margin-top:14px; }
  .header-actions .btn, .detail-actions .btn { flex:1; }
  .page-title h1, .detail-title-row h1 { font-size:23px; }
  .stats-strip { grid-template-columns:1fr 1fr; }
  .stat, .stat:nth-child(3), .stat:nth-child(n+4) { border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
  .stat:nth-child(2n) { border-right:0; }
  .stat:last-child { grid-column:1/-1; border-right:0; border-bottom:0; }
  .toolbar, .toolbar-group { display:grid; width:100%; }
  .toolbar-group { grid-template-columns:1fr 1fr; }
  .field-shell { width:100%; grid-column:1/-1; }
  .select-control { width:100%; min-width:0; }
  .list-head { display:none; }
  .group-row { grid-template-columns:1fr 36px; gap:11px; min-height:0; padding:14px; }
  .group-row > :not(.group-main):not(.row-open) { display:none; }
  .group-main { grid-template-columns:106px minmax(0,1fr); }
  .group-copy .mobile-status { display:flex; margin-top:7px; }
  .workflow { grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:7px; margin:18px 0 0; overflow:hidden; }
  .workflow-step { min-height:62px; border-bottom:1px solid var(--line); }
  .workflow-step:nth-child(odd) { border-right:1px solid var(--line); }
  .workflow-step:nth-child(n+3) { border-bottom:0; }
  .workflow-step + .workflow-step::before { display:none; }
  .source-layout { grid-template-columns:1fr; }
  .clip-grid { grid-template-columns:1fr 1fr; }
  .current-frame { grid-template-columns:110px 1fr; }
  .current-frame img { width:110px; }
  .progress-panel { grid-template-columns:1fr; }
  .progress-stats div { text-align:left; }
  .binding-panel { display:block; }
  .binding-actions { margin-top:14px; }
  .role-list-head { display:none; }
  .role-row { grid-template-columns:1fr 36px; min-height:0; padding:13px; }
  .role-row > :not(.role-main):not(.row-open) { display:none; }
  .confirm-preview, .switch-compare { grid-template-columns:1fr; }
  .confirm-preview img { width:100%; }
  .switch-arrow { transform:rotate(90deg); justify-self:center; }
  .modal { max-height:92vh; }
}

@media (max-width: 420px) {
  .group-main { grid-template-columns:88px minmax(0,1fr); }
  .thumb { width:88px; }
  .clip-grid { grid-template-columns:1fr; }
  .current-frame { grid-template-columns:1fr; }
  .current-frame img { width:100%; }
  .picker-toolbar { display:block; }
  .picker-toolbar .field-shell { width:100%; }
  .picker-toolbar span { display:block; margin-top:7px; }
  .video-choice { grid-template-columns:64px minmax(0,1fr) auto; }
  .video-choice img { width:64px; }
}
