/* C级英雄 — dark studio shell */
:root {
    --bg: #0d0d0d;
    --bg-deep: #090909;
    --surface: #161616;
    --surface-2: #1c1c1c;
    --ink: #f4f4f0;
    --ink-soft: #d8d8d0;
    --muted: #8a8a82;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --accent: #d4ff33;
    --accent-hover: #e8ff66;
    --accent-soft: rgba(212, 255, 51, 0.12);
    --accent-btn-bg: rgba(212, 255, 51, 0.10);
    --accent-btn-border: rgba(212, 255, 51, 0.30);
    --accent-btn-hover-bg: rgba(212, 255, 51, 0.16);
    --accent-btn-hover-border: rgba(212, 255, 51, 0.46);
    --accent-ink: #121212;
    --accent-2: #7ad4ff;
    --ok: #7dff9a;
    --bad: #ff6b6b;
    --warn: #ffd166;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.45);
    --glow: 0 0 24px rgba(212, 255, 51, 0.28);
    --radius: 16px;
    --radius-sm: 12px;
    --rail: 232px;
    --rail-collapsed: 76px;
    --episode-rail: 200px;
    --font: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
    --display: "Space Grotesk", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    --serif: "Literata", "Songti SC", "Palatino Linotype", serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    /* Type scale */
    --fs-2xs: 11px;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 17px;
    --fs-xl: 20px;
    --fs-2xl: 28px;
    --fs-3xl: 36px;
    --fs-hero: clamp(40px, 5vw, 56px);
    --fs-display: clamp(28px, 3.2vw, 40px);
    --fs-title: clamp(22px, 2.4vw, 28px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: var(--fs-base);
    color: var(--ink);
    line-height: 1.6;
    letter-spacing: 0.01em;
    background:
        radial-gradient(900px 480px at 8% -10%, rgba(212, 255, 51, 0.08), transparent 55%),
        radial-gradient(700px 420px at 100% 110%, rgba(212, 255, 51, 0.05), transparent 50%),
        linear-gradient(180deg, #121212 0%, var(--bg) 42%, var(--bg-deep) 100%);
    -webkit-font-smoothing: antialiased;
}
body::before {
    display: none;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rail-in {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes brand-pulse {
    0%, 100% { opacity: 0.85; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-10px); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— App shell —— */
.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.28s var(--ease);
}
.app-shell.is-rail-collapsed {
    grid-template-columns: var(--rail-collapsed) minmax(0, 1fr);
}
.app-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 24px;
    background: #121212;
    color: var(--ink);
    border-right: 1px solid var(--line);
    animation: rail-in 0.6s var(--ease) both;
    overflow: hidden;
    transition: padding 0.28s var(--ease);
}
.app-shell.is-rail-collapsed .app-rail {
    padding: 20px 10px 18px;
}
.app-rail::before,
.app-rail::after {
    display: none;
}
.rail-head {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.rail-brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    margin: 0;
    padding: 4px 6px 8px;
    min-width: 0;
}
.rail-brand:hover { text-decoration: none; color: inherit; }
.rail-brand-text { display: block; min-width: 0; }
.rail-mark,
.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin-bottom: 0;
    background: linear-gradient(145deg, #d4ff33 0%, #ffe14a 100%);
    color: var(--accent-ink);
    box-shadow: var(--glow);
    flex-shrink: 0;
    overflow: hidden;
}
.rail-mark svg { width: 24px; height: 24px; }
.rail-word {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--ink);
}
.rail-tag {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}
.rail-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rail-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
    background: var(--surface);
    transform: none;
    filter: none;
}
.rail-toggle-icon {
    width: 16px;
    height: 16px;
    position: relative;
    flex-shrink: 0;
    border-left: 2px solid currentColor;
    border-radius: 1px;
}
.rail-toggle-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}
.rail-toggle-icon::after {
    display: none;
}
/* 收起态 / 顶栏展开按钮：箭头朝右，表示展开侧栏 */
.app-shell.is-rail-collapsed .rail-toggle .rail-toggle-icon::before,
.rail-toggle-open .rail-toggle-icon::before {
    left: 2px;
    transform: translateY(-50%) rotate(-135deg);
}

.app-shell.is-rail-collapsed .rail-brand {
    align-items: center;
    padding: 0;
}
.app-shell.is-rail-collapsed .rail-brand-text,
.app-shell.is-rail-collapsed .rail-foot,
.app-shell.is-rail-collapsed .rail-toggle-label {
    display: none;
}
.app-shell.is-rail-collapsed .rail-mark {
    margin: 0 auto 0;
    width: 42px;
    height: 42px;
}
.app-shell.is-rail-collapsed .rail-head {
    align-items: center;
    margin-bottom: 18px;
}
.app-shell.is-rail-collapsed .rail-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
}
.app-shell.is-rail-collapsed .app-rail .rail-toggle {
    display: none;
}
.app-shell.is-rail-collapsed .rail-nav a,
.app-shell.is-rail-collapsed .rail-nav button {
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    font-size: inherit;
    line-height: 1;
}
.app-shell.is-rail-collapsed .rail-nav a::before,
.app-shell.is-rail-collapsed .rail-nav button::before {
    display: none;
}
.app-shell.is-rail-collapsed .rail-nav {
    align-items: stretch;
}

.rail-nav {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.rail-nav a,
.rail-nav button {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    font-size: var(--fs-base);
    padding: 11px 13px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.rail-nav a:hover,
.rail-nav button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    filter: none;
}
.rail-nav a.is-active {
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: var(--glow);
    border: 1px solid transparent;
}
.rail-nav form { margin: 0; margin-top: auto; }
.rail-nav form button {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}
.rail-nav form button:hover {
    color: var(--ink);
    border-color: var(--ink);
    background: var(--surface-2);
    transform: none;
}
.rail-foot {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-xs);
    letter-spacing: 0;
    text-transform: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rail-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--ink-soft);
    font-weight: 600;
}
.rail-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.rail-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}
.rail-user-credits {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
    opacity: 0.9;
}
.rail-user-credits strong {
    font-weight: 700;
    color: var(--ink);
}
.rail-foot form { margin: 0; }
.rail-login-btn,
.rail-nav form button,
.rail-foot button {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 650;
}
.rail-login-btn:hover,
.rail-foot button:hover,
.rail-nav form button:hover {
    color: var(--accent-ink);
    border-color: var(--accent);
    background: var(--accent);
    transform: none;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}
.app-top {
    display: none;
}
.rail-toggle-open {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 25;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.rail-toggle-open:not([hidden]) {
    display: inline-flex;
}
.app-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.app-top-title {
    font-family: var(--display);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--muted);
}
.app-top-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.app-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 32px 80px;
    animation: rise 0.55s var(--ease) both;
}
.app-content.wrap-wide {
    max-width: none;
    margin: 0;
    padding: 20px 20px 40px;
}
body.is-work-stage .app-shell {
    height: 100vh;
    overflow: hidden;
}
body.is-work-stage .app-main {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.app-content.wrap-fill {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 16px;
    overflow: hidden;
}
.app-content.wrap-fill > .note,
.app-content.wrap-fill > .work-stage-head,
.app-content.wrap-fill > .work-toolbar {
    flex-shrink: 0;
}
.app-content.wrap-fill > [data-pane] {
    flex: 1 1 0%;
    min-height: 0;
    height: auto;
    max-height: none;
}

/* Guest / login full stage */
body.is-login {
    background: #0d0d0d;
}
body.is-login::before {
    display: block;
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(720px 420px at 12% 0%, rgba(212, 255, 51, 0.16), transparent 58%),
        radial-gradient(640px 360px at 90% 100%, rgba(212, 255, 51, 0.08), transparent 52%),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 47px,
            rgba(212, 255, 51, 0.035) 47px,
            rgba(212, 255, 51, 0.035) 48px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 47px,
            rgba(212, 255, 51, 0.035) 47px,
            rgba(212, 255, 51, 0.035) 48px
        );
    mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 80%);
}
.login-stage {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.login-brand {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 6vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    color: var(--ink);
    background: transparent;
}
.login-brand::before,
.login-brand::after { display: none; }
.login-brand-top,
.login-brand-copy,
.login-brand-foot {
    position: relative;
    z-index: 1;
}
.login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--display);
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}
.login-brand-top .brand-mark,
.login-brand-top .rail-mark {
    margin: 0;
    width: 56px;
    height: 56px;
}
.login-brand-copy h1 {
    margin: 0 0 16px;
    font-family: var(--display);
    font-size: clamp(28px, 3.4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    max-width: none;
    color: #fff;
}
.login-brand-copy .login-motto {
    margin: 0 0 14px;
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 700;
    background: linear-gradient(90deg, #d4ff33, #ffe14a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-brand-copy p {
    margin: 0;
    max-width: 28em;
    color: rgba(236, 236, 230, 0.72);
    font-size: var(--fs-md);
    line-height: 1.75;
}
.login-brand-foot {
    color: rgba(212, 255, 51, 0.55);
    font-size: var(--fs-2xs);
    letter-spacing: 0.14em;
    text-transform: none;
}
.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: transparent;
}
.login-form-box {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 32px;
    border-radius: 22px;
    background: rgba(22, 22, 22, 0.78);
    border: 1px solid rgba(255, 186, 80, 0.35);
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.06), 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    animation: rise 0.65s 0.1s var(--ease) both;
}
.login-form-box .kicker { margin-bottom: 8px; color: var(--accent); }
.login-form-box h2 {
    margin: 0 0 8px;
    font-family: var(--display);
    font-size: var(--fs-2xl);
    letter-spacing: -0.04em;
}
.login-form-box .lead { margin-bottom: 24px; font-size: var(--fs-base); }
.login-form-box .card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.login-form-box input[type="text"],
.login-form-box input[type="password"] {
    background: #111;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.12);
}
.login-form-box .actions { margin-top: 18px; }
.login-form-box .actions button {
    width: 100%;
    padding: 14px 22px;
    font-size: var(--fs-md);
    background: linear-gradient(90deg, #d4ff33, #ffe14a);
    box-shadow: var(--glow);
}
.login-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    color: var(--muted);
    font-size: var(--fs-xs);
}
.login-checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
}
.login-checks input { width: auto; accent-color: var(--accent); }

/* —— Typography & page chrome —— */
h1 {
    font-family: var(--display);
    font-size: var(--fs-display);
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--ink);
}
h2 {
    font-family: var(--display);
    font-size: var(--fs-xl);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.lead {
    color: var(--muted);
    margin: 0 0 28px;
    font-size: var(--fs-md);
    max-width: 40em;
    line-height: 1.7;
}
.page-hero {
    display: grid;
    gap: 6px;
    margin-bottom: 20px;
}
.page-hero-inline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-hero-inline .lead { margin-bottom: 0; }
.page-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.page-hero.compact { margin-bottom: 16px; gap: 6px; }
.page-hero.compact h1 { font-size: var(--fs-title); margin: 0; }
.page-hero.compact .meta { margin-bottom: 0; }
.page-hero.compact .lead { font-size: var(--fs-base); margin-bottom: 0; }
.kicker {
    color: var(--accent);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.page-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.page-hero-row .lead { margin-bottom: 0; }

.pipeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 0 0 28px;
}
.pipeline span {
    display: block;
    padding: 18px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.5;
    box-shadow: var(--shadow);
}
.pipeline b {
    display: block;
    color: var(--ink);
    font-family: var(--display);
    font-size: var(--fs-base);
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.pipeline .is-now {
    border-color: rgba(212, 255, 51, 0.35);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.12), var(--shadow);
}
.path-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
.path-card {
    display: block;
    padding: 28px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}
.path-card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(212, 255, 51, 0.3);
}
.path-card.is-current {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.25), var(--shadow);
}
.path-card strong {
    font-family: var(--display);
    font-size: var(--fs-lg);
    letter-spacing: -0.03em;
}
.path-card small {
    display: block;
    color: var(--muted);
    margin-top: 8px;
    font-size: var(--fs-sm);
    line-height: 1.55;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 34px;
    box-shadow: var(--shadow);
    scroll-margin-top: 88px;
}
.card + .card, .stack > * + * { margin-top: 22px; }
.card > details.fold { border: 0; padding: 0; background: transparent; }
.card > details.fold > summary { padding-top: 0; }
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

