/* ==========================================================================
   墩墩AI口播智能体 · 工作台样式
   ========================================================================== */

:root {
    --bg-deep: #0A0E1A;
    --bg-base: #0E1426;
    --bg-soft: #0B1020;
    --panel: rgba(166, 139, 60, .04);
    --panel-hover: rgba(166, 139, 60, .09);
    --line: #1E2A3D;
    --line-strong: #2A3A52;
    --text: #E8ECF4;
    --text-dim: #8A90A0;
    --text-faint: #5A6378;
    --accent: #C9A961;
    --accent-light: #EBD9A6;
    --accent-mid: #A68B3C;
    --grad-main: linear-gradient(135deg, #C9A961 0%, #A68B3C 50%, #8a7330 100%);
    --grad-soft: linear-gradient(135deg, rgba(166, 139, 60, .14) 0%, rgba(201, 169, 97, .05) 100%);
    --ok: #6fe0b0;
    --warn: #f5c96b;
    --danger: #f08080;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --sidebar-w: 268px;
    --topbar-h: 72px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   布局骨架
   -------------------------------------------------------------------------- */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   侧边栏
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: linear-gradient(180deg, #0A0E1A 0%, #0B1020 100%);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 30;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--line);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: none;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.sidebar-brand-text strong {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: .2px;
}

.sidebar-brand-text span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.steps {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--line);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    text-align: left;
    transition: background .22s ease, color .22s ease, border-color .22s ease;
}

.step-item:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.step-item.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .34);
    color: var(--text);
}

.step-index {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    background: rgba(154, 186, 233, .1);
    border: 1px solid rgba(154, 186, 233, .2);
    color: var(--accent-light);
}

.step-item.active .step-index {
    background: var(--grad-main);
    color: #06101f;
    border-color: transparent;
}

.step-body {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.step-name {
    font-size: 14px;
    font-weight: 600;
}

.step-hint {
    font-size: 11.5px;
    color: var(--text-faint);
}

.step-state {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    flex: none;
    transition: background .25s ease;
}

.step-state.done {
    background: var(--ok);
    box-shadow: 0 0 8px rgba(111, 224, 176, .6);
}

.sidebar-projects {
    padding: 16px 12px;
    flex: 1;
    min-height: 120px;
    border-bottom: 1px solid var(--line);
}

.sidebar-projects-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 0 4px;
}

.ghost-mini {
    background: rgba(154, 186, 233, .12);
    border: 1px solid rgba(154, 186, 233, .26);
    color: var(--accent-light);
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 999px;
    transition: background .2s ease;
}

.ghost-mini:hover {
    background: rgba(154, 186, 233, .24);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 13px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.project-item:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.project-item.active {
    background: rgba(154, 186, 233, .1);
    border-color: rgba(154, 186, 233, .28);
    color: var(--text);
}

.project-item .p-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-item .p-del {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 15px;
    line-height: 1;
    padding: 0 3px;
    transition: opacity .2s ease, color .2s ease;
}

.project-item:hover .p-del {
    opacity: 1;
}

.project-item .p-del:hover {
    color: var(--danger);
}

.sidebar-foot {
    padding: 14px 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ghost-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-size: 13px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.ghost-btn:hover {
    background: var(--panel-hover);
    border-color: var(--line-strong);
    color: var(--text);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-faint);
    padding: 4px 12px 0;
}

.sidebar-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-faint);
}

.sidebar-status.online .dot {
    background: var(--ok);
    box-shadow: 0 0 8px rgba(111, 224, 176, .7);
}

/* --------------------------------------------------------------------------
   主工作区
   -------------------------------------------------------------------------- */
.workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(110, 150, 240, .1), transparent 70%),
        var(--bg-base);
}

.topbar {
    height: var(--topbar-h);
    flex: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 24, .78);
    backdrop-filter: blur(14px);
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.topbar-title p {
    font-size: 12.5px;
    color: var(--text-faint);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.save-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-faint);
}

.save-state .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    transition: background .25s ease;
}

.save-state.saving .dot {
    background: var(--warn);
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 17px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.pill-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .08);
}

.pill-primary {
    background: var(--grad-main);
    border-color: transparent;
    color: #06101f;
}

