/* 隐藏 datalist 输入框的下拉箭头 */
input[list]::-webkit-calendar-picker-indicator {
    display: none;
}

/* ============================================================
   CSS Variables & Reset
   ============================================================ */
:root {
    --primary: #6C5CE7;
    --primary-light: #a78bfa;
    --primary-dark: #5b4cc4;
    --primary-bg: #f3f0ff;
    --accent: #0ea5e9;
    --accent-bg: #f0f9ff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================================
   Sidebar Layout
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

.sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.25s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-header {
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.3px;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.sidebar-collapse-btn:hover { background: #f1f5f9; color: #1e293b; }
.sidebar-collapse-btn svg { transition: transform 0.25s ease; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: #e2e8f0; }

.nav-section-title {
    padding: 8px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 40px;
    margin: 2px 12px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.nav-item:hover { background: #f3f0ff; color: #6C5CE7; }
.nav-item.active {
    background: #f3f0ff;
    color: #6C5CE7;
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #6C5CE7;
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f43f5e, #fb923c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.user-points { font-size: 12px; color: #64748b; }
.user-points strong { color: #6C5CE7; font-weight: 600; }

.btn-login-sidebar {
    padding: 6px 14px;
    background: #6C5CE7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-login-sidebar:hover { background: #5b4cc4; }

.btn-logout-sidebar {
    padding: 6px 14px;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-logout-sidebar:hover { background: #f1f5f9; color: #1e293b; }

/* Sidebar collapsed */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item > span:not(.nav-icon),
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer { display: none !important; }
.sidebar.collapsed .nav-item { margin: 4px 8px; padding: 0; justify-content: center; }
.sidebar.collapsed .sidebar-header { padding: 16px 8px; justify-content: center; }

/* ============================================================
   Main Content Area
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
    min-height: 100vh;
}
.sidebar.collapsed ~ .main-content { margin-left: 64px; }

.content-header {
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
    margin: 0;
}
.page-title-icon { font-size: 24px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-doc-link {
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.header-doc-link:hover { background: #f1f5f9; color: #1e293b; }

.content-body {
    flex: 1;
    padding: 24px 16px 80px 16px;
    overflow-y: auto;
}
.content-inner {
    /* A: 取消 1200px 限制 → 不再被居中推到屏幕正中央
       B: 保留一个宽松上限，避免 2K/4K 屏上内容铺得太宽 */
    max-width: 1480px;
    margin: 0;
}

/* ── 手机端侧边栏遮罩 ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}

/* ── 手机端汉堡菜单按钮 ── */
.mobile-menu-btn {
    display: none !important;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 101;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }

    /* 显示汉堡按钮 */
    .mobile-menu-btn { display: flex !important; }

    /* 显示遮罩 */
    .sidebar-overlay.active { display: block; }
}

/* ============================================================
   Login Modal
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 24px;
}
.modal-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}
.modal-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.modal-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow);
}
.modal-panel { display: none; }
.modal-panel.active { display: block; }
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover {
    background: #f1f5f9;
    color: var(--text);
}
.code-input-group {
    display: flex;
    gap: 8px;
}
.code-input-group input {
    flex: 1;
}
.code-input-group .btn-send-code {
    flex-shrink: 0;
    padding: 0 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}
.code-input-group .btn-send-code:hover:not(:disabled) {
    background: var(--primary-dark);
}
.code-input-group .btn-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.modal-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}
.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.modal-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    display: none;
}
.modal-error.visible {
    display: block;
}

/* History Preview Modal */
.history-preview-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.history-preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.history-preview-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.history-preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-preview-close:hover { background: #f1f5f9; }
.history-preview-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.history-preview-body img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
.history-preview-body audio {
    width: 100%;
    margin: 0 auto;
    display: block;
}
.history-preview-body video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
.history-preview-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.history-preview-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.history-preview-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.history-preview-btn.primary {
    background: var(--primary);
    color: #fff;
}
.history-preview-btn.primary:hover { background: var(--primary-dark); }
.history-preview-btn.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.history-preview-btn.secondary:hover { background: #f1f5f9; }

/* ============================================================
   Panel Content
   ============================================================ */
.platform-panel { display: none; }
.platform-panel.active { display: block; }

/* Placeholder panels */
.placeholder-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 80px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}
.placeholder-panel .ph-icon {
    font-size: 64px;
    margin-bottom: 20px;
}
.placeholder-panel h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 8px;
}
.placeholder-panel p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto 24px;
}
.placeholder-panel .badge-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.placeholder-badge {
    background: var(--primary-bg);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   Video Panel Layout
   ============================================================ */
.video-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
/* TTS 面板左右双列布局 */
.video-layout.tts-two-col {
    grid-template-columns: 1fr 400px;
}
@media (max-width: 900px) {
    .video-layout { grid-template-columns: 1fr; }
    .video-layout.tts-two-col { grid-template-columns: 1fr; }
}

/* ── 宽屏：双列布局整体左对齐，保留舒适上限 ── */
@media (min-width: 1280px) {
    .video-layout,
    .video-layout.tts-two-col,
    .music-layout,
    .rap-layout {
        max-width: 1480px;
        margin-left: 0;
        margin-right: auto;
    }
    /* iframe 容器：左对齐 + 合理上限 */
    #panel-video-cleanup,
    #panel-dewatermark,
    #panel-copy-extract {
        max-width: 1480px;
        margin-left: 0;
        margin-right: auto;
    }
}

/* ============================================================
   Jimeng-Style Composer
   ============================================================ */
.composer-wrap {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 0;
    margin-bottom: 20px;
}
.composer-main {
    display: flex;
    gap: 20px;
    padding: 20px 24px 16px;
    align-items: flex-start;
}
/* Reference card stack - Jimeng style */
.ref-group {
    flex-shrink: 0;
    position: relative;
    height: 72px;
    --ref-count: 1;
    --ref-item-width: 48px;
    --ref-item-gap: -24px;
    --ref-item-gap-hover: 0px;
}
.ref-group-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    pointer-events: none;
    z-index: 0;
}
.ref-group-hover-trigger {
    display: none;
}
.ref-group-content {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding: 4px 8px;
    z-index: 1;
}
.ref-item {
    position: relative;
    flex-shrink: 0;
    width: var(--ref-item-width, 48px);
    height: 60px;
    margin-right: var(--ref-item-gap, -24px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(calc(var(--rotate, 0deg)));
    transform-origin: bottom center;
    cursor: pointer;
    z-index: calc(var(--index-in-group, 0) + 1);
}
/* Spread out on group hover */
.ref-group:hover .ref-item {
    margin-right: var(--ref-item-gap-hover, 0px);
}
/* Individual card hover: pop out */
.ref-item:hover {
    transform: rotate(calc(var(--rotate, 0deg))) scale(1.15) !important;
    z-index: 200 !important;
}
.ref-item:hover .ref-item-inner {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.ref-item-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: rotate(calc(-1 * var(--rotate, 0deg)));
    transform-origin: center center;
    position: relative;
    background: #e2e8f0;
}
.ref-item-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.ref-item-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(30,30,30,0.8);
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    line-height: 1;
    transition: all 0.15s;
}
.ref-item-remove:hover { background: rgba(220,38,38,0.9); }
.ref-item:hover .ref-item-remove { display: flex; }

/* Upload item (last in stack) */
.ref-upload-item {
    position: relative;
    flex-shrink: 0;
    width: var(--ref-item-width, 48px);
    height: 60px;
    margin-right: var(--ref-item-gap, -24px);
    border-radius: 8px;
    border: 1.5px dashed var(--border);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(calc(var(--rotate, 0deg)));
    transform-origin: bottom center;
    overflow: hidden;
    z-index: 100;
}
.ref-group:hover .ref-upload-item {
    margin-right: var(--ref-item-gap-hover, 0px);
}
.ref-upload-item:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}
.ref-upload-item .upload-plus {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 2px;
}
.ref-upload-item .upload-label {
    font-size: 8px;
    color: var(--text-muted);
    line-height: 1;
}
.ref-upload-item input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ref-close-btn { display: none; }
.composer-input-area {
    flex: 1;
    min-width: 0;
}
.composer-textarea {
    width: 100%;
    min-height: 80px;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    line-height: 1.6;
}
.composer-textarea::placeholder { color: var(--text-muted); }
.composer-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 24px 12px;
}
.composer-chip {
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.composer-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.composer-chip.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* Composer Toolbar (params bar below input) */
.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.toolbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
}
.toolbar-chip:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.toolbar-chip.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.toolbar-chip .chip-icon { font-size: 14px; }
.toolbar-chip .chip-value { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.toolbar-chip.active .chip-value { color: var(--primary); }
.toolbar-spacer { flex: 1; }
.toolbar-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}
.toolbar-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}
.toolbar-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.toolbar-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}
.toolbar-points .pts-icon { font-size: 14px; }

/* Mode selector in toolbar */
.toolbar-mode-wrap {
    position: relative;
}
.toolbar-mode-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 9999;
    min-width: 220px;
}
.toolbar-mode-dropdown.show { display: block; }
.toolbar-mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}
.toolbar-mode-option:hover { background: var(--primary-bg); }
.toolbar-mode-option.active { background: var(--primary-bg); border: 1px solid var(--primary-light); }
.toolbar-mode-option .mo-label { font-size: 13px; font-weight: 600; color: var(--text); }
.toolbar-mode-option .mo-desc { font-size: 11px; color: var(--text-muted); }

/* Duration / aspect ratio dropdowns */
.toolbar-dropdown-wrap { position: relative; }
.toolbar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 9999;
    min-width: 160px;
}
.toolbar-dropdown.show { display: block; }
.toolbar-dropdown-option {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    text-align: center;
}
.toolbar-dropdown-option:hover { background: var(--primary-bg); color: var(--primary); }
.toolbar-dropdown-option.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* Advanced params panel */
.advanced-params-panel {
    display: none;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}
