:root {
  --ink:#111111; --ink-2:#4a4a47; --ink-3:#8a8a86;
  --cream:#f3f1ec; --paper:#faf9f6; --bg:#f0eee8; --side:#faf9f6; --card:#fffcf8;
  --line:#e4e2dc; --line-2:#d0cfc8;
  --brand:#C4472A; --brand-hover:#A83B23; --brand-pressed:#8E311D; --brand-soft:#F7E6E0; --brand-tint:#FBF4F0; --brand-line:#E7C5B6; --brand-ink:#8E311D;
  --sidebar:248px; --top:56px; --radius:12px; --radius-sm:8px;
  --green:#0f7a4a; --green-bg:#e7f6ee; --amber:#8a5a00; --amber-bg:#fff4d6; --red:#9d2c2c;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "PingFang SC","Hiragino Sans GB","Noto Sans SC","Microsoft YaHei",ui-sans-serif,system-ui,sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; color: var(--ink); }
button.primary, a.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover { background: var(--brand-hover); }
button.ghost, a.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 14px; text-decoration: none; display: inline-flex; align-items: center; }
button:disabled { cursor: not-allowed; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: var(--bg); }
aside { background: var(--side); color: var(--ink); border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 0 10px 16px; }
.brand { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 8px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; letter-spacing: .08em; }
.logo-mark { flex: none; }
nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; overflow: auto; flex: 1; }
nav .group { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; background: transparent; color: var(--ink); border: 0; border-radius: var(--radius-sm); padding: 8px 8px; font-weight: 600; }
nav .group:hover, nav .nav-child:hover { background: rgba(17,17,17,.04); }
nav .group small { margin-left: 6px; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.group-label { display: flex; align-items: center; gap: 8px; }
.nav-ico { color: var(--mod); flex: none; }
.chevron { flex: none; }
.nav-group:not(.open) .chevron { transform: rotate(-90deg); }
.nav-group:not(.open) .nav-children { display: none; }
.nav-group.is-current > .group { color: var(--mod); background: var(--mod-bg); }
nav .nav-children { display: flex; flex-direction: column; }
nav .nav-child { position: relative; display: block; width: 100%; text-align: left; background: transparent; color: var(--ink-2); border: 0; border-radius: var(--radius-sm); padding: 7px 10px 7px 38px; font-size: 13px; text-decoration: none; cursor: pointer; }
nav .nav-child[aria-current="page"] { background: var(--mod-bg); color: var(--ink); }
nav .nav-child[aria-current="page"]::before { content: ""; position: absolute; left: 18px; top: 7px; bottom: 7px; width: 2px; background: var(--mod); }
nav .nav-child:disabled { color: var(--ink-3); cursor: not-allowed; }
nav .nav-child:disabled:hover { background: transparent; }
.aside-note { margin: 12px 8px 0; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); }
.top-title { display: flex; flex-direction: column; line-height: 1.2; }
.top-title strong { font-size: 16px; font-weight: 600; }
.top-title span, .user-meta small { color: var(--ink-3); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.credits { background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-ink); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 4px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; }
.user-meta b { font-weight: 600; font-size: 13px; }
#logout { background: transparent; border-color: var(--line); }
#view { padding: 22px 28px 48px; }
#login { margin: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
h2 { margin: 0 0 8px; font-size: 18px; }
.muted, .eyebrow { color: var(--ink-3); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.metric span, .metric small { display: block; color: var(--ink-3); font-size: 13px; }
.metric strong { font-size: 28px; }
.toolbar, .import-actions { display: flex; gap: 10px; align-items: center; margin: 8px 0 12px; flex-wrap: wrap; }
input[type="search"], input[type="text"], input[type="password"], input[type="number"], select, textarea { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; color: var(--ink); }
textarea { width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
td small, .recent small, .episodes small { display: block; color: var(--ink-3); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; background: var(--cream); font-size: 12px; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.error { color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.split, .workspace, .cost, .show-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.workspace { grid-template-columns: 1fr 300px; align-items: start; }
.preview { background: #111; color: #f3f1ec; border-radius: var(--radius); padding: 16px; }
.screen { aspect-ratio: 9/16; max-height: 520px; background: #1a1a1a; border: 2px solid var(--brand); border-radius: 18px; display: flex; align-items: flex-end; padding: 16px; }
.todo, .recent, .episodes { list-style: none; padding: 0; margin: 0; }
.todo li, .recent li, .episodes li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.recent a, .show-card, .back, .text-link { color: inherit; }
.done { color: var(--ink-3); text-decoration: line-through; }
.bars div { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; margin: 8px 0; }
.bars i { display: block; height: 8px; background: var(--brand); border-radius: 99px; min-width: 4px; }
.note { background: var(--brand-tint); border-left: 3px solid var(--brand); padding: 8px 12px; }
.canvas-board, .show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.canvas-card, .show-card { display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.show-card { padding: 0 0 14px; overflow: hidden; }
.show-card h3, .show-card p { margin: 0 14px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); height: 228px; background: #eceae4; margin-bottom: 12px; }
.thumbs span + span { box-shadow: inset 1px 0 #fff; }
.section-head, .show-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.import-hero { margin: -22px -28px 8px; padding: 52px 24px 56px; text-align: center; background: radial-gradient(ellipse at 50% -8%, rgba(196,71,42,.34) 0%, transparent 50%), radial-gradient(ellipse at 82% 120%, rgba(61,95,115,.22) 0%, transparent 46%), linear-gradient(180deg,#1a1a1a 0%, #111111 100%); }
.hero-kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: .2em; color: rgba(243,241,236,.62); }
.hero-title { margin: 0 0 28px; font-size: 30px; font-weight: 600; letter-spacing: .06em; color: #f3f1ec; }
.import-card { max-width: 580px; margin: 0 auto; background: #fffcf8; border-radius: 18px; padding: 32px 32px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.import-card h3 { margin: 12px 0 4px; font-size: 20px; }
.import-card p { margin: 0 0 16px; color: var(--ink-2); }
.import-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.drop-zone { width: 100%; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--paper); padding: 28px 16px; display: flex; flex-direction: column; gap: 6px; }
.drop-zone.drag { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone span { color: var(--ink-3); font-size: 13px; }
.text-link { background: none; border: 0; color: var(--brand-ink); padding: 0; }
.import-actions { justify-content: center; }
.modal { border: 0; border-radius: 18px; padding: 24px; background: #fffcf8; max-width: 520px; width: calc(100% - 32px); }
.modal::backdrop { background: rgba(17,17,17,.45); }
.show-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin: 8px 0 0; }
.show-tabs a { padding: 8px 0; color: var(--ink-2); text-decoration: none; }
.show-tabs a[aria-current="page"] { color: var(--brand-ink); box-shadow: inset 0 -2px var(--brand); }
.status-rail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; }
.status-rail p { margin: 0; color: var(--ink-3); font-size: 12px; }
.status-rail ul { padding-left: 18px; }
.back { color: var(--ink-2); text-decoration: none; }
.login-screen { position: fixed; inset: 0; z-index: 40; min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 32px 16px; background: var(--bg); }
body.is-logged-out { overflow: hidden; }
.login-card { width: min(420px, 100%); background: #fffcf8; border-radius: 18px; padding: 36px 32px; text-align: center; box-shadow: 0 18px 50px rgba(17,17,17,.08); }
.login-card h2 { letter-spacing: .08em; }
.login-sub { color: var(--ink-2); margin-top: 0; }
.local-login { text-align: left; color: var(--ink-3); }
.user-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fffcf8; border: 1px solid var(--line); border-radius: 8px; min-width: 120px; z-index: 6; padding: 6px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #111; color: #f3f1ec; border-radius: 999px; padding: 8px 14px; z-index: 20; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 8px 0; }
.filters label, .page-sub { color: var(--ink-2); }
.page-sub { margin-top: 0; }
.proto-tabs, .show-tabs { display: flex; gap: 16px; }
.proto-tabs a[aria-current="page"] { color: var(--brand-ink); box-shadow: inset 0 -2px var(--brand); text-decoration: none; }
.title-cell { display: flex; align-items: center; gap: 8px; }
.cover { width: 36px; height: 48px; border-radius: 4px; display: inline-block; flex: none; }
.empty { padding: 28px 8px; color: var(--ink-2); }
.task-view { white-space: pre-wrap; background: var(--paper); padding: 12px; border-radius: 8px; }
.episode-list { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.studio { display: grid; grid-template-columns: 180px 1fr 280px; gap: 12px; }
.timeline, .dept { color: var(--ink-2); }
.shortcut-row { display: flex; flex-wrap: wrap; gap: 12px; }
.shortcut { flex: 1; min-width: 220px; text-decoration: none; color: inherit; }
.canvas-workspace { position: relative; min-height: 520px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 12px; }
.canvas-node { position: absolute; background: #fffcf8; border: 1px solid var(--brand-line); }
#signPad { border: 1px solid var(--line); border-radius: 8px; background: #fff; touch-action: none; }
.login-screen { position: fixed; inset: 0; z-index: 40; min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 32px 16px; background: var(--bg); }
.login-screen[hidden] { display: none !important; }
.login-card { width: min(420px, 100%); background: #fffcf8; border-radius: 18px; padding: 36px 32px; text-align: center; box-shadow: 0 18px 50px rgba(17,17,17,.08); }
.login-sub { color: var(--ink-2); }
a.primary.login-feishu { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin: 12px auto; padding: 0 32px; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 0; line-height: 1; text-decoration: none; white-space: nowrap; box-shadow: 0 8px 18px rgba(196, 71, 42, .18); }
a.primary.login-feishu:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
a.primary.login-feishu:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.user-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: 44px; background: #fffcf8; border: 1px solid var(--line); border-radius: 8px; z-index: 8; padding: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111; color: #f3f1ec; padding: 8px 14px; border-radius: 999px; z-index: 30; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.proto-tabs { display: flex; gap: 16px; margin: 8px 0 12px; }
.proto-tabs a { color: var(--ink-2); text-decoration: none; }
.proto-tabs a[aria-current="page"] { color: var(--brand-ink); box-shadow: inset 0 -2px var(--brand); }
.title-cell { display: flex; gap: 8px; align-items: center; }
.cover { width: 36px; height: 48px; border-radius: 4px; display: inline-block; }
.task-view { white-space: pre-wrap; background: var(--paper); padding: 12px; }
.episode-list { display: flex; flex-wrap: wrap; gap: 6px; }
.studio { display: grid; grid-template-columns: 180px 1fr 280px; gap: 12px; }
.canvas-workspace { position: relative; min-height: 480px; background: var(--paper); border: 1px dashed var(--line-2); }
.canvas-node { position: absolute; }
#signPad { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.scrape-form input, .scrape-form select { height: 44px; padding: 11px 14px; font-size: 15px; border-radius: 10px; background: #fff; border: 1px solid var(--line-2); }
.scrape-form input:focus, .scrape-form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.scrape-form > button.primary { margin-top: 20px; }
.scrape-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.scrape-platform { width: 180px; flex: none; }
.scrape-platform select { width: 100%; }
.scrape-limit { width: 480px; max-width: 100%; flex: none; }
.scrape-limit input { width: 100%; }
.scrape-title { display: flex; flex-direction: column; gap: 4px; max-width: 480px; }
.film-pick { display: flex; width: 100%; max-width: 480px; min-height: 52px; align-items: center; justify-content: center; border: 1px dashed var(--brand-line); border-radius: 10px; background: var(--brand-tint); color: var(--ink); }
.library-filters { align-items: end; gap: 12px; }
.library-filters select, .library-filters input { height: 44px; min-height: 44px; padding: 0 14px; font-size: 15px; line-height: 1.2; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; box-sizing: border-box; }
.library-filters select { min-width: 168px; }
.library-filters input { width: 280px; max-width: 100%; }
.library-filters select:focus, .library-filters input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.show-hero { text-align: center; padding: 8px 0 4px; margin-bottom: 28px; }
.show-hero-title { margin: 0 0 18px; font-size: 26px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.import-stage { max-width: 880px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 14px 16px; box-shadow: 0 16px 40px rgba(17,17,17,.06); }
.import-stage .drop-zone { width: 100%; height: auto; border: 0; border-radius: 0; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; color: var(--ink); background: transparent; text-align: left; }
.import-stage .import-face { display: flex; align-items: center; min-height: 176px; padding: 28px 32px; border-radius: 16px; background: radial-gradient(ellipse 80% 140% at 88% 0%, rgba(196,71,42,.34), transparent 58%), radial-gradient(ellipse 55% 120% at 8% 100%, rgba(176,122,34,.2), transparent 62%), linear-gradient(118deg, #fbf6f1 0%, #f6e3d8 52%, #f3d5c8 100%); }
.import-stage .import-copy { display: flex; flex-direction: column; gap: 6px; max-width: 420px; color: var(--ink); }
.import-stage .import-title { font-size: 22px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.import-stage .import-sub { color: var(--ink-2); font-size: 14px; }
.import-stage .import-drop { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 16px 12px 2px; text-align: center; color: var(--ink); }
.import-stage .import-drop strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.import-stage .import-drop span { color: var(--ink-2); font-size: 13px; }
.import-stage.drag .import-face, .import-stage .drop-zone.drag .import-face { outline: 2px dashed var(--brand); outline-offset: -8px; background: linear-gradient(118deg, #f8e7df 0%, #f3d3c6 100%); }
.import-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px 2px; border: 0; background: transparent; }
.import-foot .import-actions { margin: 0; justify-content: center; }
.paste-modal { width: min(680px, calc(100% - 32px)); max-width: 680px; padding: 22px 24px 18px; }
.paste-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.paste-head h3 { margin: 0; font-size: 18px; }
#pasteClose { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 2px 6px; color: var(--ink-2); }
.paste-modal label { margin-top: 14px; color: var(--ink); font-size: 14px; }
.paste-name { position: relative; display: block; }
.paste-name input { width: 100%; height: 44px; padding: 0 64px 0 14px; border-radius: 10px; }
#pasteCount { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }
.paste-modal textarea { min-height: 240px; border-radius: 12px; padding: 12px 14px; }
.paste-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.paste-actions button { min-width: 88px; height: 40px; border-radius: 12px; }
.show-section .section-head h2 { margin: 0; }
.show-section .section-head .import-actions { margin: 0; justify-content: flex-end; }
.show-section .show-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-top: 14px; }
.show-section .poster-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; }
.show-section .poster-card:hover { box-shadow: 0 10px 24px rgba(17,17,17,.06); }
.show-section .poster-cover { position: relative; display: flex; align-items: flex-end; width: 100%; aspect-ratio: 16/9; padding: 12px; }
.show-section .poster-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 46%, rgba(17,17,17,.28) 100%); }
.show-section .poster-title { position: relative; z-index: 1; color: #fffcf8; font-size: 15px; font-weight: 600; letter-spacing: .02em; text-shadow: 0 1px 8px rgba(17,17,17,.35); }
.show-section .poster-card h3, .show-section .poster-card p { margin: 0 12px; }
.show-section .poster-card h3 { font-size: 14px; font-weight: 600; }
.show-section .poster-card p { color: var(--ink-3); font-size: 12px; }
@media (max-width: 1100px) {
  .shot-toolbar { flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .show-hero-title { font-size: 20px; letter-spacing: .03em; }
  .import-stage .import-face { min-height: 148px; padding: 22px 18px; }
  .show-section .show-grid { grid-template-columns: 1fr; }
  .scrape-row { flex-direction: column; align-items: stretch; }
  .scrape-platform, .scrape-limit, .scrape-title, .film-pick, .library-filters input, .library-filters select { width: 100%; max-width: none; }
}
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.desk-bar h2 { margin: 0; font-size: 20px; }
.desk-bar .show-tabs { flex: 1; margin: 0; border: 0; }
.desk-actions, .ep-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cast-list, .asset-grid, .view-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cast-card, .asset-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 0 12px; }
.cast-card { padding: 12px 14px; }
.cast-card h3, .asset-card strong, .asset-card span { display: block; margin: 8px 12px 0; }
.asset-card span, .cast-card p { color: var(--ink-2); font-size: 13px; }
.swatch, .ep-thumb { display: flex; align-items: flex-end; padding: 10px; color: #fffcf8; font-weight: 600; background: var(--brand); position: relative; overflow: hidden; }
.swatch { height: 132px; border-radius: 12px 12px 0 0; }
.swatch::after, .ep-thumb::after { content: ""; position: absolute; inset: 16px; border: 2px solid rgba(255,252,248,.72); border-radius: 8px; }
.ep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ep-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; cursor: pointer; }
.ep-card .ep-actions, .ep-card .ep-pull, .ep-card .ep-detail { cursor: auto; }
.ep-card .ep-actions button, .ep-card .ep-actions a, .ep-card .ep-pull { cursor: pointer; }
.ep-card:hover, .ep-card.is-hot, .ep-card.is-pinned { transform: translateY(-4px); border-color: var(--brand-line); box-shadow: 0 14px 32px rgba(196,71,42,.16); z-index: 3; }
.ep-card-top { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: stretch; }
.ep-index { font-size: 18px; line-height: 1; padding-top: 4px; }
.ep-cover { display: block; min-height: 92px; border-radius: 10px; position: relative; }
.ep-time { position: absolute; right: 8px; bottom: 8px; background: rgba(255,252,248,.9); color: var(--ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.ep-card h3 { margin: 10px 0 4px; font-size: 15px; }
.ep-counts { margin: 0 0 8px; color: var(--ink-3); font-size: 12px; }
.ep-meter { height: 6px; border-radius: 99px; background: var(--brand-soft); margin-bottom: 10px; }
.ep-meter i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.ep-card .ep-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-studio { align-items: stretch; }
body:has(.ep-studio) { height: 100vh; overflow: hidden; }
body:has(.ep-studio) .shell,
body:has(.ep-studio) .main-col { height: 100vh; min-height: 0; overflow: hidden; }
#view:has(.ep-studio) { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; padding-bottom: 12px; box-sizing: border-box; overflow-x: auto; overflow-y: hidden; }
.ep-studio { min-width: 560px; }
#view:has(.ep-studio) .ep-studio { flex: 1; min-height: 0; }
#view:has(.ep-studio) .shot-rail { flex: none; margin-top: 8px; }
.ep-studio > .panel { margin: 0; height: 100%; min-height: 0; }
.ep-main { display: flex; flex-direction: column; overflow: visible; align-items: stretch; min-height: 0; }
.ep-studio > .ep-side, .ep-studio > .ep-preview { min-height: 0; overflow: auto; }
.ep-preview { display: flex; flex-direction: column; align-items: center; }
.ep-studio .ep-preview .ep-screen,
.ep-studio .ep-preview video.shot-video { flex: 0 0 auto; width: min(260px, 100%); height: auto; max-width: 100%; max-height: none; aspect-ratio: 9 / 16; margin: 0 auto 12px; min-height: 0; object-fit: cover; }
.prompt-box { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: visible; }
.shot-warn { margin: 0 12px 8px; color: #8E311D; font-size: 13px; line-height: 1.45; }
.ep-preview video.shot-video { width: min(280px, 100%); aspect-ratio: 9/16; max-height: 460px; margin: 0 auto 12px; border-radius: 16px; border: 2px solid var(--brand); background: #111; display: block; object-fit: cover; }
.ep-main .prompt-label { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.ep-main #shotPrompt { flex: 1; height: 100%; max-height: 100%; min-height: 0; overflow: auto; resize: none; border: 0; border-radius: 12px 12px 0 0; background: #fff; }
.shot-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; margin: 0; padding: 8px; border-top: 1px solid var(--line); background: var(--cream); border-radius: 0 0 12px 12px; overflow: visible; }
.shot-capsules { display: flex; align-items: stretch; height: 32px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: visible; }
.shot-seg { position: relative; display: flex; align-items: center; padding: 0 10px; color: var(--ink); font-size: 13px; }
.shot-seg + .shot-seg { box-shadow: inset 1px 0 var(--line); }
.model-list { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.model-list button { text-align: left; }
.shot-toolbar .shot-drop { flex: none; }
.shot-toolbar .import-actions { margin: 0 0 0 auto; flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; }
.shot-toolbar #rewritePrompt { height: 34px; padding: 0 12px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-ink); white-space: nowrap; }
.shot-toolbar #regenShot { height: 34px; padding: 0 14px; border-radius: 999px; white-space: nowrap; }
.shot-toolbar #regenShot:disabled { opacity: .55; cursor: wait; }
.shot-trigger { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0; background: transparent; border: 0; border-radius: 0; color: var(--ink); font-size: 13px; }
.shot-trigger::after { content: none; }
.shot-drop { position: relative; display: flex; align-items: center; font-size: 13px; color: var(--ink); }
.shot-pop { position: absolute; z-index: 20; bottom: calc(100% + 6px); top: auto; left: 0; min-width: 220px; max-height: min(360px, calc(100vh - var(--top) - 180px)); overflow: auto; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(17,17,17,.08); }
.shot-pop.sec-pop { left: auto; right: 0; }
.shot-pop[hidden] { display: none !important; }
.shot-pop > p { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.res-row { display: flex; gap: 8px; }
.sec-grid { display: grid; grid-template-columns: repeat(4, minmax(56px, 1fr)); gap: 8px; width: 280px; }
.shot-pop button { background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.shot-pop button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.ep-pull { display: flex; width: 100%; justify-content: center; margin-top: 8px; border: 0; background: transparent; color: var(--brand-ink); opacity: 0; }
.ep-card:hover .ep-pull, .ep-card.is-hot .ep-pull, .ep-card.is-pinned .ep-pull { opacity: 1; }
.ep-detail { display: none; position: absolute; left: 0; right: 0; top: calc(100% - 6px); z-index: 4; background: var(--card); border: 1px solid var(--brand-line); border-radius: 12px; box-shadow: 0 16px 36px rgba(17,17,17,.08); padding: 12px; }
.ep-card.is-hot .ep-detail, .ep-card.is-pinned .ep-detail { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.ep-detail .ep-actions { grid-column: 1 / -1; }
.ep-script pre { white-space: pre-wrap; margin: 0; background: var(--paper); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; font: 13px/1.5 inherit; }
.ep-asset-side h4, .ep-script h4 { margin: 0 0 6px; font-size: 13px; }
.ep-mini { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 6px 0; font-size: 12px; }
.ep-mini i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.ep-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ep-thumb { width: 92px; height: 56px; border-radius: 8px; }
.ep-preview .ep-screen, #epPreview .ep-screen { aspect-ratio: 9/16; width: min(280px, 100%); max-height: 460px; margin: 0 auto 12px; border-radius: 16px; border: 2px solid var(--brand); display: flex; align-items: flex-end; padding: 14px; color: #fffcf8; }
.ep-screen p, .script-preview p { margin: 4px 0 0; }
.script-preview { min-height: 280px; padding: 8px 4px; }
.ep-studio { display: grid; grid-template-columns: minmax(120px, 200px) minmax(280px, 1fr) minmax(168px, 240px); gap: 12px; align-items: stretch; overflow: visible; }
.ep-side .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.shot-rail { display: flex; gap: 8px; overflow: auto; margin-top: 8px; padding-bottom: 6px; }
.shot-chip { flex: none; width: 108px; min-height: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.shot-chip[aria-current="page"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.shot-chip b { color: var(--brand-ink); }
.view-row figure { margin: 0; }
.view-row figcaption { text-align: center; color: var(--ink-2); font-size: 13px; }
.asset-tabs { border: 0; }
.adapt-filters { align-items: end; }
.adapt-ops { white-space: normal; }
.adapt-ops .primary { margin-right: 4px; }
.agent-modal { width: min(640px, calc(100% - 32px)); max-width: 640px; }
.agent-card, .agent-versions button, .topic-chip { text-align: left; }
.agent-card { display: block; width: 100%; margin: 8px 0 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); }
.agent-card.is-on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-tint); }
.agent-card strong, .agent-card span, .agent-card em { display: block; }
.agent-card span, .agent-card em { color: var(--ink-2); font-style: normal; font-size: 13px; margin-top: 4px; }
.agent-versions, .topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.agent-versions button[aria-pressed="true"], .topic-chip.is-on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.topic-chip:disabled { opacity: .4; }
.check-line { flex-direction: row; align-items: center; gap: 8px; margin: 8px 0; }
.adapt-head { display: flex; flex-direction: column; gap: 10px; }
.adapt-steps { display: flex; gap: 18px; margin: 8px 0 0; padding: 0; list-style: none; }
.adapt-steps li { color: var(--ink-3); }
.adapt-steps li.current { color: var(--brand-ink); font-weight: 600; }
.adapt-steps li.done { color: var(--ink); }
.adapt-bar { height: 8px; border-radius: 99px; background: var(--cream); overflow: hidden; }
.adapt-bar i { display: block; height: 100%; background: var(--brand); }
.adapt-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.adapt-meta div { margin: 0; }
.adapt-meta dt { color: var(--ink-3); font-size: 12px; }
.adapt-meta dd { margin: 2px 0 0; }
.adapt-split, .adapt-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.adapt-editor { grid-template-columns: 220px minmax(0, 1fr); }
.adapt-eps { max-height: 560px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.adapt-eps button { text-align: left; }
@media (max-width: 860px) {
  .shell, .metrics, .form-grid, .split, .workspace, .cost, .show-layout, .ep-row, .ep-grid, .ep-detail { grid-template-columns: 1fr; }
  aside { height: auto; position: relative; }
  .topbar { padding: 0 16px; }
  #view { padding: 16px; }
  .import-hero { margin: -16px -16px 8px; }
}
@media (max-width: 1180px) {
  .ep-studio { grid-template-columns: minmax(96px, 150px) minmax(440px, 1fr) minmax(128px, 176px); }
  .ep-studio .shot-toolbar { flex-wrap: nowrap; gap: 6px; padding: 6px; }
  .ep-studio .shot-toolbar #rewritePrompt { padding: 0 10px; }
  .ep-studio .shot-toolbar #regenShot { padding: 0 12px; }
}
@media (max-width: 699px) {
  .ep-studio { grid-template-columns: 1fr; min-width: 0; }
}