label { display: block; font-weight: 650; margin-bottom: 8px; font-size: var(--fs-sm); color: var(--ink-soft); }
.field-help { color: var(--muted); font-size: var(--fs-xs); margin: -2px 0 10px; font-weight: 400; line-height: 1.5; }
.field-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: var(--fs-2xs);
    margin-top: 8px;
}
textarea, input[type="text"], input[type="password"], input[type="number"], input[type="search"], select {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font: inherit;
    color: var(--ink);
    background: var(--surface-2);
    transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.script-box {
    min-height: 340px;
    font-family: var(--serif);
    font-size: var(--fs-md);
    line-height: 1.85;
    background: var(--surface);
}
textarea.rules-box { min-height: 240px; font-size: var(--fs-xs); line-height: 1.6; }
textarea.list-box { min-height: 140px; }
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 255, 51, 0.18);
    background: var(--surface);
}
input[type="radio"], input[type="checkbox"] { outline: none; box-shadow: none; }
textarea::placeholder, input::placeholder {
    color: #6f6f68;
    font-size: var(--fs-xs);
    line-height: 1.5;
    font-weight: 400;
}
textarea.script-box::placeholder {
    font-size: var(--fs-xs);
    line-height: 1.65;
    font-family: var(--font);
}
input[type="file"] { display: block; width: 100%; margin: 8px 0 0; color: var(--muted); font-size: 12px; }

details.fold {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px 16px 14px;
    background: var(--surface-2);
}
details.fold > summary {
    cursor: pointer;
    font-weight: 650;
    padding: 14px 0;
    list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
    content: "展开";
    float: right;
    color: var(--muted);
    font-weight: 500;
    font-size: var(--fs-2xs);
}
details.fold[open] > summary::after { content: "收起"; }
.error { color: var(--bad); margin: 8px 0 0; font-size: var(--fs-sm); }
.actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

button, .btn {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 11px 20px;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: var(--fs-base);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s var(--ease), box-shadow 0.2s;
    box-shadow: 0 8px 20px rgba(212, 255, 51, 0.25);
}
button:hover, .btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
    transform: translateY(-1px);
    filter: none;
}
.btn-light {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    font-weight: 600;
    box-shadow: none;
}
.btn-light:hover {
    background: var(--surface);
    transform: none;
    border-color: var(--ink);
}

.asset-detail-prompt-btn,
.asset-detail-upload-btn,
.asset-detail-model-row > button,
.asset-preview-upload,
#asset-ai-submit {
    border: 1px solid var(--accent-btn-border);
    background: var(--accent-btn-bg);
    color: var(--accent);
    box-shadow: none;
    font-weight: 650;
}
.asset-detail-prompt-btn:hover,
.asset-detail-upload-btn:hover,
.asset-detail-model-row > button:hover,
.asset-preview-upload:hover,
#asset-ai-submit:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
    box-shadow: none;
}

.note {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: var(--fs-sm);
    border: 1px solid var(--line);
    line-height: 1.55;
}
.note.bad {
    background: rgba(255, 107, 107, 0.12);
    color: #ffb4b4;
    border-color: rgba(255, 107, 107, 0.28);
}
.note.ok {
    background: rgba(125, 255, 154, 0.1);
    color: #b8ffc8;
    border-color: rgba(125, 255, 154, 0.24);
}
.meta { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.block { white-space: pre-wrap; word-break: break-word; }
.story { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: 0.04em; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: var(--fs-2xs);
    font-weight: 650;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
}
.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-done, .pill.status-done { color: var(--ok); background: rgba(125, 255, 154, 0.12); border-color: rgba(125, 255, 154, 0.22); }
.status-failed, .pill.status-failed { color: var(--bad); background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.22); }
.status-rendering, .status-scripting, .pill.status-rendering, .pill.status-scripting { color: var(--warn); background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.22); }
.status-pending, .status-none, .status-stopped, .pill.status-pending, .pill.status-none, .pill.status-stopped { color: var(--muted); }
.pill.ok { color: var(--ok); background: rgba(125, 255, 154, 0.12); }
.pill-project {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}
.pill-project::before {
    background: var(--accent);
}
.field-help.ok { color: var(--ok); }
.field-help.bad { color: var(--bad); }
.skill-item summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.skill-item .pill { flex: 0 0 auto; }

.player { margin-top: 10px; }
.player video {
    width: auto;
    max-width: min(100%, 860px);
    max-height: min(64vh, 680px);
    height: auto;
    display: block;
    border-radius: 14px;
    background: #0b0d12;
    object-fit: contain;
    box-shadow: var(--shadow-lg);
}

.choices { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.choice {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
}
.choice input {
    margin: 0 0 6px;
    accent-color: var(--accent);
    align-self: flex-start;
    width: auto;
}
.choice small { color: var(--muted); font-weight: 400; }
.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(212, 255, 51, 0.2);
    color: var(--accent);
}

.ref-fields { margin-bottom: 8px; }

/* 出片页字号层级：标题/分区大，说明/辅文小 */
#video-card .video-pane-title {
    margin: 0 0 16px;
    font-family: var(--display);
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.25;
}
#video-card > .lead {
    margin: 0 0 22px;
    font-size: var(--fs-md);
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 46em;
}
#video-card > .note {
    font-size: var(--fs-base);
    line-height: 1.6;
    padding: 14px 16px;
}
#video-card #video-form > label {
    margin-top: 22px;
    margin-bottom: 6px;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--ink);
}
#video-card #video-form > label:first-of-type {
    margin-top: 4px;
}
#video-card #video-form .field-help {
    font-size: var(--fs-2xs);
    line-height: 1.5;
    margin: 0 0 12px;
    color: var(--muted);
}
#video-card #video-form .field-help strong {
    color: var(--ink-soft);
    font-weight: 650;
}
#video-card #video-form .choices {
    margin: 0 0 8px;
    gap: 10px;
}
#video-card #video-form .choice {
    padding: 14px 16px;
    gap: 4px;
}
#video-card #video-form .choice span {
    font-size: var(--fs-md);
    font-weight: 650;
    color: var(--ink);
    line-height: 1.3;
}
#video-card #video-form .choice small {
    font-size: var(--fs-2xs);
    line-height: 1.45;
    color: var(--muted);
}
#video-card #video-form .ref-fields > label {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--ink);
}
#video-card #video-form .ref-fields > .lead {
    margin: 8px 0 0;
    font-size: var(--fs-sm);
    line-height: 1.55;
    max-width: 46em;
}
#video-card #video-form .ref-fields > .note {
    font-size: var(--fs-sm);
}
#video-card #video-form .asset-item strong {
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#video-card #video-form .asset-item > small {
    font-size: var(--fs-2xs);
    letter-spacing: 0.02em;
}
#video-card #video-form .actions {
    margin-top: 28px;
}
#video-card #video-form .actions button {
    font-size: var(--fs-md);
    padding: 13px 24px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 0 0 14px;
}
.asset-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
.asset-item[hidden] {
    display: none !important;
}
.asset-item:hover,
.asset-item:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.25), var(--glow);
}
.asset-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.asset-item-labels {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}
.asset-delete-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.asset-delete-btn:hover {
    border-color: #e57373;
    background: rgba(255, 107, 107, 0.12);
    color: #ffb4b4;
}
.asset-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.asset-pane-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.asset-add-open {
    margin: 0;
    padding: 7px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.asset-add-open:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.asset-grid-empty {
    margin: 0;
}
.asset-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
    height: auto;
    overflow: hidden;
}
.asset-studio-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 18px 8px;
}
.asset-type-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    margin-bottom: 14px;
}
.asset-type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.asset-type-tabs button {
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
}
.asset-type-tabs button span {
    display: inline-block;
    margin-left: 4px;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.asset-type-tabs button.is-active {
    background: var(--accent-btn-bg);
    border-color: var(--accent-btn-border);
    color: var(--accent);
}
.asset-type-tabs button.is-active span {
    color: var(--accent);
}
.asset-workspace .asset-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: min-content;
    align-items: start;
    align-content: start;
    margin: 0;
    padding: 0 4px 24px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.asset-workspace .asset-grid::-webkit-scrollbar {
    width: 8px;
}
.asset-workspace .asset-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 99px;
}
.asset-workspace .asset-item {
    padding: 0;
    gap: 0;
    height: auto;
    min-height: min-content;
    overflow: visible;
    cursor: pointer;
    background: #111;
    border-top-width: 1px;
    border-top-color: var(--line);
}
.asset-workspace .asset-item.asset-character,
.asset-workspace .asset-item.asset-scene,
.asset-workspace .asset-item.asset-prop {
    border-top: 1px solid var(--line);
}
.asset-workspace .asset-item.is-selected {
    border-color: var(--accent-btn-border);
    box-shadow: 0 0 0 1px var(--accent-btn-border);
    background: var(--accent-btn-bg);
}
.asset-workspace .asset-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 24px;
    height: 24px;
    margin: 0;
    border-radius: 999px;
    opacity: 0;
}
.asset-workspace .asset-item:hover .asset-delete-btn,
.asset-workspace .asset-item.is-selected .asset-delete-btn {
    opacity: 1;
}
.asset-workspace .asset-preview-slot {
    position: relative;
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #1a1a1a;
}
.asset-workspace .asset-item img.asset-preview {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 180px;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    background: transparent;
    margin: 0;
    display: block;
}
.asset-preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5c5c56;
    pointer-events: none;
}
.asset-preview-empty svg {
    width: 42px;
    height: 42px;
}
.asset-preview-empty[hidden] { display: none !important; }
.asset-preview-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.asset-workspace .asset-item:hover .asset-preview-actions,
.asset-workspace .asset-item:focus-within .asset-preview-actions {
    opacity: 1;
}
.asset-preview-zoom,
.asset-preview-upload {
    pointer-events: auto;
    cursor: pointer;
}
.asset-preview-zoom {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(12, 12, 12, 0.78);
    color: #fff;
}
.asset-preview-zoom svg {
    width: 15px;
    height: 15px;
}
.asset-preview-zoom:hover {
    background: rgba(12, 12, 12, 0.94);
    transform: none;
}
.asset-item[data-has-image="0"] .asset-preview-zoom {
    display: none;
}
.asset-preview-upload {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    width: max-content;
    margin: 0 auto;
    transform: none;
    padding: 6px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.asset-card-caption {
    padding: 8px 10px 10px;
    flex-shrink: 0;
}
.asset-card-caption .asset-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.asset-card-caption small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}
.asset-card-voice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 10px 12px;
    position: relative;
    flex-shrink: 0;
}
.asset-card-voice label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    min-width: 0;
}
.asset-card-voice label span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.asset-card-voice .asset-voice-select {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 8px;
    background: #0d0d0d;
    min-width: 0;
}
.asset-card-voice-status {
    grid-column: 1 / -1;
    font-size: 10px;
    color: var(--muted);
    min-height: 0;
}
.asset-card-voice-status.is-ok { color: var(--ok); }
.asset-card-voice-status.is-err { color: var(--bad); }
.asset-detail {
    min-width: 0;
    min-height: 0;
    height: auto;
    max-height: 100%;
    align-self: stretch;
    overflow: auto;
    border-left: 1px solid var(--line);
    background: var(--surface-2);
    padding: 14px 14px 22px;
}
.asset-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    color: var(--muted);
    font-size: var(--fs-sm);
    text-align: center;
}
.asset-detail-empty[hidden],
.asset-detail-body[hidden] {
    display: none !important;
}
.asset-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.asset-detail-head strong {
    font-size: var(--fs-sm);
    font-weight: 700;
}
.asset-detail-status {
    font-size: 11px;
    color: var(--muted);
}
.asset-detail-status.is-ok { color: var(--ok); }
.asset-detail-status.is-err { color: var(--bad); }
.asset-detail-identity,
.asset-detail-voice,
.asset-detail-prompt,
.asset-detail-model,
.asset-detail-refs {
    margin: 0 0 18px;
}
.asset-detail-refs[hidden] {
    display: none !important;
}
.asset-detail label {
    display: block;
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}
.asset-detail-id-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.asset-detail-thumb-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    border: 1px solid var(--line);
}
.asset-detail-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.asset-detail-thumb-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 11px;
}
.asset-detail-thumb-empty[hidden] { display: none !important; }
.asset-detail-id-meta strong {
    display: block;
    font-size: var(--fs-sm);
}
.asset-detail-id-meta small {
    color: var(--muted);
    font-size: 11px;
}
.asset-detail textarea {
    min-height: 72px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    background: #111;
}
#asset-detail-prompt {
    min-height: 140px;
}
.asset-detail-prompt-head,
.asset-detail-refs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.asset-detail-prompt-head label,
.asset-detail-refs-head label {
    margin: 0;
}
.asset-detail-prompt-btn,
.asset-detail-upload-btn {
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
}
.asset-detail-prompt-count {
    display: block;
    margin-top: 4px;
    text-align: right;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.asset-detail-model-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px auto;
    gap: 6px;
    align-items: stretch;
}
.asset-detail-model-row select {
    margin: 0;
    padding: 7px 8px;
    font-size: 12px;
    background: #111;
}
.asset-detail-model-row button {
    margin: 0;
    padding: 7px 12px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 650;
    border-radius: 999px;
}
.asset-detail-ref-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    align-items: flex-start;
}
.asset-detail-ref-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}
.asset-detail-ref {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    cursor: default;
}
.asset-detail-ref.is-on {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.asset-detail-ref img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.asset-detail-ref-remove {
    margin: 0;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
}
.asset-detail-ref-remove:hover {
    color: var(--bad);
}
.asset-detail-ref-empty {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}
.asset-detail-voice .asset-voice-select {
    background: #111;
}
@media (max-width: 960px) {
    .asset-workspace {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    .asset-detail {
        border-left: 0;
        border-top: 1px solid var(--line);
        height: auto;
    }
    .asset-detail-model-row {
        grid-template-columns: 1fr;
    }
}
.asset-add-mask {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 22, 28, 0.46);
    backdrop-filter: blur(4px);
}
.asset-add-mask[hidden] { display: none !important; }
.asset-add-dialog {
    width: min(480px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    padding: 20px 22px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
    animation: rise 0.22s var(--ease) both;
}
.asset-add-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.asset-add-dialog-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
}
.asset-add-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.asset-add-dialog select,
.asset-add-dialog input[type="text"] {
    width: 100%;
    margin: 0;
}
.asset-add-dialog textarea {
    width: 100%;
    margin: 0;
}
.asset-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
.asset-add-actions button {
    min-width: 88px;
    padding: 8px 14px;
    font-size: var(--fs-xs);
}
.asset-item:hover { z-index: 4; }
.asset-item > small,
.asset-item-labels > small { color: var(--muted); font-weight: 500; font-size: var(--fs-2xs); }
.asset-item > strong,
.asset-item-name {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--ink);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asset-item-name-wrap {
    position: relative;
    display: block;
    min-width: 0;
    max-width: 100%;
}
.asset-item-name-wrap::after {
    content: attr(data-full-name);
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 8;
    max-width: min(260px, 72vw);
    padding: 7px 9px;
    border-radius: 8px;
    background: #1c1f26;
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.01em;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 10px 24px rgba(16, 18, 24, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
}
.asset-item-name-wrap:hover::after {
    opacity: 1;
    visibility: visible;
}
.asset-identity {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: var(--fs-2xs);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.asset-desc-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 4px;
}
.asset-desc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.asset-desc-label {
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-2xs);
    font-weight: 600;
}
.asset-desc-status {
    font-size: var(--fs-2xs);
    color: var(--muted);
}
.asset-desc-status.is-ok { color: var(--ok); }
.asset-desc-status.is-err { color: var(--bad); }
.asset-voice-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 8px;
}
.asset-voice-block .asset-desc-label + .asset-voice-select {
    margin-bottom: 4px;
}
.asset-voice-block .asset-desc-label:not(:first-child) {
    margin-top: 4px;
}
.video-narrator-voice {
    margin: 0 0 12px;
}
.asset-voice-select {
    width: 100%;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2, var(--surface));
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-2xs);
}
.asset-identity-edit {
    width: 100%;
    height: 108px;
    min-height: 108px;
    max-height: 108px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2, var(--surface));
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-2xs);
    line-height: 1.45;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
}
.asset-identity-edit::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
.asset-identity-edit:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}
.asset-identity-edit:disabled {
    opacity: 0.7;
}
.asset-item.asset-character { border-top: 3px solid var(--accent); }
.asset-item.asset-scene { border-top: 3px solid var(--accent-2); }
.asset-item.asset-prop { border-top: 3px solid var(--warn); }
.asset-media {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    flex: 1;
}
.asset-preview-slot {
    position: relative;
    width: 100%;
    height: 112px;
    min-height: 112px;
    border-radius: 10px;
    background: #dfe2e8;
    overflow: hidden;
}
.asset-ai-busy {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(18, 22, 28, 0.48);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 650;
    letter-spacing: 0.04em;
}
.asset-ai-busy[hidden] {
    display: none !important;
}
.asset-ai-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    animation: busy-rotate 0.8s linear infinite;
}
.asset-item.is-ai-generating img.asset-preview:not([hidden]) {
    filter: brightness(0.62);
    cursor: default;
}
.asset-item.is-ai-generating .asset-preview-empty {
    opacity: 0.2;
}
.asset-item.is-ai-generating .asset-preview-actions {
    pointer-events: none;
    opacity: 0;
}
.asset-item.is-ai-generating .asset-ai-btn,
.asset-ai-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.asset-item img,
.asset-item img.asset-preview {
    width: 100%;
    height: 112px;
    object-fit: cover;
    border-radius: 10px;
    background: #dfe2e8;
    margin: 0;
    display: block;
}
.asset-workspace .asset-item img.asset-preview {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    background: transparent;
}
.asset-item img.asset-preview:not([hidden]) {
    cursor: pointer;
}
.asset-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background: rgba(12, 16, 22, 0.78);
    backdrop-filter: blur(6px);
}
.asset-lightbox[hidden] { display: none !important; }
.asset-lightbox-inner {
    position: relative;
    max-width: min(960px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.asset-lightbox-inner img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #1a1f27;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.asset-lightbox-caption {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: center;
}
.asset-lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #1a1f27;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.asset-lightbox-close:hover { opacity: 0.92; }
.asset-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}
.asset-upload-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.asset-upload-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.asset-upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    font-size: 0;
}
.asset-upload-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.asset-upload-status {
    color: var(--muted);
    font-size: var(--fs-2xs);
    line-height: 1.4;
}
.episode-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 12px 0 22px;
}
.episode-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    padding: 14px 16px;
}
.episode-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.episode-card-head strong {
    font-size: var(--fs-md);
    font-weight: 700;
}
.episode-body {
    white-space: pre-wrap;
    max-height: 280px;
    overflow: auto;
    margin: 0;
}
.episode-add {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.episode-add .script-box {
    min-height: 180px;
}
.asset-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}
.asset-ai-btn:hover { opacity: 0.9; }
.asset-ai-btn:disabled:hover,
.asset-item.is-ai-generating .asset-ai-btn:hover {
    opacity: 0.55;
}
.asset-ai-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 22, 28, 0.46);
    backdrop-filter: blur(4px);
}
.asset-ai-mask[hidden] { display: none !important; }