.advanced-params-panel.visible { display: block; }
.advanced-params-panel .form-row { margin-bottom: 12px; }
.advanced-params-panel .form-group:last-child { margin-bottom: 0; }

/* ============================================================
   Result display (above composer)
   ============================================================ */
.video-result-area {
    margin-bottom: 20px;
}
.video-result-area .result-section { display: none; }
.video-result-area .result-section.visible { display: block; }

/* ============================================================
   History Sidebar
   ============================================================ */
.history-sidebar {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.history-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
}
.history-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.history-item-thumb {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
    position: relative;
}
.history-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.history-item-thumb .thumb-play {
    position: absolute;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}
.history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}
.history-item-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.history-item-status.completed { background: var(--success-bg); color: #059669; }
.history-item-status.failed { background: var(--danger-bg); color: #dc2626; }
.history-item-status.pending { background: #f1f5f9; color: #475569; }

/* ============================================================
   Old card styles (kept for other panels)
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title .icon { font-size: 18px; }

/* ============================================================
   Mode Selector (inside video panel)
   ============================================================ */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
@media (max-width: 700px) { .mode-grid { grid-template-columns: repeat(2, 1fr); } }

.mode-card {
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    background: #fafbfc;
}
.mode-card:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.mode-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.mode-card .mode-emoji { font-size: 24px; display: block; margin-bottom: 6px; }
.mode-card .mode-label { font-size: 13px; font-weight: 600; color: var(--text); }
.mode-card .mode-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   Form Elements
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: all var(--transition);
    resize: vertical;
}
.form-input:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
    background: #fff;
}
.form-textarea { min-height: 100px; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}
.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: #f1f5f9; }
.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.btn-accent:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ============================================================
   Image Thumbnail Input
   ============================================================ */
.image-thumb-list { display: flex; flex-wrap: wrap; gap: 10px; }
.image-thumb-box {
    position: relative;
    width: 100px; height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}
.image-thumb-box.empty {
    border: 2px dashed var(--border);
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.image-thumb-box.empty:hover { border-color: var(--primary); background: var(--primary-bg); }
.image-thumb-box.empty .thumb-plus {
    font-size: 28px; color: var(--text-muted); line-height: 1;
}
.image-thumb-box.empty:hover .thumb-plus { color: var(--primary); }
.image-thumb-box.filled {
    border: 1px solid var(--border);
    background: #fff;
}
.image-thumb-box.filled img {
    width: 100%; height: 100%; object-fit: cover;
}
.image-thumb-box .thumb-remove {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}
.image-thumb-box.filled:hover .thumb-remove { opacity: 1; }
.image-thumb-box .thumb-remove:hover { background: rgba(220,38,38,0.85); }
.add-image-btn {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: 1px dashed var(--primary-light);
    padding: 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all var(--transition);
}
.add-image-btn:hover { background: var(--primary-bg); }

/* ============================================================
   Preset Chips
   ============================================================ */
.preset-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.preset-chip {
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.preset-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.preset-chip.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ============================================================
   Image Composer (Jimeng-style)
   ============================================================ */
.image-hero {
    text-align: center;
    padding: 16px 0 20px;
}
.image-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}
.image-hero-link {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 700;
}
.image-hero-link:hover { text-decoration: underline; }

.image-apikey-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 12px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.image-apikey-label { font-size: 16px; }
.image-apikey-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-secondary);
}
.image-apikey-input:focus { color: var(--text); }