.pill-primary:hover {
    filter: brightness(1.06);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    color: var(--text-dim);
    transition: background .2s ease, color .2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .09);
    color: var(--text);
}

.only-mobile {
    display: none;
}

/* --------------------------------------------------------------------------
   面板容器
   -------------------------------------------------------------------------- */
.panels {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.panel {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: panelIn .32s ease;
}

.panel.active {
    display: flex;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.panel-grid.three {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* --------------------------------------------------------------------------
   卡片
   -------------------------------------------------------------------------- */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(6px);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-head h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
}

.card-head h2::before {
    content: "";
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: var(--grad-main);
}

.card-sub {
    font-size: 12.5px;
    color: var(--text-faint);
}

.card-sub b {
    color: var(--accent-light);
}

/* --------------------------------------------------------------------------
   表单元素
   -------------------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.field>label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.field .val {
    color: var(--accent-light);
    font-weight: 700;
}

.inline-link {
    background: none;
    border: none;
    color: var(--accent-light);
    font-size: 12.5px;
    font-weight: 600;
    padding: 2px 0;
}

.inline-link:hover {
    text-decoration: underline;
}

.text-input,
.text-area {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .28);
    color: var(--text);
    font-size: 14px;
    padding: 12px 14px;
    transition: border-color .2s ease, background .2s ease;
    outline: none;
}

.text-input::placeholder,
.text-area::placeholder {
    color: var(--text-faint);
}

.text-input:focus,
.text-area:focus {
    border-color: rgba(154, 186, 233, .5);
    background: rgba(0, 0, 0, .4);
}

.text-area {
    resize: vertical;
    line-height: 1.7;
}

.text-area.editor {
    min-height: 240px;
    font-size: 14.5px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--grad-main);
    border: 2px solid #0a1024;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(120, 160, 240, .5);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #C9A961;
    border: 2px solid #0a1024;
    cursor: pointer;
}

/* 分段控件 */
.seg {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.seg button {
    flex: 1;
    min-width: 74px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.seg button:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.seg button.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .45);
    color: var(--accent-light);
}

.seg.small button {
    min-width: 58px;
    padding: 7px 10px;
    font-size: 12.5px;
}

/* 芯片行 */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
    font-size: 13px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.chip:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.chip.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
    color: var(--accent-light);
    font-weight: 600;
}

.chip-row.small .chip {
    padding: 6px 13px;
    font-size: 12.5px;
}

/* 开关 */
.row-switch {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.row-switch>label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex: none;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    transition: background .25s ease;
}

.switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s ease;
}

.switch input:checked+span {
    background: var(--grad-main);
}

.switch input:checked+span::after {
    transform: translateX(20px);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    transition: transform .2s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}

.btn-primary {
    background: var(--grad-main);
    color: #06101f;
    box-shadow: 0 8px 24px rgba(110, 150, 240, .26);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn-secondary {
    background: rgba(255, 255, 255, .04);
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .09);
}

.btn-block {
    width: 100%;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-btn {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
    font-size: 12.5px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.mini-btn:hover {
    background: rgba(154, 186, 233, .14);
    border-color: rgba(154, 186, 233, .4);
    color: var(--accent-light);
}

/* --------------------------------------------------------------------------
   文案面板
   -------------------------------------------------------------------------- */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.mode-tab {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--text-dim);
    transition: background .22s ease, border-color .22s ease, color .22s ease;
}

.mode-tab strong {
    font-size: 13.8px;
    color: var(--text);
}

.mode-tab span {
    font-size: 12px;
    color: var(--text-faint);
}

.mode-tab:hover {
    background: var(--panel-hover);
}

.mode-tab.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .45);
}

.mode-tab.active strong {
    color: var(--accent-light);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.topic-card {
    text-align: left;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--text-dim);
    font-size: 13.5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background .22s ease, border-color .22s ease, transform .22s ease;
}

.topic-card:hover {
    background: var(--panel-hover);
    transform: translateY(-2px);
}

.topic-card.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
}

.topic-card .t-title {
    color: var(--text);
    font-weight: 600;
    line-height: 1.5;
}

.topic-card .t-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11.5px;
}

.topic-card .t-meta span {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(154, 186, 233, .1);
    border: 1px solid rgba(154, 186, 233, .2);
    color: var(--accent-light);
}