.studio-confirm-mask {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
}
.studio-confirm-mask[hidden] { display: none !important; }
body.is-confirm-open { overflow: hidden; }
.studio-confirm-dialog {
    width: min(440px, 100%);
    padding: 22px 22px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 186, 80, 0.16);
    background: linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 255, 51, 0.06);
    animation: rise 0.22s var(--ease) both;
}
.studio-confirm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.studio-confirm-dialog h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    letter-spacing: -0.02em;
}
.studio-confirm-close {
    width: 32px;
    height: 32px;
    margin: -4px -6px 0 0;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    box-shadow: none;
    cursor: pointer;
}
.studio-confirm-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: none;
    filter: none;
    box-shadow: none;
}
.studio-confirm-dialog p {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-soft);
    white-space: pre-line;
}
.studio-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.studio-confirm-actions:has(#studio-confirm-cancel[hidden]) {
    grid-template-columns: 1fr;
}
.studio-confirm-actions .studio-confirm-btn,
.studio-confirm-actions button {
    min-width: 0;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
    transform: none;
}
.studio-confirm-btn-ghost,
#studio-confirm-cancel {
    background: #242424;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
.studio-confirm-btn-ghost:hover,
#studio-confirm-cancel:hover {
    background: #2e2e2e;
    color: #fff;
    border-color: rgba(212, 255, 51, 0.32);
    transform: none;
    filter: none;
    box-shadow: none;
}
.studio-confirm-btn-primary,
#studio-confirm-ok {
    background: var(--accent-btn-bg);
    color: var(--accent);
    border: 1px solid var(--accent-btn-border);
    box-shadow: none;
    font-weight: 650;
}
.studio-confirm-btn-primary:hover,
#studio-confirm-ok:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
    box-shadow: none;
}
#studio-confirm-ok.btn-danger {
    background: #c44545;
    color: #fff;
    border: 0;
    box-shadow: none;
}
#studio-confirm-ok.btn-danger:hover {
    background: #d95555;
    color: #fff;
    transform: none;
    filter: none;
    box-shadow: none;
}

.asset-ai-dialog {
    width: min(520px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    padding: 20px 22px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
}
.asset-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.asset-ai-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
}
.asset-ai-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.asset-ai-dialog label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--ink-soft);
}
.asset-ai-dialog select,
.asset-ai-dialog textarea,
.asset-ai-dialog input[type="file"] {
    width: 100%;
}
.asset-ai-dialog select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    padding: 0 12px;
    color: var(--ink);
}
.asset-ai-ref-label {
    display: block;
    margin: 12px 0 8px;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--ink-soft);
}
.asset-ai-ref-field {
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 12px;
}
.asset-ai-ref-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 8px 4px;
}
.asset-ai-ref-empty .field-help {
    margin: 0;
}
.asset-ai-ref-pick,
.asset-ai-ref-change,
.asset-ai-ref-remove {
    margin: 0;
    padding: 8px 14px;
    border-radius: 10px;
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.asset-ai-ref-pick,
.asset-ai-ref-change {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}
.asset-ai-ref-pick:hover,
.asset-ai-ref-change:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.asset-ai-ref-remove {
    border: 1px solid rgba(194, 59, 59, 0.28);
    background: rgba(194, 59, 59, 0.08);
    color: var(--bad);
}
.asset-ai-ref-remove:hover {
    background: rgba(194, 59, 59, 0.14);
}
.asset-ai-ref-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.asset-ai-ref-preview[hidden] {
    display: none !important;
}
.asset-ai-ref-empty[hidden] {
    display: none !important;
}
.asset-ai-ref-img {
    display: block;
    width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: 10px;
    background: #11151c;
    border: 1px solid var(--line);
}
.asset-ai-ref-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.asset-ai-ref-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--fs-xs);
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asset-ai-ref-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    position: sticky;
    top: 64px;
    z-index: 5;
    padding: 10px;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
}
.jump-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: var(--fs-xs);
    font-weight: 600;
}
.jump-nav a:hover { color: var(--ink); background: var(--surface); }

