/* ==================== Podcast Generator Page Styles (matching Dubbing) ==================== */

/*
 * Note: This page reuses dubbing.css styles for consistency.
 * The main container uses .dubbing-container class.
 * Additional podcast-specific styles are defined below.
 */

/* ==================== Create Podcast Modal ==================== */
.create-podcast-modal {
    max-width: 680px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 按钮加载状态 */
.btn-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

button.loading {
    opacity: 0.8;
    cursor: wait !important;
    pointer-events: none;
}

button.loading:hover {
    transform: none !important;
}

/* Toolbar 按钮加载状态 */
.toolbar-btn-compact.loading {
    min-width: 80px;
}

.toolbar-btn-compact.loading .btn-label {
    display: inline;
}

/* ==================== Podcast AI Generate Modal ==================== */
.podcast-ai-modal {
    max-width: 480px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.podcast-ai-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.podcast-ai-modal .modal-header h3::before {
    content: '✨';
}

.podcast-ai-modal .modal-body {
    padding: 24px;
}

.podcast-ai-modal .form-group {
    margin-bottom: 20px;
}

.podcast-ai-modal .form-group:last-child {
    margin-bottom: 0;
}

.podcast-ai-modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.podcast-ai-modal .form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.podcast-ai-modal .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.podcast-ai-modal .form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

.podcast-ai-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.podcast-ai-modal .btn-primary {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.podcast-ai-modal .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.podcast-ai-modal .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.podcast-ai-modal .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.podcast-ai-modal .btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
}

.create-podcast-modal .modal-body {
    padding: 28px 32px;
}

/* Template Selection in Modal */
.create-podcast-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.modal-template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.modal-template-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-template-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
}

.modal-template-card:hover::before {
    opacity: 1;
}

.modal-template-card.selected {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.modal-template-card .template-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    font-style: normal;
    font-weight: normal;
}

.modal-template-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.modal-template-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Form Groups */
.create-podcast-modal .form-group {
    margin-bottom: 24px;
}

.create-podcast-modal .form-group:last-child {
    margin-bottom: 0;
}

.create-podcast-modal .form-input,
.create-podcast-modal .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.create-podcast-modal .form-input:hover,
.create-podcast-modal .form-textarea:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.create-podcast-modal .form-input:focus,
.create-podcast-modal .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
}

.create-podcast-modal .form-input::placeholder,
.create-podcast-modal .form-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.create-podcast-modal .form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.create-podcast-modal .modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.create-podcast-modal .btn-secondary {
    padding: 11px 24px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.create-podcast-modal .btn-secondary:hover {
    background: var(--hover-bg);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.create-podcast-modal .btn-secondary:active {
    transform: translateY(0);
}

.create-podcast-modal .btn-primary {
    padding: 11px 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.create-podcast-modal .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.create-podcast-modal .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.create-podcast-modal .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== Podcast Editor Modal ==================== */
.podcast-editor-modal {
    max-width: 1200px;
    width: 95vw;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.podcast-editor-modal .modal-body {
    padding: 0;
    max-height: 85vh;
    overflow-y: auto;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    min-height: 600px;
}

/* Left Panel - Script Editor */
.editor-left-panel {
    padding: 24px;
    border-right: 1px solid var(--border-color);
}

.editor-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
}

.editor-hint-inline {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: 12px;
}

.editor-topic-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-topic-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.editor-topic-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.editor-topic-actions button {
    flex: 1;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.editor-topic-actions button:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.editor-topic-actions button.btn-generate {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.editor-topic-actions button.btn-generate:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
}

.editor-script-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-script-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.editor-script-stats {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Right Panel - Speaker Config */
.editor-right-panel {
    padding: 24px;
    background: var(--panel-bg);
}

.speaker-config-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.speaker-config-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.speaker-config-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.speaker-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.speaker-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.speaker-config-item .voice-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.speaker-config-item .voice-select:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.speaker-config-item .voice-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.speaker-config-item .form-group {
    margin-bottom: 12px;
}

.speaker-params {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.param-input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
}

.param-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Editor Footer */
.editor-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: white;
}

.editor-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.editor-footer .btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.editor-footer .btn-cancel:hover {
    background: var(--hover-bg);
}

.editor-footer .btn-synthesize {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: white;
}

.editor-footer .btn-synthesize:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.editor-footer .btn-synthesize:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== Project Items (Table Rows) ==================== */
.podcast-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.podcast-item:last-child {
    border-bottom: none;
}

.podcast-item:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.04) 0%, rgba(99, 102, 241, 0.02) 100%);
}

/* Project icon (matching dubbing page) */
.podcast-item .project-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    margin-right: 12px;
}

/* Action Button */
.podcast-item .action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.podcast-item:hover .action-btn {
    opacity: 1;
}

.podcast-item .action-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .modal-template-grid {
        grid-template-columns: 1fr;
    }

    .editor-topic-actions {
        flex-direction: column;
    }

    .speaker-params {
        grid-template-columns: 1fr;
    }
}