.result-card {
    min-height: 320px;
}

.version-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.version-pick {
    text-align: left;
    padding: 13px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--text-dim);
    font-size: 12.8px;
    line-height: 1.6;
    max-height: 118px;
    overflow: hidden;
    position: relative;
    transition: background .2s ease, border-color .2s ease;
}

.version-pick b {
    display: block;
    font-size: 12px;
    color: var(--accent-light);
    margin-bottom: 5px;
}

.version-pick:hover {
    background: var(--panel-hover);
}

.version-pick.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
    color: var(--text);
}

.editor-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.counter {
    font-size: 12.5px;
    color: var(--text-faint);
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   音频面板
   -------------------------------------------------------------------------- */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.voice-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    text-align: left;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.voice-card:hover {
    background: var(--panel-hover);
    transform: translateY(-2px);
}

.voice-card.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
}

.voice-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #06101f;
    background: var(--grad-main);
}

.voice-info {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    min-width: 0;
}

.voice-info strong {
    font-size: 13.5px;
    color: var(--text);
}

.voice-info span {
    font-size: 11.5px;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-box {
    padding: 12px 15px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: rgba(0, 0, 0, .22);
    font-size: 13px;
    color: var(--accent-light);
}

.progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--grad-main);
    transition: width .25s ease;
}

.progress-text {
    font-size: 12.5px;
    color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   数字人面板
   -------------------------------------------------------------------------- */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 4px;
}

.avatar-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.avatar-card:hover {
    background: var(--panel-hover);
    transform: translateY(-3px);
}

.avatar-card.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
}

.avatar-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0a1024;
    position: relative;
}

.avatar-thumb canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.avatar-card strong {
    font-size: 13px;
    color: var(--text);
}

.avatar-card span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.stage-wrap {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stage {
    flex: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #04060d;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

.stage canvas {
    display: block;
    width: auto;
    height: 470px;
    max-height: 52vh;
}

.stage-side {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .22);
    font-size: 13px;
    color: var(--text-faint);
}

.info-line b {
    color: var(--text);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   剪辑面板
   -------------------------------------------------------------------------- */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 9px;
    max-height: 240px;
    overflow-y: auto;
}

.asset-card {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .25);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color .2s ease, background .2s ease;
}

.asset-card.active {
    border-color: rgba(201, 169, 97, .95);
    background: rgba(201, 169, 97, .16);
    box-shadow: 0 0 0 1px rgba(201, 169, 97, .55), 0 4px 14px rgba(201, 169, 97, .18);
}

.asset-card.active span:not(.asset-thumb) {
    color: #e8c987;
    font-weight: 700;
}

.asset-thumb-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}

.asset-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: rgba(6, 16, 31, .82);
}

.asset-card span {
    font-size: 11px;
    color: var(--text-faint);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 9px;
}

.sub-style-item {
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .28);
    text-align: center;
    transition: border-color .2s ease, background .2s ease;
}

.sub-style-item.active {
    border-color: rgba(201, 169, 97, .95);
    background: rgba(201, 169, 97, .16);
    box-shadow: 0 0 0 1px rgba(201, 169, 97, .55), 0 4px 14px rgba(201, 169, 97, .18);
}

.sub-style-item.active span {
    color: #e8c987;
    font-weight: 700;
}

.sub-style-item .preview-text {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sub-style-item span {
    font-size: 11px;
    color: var(--text-faint);
}

.bgm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 236px;
    overflow-y: auto;
}

.bgm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    text-align: left;
    transition: background .2s ease, border-color .2s ease;
}

.bgm-item:hover {
    background: var(--panel-hover);
}

.bgm-item.active {
    background: rgba(154, 186, 233, .12);
    border-color: rgba(154, 186, 233, .5);
}

.bgm-item .b-name {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.bgm-item .b-name strong {
    font-size: 13px;
    color: var(--text);
}

.bgm-item .b-name span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.bgm-item .b-play {
    font-size: 11.5px;
    color: var(--accent-light);
    flex: none;
}

/* --------------------------------------------------------------------------
   标题封面
   -------------------------------------------------------------------------- */
.title-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.title-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    text-align: left;
    transition: background .2s ease, border-color .2s ease;
}

.title-item:hover {
    background: var(--panel-hover);
}

.title-item.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
}