/* —— Project list —— */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow);
}
.project-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    border-radius: 14px;
    transition: background 0.15s ease;
}
.project-row:hover { background: var(--surface-2); }
.project-row-main {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-width: 0;
    padding: 14px 12px 14px 14px;
    color: inherit;
    text-decoration: none;
}
.project-row-main:hover { text-decoration: none; }
.project-id {
    font-family: var(--display);
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
}
.project-info { min-width: 0; }
.project-info strong {
    display: block;
    font-family: var(--display);
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.project-info p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.project-row-action {
    margin: 0;
    padding-right: 10px;
}
.project-row-action .btn-danger {
    padding: 7px 12px;
    font-size: var(--fs-2xs);
}

/* legacy tile styles kept minimal for safety */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.project-tile { display: none; }

@media (max-width: 900px) {
    .project-row-main {
        grid-template-columns: 48px 1fr;
    }
    .project-meta {
        grid-column: 2;
        justify-content: flex-start;
    }
}

.record-list { display: grid; gap: 12px; }
.record-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 0 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.record-card:hover { border-color: rgba(212, 255, 51, 0.35); }
.record-main {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 18px;
    align-items: center;
    min-width: 0;
    padding: 20px 10px 20px 22px;
    color: inherit;
    text-decoration: none;
}
.record-main:hover { text-decoration: none; }
.record-id {
    color: var(--accent);
    font-family: var(--display);
    font-weight: 700;
    font-size: var(--fs-lg);
}
.record-card strong { font-family: var(--display); font-size: var(--fs-md); letter-spacing: -0.02em; }
.record-card p { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.record-delete { margin: 0; }
.btn-danger {
    background: rgba(194, 59, 59, 0.08);
    color: var(--bad);
    border: 1px solid rgba(194, 59, 59, 0.22);
    box-shadow: none;
    padding: 10px 14px;
    font-size: var(--fs-xs);
    font-weight: 600;
}
.btn-danger:hover {
    background: rgba(255, 107, 107, 0.16);
    color: #ffb4b4;
    border-color: rgba(255, 107, 107, 0.4);
    transform: none;
    box-shadow: none;
}
.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.empty {
    text-align: center;
    padding: 72px 28px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: 24px;
}
.empty h2 {
    margin: 0 0 10px;
    font-size: var(--fs-2xl);
}

.work-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    position: sticky;
    top: 12px;
    z-index: 6;
    padding: 8px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.work-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.work-tabs button {
    background: transparent;
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: var(--fs-sm);
    box-shadow: none;
    transform: none;
}
.work-tabs button:hover { color: var(--ink); background: var(--surface-2); filter: none; }
.work-tabs button.is-active {
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: var(--glow);
}
.work-tabs button.is-locked,
.work-tabs button[aria-disabled="true"] {
    position: relative;
    opacity: 0.48;
    cursor: not-allowed;
    color: var(--muted);
    padding-left: 28px;
    padding-right: 22px;
}
.work-tabs button.is-locked::before,
.work-tabs button[aria-disabled="true"]::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    background: currentColor;
    opacity: 0.72;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.work-tabs button.is-locked::after,
.work-tabs button[aria-disabled="true"]::after {
    content: '';
    position: absolute;
    right: 7px;
    top: 50%;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s ease, width 0.15s ease, height 0.15s ease;
    background: #e53935;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.5 5.5l13 13'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.5 5.5l13 13'/%3E%3C/svg%3E") center / contain no-repeat;
}
.work-tabs button.is-locked:hover,
.work-tabs button[aria-disabled="true"]:hover {
    color: #ffb4b4;
    background: rgba(255, 107, 107, 0.12);
    opacity: 1;
}
.work-tabs button.is-locked:hover::after,
.work-tabs button[aria-disabled="true"]:hover::after {
    width: 14px;
    height: 14px;
    opacity: 1;
}
.work-tabs button.is-locked:hover::before,
.work-tabs button[aria-disabled="true"]:hover::before {
    opacity: 0.35;
}
.work-toolbar .actions { margin: 0; }
.work-toolbar .actions button { padding: 8px 12px; font-size: var(--fs-xs); }
.work-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
.work-toolbar-tab-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.work-toolbar-tab-actions[hidden] {
    display: none !important;
}
.work-toolbar .work-toolbar-action-btn,
.work-toolbar .script-episode-extract,
.work-toolbar .storyboard-generate-all,
.work-toolbar .storyboard-generate-panels,
.work-toolbar .storyboard-retry-failed-panels {
    width: auto;
    margin: 0;
}

.work-stage-head {
    display: none;
}
.work-stage-title {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}
.work-stepper-bar {
    padding: 8px 10px 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 186, 80, 0.28);
    background: #121212;
    gap: 12px;
}
.work-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.work-stepper-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 650;
    white-space: nowrap;
    margin-right: 4px;
}
.work-stepper-label::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid var(--accent);
}
.work-stepper [role="tab"] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 650;
    box-shadow: none;
    transform: none;
    cursor: pointer;
}
.work-stepper [role="tab"]:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    transform: none;
    filter: none;
}
.work-stepper-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.38);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: inherit;
}
.work-stepper [role="tab"].is-active {
    color: var(--accent);
    background: transparent;
    box-shadow: none;
}
.work-stepper [role="tab"].is-active .work-stepper-num {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    box-shadow: var(--glow);
}
.work-stepper [role="tab"].is-locked,
.work-stepper [role="tab"][aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    padding-left: 10px;
    padding-right: 10px;
    color: var(--muted);
}
.work-stepper [role="tab"].is-locked::before,
.work-stepper [role="tab"][aria-disabled="true"]::before,
.work-stepper [role="tab"].is-locked::after,
.work-stepper [role="tab"][aria-disabled="true"]::after {
    display: none;
}
.work-stepper [role="tab"].is-locked:hover,
.work-stepper [role="tab"][aria-disabled="true"]:hover {
    background: transparent;
    color: var(--muted);
    opacity: 0.55;
}
.work-stepper-arrow {
    width: 18px;
    height: 10px;
    flex-shrink: 0;
    opacity: 0.35;
    background: currentColor;
    color: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath fill='black' d='M0 4.2h12.2v1.6H0z'/%3E%3Cpath fill='black' d='M10.2 0l7.4 5-7.4 5V0z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath fill='black' d='M0 4.2h12.2v1.6H0z'/%3E%3Cpath fill='black' d='M10.2 0l7.4 5-7.4 5V0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.work-stepper-bar .work-toolbar-action-btn,
.work-stepper-bar .script-episode-extract,
.work-stepper-bar .storyboard-generate-all,
.work-stepper-bar .storyboard-generate-panels {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--accent-btn-border);
    font-size: var(--fs-sm);
    font-weight: 650;
    background: var(--accent-btn-bg);
    color: var(--accent);
    box-shadow: none;
}
.work-stepper-bar .work-toolbar-action-btn:hover,
.work-stepper-bar .script-episode-extract:hover,
.work-stepper-bar .storyboard-generate-all:hover,
.work-stepper-bar .storyboard-generate-panels:hover:not(:disabled) {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
    box-shadow: none;
}
.work-stepper-bar .storyboard-retry-failed-panels {
    padding: 10px 18px;
    border-radius: 999px;
    font-size: var(--fs-sm);
    box-shadow: none;
}
.pane-scroll {
    max-height: calc(100dvh - 220px);
    min-height: 420px;
    overflow: auto;
}