/* ==================== Homepage Template Cards ==================== */
.podcast-template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.podcast-template-card {
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.podcast-template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.podcast-template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
}

.podcast-template-card:hover::before {
    opacity: 1;
}

.podcast-template-card:active {
    transform: translateY(-2px);
}

.template-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.podcast-template-card .template-info {
    position: relative;
    z-index: 1;
    flex: 1;
}

.podcast-template-card .template-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.podcast-template-card .template-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.podcast-template-card .template-speakers {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    align-self: flex-start;
}

/* Responsive for template cards */
@media (max-width: 1200px) {
    .podcast-template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .podcast-template-grid {
        grid-template-columns: 1fr;
    }
    
    .podcast-template-card {
        flex-direction: row;
        align-items: center;
        padding: 16px;
    }
    
    .template-icon-wrap {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }
    
    .podcast-template-card .template-info {
        flex: 1;
        margin-left: 12px;
    }
    
    .podcast-template-card .template-speakers {
        position: absolute;
        top: 12px;
        right: 12px;
    }
}

/* ==================== 播客编辑器优化样式 ==================== */

/* Header 按钮对齐 */
.podcast-editor-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.podcast-editor-header .header-right .btn-secondary,
.podcast-editor-header .header-right .btn-primary {
    height: 34px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.podcast-editor-header .header-right .btn-secondary {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.podcast-editor-header .header-right .btn-secondary:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.podcast-editor-header .header-right .btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.podcast-editor-header .header-right .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

/* Toolbar Select 样式 */
.podcast-editor-header .toolbar-select {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.podcast-editor-header .toolbar-select:hover,
.podcast-editor-header .toolbar-select:focus {
    border-color: var(--primary-color);
}

/* ==================== AI 生成面板 ==================== */

.podcast-ai-panel {
    margin-bottom: 16px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.podcast-ai-panel .form-group {
    margin-bottom: 16px;
}

.podcast-ai-panel .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.podcast-ai-panel .form-input,
.podcast-ai-panel .form-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.podcast-ai-panel .form-input:focus,
.podcast-ai-panel .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.podcast-ai-panel .form-actions {
    display: flex;
    gap: 8px;
}

.podcast-ai-panel .form-actions .btn-primary {
    flex: 1;
}

/* ==================== 内联对话编辑器（圆角卡片风格） ==================== */

.podcast-dialogue-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--panel-bg);
    border-radius: 12px;
}

/* 复用配音编辑器的对话行样式 */
.podcast-dialogue-container .dialogue-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.podcast-dialogue-container .dialogue-line:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.podcast-dialogue-container .dialogue-line:last-child {
    margin-bottom: 0;
}

/* 讲者徽章 */
.podcast-dialogue-container .speaker-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    flex-shrink: 0;
}

.podcast-dialogue-container .speaker-name-tag {
    font-size: 12px;
    font-weight: 600;
    color: white;
    padding: 5px 12px;
    border-radius: 14px;
    text-align: center;
    min-width: 60px;
    cursor: default;
}

/* 复用讲者颜色 */
.podcast-dialogue-container .speaker-color-0 { background: #6366f1; }
.podcast-dialogue-container .speaker-color-1 { background: #ec4899; }
.podcast-dialogue-container .speaker-color-2 { background: #10b981; }
.podcast-dialogue-container .speaker-color-3 { background: #f59e0b; }
.podcast-dialogue-container .speaker-color-4 { background: #8b5cf6; }
.podcast-dialogue-container .speaker-color-5 { background: #06b6d4; }
.podcast-dialogue-container .speaker-color-6 { background: #ef4444; }
.podcast-dialogue-container .speaker-color-7 { background: #84cc16; }

/* 对话内容 */
.podcast-dialogue-container .dialogue-content {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 36px;
}

.podcast-dialogue-container .dialogue-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
}

/* 行操作按钮 */
.podcast-dialogue-container .line-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.podcast-dialogue-container .dialogue-line:hover .line-actions {
    opacity: 1;
}

.podcast-dialogue-container .line-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.podcast-dialogue-container .line-action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.podcast-dialogue-container .line-action-btn svg {
    width: 14px;
    height: 14px;
}

/* 空状态 */
.dialogue-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.dialogue-empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== 视图切换按钮 ==================== */

.podcast-view-toggle {
    display: flex;
    gap: 0;
    margin-left: auto;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 2px;
}

.podcast-view-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.podcast-view-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.podcast-view-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ==================== 侧边栏（讲者配置） ==================== */

.podcast-sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease;
}

.podcast-sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-left: none;
}

.podcast-sidebar.collapsed .sidebar-section {
    display: none;
}

/* ==================== 侧边栏切换按钮（精致玻璃拟态设计） ==================== */

.sidebar-toggle-btn {
    position: absolute;
    right: 320px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 72px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.9) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-right: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #94a3b8);
    transition: 
        right 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
    z-index: 50;
    box-shadow: 
        -4px 0 12px rgba(0, 0, 0, 0.03),
        inset 1px 0 0 rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.sidebar-toggle-btn:hover {
    width: 24px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(248, 250, 252, 0.98) 100%
    );
    color: var(--text-secondary, #64748b);
    box-shadow: 
        -6px 0 20px rgba(0, 0, 0, 0.06),
        inset 1px 0 0 rgba(255, 255, 255, 0.8);
}

.sidebar-toggle-btn:active {
    transform: translateY(-50%) scale(0.98);
}

/* 图标样式 */
.sidebar-toggle-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* 折叠状态 */
.sidebar-toggle-btn.collapsed {
    right: 0;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08) 0%,
        rgba(139, 92, 246, 0.05) 100%
    );
    border-color: rgba(99, 102, 241, 0.15);
    color: var(--primary-color, #6366f1);
}

.sidebar-toggle-btn.collapsed:hover {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.12) 0%,
        rgba(139, 92, 246, 0.08) 100%
    );
    color: var(--primary-color, #6366f1);
}

.sidebar-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .sidebar-toggle-btn {
        background: linear-gradient(
            135deg,
            rgba(30, 41, 59, 0.95) 0%,
            rgba(15, 23, 42, 0.9) 100%
        );
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 
            -4px 0 12px rgba(0, 0, 0, 0.2),
            inset 1px 0 0 rgba(255, 255, 255, 0.05);
    }
    
    .sidebar-toggle-btn:hover {
        background: linear-gradient(
            135deg,
            rgba(51, 65, 85, 0.98) 0%,
            rgba(30, 41, 59, 0.95) 100%
        );
        box-shadow: 
            -6px 0 20px rgba(0, 0, 0, 0.3),
            inset 1px 0 0 rgba(255, 255, 255, 0.08);
    }
    
    .sidebar-toggle-btn.collapsed {
        background: linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(139, 92, 246, 0.1) 100%
        );
        border-color: rgba(99, 102, 241, 0.25);
    }
    
    .sidebar-toggle-btn.collapsed:hover {
        background: linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.2) 0%,
            rgba(139, 92, 246, 0.15) 100%
        );
    }
}