.image-composer {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 20px 20px 12px;
    max-width: 720px;
    margin: 0 auto 24px;
    position: relative;
}

.video-composer-area {
    max-width: 720px;
    margin: 0 auto 24px;
}
/* 图像面板历史记录宽度 */
#panel-image .history-section {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
/* 视频面板历史记录宽度 */
#panel-video .history-section {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
/* 语音合成面板历史记录：放在左列，与操作区对齐 */
#panel-tts .history-section {
    grid-column: 1;
}
/* 去水印面板历史记录 */
#panel-dewatermark .history-section {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}
/* 文案提取面板历史记录：跨满两列，与操作区对齐 */
#panel-copy-extract .history-section {
    grid-column: 1 / -1;
}
.video-composer-area .composer-wrap {
    margin-bottom: 16px;
}
.video-composer-area .card {
    margin-bottom: 16px;
}
.video-composer-area .composer-chips {
    padding-left: 15px;
}
.video-composer-area .composer-toolbar {
    padding-left: 15px;
}

.composer-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.composer-upload {
    flex-shrink: 0;
    width: 64px;
}

.composer-input-wrap {
    flex: 1;
    position: relative;
    min-height: 80px;
    margin-left: 8px;
}
.composer-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: transparent;
    font-family: inherit;
}
.composer-textarea::placeholder {
    color: var(--text-muted);
}

.composer-preset-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
}

/* Composer Toolbar */
.composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-left: 0;
}
.composer-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    margin-left: -3px;
}
.composer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toolbar Dropdown (image composer) — override legacy .toolbar-dropdown */
.image-composer .toolbar-dropdown {
    display: inline-block !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    z-index: auto !important;
    min-width: auto !important;
}
.toolbar-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    white-space: nowrap;
}
.toolbar-dropdown-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}
.toolbar-dropdown-btn.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.toolbar-icon { font-size: 14px; }
.toolbar-arrow {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 2px;
}
.toolbar-dropdown-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 200;
    padding: 4px;
}
.toolbar-dropdown.open .toolbar-dropdown-menu { display: block; }
.toolbar-dropdown-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    transition: all var(--transition);
    white-space: nowrap;
}
.toolbar-dropdown-item:hover { background: #f1f5f9; }
.toolbar-dropdown-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   Image Popover (比例/分辨率/尺寸面板)
   ============================================================ */
.image-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    z-index: 300;
    min-width: 380px;
    max-width: 480px;
}
.image-popover.open { display: block; }