.pane-story.card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 220px);
    max-height: calc(100dvh - 220px);
}
.app-content.wrap-fill .pane-story.card {
    height: auto;
    max-height: none;
}
.pane-assets.card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.pane-assets.card > .asset-workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}
.app-content.wrap-fill .pane-assets.card {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
}
.pane-story.card > .script-workspace {
    border: 0;
    border-radius: inherit;
    box-shadow: none;
    flex: 1;
    min-height: 0;
    height: 100%;
}
.script-workspace {
    display: grid;
    grid-template-columns: var(--episode-rail) minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    min-height: 420px;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.script-workspace--single {
    grid-template-columns: minmax(0, 1fr) 320px;
}
.script-episodes {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    align-self: stretch;
    border-right: 1px solid var(--line);
    background: var(--surface-2);
}
.script-episodes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
}
.script-episodes-head strong {
    font-size: var(--fs-sm);
    font-weight: 700;
}
.script-episode-item {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.script-episode-item:hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}
.script-episode-item.is-active {
    background: var(--accent-btn-bg);
    border-color: var(--accent-btn-border);
    color: var(--accent);
    box-shadow: none;
}
.script-episode-item.is-active:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
}
.storyboard-episode-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.script-episode-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.script-episode-duration {
    flex-shrink: 0;
    font-size: var(--fs-2xs);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.script-episode-item.is-active .script-episode-duration {
    color: var(--accent);
    opacity: 0.72;
}
.script-episodes-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-shrink: 0;
    padding: 10px 8px 12px;
}
.script-episode-add,
.script-episode-extract {
    width: 100%;
    margin: 0;
    padding: 9px 8px;
    border-radius: 10px;
    font: inherit;
    font-size: var(--fs-2xs);
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.script-episode-add {
    border: 1px dashed var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}
.script-episode-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.script-episode-extract {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--accent);
}
.script-episode-extract:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.script-episode-extract:disabled {
    opacity: 0.5;
    cursor: wait;
}
.script-episodes-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.script-main {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 20px 22px;
}
.script-episode-notice {
    flex-shrink: 0;
    margin-bottom: 12px;
}
.script-episode-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.script-episode-panel-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.script-episode-panel-head h2 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: 1.3;
    min-width: 0;
}
.script-episode-delete {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: var(--fs-xs);
}
.script-episode-editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.script-episode-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-bottom: 2px;
}
.script-episode-textarea {
    flex: 1;
    min-height: 0;
    width: 100%;
    margin: 0;
    resize: none;
    line-height: 1.65;
    font-family: inherit;
    box-sizing: border-box;
}
.script-episode-charcount {
    font-size: var(--fs-2xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.script-episode-charcount.is-over {
    color: var(--bad);
    font-weight: 600;
}
.script-episode-editor-actions {
    display: flex;
    gap: 8px;
}
.script-episode-editor-actions button {
    padding: 7px 14px;
    font-size: var(--fs-xs);
}
.script-episode-editor-status {
    margin: 0;
    flex-shrink: 0;
}

.script-episode-add-mask {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 22, 28, 0.46);
    backdrop-filter: blur(4px);
}
.script-episode-add-mask[hidden] { display: none !important; }
.script-episode-add-dialog {
    width: min(560px, 100%);
    max-height: min(90vh, 760px);
    overflow: auto;
    padding: 20px 22px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
    animation: rise 0.22s var(--ease) both;
}
.script-episode-add-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.script-episode-add-dialog-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
}
.script-episode-add-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.script-episode-add-dialog .field-help {
    margin: 0 0 12px;
}
.script-episode-add-dialog textarea {
    width: 100%;
    min-height: 220px;
    margin: 0;
}
.script-episode-add-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px;
    font-size: var(--fs-2xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.script-episode-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.script-episode-add-actions button {
    min-width: 88px;
    padding: 8px 14px;
    font-size: var(--fs-xs);
}

.script-episode-body {
    white-space: pre-wrap;
    margin: 0;
    line-height: 1.65;
}
.script-settings {
    min-height: 0;
    height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    overflow: auto;
    overflow-x: hidden;
    border-left: 1px solid var(--line);
    background: #141414;
    padding: 0;
}
.video-settings-panel {
    flex: 1 1 auto;
    min-height: 100%;
    padding: 14px 14px 18px;
}
.video-settings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    color: #fff;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.2;
    white-space: nowrap;
}
.video-settings-label::before {
    content: "";
    width: 3px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 2px;
    background: var(--accent);
}
.video-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 2px;
    padding: 2px 0 12px;
    border-bottom: 1px solid var(--line);
}
.video-settings-head strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
}
.video-settings-head strong::before {
    content: "";
    width: 3px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    background: var(--accent);
}
.video-settings-status {
    font-size: var(--fs-2xs);
    color: var(--muted);
}
.video-settings-status.ok { color: var(--ok); }
.video-settings-status.bad { color: var(--bad); }
.video-settings-block {
    display: grid;
    grid-template-columns: 4.7em minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.video-settings-block.video-narrator-voice,
.video-settings-block--style {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.video-settings-block:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.video-settings-block--model {
    align-items: center;
}
.video-settings-model-value {
    min-width: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #1c1c1c;
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-settings-panel .field-help {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
}
.video-settings-panel .choice {
    position: relative;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid transparent;
    background: #1c1c1c;
    color: #fff;
    box-shadow: none;
}
.video-settings-panel .choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.video-settings-panel .choice:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: #222;
}
.video-settings-panel .choice:has(input:checked) {
    border-color: var(--accent);
    background: #1c1c1c;
    box-shadow: none;
    color: #fff;
}
.choices-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
}
.choices-compact .choice {
    flex: unset;
    width: auto;
    margin: 0;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: start;
    column-gap: 0;
    row-gap: 1px;
    border-radius: 8px;
}
.choices-compact .choice span {
    grid-column: 1;
    grid-row: 1;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    color: inherit;
}
.choices-compact .choice small {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 10px;
    color: var(--muted);
    line-height: 1.2;
}
.choices-compact .choice:not(:has(small)) span {
    grid-row: 1 / -1;
}
.choices-compact .choice.is-saving {
    opacity: 0.6;
    cursor: wait;
}
.video-settings-panel .choices-pills {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
}
.video-settings-panel .choices-pills .choice {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    gap: 0;
}
.video-settings-panel .choices-pills .choice span {
    font-size: 11px;
    font-weight: 650;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.video-settings-panel .choices-pills .choice small {
    display: none;
}
.video-settings-panel .choices-styles {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: none;
    gap: 6px;
    width: 100%;
}
.video-settings-panel .choices-styles[hidden] {
    display: none !important;
}
.video-settings-panel .choices-styles .choice {
    flex: 0 0 auto;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
}
.video-settings-panel .choices-styles .choice span {
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}
.video-settings-panel .choices-styles .choice:has(input:checked) {
    background: #1c1c1c;
    border-color: var(--accent);
    box-shadow: none;
}
.video-settings-panel .choices-styles .choice:has(input:checked) span {
    color: #fff;
}
.video-settings-panel .choices-styles .choice--thumb,
.choice.choice--thumb {
    padding: 6px;
}
.video-settings-panel .choices-styles .choice--thumb span,
.choice.choice--thumb span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    white-space: normal;
}
.style-thumb {
    width: 64px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #111;
    display: block;
}
.style-ref {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.video-settings-style-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.style-ref-tabs {
    display: inline-flex;
    align-self: flex-end;
    padding: 0;
    gap: 6px;
    border: 0;
    background: transparent;
    border-radius: 0;
}
.style-ref-tab {
    appearance: none;
    border: 1px solid transparent;
    background: #1c1c1c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.style-ref-tab:hover {
    background: #222;
    color: #fff;
    transform: none;
    box-shadow: none;
}
.style-ref-tab.is-active {
    background: #1c1c1c;
    border-color: var(--accent);
    color: #fff;
}
.style-ref-tab.is-active:hover {
    background: #1c1c1c;
    color: #fff;
    transform: none;
    box-shadow: none;
}
.style-ref-wrap {
    min-width: 0;
    width: 100%;
}
.video-settings-panel .video-narrator-voice {
    margin: 0;
    gap: 10px;
}
.video-settings-voice-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.video-settings-panel .asset-voice-select {
    display: block;
    width: 100%;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 36px 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: #1c1c1c;
    background-image:
        radial-gradient(circle, #fff 0 5px, transparent 6px);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    box-shadow: none;
    cursor: pointer;
}
.video-settings-panel .asset-voice-select:hover,
.video-settings-panel .asset-voice-select:focus {
    border-color: rgba(255, 255, 255, 0.12);
    outline: none;
}
.video-settings-status.ok { font-weight: 600; }

/* Shot workspace — same light system as the product shell */
.workspace {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    min-height: 420px;
    height: calc(100dvh - 220px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.shot-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: var(--surface-2);
}
.shot-list-head {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
}
.shot-list-head input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-sm);
}
.shot-list-head .field-help {
    margin: 8px 0 0;
    font-size: var(--fs-2xs);
}
.shot-list-body { overflow: auto; flex: 1; }
.shot-row {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
}
.shot-row .shot-dl-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 4px;
    cursor: pointer;
}
.shot-row .shot-dl-pick input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.shot-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 14px 14px 14px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    align-items: center;
    box-shadow: none;
    transform: none;
}
.shot-item:hover { background: rgba(255, 255, 255, 0.04); filter: none; }
.shot-row:has(.shot-item.is-on) { background: var(--accent-soft); }
.shot-item.is-on {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}
.shot-item .no {
    color: var(--accent);
    font-family: var(--display);
    font-weight: 700;
    font-size: var(--fs-xs);
}
.shot-item .ttl { display: block; font-size: var(--fs-sm); line-height: 1.4; font-weight: 600; }
.shot-item small { display: block; color: var(--muted); font-size: var(--fs-2xs); font-weight: 400; margin-top: 2px; }
.shot-item .pill {
    white-space: nowrap;
    font-size: 10px;
    padding: 2px 7px;
}
.shot-dl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.shot-dl-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 500;
    cursor: pointer;
}
.shot-dl-all input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.shot-dl-bar .btn-light:disabled { opacity: 0.45; cursor: not-allowed; }
.shot-detail {
    min-height: 0;
    overflow: auto;
    padding: 24px 28px 32px;
    background: var(--surface);
}
.shot-detail .player {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: #12151c;
    border: 1px solid var(--line);
}
.shot-detail .player video {
    width: 100%;
    max-width: 100%;
    max-height: min(58vh, 560px);
    box-shadow: none;
}
.shot-detail .player:empty,
.shot-detail .player:not(:has(video)) {
    display: none;
}
.shot-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}
.shot-meta-grid div {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.shot-meta-grid small { display: block; color: var(--muted); font-size: var(--fs-2xs); margin-bottom: 2px; }
.shot-meta-grid div { font-size: var(--fs-sm); }
.shot-detail .note {
    box-shadow: none;
}
.shot-detail details.fold,
.shot-detail .shot-edit textarea,
.shot-detail textarea {
    background: var(--surface-2);
}
.shot-detail details.fold[open] {
    background: var(--surface-2);
}
.workspace .card-head h2,
.shot-detail h2,
.shot-detail .card-head {
    color: var(--ink);
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.check-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-weight: 500;
    cursor: pointer;
}
.check-row label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.check-row input { margin: 0; accent-color: var(--accent); }
.shot-edit { margin-top: 16px; }
input[type="number"] { max-width: 140px; }
.beat-fold { border-bottom: 1px solid var(--line); padding: 0; }
.beat-fold > summary {
    cursor: pointer;
    padding: 14px 4px;
    font-weight: 650;
    list-style: none;
}
.beat-fold > summary::-webkit-details-marker { display: none; }
.beat-fold .block { padding: 0 4px 16px; }
.form-grid { display: grid; gap: 18px; }
@media (min-width: 860px) {
    .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

button:disabled, .btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}
.btn-skill-gen.is-missing {
    background: var(--bad);
    box-shadow: 0 8px 20px rgba(194, 59, 59, 0.28);
}
.btn-skill-gen.is-missing:hover {
    background: #a83232;
    box-shadow: 0 10px 22px rgba(194, 59, 59, 0.32);
}
.btn-skill-gen.is-done,
.btn-skill-gen.is-done:disabled,
.btn-skill-gen:disabled.is-done {
    background: #b8bcc4;
    color: #fff;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
    filter: none;
}
#busy-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, 0.55);
    backdrop-filter: blur(8px);
}
#busy-mask.is-on { display: flex; }
.busy-box {
    width: min(400px, calc(100vw - 48px));
    max-width: 400px;
    margin: 20px;
    padding: 28px 32px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    text-align: center;
    box-sizing: border-box;
}
.busy-box .busy-count {
    margin: 0 0 8px;
    color: var(--accent);
    font-family: var(--display);
    font-size: var(--fs-xl);
    font-weight: 700;
}
.busy-spin {
    width: 32px;
    height: 32px;
    margin: 0 auto 14px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: busy-rotate 0.8s linear infinite;
}
.busy-box p { margin: 0; color: var(--ink); font-size: var(--fs-base); }
.busy-box #busy-text {
    min-height: 1.5em;
    word-break: break-word;
}
.busy-progress {
    margin: 0 0 14px;
    width: 100%;
}
.busy-progress-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}
.busy-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.25s ease;
}
.busy-progress-pct {
    margin: 8px 0 0 !important;
    color: var(--muted) !important;
    font-size: var(--fs-xs) !important;
    font-weight: 600;
}
@keyframes busy-rotate { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .app-shell,
    .app-shell.is-rail-collapsed {
        grid-template-columns: 1fr;
    }
    .app-rail {
        position: relative;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        padding: 16px 18px;
    }
    .app-shell.is-rail-collapsed .app-rail {
        display: none;
    }
    .app-rail::after { display: none; }
    .rail-head {
        flex-direction: row;
        align-items: center;
        margin: 0;
        gap: 10px;
        flex: 1;
    }
    .rail-brand {
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 0;
    }
    .rail-mark { margin: 0; width: 40px; height: 40px; }
    .rail-word { font-size: var(--fs-xl); }
    .rail-tag { display: none; }
    .rail-toggle { display: none; }
    .rail-toggle-open { display: inline-flex; }
    .app-shell.is-rail-collapsed .rail-toggle-open { display: inline-flex; }
    .app-shell:not(.is-rail-collapsed) .rail-toggle-open { display: none; }
    .rail-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
        justify-content: flex-end;
    }
    .rail-nav form { margin-top: 0; }
    .rail-foot { display: none; }
    .login-stage { grid-template-columns: 1fr; }
    .login-brand { min-height: 42vh; }
    .login-brand-copy h1 { max-width: none; font-size: clamp(36px, 9vw, 48px); }
}
@media (max-width: 960px) {
    .app-content, .app-content.wrap-wide { padding: 28px 18px 72px; }
    .app-content.wrap-fill { padding: 16px 18px 16px; }
    .app-top { padding: 14px 18px; }
    .pipeline { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    body.is-work-stage .app-shell {
        height: auto;
        overflow: visible;
    }
    body.is-work-stage .app-main {
        overflow: auto;
    }
    .app-content.wrap-fill {
        overflow: visible;
        height: auto;
    }
    .workspace { grid-template-columns: 1fr; height: auto; }
    .shot-list { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .shot-list-body { max-height: 32vh; }
    .shot-detail { max-height: none; padding: 18px 16px 24px; }
    .pane-scroll { max-height: none; min-height: 0; }
    .pane-story.card {
        height: auto;
        max-height: none;
    }
}

/* —— 智能分镜 —— */
.storyboard-pane.card.pane-scroll {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: auto;
    max-height: none;
    min-height: 0;
}
.storyboard-pane.card > .storyboard-workspace {
    border: 0;
    border-radius: inherit;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
.storyboard-workspace {
    grid-template-columns: var(--episode-rail) minmax(0, 1fr);
}
.storyboard-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.storyboard-main-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.storyboard-main-title {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    font-size: var(--fs-md);
    font-weight: 700;
}
.storyboard-episode-name {
    font-size: inherit;
    font-weight: 700;
}
.storyboard-episode-runtime {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.storyboard-main-meta {
    margin: 4px 0 0;
}
.storyboard-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#storyboard-beats-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#storyboard-beats-root[hidden] {
    display: none !important;
}
.storyboard-current {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.storyboard-current::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.storyboard-beat-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
}
.storyboard-beat-nav {
    flex: 0 0 auto;
    width: 32px;
    height: 108px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 22px;
    line-height: 1;
    box-shadow: none;
    transform: none;
}
.storyboard-beat-nav:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(212, 255, 51, 0.35);
    transform: none;
    box-shadow: none;
}
.storyboard-beat-nav[hidden] { display: none !important; }
.storyboard-beat-nav:disabled {
    opacity: 0.35;
    cursor: default;
    background: var(--surface);
    color: var(--muted);
    transform: none;
    box-shadow: none;
}
.storyboard-beat-dock {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 2px 0 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}
.storyboard-beat-dock::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}
.storyboard-beat-dock.is-dragging {
    cursor: grabbing;
    user-select: none;
}
.storyboard-beat-dock.is-dragging * {
    user-select: none;
}
.storyboard-beat-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    width: max-content;
    min-height: 132px;
    padding: 2px 4px;
}
.storyboard-beat-insert {
    flex: 0 0 auto;
    align-self: stretch;
    width: 10px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.storyboard-beat-insert-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 100%;
    border-radius: 999px;
    background: #3a3a36;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.16s var(--ease), color 0.16s var(--ease), width 0.16s var(--ease);
}
.storyboard-beat-insert:hover .storyboard-beat-insert-mark,
.storyboard-beat-insert:focus-visible .storyboard-beat-insert-mark {
    background: var(--accent);
    color: var(--accent-ink);
    width: 10px;
}
.storyboard-beat-insert:disabled {
    cursor: default;
    opacity: 0.55;
}
.storyboard-beat-tab-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 196px;
}
.storyboard-beat-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    height: 128px;
    margin: 0;
    padding: 14px 14px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink);
    text-align: left;
    cursor: grab;
    box-shadow: none;
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
.storyboard-beat-tab:hover {
    border-color: rgba(212, 255, 51, 0.55);
    background: #1a1f10;
    color: var(--ink);
    transform: none;
    filter: none;
    box-shadow: none;
}
.storyboard-beat-tab.is-active:hover {
    border-color: var(--accent);
    background: #14180a;
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.35), var(--glow);
}
.storyboard-beat-tab.is-active {
    border-color: var(--accent);
    background: #14180a;
    box-shadow: 0 0 0 1px rgba(212, 255, 51, 0.35), var(--glow);
}
.storyboard-beat-tab strong {
    font-size: var(--fs-md);
    font-weight: 750;
    letter-spacing: 0.02em;
}
.storyboard-beat-tab p {
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    font-size: var(--fs-2xs);
    line-height: 1.5;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.storyboard-beat-tab-meta {
    font-size: 10px;
    color: var(--muted);
    font-weight: 650;
}
.storyboard-beat-tab-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.storyboard-beat-tab-wrap:hover .storyboard-beat-tab-delete,
.storyboard-beat-tab-wrap:focus-within .storyboard-beat-tab-delete {
    opacity: 1;
}
.storyboard-beat-tab-delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ffb4b4;
}
.storyboard-empty {
    margin: 0;
    padding: 28px 8px 32px;
    text-align: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.storyboard-empty[hidden] {
    display: none !important;
}
.storyboard-empty .note {
    margin: 0;
}
.storyboard-empty-generate {
    margin: 0;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
}
.storyboard-empty-generate:hover {
    filter: brightness(1.06);
}
.storyboard-empty-generate[hidden] {
    display: none !important;
}
.storyboard-beat {
    margin-bottom: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.storyboard-beat-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.storyboard-beat-head strong {
    flex-shrink: 0;
    color: var(--accent);
    font-size: var(--fs-sm);
    font-weight: 700;
}
.storyboard-beat-summary {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: var(--fs-xs);
    line-height: 1.55;
    color: var(--ink-soft);
}
.storyboard-beat-summary.storyboard-editable {
    cursor: text;
}
.storyboard-beat-summary .storyboard-cell {
    min-height: 2.6em;
}
.storyboard-beat-summary-placeholder {
    color: var(--muted);
}
.storyboard-beat-summary.is-editing .storyboard-cell-input {
    position: relative;
    inset: auto;
    min-height: 3.2em;
    height: auto;
    resize: vertical;
}
.storyboard-table-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.storyboard-table-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.storyboard-table {
    width: max(100%, 1180px);
    min-width: 1180px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: var(--fs-2xs);
}
.storyboard-table th,
.storyboard-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.storyboard-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 650;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.storyboard-table tbody tr:hover td {
    background: rgba(16, 185, 129, 0.04);
}
.storyboard-table th:nth-child(1),
.storyboard-table td:nth-child(1) { width: 5%; }
.storyboard-table th:nth-child(2),
.storyboard-table td:nth-child(2) { width: 8%; }
.storyboard-table th:nth-child(3),
.storyboard-table td:nth-child(3) { width: 5%; }
.storyboard-table th:nth-child(4),
.storyboard-table td:nth-child(4) { width: 6%; }
.storyboard-table th:nth-child(5),
.storyboard-table td:nth-child(5) { width: 6%; }
.storyboard-table th:nth-child(6),
.storyboard-table td:nth-child(6) { width: 6%; }
.storyboard-table th:nth-child(7),
.storyboard-table td:nth-child(7) { width: 18%; }
.storyboard-table th:nth-child(8),
.storyboard-table td:nth-child(8) { width: 8%; }
.storyboard-table th:nth-child(9),
.storyboard-table td:nth-child(9) { width: 16%; }
.storyboard-table th:nth-child(10),
.storyboard-table td:nth-child(10),
.storyboard-col-duration {
    width: 5%;
    min-width: 4.5rem;
    text-align: center;
    white-space: nowrap;
}
.storyboard-table th:nth-child(11),
.storyboard-table td:nth-child(11),
.storyboard-col-actions {
    width: 4%;
    min-width: 2.5rem;
}
.storyboard-col-code {
    font-weight: 700;
    color: var(--accent);
}
.storyboard-col-desc,
.storyboard-col-dialogue {
    line-height: 1.5;
}
.storyboard-cue-empty {
    color: var(--muted);
}
.storyboard-cue-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin: 0 0 6px;
    font-size: var(--fs-2xs);
}
.storyboard-cue-chip:last-child {
    margin-bottom: 0;
}
.storyboard-cue-chip .storyboard-cue-type,
.storyboard-cue-chip em {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-style: normal;
    font-size: 11px;
    line-height: 1.6;
}
.storyboard-cue-chip q {
    quotes: none;
    color: var(--ink);
}
.storyboard-cues-editor {
    display: none;
}
.storyboard-cues-cell.is-editing {
    z-index: 8;
}
.storyboard-cues-cell.is-editing .storyboard-cues-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    z-index: 80;
    min-width: 320px;
    width: max(100%, 320px);
    max-height: min(70vh, 520px);
    padding: 8px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}