/* 使用 CSS 变量的暗色模式（如果页面有 dark 类） */
.dark .sidebar-toggle-btn,
[data-theme="dark"] .sidebar-toggle-btn {
    background: linear-gradient(
        135deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(15, 23, 42, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 
        -4px 0 12px rgba(0, 0, 0, 0.2),
        inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.dark .sidebar-toggle-btn:hover,
[data-theme="dark"] .sidebar-toggle-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(51, 65, 85, 0.98) 0%,
        rgba(30, 41, 59, 0.95) 100%
    );
}

.dark .sidebar-toggle-btn.collapsed,
[data-theme="dark"] .sidebar-toggle-btn.collapsed {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.15) 0%,
        rgba(139, 92, 246, 0.1) 100%
    );
    border-color: rgba(99, 102, 241, 0.25);
}

.podcast-sidebar .sidebar-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.podcast-sidebar .section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.podcast-sidebar .speaker-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.podcast-sidebar .speaker-config-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 讲者配置卡片 */
.speaker-config-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.speaker-config-card:hover {
    border-color: var(--primary-color);
}

.speaker-config-card:last-child {
    margin-bottom: 0;
}

.speaker-config-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.speaker-config-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.speaker-config-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.speaker-config-field {
    margin-bottom: 12px;
}

.speaker-config-field:last-child {
    margin-bottom: 0;
}

.speaker-config-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.speaker-config-field select,
.speaker-config-field input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.speaker-config-field select:focus,
.speaker-config-field input:focus {
    border-color: var(--primary-color);
}

.speaker-config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* 讲者空状态 */
.speaker-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.speaker-empty-state p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* Editor Section Header */
.editor-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 12px;
}

.editor-section-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ==================== Podcast Synthesis Progress Modal ==================== */
.synthesis-progress-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.synthesis-progress-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.synthesis-progress-content {
    background: var(--panel-bg);
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    min-width: 380px;
    max-width: 90vw;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.synthesis-progress-icon {
    margin-bottom: 24px;
}

.synthesis-spinner {
    color: var(--primary-color);
    animation: spin 1.2s linear infinite;
}

.synthesis-spinner circle {
    opacity: 0.9;
}

.synthesis-progress-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 28px 0;
}

.synthesis-progress-bar-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}

.synthesis-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.synthesis-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6, var(--primary-color));
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: progressShimmer 2s ease infinite;
}

@keyframes progressShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.synthesis-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmerSlide 1.5s ease infinite;
}

@keyframes shimmerSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.synthesis-progress-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-variant-numeric: tabular-nums;
}

.synthesis-progress-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

/* Dark Mode Enhancement */
body.dark .synthesis-progress-content {
    background: rgba(30, 30, 40, 0.95);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

body.dark .synthesis-progress-bar-container {
    background: rgba(0, 0, 0, 0.3);
}

body.dark .synthesis-progress-bar {
    background: rgba(255, 255, 255, 0.1);
}