.popover-field { margin-bottom: 16px; }
.popover-field:last-child { margin-bottom: 0; }
.popover-field-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 比例网格 */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 6px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
    color: var(--text-secondary);
}
.ratio-item svg { flex-shrink: 0; }
.ratio-item span { font-size: 11px; font-weight: 500; }
.ratio-item:hover { border-color: var(--primary-light); background: var(--primary-bg); color: var(--primary); }
.ratio-item.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* 分辨率选项 */
.res-options {
    display: flex;
    gap: 8px;
}
.res-option {
    padding: 6px 16px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
    color: var(--text);
}
.res-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.res-option.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* 尺寸输入 */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.size-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex: 1;
}
.size-input-label {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    border-right: 1px solid var(--border);
    user-select: none;
}
.size-input {
    width: 80px;
    padding: 6px 10px;
    border: none;
    outline: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: transparent;
    -moz-appearance: textfield;
}
.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.size-input:focus { background: #f0f4ff; }
.lock-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}
.lock-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.lock-btn.locked { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.size-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}

.composer-points {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.composer-generate-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}
.composer-generate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.45);
}
.composer-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 600px) {
    .image-hero-title { font-size: 20px; }
    .composer-toolbar { flex-direction: column; align-items: stretch; }
    .composer-toolbar-left { justify-content: center; }
    .composer-toolbar-right { justify-content: center; }
}

/* ============================================================
   Status / Result Area
   ============================================================ */
.result-section { display: none; }
.result-section.visible { display: block; }

/* History Section */
.history-section { margin-top: 24px; }
.history-title {
    font-size: 14px; font-weight: 600; color: #64748b;
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fff;
    border: 1px solid #e8e8e8; border-radius: 10px;
    transition: all 0.2s ease;
}
.history-item-card:hover {
    border-color: #6C5CE7; box-shadow: 0 2px 8px rgba(108,92,231,0.08);
}
.history-thumb {
    width: 48px; height: 48px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0; background: #f1f5f9;
}
.history-thumb-placeholder {
    width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; background: #f3f0ff;
}
.history-thumb-link {
    display: inline-block; flex-shrink: 0; text-decoration: none;
    border-radius: 8px; transition: opacity 0.2s;
}
.history-thumb-link:hover { opacity: 0.8; }
.history-text-link {
    color: #1e293b; text-decoration: none; cursor: pointer;
    transition: color 0.15s;
}
.history-text-link:hover {
    color: #6C5CE7;
}
.history-info { flex: 1; min-width: 0; }
.history-text {
    font-size: 13px; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.history-meta {
    font-size: 12px; color: #94a3b8; display: flex; gap: 12px;
}
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }
.history-btn {
    padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; font-size: 12px; color: #64748b;
    cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.history-btn:hover {
    border-color: #6C5CE7; color: #6C5CE7; background: #f3f0ff;
}
.history-btn-download {
    color: #6C5CE7; border-color: #6C5CE7; background: #f3f0ff;
}
.history-btn-download:hover {
    background: #ede9fe;
}
.history-empty {
    text-align: center; padding: 32px 16px; color: #94a3b8; font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.status-queued { background: #f1f5f9; color: #475569; }
.status-in_progress { background: #eff6ff; color: #2563eb; }
.status-completed { background: var(--success-bg); color: #059669; }
.status-failed { background: var(--danger-bg); color: #dc2626; }

.progress-bar-wrap {
    background: #f1f5f9;
    border-radius: 8px;
    height: 8px;
    margin: 12px 0;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.5s ease;
    width: 0%;
}

.video-container {
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 12px;
}
.video-container video {
    width: 100%;
    display: block;
    max-height: 420px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.info-item {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}
.info-item .info-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item .info-value { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; word-break: break-all; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 420px;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.info { background: var(--accent); }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   Toggle Switch for Advanced
   ============================================================ */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}
.toggle-wrap input { display: none; }
.toggle-track {
    width: 36px; height: 20px;
    background: #cbd5e1;
    border-radius: 6px;
    position: relative;
    transition: background var(--transition);
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}
.toggle-wrap input:checked + .toggle-track { background: var(--primary); }
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(16px); }
.advanced-section { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.advanced-section.visible { display: block; }

/* ============================================================
   Polling indicator
   ============================================================ */
.poll-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #eff6ff;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 13px;
    color: #2563eb;
}
.poll-indicator.active { display: flex; }
.spinner {
    width: 18px; height: 18px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   API Key Section (登录後自动填充，隐藏输入框)
   ============================================================ */
.apikey-section { display: none; }

/* ============================================================
   TTS Panel Styles
   ============================================================ */
#panel-tts {
    padding-top: 8px;
}

/* TTS Form Elements */
.tts-form-group {
    margin-bottom: 16px;
}
.tts-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.tts-form-group input[type="text"],
.tts-form-group input[type="number"],
.tts-form-group textarea,
.tts-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: all var(--transition);
    resize: vertical;
    box-sizing: border-box;
}
.tts-form-group textarea {
    min-height: 100px;
}
.tts-form-group input:focus,
.tts-form-group textarea:focus,
.tts-form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background: #fff;
}
.tts-form-group select {
    appearance: auto;
}
.tts-form-group small {
    display: block;
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 12px;
}
.tts-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.tts-form-row > .tts-form-group {
    flex: 1;
    min-width: 180px;
}

/* TTS Buttons */
.tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.tts-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}
.tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* TTS Result Section */
.tts-result-section {
    margin-top: 20px;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    display: none;
    background: var(--card-bg);
}
.tts-result-section audio {
    width: 100%;
    margin-bottom: 8px;
}
.tts-error {
    color: var(--danger);
    margin-top: 8px;
    font-size: 13px;
}
.tts-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tts-section-title .icon { font-size: 22px; }

/* ============================================================
   Voice Clone Panel Styles
   ============================================================ */
.voiceid-input-wrap {
    position: relative;
}
.voiceid-input-wrap .char-counter {
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}
.upload-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: stretch;
}
@media (max-width: 700px) {
    .upload-grid { grid-template-columns: 1fr; }
    .upload-grid .upload-divider { display: none; }
}
.upload-card {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}
.upload-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}
.upload-card.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.upload-card .upload-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.upload-card .upload-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.upload-card .upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.upload-card .upload-fileinfo {
    margin-top: 8px;
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
    display: none;
}
.upload-card.has-file .upload-fileinfo {
    display: block;
}
.upload-card input[type="file"] {
    display: none;
}
.upload-delete {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
}
.upload-delete:hover {
    background: var(--danger, #dc2626);
}
.upload-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.record-card {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}
.record-card:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.record-card .upload-icon { font-size: 36px; margin-bottom: 10px; }
.record-card .upload-label { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.record-card .upload-hint { font-size: 12px; color: var(--text-muted); }
.record-card .record-status {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    display: none;
}
.record-card.recording .record-status {
    display: block;
    color: var(--danger);
}
.record-card.has-file .record-status {
    display: block;
    color: var(--success);
}
.clone-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #0369a1;
    margin-top: 12px;
}
.clone-tip .tip-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.preview-textarea-wrap {
    position: relative;
}
.preview-textarea-wrap .char-counter {
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}
.clone-result-section {
    margin-top: 20px;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    display: none;
    background: var(--card-bg);
}
.clone-result-section.visible { display: block; }
.clone-result-section audio {
    width: 100%;
    margin-bottom: 8px;
}
.clone-voice-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}
.clone-voice-id-badge code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
}