.title-item .t-badge {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(154, 186, 233, .14);
    border: 1px solid rgba(154, 186, 233, .28);
    color: var(--accent-light);
}

.title-item .t-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.title-item .t-score {
    font-size: 11.5px;
    color: var(--text-faint);
    margin-top: 4px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(154, 186, 233, .24);
    background: rgba(154, 186, 233, .08);
    color: var(--accent-light);
    font-size: 12.5px;
    transition: background .2s ease;
}

.tag:hover {
    background: rgba(154, 186, 233, .2);
}

.cover-stage {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #04060d;
    padding: 14px;
    display: flex;
    justify-content: center;
}

.cover-stage canvas {
    width: auto;
    height: 340px;
    max-height: 42vh;
    border-radius: var(--radius-sm);
    display: block;
}

/* --------------------------------------------------------------------------
   发布面板
   -------------------------------------------------------------------------- */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 11px;
}

.platform-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    text-align: left;
    position: relative;
    transition: background .2s ease, border-color .2s ease;
}

.platform-card:hover {
    background: var(--panel-hover);
}

.platform-card.active {
    background: var(--grad-soft);
    border-color: rgba(154, 186, 233, .5);
}

.platform-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #06101f;
}

.platform-info {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    min-width: 0;
}

.platform-info strong {
    font-size: 13.5px;
    color: var(--text);
}

.platform-info span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.platform-check {
    position: absolute;
    top: 10px;
    right: 11px;
    font-size: 12px;
    color: var(--accent-light);
    opacity: 0;
    transition: opacity .2s ease;
}

.platform-card.active .platform-check {
    opacity: 1;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 420px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
}

.queue-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    background: var(--text-faint);
}

.queue-dot.pending {
    background: var(--warn);
}

.queue-dot.running {
    background: var(--accent-mid);
    animation: pulse 1.1s infinite;
}

.queue-dot.done {
    background: var(--ok);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .28;
    }
}

.queue-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}

.queue-body strong {
    font-size: 13px;
    color: var(--text);
}

.queue-body span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.queue-time {
    font-size: 11.5px;
    color: var(--text-faint);
    flex: none;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
    padding: 30px 0;
}

/* --------------------------------------------------------------------------
   弹层
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 11, .78);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200;
}

.modal.open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #0b1120 0%, #070b15 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn .26s ease;
}

.modal-card.wide {
    max-width: 940px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 {
    font-size: 16.5px;
    font-weight: 700;
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-note {
    font-size: 13px;
    color: var(--text-faint);
    line-height: 1.7;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(154, 186, 233, .08);
    border: 1px solid rgba(154, 186, 233, .2);
}

.settings-feedback {
    font-size: 13px;
    min-height: 20px;
}

.settings-feedback.ok {
    color: var(--ok);
}

.settings-feedback.err {
    color: var(--danger);
}

.preview-body {
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
}

.preview-stage {
    flex: none;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #04060d;
    overflow: hidden;
}

.preview-stage canvas {
    display: block;
    height: 460px;
    width: auto;
    max-height: 58vh;
}

.preview-info {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.preview-tags {
    font-size: 12.5px;
    color: var(--accent-light);
    line-height: 1.7;
}

.preview-video {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #000;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    bottom: 26px;
    right: 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
    pointer-events: none;
}

.toast {
    min-width: 220px;
    max-width: 340px;
    padding: 13px 17px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(154, 186, 233, .32);
    background: rgba(12, 18, 34, .96);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 13.5px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    animation: toastIn .28s ease;
}

.toast.ok {
    border-color: rgba(111, 224, 176, .45);
}

.toast.err {
    border-color: rgba(240, 128, 128, .45);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .22);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {

    .preview-body {
        flex-direction: column;
        align-items: center;
    }

    .preview-info {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform .28s ease;
        box-shadow: 26px 0 60px rgba(0, 0, 0, .5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .only-mobile {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
        gap: 12px;
    }

    .topbar-title p {
        display: none;
    }

    .save-state {
        display: none;
    }

    .panels {
        padding: 16px;
    }

    .stage canvas,
    .preview-stage canvas {
        height: auto;
        width: 100%;
        max-height: 56vh;
    }

    .cover-stage canvas {
        width: 100%;
        height: auto;
    }
}