.storyboard-cue-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg, var(--surface));
}
.storyboard-cue-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
}
.storyboard-cue-toolbar select {
    flex: 1;
    min-width: 0;
}
.storyboard-cue-input {
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-2xs);
    box-sizing: border-box;
}
.storyboard-cue-input[data-cue-field="speakers"] {
    min-height: 32px;
}
.storyboard-cue-input[data-cue-field="speakers"][multiple] {
    min-height: 72px;
    padding: 4px 6px;
}
    resize: vertical;
    min-height: 48px;
}
button.storyboard-cue-remove,
button.storyboard-cue-add {
    appearance: none;
    margin: 0;
    box-shadow: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transform: none;
    filter: none;
}
button.storyboard-cue-remove,
button.storyboard-cue-remove:hover,
button.storyboard-cue-remove:focus-visible {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    box-shadow: none;
    transform: none;
}
button.storyboard-cue-remove:hover,
button.storyboard-cue-remove:focus-visible {
    border-color: rgba(229, 115, 115, 0.55);
    background: rgba(255, 107, 107, 0.12);
    color: #ffb4b4;
}
button.storyboard-cue-add,
button.storyboard-cue-add:hover,
button.storyboard-cue-add:focus-visible {
    width: 100%;
    gap: 6px;
    padding: 7px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: var(--fs-2xs);
    box-shadow: none;
    transform: none;
}
button.storyboard-cue-add:hover,
button.storyboard-cue-add:focus-visible {
    border-color: var(--accent);
    border-style: dashed;
    background: var(--accent-soft);
    color: var(--accent);
}
.storyboard-cue-actions {
    display: flex;
    width: 100%;
}
.storyboard-col-actions {
    text-align: center;
}
.storyboard-row-delete {
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.storyboard-row-delete:hover {
    border-color: #e57373;
    background: rgba(255, 107, 107, 0.12);
    color: #ffb4b4;
}
.storyboard-mention {
    display: inline;
    padding: 0 4px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.storyboard-editable {
    position: relative;
    cursor: text;
    min-width: 0;
}
.storyboard-cell {
    position: relative;
    min-height: calc(1.45em + 14px);
}
.storyboard-cell-view {
    display: block;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 0 0 2px transparent;
    box-sizing: border-box;
}
.storyboard-cell-input {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-2xs);
    line-height: 1.45;
    resize: none;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.storyboard-editable:hover .storyboard-cell-input,
.storyboard-editable.is-editing .storyboard-cell-input {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
.storyboard-editable:hover:not(.storyboard-cues-cell) .storyboard-cell-view,
.storyboard-editable.is-editing .storyboard-cell-view {
    visibility: hidden;
}
.storyboard-editable.is-editing .storyboard-cell-input {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
    resize: vertical;
    min-height: 100%;
    height: auto;
}
.storyboard-editable.is-saving .storyboard-cell-input {
    opacity: 1;
    pointer-events: none;
}
.storyboard-editable.is-saving .storyboard-cell-view {
    visibility: hidden;
}
.storyboard-editable.is-saved .storyboard-cell-input {
    border-color: #66bb6a;
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.18);
}
.storyboard-add-shot {
    display: block;
    width: calc(100% - 24px);
    margin: 12px auto 14px;
    padding: 10px 16px;
    border: 1px solid var(--accent-btn-border);
    border-radius: 999px;
    background: var(--accent-btn-bg);
    color: var(--accent);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.storyboard-add-shot:hover {
    color: var(--accent);
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    filter: none;
    transform: none;
}
.storyboard-generate-all {
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.storyboard-generate-all:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.storyboard-generate-all:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.storyboard-generate-panels {
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
.storyboard-generate-panels:hover:not(:disabled) {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
}
.storyboard-generate-panels:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--muted);
}
.storyboard-retry-failed-panels {
    padding: 8px 14px;
    border: 1px solid var(--warn);
    border-radius: 10px;
    background: var(--surface);
    color: var(--warn);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
}
.storyboard-retry-failed-panels:hover:not(:disabled) {
    background: var(--warn);
    color: #fff;
}
.storyboard-retry-failed-panels:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.storyboard-retry-failed-panels.is-generating,
.work-stepper-bar .storyboard-retry-failed-panels.is-generating,
.work-toolbar .storyboard-retry-failed-panels.is-generating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
    pointer-events: none;
    cursor: wait;
}
.storyboard-retry-failed-panels.is-generating::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(13, 13, 13, 0.22);
    border-top-color: var(--accent-ink, #111);
    animation: busy-rotate 0.8s linear infinite;
    flex-shrink: 0;
}
.storyboard-generate-panels:disabled,
.work-stepper-bar .storyboard-generate-panels:disabled,
.work-toolbar .storyboard-generate-panels:disabled {
    pointer-events: none;
}
.storyboard-retry-failed-panels[hidden] {
    display: none !important;
}

.story-panel-pane.card.pane-scroll {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: auto;
    max-height: none;
    min-height: 0;
}
.app-content.wrap-fill .story-panel-pane.card {
    flex: 1 1 0%;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
}
.story-panel-pane.card > .story-panel-workspace {
    border: 0;
    border-radius: inherit;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
.story-panel-workspace {
    display: grid;
    grid-template-columns: var(--episode-rail) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    height: 100%;
}
.story-panel-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
    position: relative;
    padding: 0;
}
.story-panel-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: minmax(0, 1fr);
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    height: 100%;
}
.story-panel-stage-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: #101010;
}
.story-panel-blank {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #12151a;
    color: #fff;
    text-align: center;
    padding: 32px 24px;
}
.story-panel-blank[hidden] {
    display: none !important;
}
.story-panel-blank-copy h2 {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #fff;
}
.story-panel-blank-copy p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: var(--fs-sm);
}
.story-panel-blank-generate {
    margin: 22px 0 0;
    padding: 10px 22px;
    border: 0;
    border-radius: 8px;
    background: #2b3038;
    color: #fff;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
}
.story-panel-blank-generate:hover {
    background: #353b45;
}
.story-panel-preview-zone {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 18px 10px;
    background: #101010;
}
.story-panel-stage {
    position: relative;
    flex: 1 1 0%;
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-color: #1a1d24;
    border: 1px solid rgba(255, 186, 80, 0.18);
}
.story-panel-stage-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
}
.story-panel-stage-player {
    position: relative;
    width: 100%;
    height: 100%;
}
.story-panel-stage-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.story-panel-stage-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}
.story-panel-stage-placeholder span,
.story-panel-stage-placeholder .story-panel-stage-generate {
    padding: 8px 18px;
    border-radius: 8px;
    background: rgba(255, 160, 60, 0.15);
    color: #ffb347;
    font-size: var(--fs-sm);
    font-weight: 700;
    border: 1px solid rgba(255, 179, 71, 0.45);
}
.story-panel-stage-placeholder .story-panel-stage-generate {
    cursor: pointer;
    appearance: none;
    font: inherit;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.story-panel-stage-placeholder .story-panel-stage-generate:hover:not(:disabled) {
    background: rgba(255, 160, 60, 0.28);
    border-color: rgba(255, 179, 71, 0.75);
}
.story-panel-stage-placeholder .story-panel-stage-generate:disabled {
    opacity: 0.65;
    cursor: wait;
}
.story-panel-stage-placeholder .story-panel-stage-generating {
    border-color: transparent;
    cursor: default;
}
.story-panel-clip-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #171717;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 650;
}
.story-panel-clip-meta[hidden] { display: none !important; }
.story-panel-clip-meta span:first-child {
    color: var(--accent);
}
.story-panel-scene-bar {
    flex: 0 0 auto;
    min-width: 0;
    max-height: 88px;
    overflow: auto;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #171717;
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
    line-height: 1.65;
}
.story-panel-scene-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.story-panel-scene-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}
.story-panel-scene-label {
    display: block;
    color: var(--muted);
    font-size: var(--fs-2xs);
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 auto 0 0;
}
.story-panel-scene-override {
    color: var(--accent);
    font-size: var(--fs-2xs);
    font-weight: 650;
}
.story-panel-regen-btn {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-2xs);
    font-weight: 650;
    cursor: pointer;
    opacity: 1;
    box-shadow: none;
    transform: none;
}
.story-panel-regen-btn:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
}
.story-panel-regen-btn[hidden] { display: none !important; }
.story-panel-delete-btn {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid rgba(181, 70, 70, 0.35);
    border-radius: 8px;
    background: var(--surface);
    color: #ffb4b4;
    font: inherit;
    font-size: var(--fs-2xs);
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.story-panel-delete-btn:hover {
    background: #b54646;
    border-color: #b54646;
    color: #fff;
}
.story-panel-delete-btn[hidden] { display: none !important; }
.story-panel-delete-btn:disabled {
    opacity: 0.55;
    cursor: default;
}
.story-panel-scene-override[hidden] { display: none !important; }
.story-panel-scene-text {
    margin: 0;
    display: block;
    color: var(--ink-soft);
    word-break: break-word;
    white-space: pre-wrap;
}
.story-panel-scene-empty {
    color: var(--muted);
}
.story-panel-inspector {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #141414;
    padding: 16px 16px 16px;
}
.story-panel-inspector-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 12px;
}
.story-panel-inspector-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.story-panel-inspector-scroll::-webkit-scrollbar {
    width: 6px;
}
.story-panel-inspector-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 99px;
}
.story-panel-inspector-head strong {
    display: block;
    font-size: var(--fs-md);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.story-panel-inspector-style {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-2xs);
}
.story-panel-inspector-section {
    margin-bottom: 14px;
}
.story-panel-inspector .story-panel-regen-prompt {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.story-panel-inspector .story-panel-prompt-view {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #1a1a1a;
    color: var(--ink-soft);
    font-size: var(--fs-sm);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    cursor: pointer;
}
.story-panel-inspector .story-panel-prompt-view:hover {
    border-color: rgba(212, 255, 51, 0.35);
}
.story-panel-inspector .story-panel-prompt-view .story-panel-scene-empty {
    color: var(--muted);
}
.story-panel-inspector-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.story-panel-inspector-label-row label {
    margin: 0;
}
.story-panel-inspector-save {
    height: 30px;
    padding: 0 10px;
    min-width: 0;
    font-size: var(--fs-2xs);
}
.story-panel-inspector-edit {
    height: 28px;
    padding: 0 10px;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-2xs);
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.story-panel-inspector-edit:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: rgba(212, 255, 51, 0.38);
    color: var(--accent);
    box-shadow: none;
    filter: none;
    transform: none;
}
.story-panel-inspector-edit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.story-panel-inspector .story-panel-regen-board {
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    margin-bottom: 0;
}
.story-panel-inspector-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.story-panel-inspector-model {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.story-panel-inspector-model span {
    color: var(--muted);
    font-size: var(--fs-2xs);
}
.story-panel-inspector-model strong {
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.story-panel-duration-row {
    margin-bottom: 12px;
}
.story-panel-duration-field {
    display: block;
}
.story-panel-duration-field select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #171717;
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 650;
}
.story-panel-duration-field select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.story-panel-inspector .story-panel-regen-btn {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--accent-btn-border);
    border-radius: 12px;
    background: var(--accent-btn-bg);
    color: var(--accent);
    font-size: var(--fs-sm);
    font-weight: 650;
    box-shadow: none;
}
.story-panel-inspector .story-panel-regen-btn:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
}
.story-panel-gallery-zone {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    padding: 10px 18px 12px;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border-top: 1px solid var(--line);
}
.story-panel-gallery-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 8px;
}
.story-panel-gallery-head {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}
.story-panel-gallery-head strong {
    font-size: var(--fs-sm);
    font-weight: 650;
    color: var(--ink);
    letter-spacing: 0.02em;
}
.story-panel-gallery-meta {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 500;
}
.story-panel-gallery-actions {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}
.story-panel-continue-btn,
.story-panel-stop-btn {
    padding: 7px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.story-panel-continue-btn {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}
.story-panel-continue-btn:hover,
.story-panel-continue-btn:focus-visible,
.story-panel-continue-btn:active {
    background: var(--accent-soft);
    border-color: rgba(212, 255, 51, 0.38);
    color: var(--accent);
    box-shadow: none;
    filter: none;
    transform: none;
}
.story-panel-stop-btn {
    border: 1px solid rgba(194, 59, 59, 0.22);
    background: rgba(194, 59, 59, 0.08);
    color: var(--bad);
}
.story-panel-stop-btn:hover {
    background: rgba(194, 59, 59, 0.14);
    color: #a93232;
    border-color: rgba(194, 59, 59, 0.34);
}
.story-panel-batch-btn {
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
}
.story-panel-batch-btn:not(:disabled) {
    cursor: pointer;
    opacity: 1;
    background: var(--accent-soft);
    border-color: rgba(212, 255, 51, 0.28);
    color: var(--accent);
}
.story-panel-batch-btn:not(:disabled):hover,
.story-panel-batch-btn:not(:disabled):focus-visible,
.story-panel-batch-btn:not(:disabled):active {
    background: rgba(212, 255, 51, 0.18);
    border-color: rgba(212, 255, 51, 0.48);
    color: var(--accent);
    box-shadow: none;
    filter: none;
    transform: none;
}
.story-panel-download-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
}
.story-panel-download-btn:not(:disabled) {
    cursor: pointer;
    opacity: 1;
    color: var(--accent);
    border-color: rgba(212, 255, 51, 0.35);
    background: var(--accent-soft);
}
.story-panel-download-btn:not(:disabled):hover {
    filter: brightness(0.98);
}
.story-panel-gallery-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.story-panel-gallery-nav {
    flex: 0 0 auto;
    width: 32px;
    height: 88px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 22px;
    line-height: 1;
    box-shadow: none;
    transform: none;
}
.story-panel-gallery-nav:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(212, 255, 51, 0.35);
    transform: none;
}
.story-panel-gallery-nav[hidden] { display: none !important; }
.story-panel-gallery-nav:disabled {
    opacity: 0.35;
    cursor: default;
    background: var(--surface);
    color: var(--muted);
    transform: none;
}
.story-panel-gallery-scroll {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 4px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 18, 24, 0.28) transparent;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}
.story-panel-gallery-scroll.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.story-panel-gallery-scroll::-webkit-scrollbar {
    height: 8px;
}
.story-panel-gallery-scroll::-webkit-scrollbar-thumb {
    background: rgba(16, 18, 24, 0.22);
    border-radius: 999px;
}
.story-panel-gallery {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
    width: max-content;
    min-height: 166px;
    padding: 4px;
}
.story-panel-insert {
    flex: 0 0 auto;
    align-self: flex-start;
    width: 10px;
    height: 164px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.story-panel-insert-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 100%;
    border-radius: 999px;
    background: #9eb0ad;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: background 0.16s var(--ease), color 0.16s var(--ease), width 0.16s var(--ease);
}
.story-panel-insert:hover .story-panel-insert-mark,
.story-panel-insert:focus-visible .story-panel-insert-mark {
    background: var(--accent);
    color: #fff;
    width: 10px;
}
.story-panel-insert:disabled {
    cursor: default;
    opacity: 0.55;
}
.story-panel-insert:disabled .story-panel-insert-mark {
    width: 8px;
    background: #c5cecc;
    color: #6a807c;
}
.story-panel-thumb-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.story-panel-thumb-delete {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(16, 18, 24, 0.72);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translate(35%, -35%);
    transition: opacity 0.16s var(--ease), background 0.16s var(--ease);
}
.story-panel-thumb-wrap:hover .story-panel-thumb-delete,
.story-panel-thumb-wrap:focus-within .story-panel-thumb-delete {
    opacity: 1;
    pointer-events: auto;
}
.story-panel-thumb-delete:hover {
    background: #b54646;
}
.story-panel-thumb-delete:disabled {
    opacity: 0.45;
    cursor: default;
}
.story-panel-gallery .story-panel-thumb {
    flex: 0 0 auto;
    width: 112px !important;
    min-width: 112px;
    max-width: 112px;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 !important;
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
    font: inherit;
    font-weight: 500;
    font-size: var(--fs-xs);
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    appearance: none;
    box-shadow: none !important;
    transform: none;
    scroll-snap-align: start;
}
.story-panel-gallery .story-panel-thumb:hover {
    background: transparent !important;
    transform: translateY(-2px);
    filter: none;
    box-shadow: none !important;
}
.story-panel-gallery .story-panel-thumb.is-active {
    transform: translateY(-3px);
}
.story-panel-thumb-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    flex-shrink: 0;
    border-radius: 14px;
    padding: 4px;
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    box-shadow: 0 6px 18px rgba(16, 18, 24, 0.06);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.story-panel-gallery .story-panel-thumb:hover .story-panel-thumb-card {
    border-color: rgba(212, 255, 51, 0.35);
    box-shadow: 0 10px 24px rgba(16, 18, 24, 0.1);
}
.story-panel-gallery .story-panel-thumb.is-active .story-panel-thumb-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 28px rgba(212, 255, 51, 0.14);
}
.story-panel-thumb-poster {
    position: relative;
    width: 100%;
    height: 118px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(165deg, #313843 0%, #171b22 55%, #10141a 100%);
}
.story-panel-thumb-poster.is-pending {
    background: linear-gradient(165deg, #3a3428 0%, #1f1b16 55%, #14110e 100%);
}
.story-panel-thumb-poster.is-ready-skill {
    background: linear-gradient(165deg, #2a3d4f 0%, #162029 55%, #10161c 100%);
}
.story-panel-thumb-poster.is-queued {
    background: linear-gradient(165deg, #343a45 0%, #1a1f28 55%, #12161d 100%);
}
.story-panel-thumb-poster.is-rendering {
    background: linear-gradient(165deg, #2a3f66 0%, #162238 55%, #101722 100%);
}
.story-panel-thumb-poster.is-done {
    background: linear-gradient(165deg, #274532 0%, #15241b 55%, #101814 100%);
}
.story-panel-thumb-poster.is-failed {
    background: linear-gradient(165deg, #4a2d2d 0%, #241515 55%, #181010 100%);
}
.story-panel-thumb-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.45;
    pointer-events: none;
}
.story-panel-thumb-poster:has(.story-panel-thumb-video)::before {
    display: none;
}
.story-panel-thumb-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    pointer-events: none;
}
}
.story-panel-thumb-index {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.94);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-align: center;
}
.story-panel-thumb-play,
.story-panel-thumb-icon {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    z-index: 2;
}
.story-panel-thumb-spinner {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #8ec0ff;
    animation: story-panel-spin 0.9s linear infinite;
}
@keyframes story-panel-spin {
    to { transform: rotate(360deg); }
}
.story-panel-thumb-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.story-panel-thumb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.story-panel-thumb-status.is-pending {
    background: #f8f1e7;
    color: #9a6a1f;
}
.story-panel-thumb-status.is-pending .story-panel-thumb-status-dot { background: #d6a24b; }
.story-panel-thumb-status.is-ready-skill {
    background: #edf6fc;
    color: #2d6f9b;
}
.story-panel-thumb-status.is-ready-skill .story-panel-thumb-status-dot { background: #5aa6d6; }
.story-panel-thumb-status.is-queued {
    background: #f2f4f8;
    color: #5a6475;
}
.story-panel-thumb-status.is-queued .story-panel-thumb-status-dot { background: #8b95a5; }
.story-panel-thumb-status.is-rendering {
    background: #edf2ff;
    color: #2f5fbf;
}
.story-panel-thumb-status.is-rendering .story-panel-thumb-status-dot {
    background: #4f86ff;
    animation: story-panel-pulse 1.2s ease-in-out infinite;
}
.story-panel-thumb-status.is-done {
    background: #e8f7ee;
    color: #1f7a45;
}
.story-panel-thumb-status.is-done .story-panel-thumb-status-dot { background: #2f9d58; }
.story-panel-thumb-status.is-failed {
    background: #fdeeee;
    color: #b33a3a;
}
.story-panel-thumb-status.is-failed .story-panel-thumb-status-dot { background: #d9534f; }
@keyframes story-panel-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.72; }
}
.story-panel-thumb-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 0 2px;
    min-width: 0;
}
.story-panel-thumb-label {
    display: block;
    font-size: 12px;
    font-weight: 650;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.story-panel-thumb-duration {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.story-panel-thumb-media,
.story-panel-thumb-badge,
.story-panel-thumb-no,
.story-panel-thumb-gap,
.story-panel-thumb-actions {
    display: none !important;
}

.story-panel-regen-mask {
    position: fixed;
    inset: 0;
    z-index: 92;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 22, 28, 0.46);
    backdrop-filter: blur(4px);
}
.story-panel-regen-mask[hidden] { display: none !important; }
body.is-story-panel-regen-open { overflow: hidden; }
.story-panel-regen-dialog {
    width: min(980px, 100%);
    max-height: min(90vh, 760px);
    display: flex;
    flex-direction: column;
    padding: 18px 20px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
}
.story-panel-regen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.story-panel-regen-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
}
.story-panel-regen-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    box-shadow: none;
    transform: none;
}
.story-panel-regen-close:hover {
    background: var(--surface-2);
    color: var(--ink);
    transform: none;
}
.story-panel-regen-body {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
    gap: 16px;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
}
.story-panel-regen-board,
.story-panel-regen-prompt {
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.story-panel-regen-prompt {
    position: relative;
}
.story-panel-inspector .storyboard-mention,
.story-panel-regen-dialog .storyboard-mention {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-weight: inherit;
}
.story-panel-mention-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 6;
    max-height: 240px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #141414;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.story-panel-mention-menu[hidden] {
    display: none !important;
}
.story-panel-mention-empty {
    margin: 0;
    padding: 10px 12px;
    color: var(--muted);
    font-size: var(--fs-xs);
}
.story-panel-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.story-panel-mention-item:hover,
.story-panel-mention-item.is-active,
.story-panel-mention-item:hover:not(:disabled),
.story-panel-mention-item.is-active:hover {
    background: #222;
    color: var(--ink);
    box-shadow: none;
    filter: none;
    transform: none;
}
.story-panel-mention-thumb {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 8px;
    background: #1a1a1a;
    display: grid;
    place-items: center;
}
.story-panel-mention-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-panel-mention-ph {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #3a3a3a;
}
.story-panel-mention-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.story-panel-mention-type {
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}
.story-panel-regen-board {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    overflow: auto;
}
.story-panel-regen-board h4 {
    margin: 0 0 10px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.story-panel-regen-summary {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.story-panel-regen-summary[hidden] { display: none !important; }
.story-panel-regen-board-list {
    display: grid;
    gap: 10px;
}
.story-panel-regen-shot {
    padding: 10px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.story-panel-regen-shot header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.story-panel-regen-shot header strong {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--ink);
}
.story-panel-regen-shot header span {
    color: var(--muted);
    font-size: var(--fs-2xs);
}
.story-panel-regen-dl {
    margin: 0;
    display: grid;
    gap: 10px;
}
.story-panel-regen-dl > div {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    align-items: start;
}
.story-panel-regen-dl > div.is-block {
    grid-template-columns: 1fr;
    gap: 4px;
}
.story-panel-regen-dl dt {
    color: var(--muted);
    font-size: var(--fs-2xs);
    font-weight: 650;
}
.story-panel-regen-dl dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.story-panel-regen-prompt label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--ink);
}
.story-panel-regen-prompt textarea {
    flex: 1 1 auto;
    min-height: 220px;
    width: 100%;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #111;
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-sm);
    line-height: 1.6;
}
.story-panel-regen-prompt textarea:focus {
    outline: none;
    border-color: rgba(212, 255, 51, 0.42);
}
.story-panel-regen-prompt .field-help {
    margin: 8px 0 0;
}
.story-panel-regen-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.story-panel-regen-foot button {
    min-width: 112px;
    padding: 8px 14px;
    font-size: var(--fs-xs);
}
.story-panel-regen-foot .btn {
    border: 1px solid var(--accent-btn-border);
    background: var(--accent-btn-bg);
    color: var(--accent);
    box-shadow: none;
    font-weight: 650;
}
.story-panel-regen-foot .btn:hover {
    background: var(--accent-btn-hover-bg);
    border-color: var(--accent-btn-hover-border);
    color: var(--accent);
    transform: none;
    filter: none;
    box-shadow: none;
}
.story-panel-regen-foot .btn-light:hover {
    background: var(--surface-2);
    border-color: rgba(212, 255, 51, 0.38);
    color: var(--accent);
    transform: none;
    filter: none;
}

@media (max-width: 960px) {
    .script-workspace {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 520px;
    }
    .script-episodes {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 220px;
    }
    .script-settings {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
    .story-panel-workspace {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 520px;
    }
    .story-panel-body {
        grid-template-columns: 1fr;
    }
    .story-panel-stage-col {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        min-height: 520px;
    }
    .story-panel-preview-zone {
        min-height: 240px;
    }
    .story-panel-stage {
        min-height: 220px;
    }
    .story-panel-inspector {
        max-height: none;
    }
    .story-panel-inspector-scroll {
        max-height: min(52vh, 560px);
    }
    .story-panel-inspector .story-panel-prompt-view {
        min-height: 180px;
    }
    .story-panel-regen-body {
        grid-template-columns: 1fr;
    }
    .story-panel-regen-dialog {
        max-height: min(92vh, 860px);
    }
}
@media (max-width: 720px) {
    .pipeline, .path-switch, .record-card, .record-main { grid-template-columns: 1fr; }
    .record-meta { justify-content: flex-start; }
    .card { padding: 22px 18px; }
    h1 { font-size: var(--fs-2xl); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* —— C级英雄 theme extras —— */
.brand-mark svg,
.rail-mark svg { width: 28px; height: 28px; display: block; }
.rail-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.rail-ico svg { width: 18px; height: 18px; display: block; }
.rail-label { min-width: 0; }
.app-shell.is-rail-collapsed .rail-label,
.app-shell.is-rail-collapsed .rail-user-name,
.app-shell.is-rail-collapsed .rail-user-credits {
    display: none;
}
.app-shell.is-rail-collapsed .rail-user { justify-content: center; }
.app-shell.is-rail-collapsed .rail-brand {
    justify-content: center;
}

.kicker { color: var(--accent); }

.create-page {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 40px;
}
.create-page-title {
    width: min(920px, 100%);
    margin: 0 0 18px;
    font-size: var(--fs-xl);
    font-weight: 700;
    color: #fff;
}
.create-modal {
    width: min(920px, 100%);
    padding: 36px 36px 28px;
    border-radius: 22px;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid var(--line);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 60px rgba(212, 255, 51, 0.08);
    position: relative;
}
.create-modal h1 {
    margin: 0 0 22px;
    font-size: var(--fs-3xl);
}
.create-modal label { color: var(--accent); font-weight: 700; }
.create-modal input[type="text"],
.create-modal textarea {
    border-color: rgba(212, 255, 51, 0.45);
    background: #111;
    border-radius: 999px;
}
.create-modal textarea {
    border-radius: 18px;
    min-height: 280px;
}
.create-modal .actions {
    justify-content: center;
    margin-top: 28px;
}
.create-modal .actions button {
    min-width: 220px;
    padding: 14px 36px;
    font-size: var(--fs-md);
}
.create-modal .path-switch {
    gap: 10px;
    margin-bottom: 18px;
}
.create-modal .path-card {
    padding: 14px 16px;
}

.home-stage {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 0 48px;
}
.home-hero {
    margin-bottom: 48px;
}
.home-hero .brand-mark {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
}
.home-hero .brand-mark svg { width: 36px; height: 36px; }
.home-kicker {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: var(--fs-sm);
}
.home-hero h1 {
    font-size: clamp(28px, 3.6vw, 44px);
    margin-bottom: 12px;
}
.home-motto {
    margin: 0 0 10px;
    font-size: clamp(18px, 2.2vw, 26px);
    font-weight: 700;
    background: linear-gradient(90deg, #d4ff33, #ffe14a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.home-sub {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: var(--fs-md);
}
.home-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.home-ctas .btn {
    padding: 12px 22px;
}
.home-ctas .btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: none;
}
.home-ctas .btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.home-privileges {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.home-priv {
    padding: 22px 16px 18px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
}
.home-priv-ico {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(212, 255, 51, 0.28);
}
.home-priv-ico svg { width: 22px; height: 22px; }
.home-priv strong {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-sm);
}
.home-priv p {
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-2xs);
    line-height: 1.5;
}

.guide-list {
    display: grid;
    gap: 12px;
    max-width: 760px;
}
.guide-step {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.guide-step b {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: var(--fs-md);
}
.guide-step h2 {
    margin: 0 0 4px;
    font-size: var(--fs-md);
}
.guide-step p {
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-sm);
}

.asset-item.is-selected,
.asset-item.is-on {
    border-color: var(--accent-btn-border);
    box-shadow: 0 0 0 1px var(--accent-btn-border);
    background: var(--accent-btn-bg);
}

@media (max-width: 960px) {
    .home-privileges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-stage { grid-template-columns: 1fr; }
    .login-brand { padding-bottom: 0; min-height: auto; }
    .login-form-side { padding-top: 12px; }
    .work-stepper-bar {
        border-radius: 18px;
        padding: 10px 12px;
    }
}
@media (max-width: 720px) {
    .home-privileges { grid-template-columns: 1fr; }
    .create-modal { padding: 22px 18px; }
}

/* Membership / payment */
.member-page { max-width: 1080px; margin: 0 auto; padding: 28px 18px 64px; }
.member-hero { margin-bottom: 28px; }
.member-kicker {
    margin: 0 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.member-hero h1 {
    margin: 0 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.15;
}
.member-sub { margin: 0; color: var(--muted); max-width: 42rem; }
.member-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.member-stat {
    min-width: 140px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}
.member-stat span { display: block; font-size: 12px; color: var(--muted); }
.member-stat strong {
    display: block;
    margin-top: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
}
.member-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 22px;
}
.member-tabs button {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
}
.member-tabs button:hover {
    transform: none;
    filter: none;
    background: rgba(255, 255, 255, 0.04);
}
.member-tabs button.is-active {
    background: var(--accent-btn-bg);
    border-color: var(--accent-btn-border);
    color: var(--accent);
}
.member-panel h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}
.member-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.member-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 16px 16px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.member-card h3 { margin: 0; font-size: 1.05rem; }
.member-points {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}
.member-points small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.member-price {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.member-hint, .member-desc { margin: 0; color: var(--muted); font-size: 13px; }
.member-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
}
.member-period {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 8px;
    font-size: 13px;
}
.member-card .btn { margin-top: auto; width: 100%; }

.member-pay-dialog {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 0;
    max-width: 420px;
    width: calc(100% - 32px);
    margin: auto;
    color: var(--ink);
    background: linear-gradient(180deg, #1f1f1f 0%, #141414 100%);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.member-pay-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}
.member-pay-dialog[open] {
    display: block;
}
.member-pay-box {
    padding: 22px 22px 18px;
    position: relative;
    z-index: 1;
}
.member-pay-box h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}
.member-pay-box > .member-desc {
    margin: 0 0 4px;
    color: var(--ink-soft);
    font-size: 14px;
}
.member-channels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 8px;
}
.member-channels .note {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 209, 102, 0.28);
    background: rgba(255, 209, 102, 0.08);
    color: var(--warn);
    font-size: 13px;
    line-height: 1.55;
}
.member-channel-btn {
    width: 100%;
    background: #242424;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    border-radius: 12px;
}
.member-channel-btn:hover {
    background: #2e2e2e;
    border-color: rgba(212, 255, 51, 0.35);
    color: #fff;
    transform: none;
    filter: none;
    box-shadow: none;
}
.member-qr { text-align: center; margin: 12px 0; }
.member-qr img {
    display: inline-block;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
.member-pay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.member-pay-actions .btn-ghost,
.member-pay-actions button[value="cancel"] {
    background: #242424;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    border-radius: 12px;
    min-width: 88px;
}
.member-pay-actions .btn-ghost:hover,
.member-pay-actions button[value="cancel"]:hover {
    background: #2e2e2e;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    transform: none;
    filter: none;
    box-shadow: none;
}
.member-pay-box > .note.bad {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.28);
}
@media (max-width: 900px) {
    .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .member-grid { grid-template-columns: 1fr; }
}