/* ============================================================
   TTS Textarea Toolbar Styles
   ============================================================ */
.tts-textarea-wrap textarea {
    font-size: 15px;
    line-height: 2.0;
}
.tts-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.tts-tool-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.tts-tool-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary);
}
.tts-tool-btn .tool-icon { font-size: 16px; line-height: 1; }
.tts-tool-btn .tool-icon img {
    width: 22px; height: 22px;
    display: block;
}
.tts-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.tts-footer-actions {
    display: flex;
    gap: 8px;
}
.tts-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.tts-footer-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}
.tts-char-counter {
    font-size: 12px;
    color: var(--text-muted);
}
.tts-char-counter.over-limit {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================================
   Pause Duration Modal Styles
   ============================================================ */
.pause-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 32px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideIn 0.25s ease;
}
.pause-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 20px;
}
.pause-duration-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.pause-duration-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: center;
}
.pause-duration-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary);
}
.pause-duration-btn.selected {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a34a;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.pause-slider-wrap {
    margin-bottom: 20px;
}
.pause-slider-wrap input[type="range"] {
    width: 100%;
    padding: 0;
    border: none;
    cursor: pointer;
    accent-color: #22c55e;
}
.pause-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}
.pause-current-value {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 16px;
}
.pause-confirm-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.pause-confirm-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}
.pause-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Polyphone Correction Modal Styles
   ============================================================ */
.polyphone-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideIn 0.25s ease;
    display: flex;
    flex-direction: column;
}
.polyphone-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.polyphone-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.polyphone-hint {
    font-size: 13px;
    color: #16a34a;
    margin-top: 6px;
    font-weight: 500;
}
.polyphone-text-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    font-size: 16px;
    line-height: 2;
    color: var(--text);
    min-height: 300px;
    max-height: 50vh;
}
.polyphone-text-area .poly-char {
    background: #bbf7d0;
    padding: 1px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid #22c55e;
}
.polyphone-text-area .poly-char:hover {
    background: #86efac;
    transform: scale(1.1);
}
.polyphone-text-area .poly-char.corrected {
    background: #fde68a;
    border-bottom-color: #f59e0b;
}
.polyphone-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.polyphone-complete-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.polyphone-complete-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

