/* 基础样式 */
:root {
    --primary-color: #4c6ef5;
    --secondary-color: #764ba2;
    --success-color: #00f2fe;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
}

body {
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

/* 主内容区域 */
#mainContent {
    padding: 2rem 0;
    min-height: calc(100vh - 76px);
}

/* 页面容器 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* 卡片样式 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: white;
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* 按钮样式 */
.btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

/* 表单控件 */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    padding: 12px 16px;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-label {
    color: white;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 文本域 */
textarea.form-control {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* 加载中遮罩 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

/* Toast 样式 */
.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: white;
}

.toast-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--glass-border);
    color: white;
}

/* 音频播放器 */
.audio-player {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-play {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play:hover {
    transform: scale(1.1);
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    color: white;
    font-size: 0.875rem;
    min-width: 100px;
    text-align: center;
}

/* 任务列表 */
.task-list {
    list-style: none;
    padding: 0;
}

.task-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    transition: all 0.3s ease;
}

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.task-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.task-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.task-status.processing {
    background: rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

.task-status.completed {
    background: rgba(25, 135, 84, 0.2);
    color: #198754;
}

.task-status.failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.task-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hero-card {
    border-radius: var(--border-radius);
    padding: 2rem;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(118, 75, 162, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.section-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.attachment-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.attachment-header {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
}

.attachment-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.attachment-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.link-btn {
    border: none;
    background: none;
    color: #4facfe;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.link-btn:hover {
    text-decoration: underline;
}

.workflow-selector {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.workflow-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.workflow-option.active {
    border-color: rgba(79, 172, 254, 0.8);
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15), rgba(118, 75, 162, 0.15));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.workflow-option .option-icon {
    font-size: 1.5rem;
}

.workflow-option .option-content {
    flex: 1;
}

.workflow-option .option-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.workflow-option .option-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.workflow-option .option-arrow {
    font-size: 1.25rem;
    opacity: 0.6;
}

.document-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
}

.document-upload-zone .file-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.document-upload-zone .btn {
    align-self: flex-start;
}

/* 音色选择器 */
.voice-section-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-step-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.voice-filter-control {
    width: 100%;
}

@media (min-width: 768px) {
    .voice-section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
    .voice-filter-control {
        max-width: 260px;
    }
}

.selected-voice-display,
.voice-placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.selected-voice-display {
    border-color: rgba(79, 172, 254, 0.8);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
}

.selected-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.selected-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.selected-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.voice-placeholder {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-placeholder:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.placeholder-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.placeholder-icon {
    font-size: 2rem;
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.placeholder-text span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.placeholder-arrow {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.select-voice-btn {
    width: 100%;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: all 0.2s ease;
}

.select-voice-btn:hover {
    background: rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.8);
}

.voice-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.task-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card .task-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-card .task-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.task-card .task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.detail-btn,
.plain-btn {
    border-radius: 999px;
    padding: 0.35rem 1.5rem;
    border: none;
    font-weight: 600;
}

.detail-btn {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #0c0f19;
}

.plain-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.empty-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0;
}

.voice-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.voice-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 172, 254, 0.5);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.voice-card.selected {
    border-color: rgba(79, 172, 254, 0.9);
    background: rgba(79, 172, 254, 0.15);
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.3);
}

.voice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.voice-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.voice-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: #fff;
}

.voice-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-bottom: 0;
    flex: 1;
}

.voice-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

.voice-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.voice-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
}

.voice-modal.show {
    display: flex;
}

.voice-modal-dialog {
    background: rgba(12, 15, 25, 0.95);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: min(960px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.voice-modal-header,
.voice-modal-footer {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    gap: 1rem;
}

.voice-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.voice-modal-filter {
    padding: 0 1.5rem 1.5rem;
}

.voice-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    cursor: pointer;
}

body.voice-selector-modal-open {
    overflow: hidden;
}

.step-flow {
    row-gap: 2rem;
}

.step-card {
    border-radius: 24px;
}

.script-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.script-editor-toolbar .btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.script-editor-toolbar.in-generated {
    margin-top: 0.5rem;
}


.generated-script-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.script-editor-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2100;
}

.script-editor-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.script-editor-modal-dialog {
    background: rgba(12, 15, 25, 0.95);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: min(800px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.script-editor-modal-header,
.script-editor-modal-footer {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.script-editor-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.script-editor-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 1rem;
    justify-content: flex-end;
}

.script-editor-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.script-editor-modal-body textarea {
    min-height: 240px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.script-editor-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    cursor: pointer;
}

.script-editor-meta {
    color: rgba(255, 255, 255, 0.8);
}

body.script-editor-modal-open {
    overflow: hidden;
}

/* 文件上传区域 */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: rgba(79, 172, 254, 0.6);
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.upload-text {
    color: white;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-container {
        padding: 0 15px;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .voice-selector {
        grid-template-columns: 1fr;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .task-actions {
        flex-direction: column;
    }

    .audio-controls {
        flex-direction: column;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 文本样式 */
.text-white { color: white !important; }
.text-muted { color: rgba(255, 255, 255, 0.7) !important; }
.text-primary { color: #4facfe !important; }

/* 统计卡片 */
.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2rem;
    color: #4facfe;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 操作列表 */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.action-btn.warn {
    border-color: rgba(220, 53, 69, 0.3);
}

.action-btn.warn:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* 间距 */
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