/* Pronunciation Sub-Modal */
.pronunciation-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 32px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideIn 0.25s ease;
}
.pronunciation-char-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 20px;
}
.pronunciation-batch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.pronunciation-section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.pronunciation-options {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pronunciation-option-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.pronunciation-option-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary);
}
.pronunciation-option-btn.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.custom-pronunciation-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    margin-bottom: 12px;
}
.custom-pronunciation-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
.pronunciation-format-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.pronunciation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.pronunciation-cancel-btn {
    padding: 12px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.pronunciation-cancel-btn:hover {
    background: #f1f5f9;
}
.pronunciation-confirm-btn {
    padding: 12px;
    background: #fff;
    border: 1.5px solid #22c55e;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.pronunciation-confirm-btn:hover {
    background: #f0fdf4;
}
.custom-pronunciation-input-wrap {
    display: none;
    margin-bottom: 12px;
}
.custom-pronunciation-input-wrap.visible {
    display: block;
}
.custom-pronunciation-input-wrap .form-input {
    width: 100%;
}

/* Toggle Switch (for batch mode) */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
    background: #22c55e;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ============================================================
   Dewatermark Panel Styles
   ============================================================ */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.image-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition);
    border: 1px solid var(--border);
}
.image-gallery img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}
.info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}
.info-row .info-label {
    color: var(--text-muted);
    min-width: 60px;
    flex-shrink: 0;
}
.info-row .info-value {
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}

/* ============================================================
   Voice Actor List Styles
   ============================================================ */
.actor-list-section {
    margin-bottom: 20px;
}
.actor-list-section .card-title {
    font-size: 15px;
    padding: 12px 16px;
}
.actor-search-wrap {
    padding: 0 12px 10px;
}
.actor-search-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 6px 10px;
}

/* 左右布局容器 */
.actor-layout {
    display: flex;
    min-height: 440px;
    max-height: 520px;
}

/* 左侧分类侧边栏 */
.actor-category-sidebar {
    width: 90px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 8px 0;
    background: #f8fafc;
}
.actor-category-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
    transition: all var(--transition);
    border-right: 2px solid transparent;
}
.actor-category-item:hover {
    background: #eef2ff;
    color: var(--accent);
}
.actor-category-item.active {
    background: #eef2ff;
    color: var(--accent);
    font-weight: 600;
    border-right-color: var(--accent);
}
.actor-category-item .cat-count {
    display: block;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 1px;
}

/* 右侧配音员列表 */
.actor-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 配音员行卡片 — 头像左侧，信息右侧 */
.actor-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 4px;
    position: relative;
}
.actor-row:hover {
    border-color: var(--accent);
    background: #f0f9ff;
}
.actor-row.selected {
    border-color: var(--accent);
    background: #eff6ff;
}

/* 头像 */
.actor-row-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}
/* 无图片时的文字头像 */
.actor-avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #B8C9D8;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 右侧信息区 */
.actor-row-info {
    flex: 1;
    min-width: 0;
}
.actor-row-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.actor-row-name-text {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}
.actor-row-gender-badge {
    flex-shrink: 0;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
}
.actor-row-gender-badge.male {
    background: #dbeafe;
    color: #1d4ed8;
}
.actor-row-gender-badge.female {
    background: #fce7f3;
    color: #db2777;
}
/* 情感音色角标 */
.actor-row-vip-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}
.actor-row-descr {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.actor-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}
.actor-row-price {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
}
.actor-row-audition {
    font-size: 11px;
    padding: 2px 10px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.actor-row-audition:hover {
    background: var(--accent);
    color: #fff;
}

.actor-list-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.actor-list-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.actor-list-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* 收藏按钮 */
.actor-fav-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    transition: transform 0.15s;
    z-index: 1;
}
.actor-fav-btn:hover { transform: scale(1.2); }
.actor-fav-btn.faved { color: #f59e0b; }
.actor-fav-btn:not(.faved) { color: #d1d5db; }

/* ============================================================
   Clone Statement Modal
   ============================================================ */
.clone-statement-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px 40px 28px;
    width: 100%;
    max-width: 640px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}
.clone-statement-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 24px;
}
.clone-statement-warning {
    border: 2px solid #ef4444;
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    background: #fef2f2;
    margin-bottom: 24px;
}
.clone-statement-warning p {
    font-size: 16px;
    line-height: 1.8;
    color: #ef4444;
    margin: 0;
}
.clone-statement-notes h3 {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
}
.clone-statement-notes ol {
    padding-left: 24px;
    margin: 0;
}
.clone-statement-notes li {
    font-size: 14px;
    color: #94a3b8;
    line-height: 2;
}
.clone-statement-agree {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.clone-statement-agree input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.clone-statement-agree a {
    color: var(--accent);
    text-decoration: none;
}
.clone-statement-agree a:hover {
    text-decoration: underline;
}
.clone-statement-submit {
    display: block;
    margin: 0 auto;
    padding: 12px 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.clone-statement-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}
.clone-statement-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Clone Agreement Modal (Full Text)
   ============================================================ */
.clone-agreement-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}
.clone-agreement-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.clone-agreement-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.clone-agreement-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.clone-agreement-close:hover {
    background: #f1f5f9;
    color: var(--text);
}
.clone-agreement-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}
.clone-agreement-body h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 20px;
    margin-bottom: 8px;
}
.clone-agreement-body h4:first-child {
    margin-top: 0;
}
.clone-agreement-body p {
    margin-bottom: 12px;
    text-indent: 2em;
}
.clone-agreement-body ol, .clone-agreement-body ul {
    padding-left: 24px;
    margin-bottom: 12px;
}
.clone-agreement-body li {
    margin-bottom: 6px;
}
.clone-agreement-body .bold-notice {
    font-weight: 700;
    color: var(--danger);
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
}
.clone-agreement-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    text-align: center;
}
.clone-agreement-footer button {
    padding: 10px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.clone-agreement-footer button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}

/* ============================================================
   Music Panel — 流式垂直布局
   ============================================================ */
.music-layout {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── 参数栏（可折叠）── */
.music-params-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.music-params-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    user-select: none;
    transition: background var(--transition);
}
.music-params-toggle:hover { background: #f8fafc; }
.music-params-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.music-params-arrow.open { transform: rotate(180deg); }
.music-params-body { padding: 0 16px 14px; }
.music-params-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 600px) { .music-params-row { grid-template-columns: repeat(2, 1fr); } }
.music-param-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.music-param-item select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbfc;
}

/* ── 参考音频上传条 ── */
.music-ref-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.music-ref-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    position: relative;
}
.music-ref-bar:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}
.music-ref-bar.has-file {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}
.music-ref-text { flex: 1; min-width: 0; }
.music-ref-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.music-ref-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.music-ref-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.music-ref-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.music-ref-delete:hover { background: var(--danger); }

/* ── 面板（歌词 / 风格通用）── */
.music-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.music-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 17px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
}
.music-panel-header-right { display: flex; align-items: center; gap: 8px; }
.music-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.music-panel-body {
    flex: 1;
    padding: 10px 17px;
    min-height: 120px;
}
.music-textarea {
    width: 100%;
    height: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    line-height: 2;
    color: var(--text);
    background: transparent;
}
.music-textarea::placeholder { color: var(--text-muted); }
.music-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 17px 12px;
    flex-shrink: 0;
}
.music-char-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 300;
}

/* 纯音乐时歌词淡化 */
.music-panel-lyrics.instrumental .music-panel-body { opacity: 0.35; pointer-events: none; }

/* ── 拖拽条 ── */
.music-resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    cursor: row-resize;
    flex-shrink: 0;
}
.music-resize-thumb {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    transition: background var(--transition);
}
.music-resize-handle:hover .music-resize-thumb { background: var(--primary-light); }

/* ── 预处理分析按钮 ── */
.music-preprocess-btn {
    flex-shrink: 0;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.music-preprocess-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary);
}
.music-preprocess-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 风格快捷标签 ── */
.music-style-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
    background: #fff;
}
.music-style-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}

/* ── 风格标签行（刷新按钮 + 标签）── */
.music-style-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 17px 14px;
}
.music-style-refresh-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.music-style-refresh-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}
.music-style-chips {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.music-style-chips::-webkit-scrollbar { display: none; }
.music-title-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 17px;
}
.music-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    line-height: 2;
}
.music-title-input::placeholder { color: var(--text-muted); }

/* ── 底部操作栏 ── */
.music-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}
.music-generate-btn {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.35);
    font-family: inherit;
}
.music-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.45);
}
.music-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.music-btn-price { font-size: 11px; font-weight: 400; opacity: 0.75; margin-left: 4px; }

/* ================================================================
   说唱配音 (rap-dubbing) — 克隆自音乐生成，使用 rap- 前缀
   ================================================================ */
.rap-layout {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── 参数栏（可折叠）── */
.rap-params-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.rap-params-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    user-select: none;
    transition: background var(--transition);
}
.rap-params-toggle:hover { background: #f8fafc; }
.rap-params-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.rap-params-arrow.open { transform: rotate(180deg); }
.rap-params-body { padding: 0 16px 14px; }
.rap-params-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 600px) { .rap-params-row { grid-template-columns: repeat(2, 1fr); } }
.rap-param-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rap-param-item select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbfc;
}

/* ── 参考音频上传条 ── */
.rap-ref-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.rap-ref-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    position: relative;
}
.rap-ref-bar:hover {
    border-color: var(--rap-brand, #E74C3C);
    background: #fef2f2;
}
.rap-ref-bar.has-file {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}
.rap-ref-text { flex: 1; min-width: 0; }
.rap-ref-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.rap-ref-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.rap-ref-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.rap-ref-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.rap-ref-delete:hover { background: var(--danger); }

/* ── 面板（歌词 / 风格通用）── */
.rap-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.rap-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 17px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
}
.rap-panel-header-right { display: flex; align-items: center; gap: 8px; }
.rap-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.rap-panel-body {
    flex: 1;
    padding: 10px 17px;
    min-height: 120px;
}
.rap-textarea {
    width: 100%;
    height: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    line-height: 2;
    color: var(--text);
    background: transparent;
}
.rap-textarea::placeholder { color: var(--text-muted); }
.rap-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 17px 12px;
    flex-shrink: 0;
}
.rap-char-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 300;
}

/* 纯音乐时歌词淡化 */
.rap-panel-lyrics.instrumental .rap-panel-body { opacity: 0.35; pointer-events: none; }

/* ── 拖拽条 ── */
.rap-resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    cursor: row-resize;
    flex-shrink: 0;
}
.rap-resize-thumb {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    transition: background var(--transition);
}
.rap-resize-handle:hover .rap-resize-thumb { background: var(--rap-brand, #E74C3C); }

/* ── 预处理分析按钮 ── */
.rap-preprocess-btn {
    flex-shrink: 0;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.rap-preprocess-btn:hover:not(:disabled) {
    border-color: var(--rap-brand, #E74C3C);
    background: #fef2f2;
    color: var(--rap-brand, #E74C3C);
}
.rap-preprocess-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 风格快捷标签 ── */
.rap-style-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
    background: #fff;
}
.rap-style-chip:hover {
    border-color: var(--rap-brand, #E74C3C);
    color: var(--rap-brand, #E74C3C);
    background: #fef2f2;
}

/* ── 风格标签行（刷新按钮 + 标签）── */
.rap-style-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 17px 14px;
}
.rap-style-refresh-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.rap-style-refresh-btn:hover {
    border-color: var(--rap-brand, #E74C3C);
    color: var(--rap-brand, #E74C3C);
    background: #fef2f2;
}
.rap-style-chips {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.rap-style-chips::-webkit-scrollbar { display: none; }
.rap-title-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 17px;
}
.rap-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    line-height: 2;
}
.rap-title-input::placeholder { color: var(--text-muted); }

/* ── 底部操作栏 ── */
.rap-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}
.rap-generate-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.35);
    font-family: inherit;
    line-height: 1;
}
.rap-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(231, 76, 60, 0.45);
}
.rap-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── 按钮内价格小字 ── */
.rap-btn-price {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
    margin-left: 6px;
    vertical-align: baseline;
    line-height: 1;
    position: relative;
    top: 3px;
}

/* ── 使用说明 ── */
.rap-guide-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rap-guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}
.rap-guide-step {
    font-size: 12px;
    color: #a16207;
    line-height: 1.6;
}

/* ── 风格预设选择栏（独立区域）── */
.rap-preset-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 17px;
}
.rap-preset-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.rap-preset-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--transition);
}
.rap-preset-select:hover { border-color: var(--rap-brand, #E74C3C); }
.rap-preset-select:focus { outline: none; border-color: var(--rap-brand, #E74C3C); box-shadow: 0 0 0 2px rgba(231,76,60,0.15); }

/* ── 主内容区：歌词（左）+ 风格/操作（右）── */
.rap-main-row {
    display: flex;
    gap: 14px;
    align-items: stretch;
}
.rap-main-row > .rap-panel-lyrics {
    flex: 1;
    min-width: 0;
}
.rap-main-row > .rap-panel-lyrics .rap-panel-body {
    min-height: 320px;
}
.rap-main-row > .rap-panel-lyrics .rap-textarea {
    min-height: 320px;
}
.rap-sidebar-col {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rap-sidebar-col .rap-action-bar {
    padding-top: 0;
}
.rap-sidebar-col .rap-generate-btn {
    height: 48px;
}
@media (max-width: 700px) {
    .rap-main-row { flex-direction: column; }
    .rap-sidebar-col { width: 100%; }
}

/* ── 文案转歌词按钮 ── */
.rap-convert-btn {
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--rap-brand, #E74C3C);
    border-radius: 6px;
    background: #fff;
    color: var(--rap-brand, #E74C3C);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    white-space: nowrap;
}
.rap-convert-btn:hover {
    background: var(--rap-brand, #E74C3C);
    color: #fff;
}

/* ── 文案转歌词模态框 ── */
.rap-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}
.rap-modal {
    background: #fff;
    border-radius: 16px;
    width: 600px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}
.rap-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}
.rap-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.rap-modal-close:hover { background: #e2e8f0; color: var(--text); }
.rap-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.rap-modal-section { margin-bottom: 16px; }
.rap-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.rap-modal-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}
.rap-modal-textarea:focus { outline: none; border-color: var(--rap-brand, #E74C3C); box-shadow: 0 0 0 2px rgba(231,76,60,0.12); }
.rap-modal-result { background: #f8fafc; }
.rap-modal-actions { margin-bottom: 16px; }
.rap-convert-action-btn {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}
.rap-convert-action-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(231,76,60,0.3); }
.rap-convert-action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.rap-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-muted);
}
.rap-modal-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--rap-brand, #E74C3C);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rap-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.rap-modal-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    border: 1px solid var(--border);
}
.rap-modal-btn-cancel { background: #fff; color: var(--text); }
.rap-modal-btn-cancel:hover { background: #f8fafc; }
.rap-modal-btn-primary {
    background: var(--rap-brand, #E74C3C);
    color: #fff;
    border-color: var(--rap-brand, #E74C3C);
}
.rap-modal-btn-primary:hover { background: #c0392b; }