:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #1e1e2e;
    --bg-hover: #252535;
    --bg-active: #2a2a40;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --text-primary: #f1f1f4;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    --border-color: #27273a;
    --border-hover: #3f3f5a;

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

body.light-theme {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2f7;
    --bg-card: #ffffff;
    --bg-hover: #e6ebf3;
    --bg-active: #dbe4f0;

    --accent-primary: #4f46e5;
    --accent-secondary: #0284c7;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
    --accent-glow: rgba(79, 70, 229, 0.2);

    --text-primary: #111827;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    --border-color: #d7deea;
    --border-hover: #b8c4d8;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 18px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.14);
    --shadow-glow: 0 0 0 4px var(--accent-glow);

    color-scheme: light;
    background:
        radial-gradient(circle at 8% 0%, rgba(79, 70, 229, 0.1), transparent 32%),
        radial-gradient(circle at 92% 4%, rgba(14, 165, 233, 0.09), transparent 34%),
        var(--bg-primary);
}

body.light-theme .permission-empty-card {
    border-color: rgba(79, 70, 229, 0.18);
    background:
        radial-gradient(circle at 18% 10%, rgba(79, 70, 229, 0.1), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.96));
}

body.light-theme .mode-switch,
body.light-theme .mode-switch.is-standard {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.9);
}

body.light-theme .mode-switch.is-pro {
    color: #166534;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(220, 252, 231, 0.78);
}

body.light-theme .modal-overlay {
    background: rgba(15, 23, 42, 0.28);
}

body.light-theme .account-status-modal {
    background:
        radial-gradient(circle at 18% 0%, rgba(79, 70, 229, 0.12), transparent 34%),
        radial-gradient(circle at 86% 18%, rgba(34, 197, 94, 0.12), transparent 30%),
        rgba(255, 255, 255, 0.96);
    border-color: rgba(79, 70, 229, 0.18);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.78) inset;
}

body.light-theme .voice-picker-content {
    background:
        radial-gradient(circle at 12% 0%, rgba(45, 212, 191, 0.12), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(251, 191, 36, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

body.light-theme .voice-picker-summary {
    border-color: rgba(148, 163, 184, 0.24);
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(245, 158, 11, 0.08)),
        rgba(248, 250, 252, 0.9);
}

body.light-theme .voice-picker-summary small,
body.light-theme .voice-picker-option-main em {
    color: #0f766e;
}

body.light-theme .voice-picker-option {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.84);
}

body.light-theme .voice-picker-option::before {
    background: linear-gradient(120deg, transparent, rgba(14, 165, 233, 0.14), transparent);
}

body.light-theme .voice-picker-option:hover {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13);
}

body.light-theme .voice-picker-option.selected {
    border-color: rgba(20, 184, 166, 0.62);
    background:
        linear-gradient(145deg, rgba(20, 184, 166, 0.13), rgba(245, 158, 11, 0.08)),
        rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(20, 184, 166, 0.14);
}

body.light-theme .voice-picker-option.is-preview-loading,
body.light-theme .voice-picker-option.is-previewing {
    border-color: rgba(8, 145, 178, 0.5);
}

body.light-theme .voice-picker-option.is-preview-loading::after,
body.light-theme .voice-picker-option.is-previewing::after,
body.light-theme .voice-picker-option.is-preview-ready::after {
    background: rgba(236, 254, 255, 0.82);
    color: #155e75;
}

body.light-theme .voice-picker-option-check {
    background: rgba(248, 250, 252, 0.86);
}

body.light-theme .voice-picker-footer {
    background: rgba(248, 250, 252, 0.88);
    border-top-color: rgba(148, 163, 184, 0.22);
}

body.light-theme .video-wrapper {
    background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
}

body.light-theme .tutorial-empty {
    color: var(--text-secondary);
    border-color: rgba(79, 70, 229, 0.18);
    background:
        radial-gradient(circle at 18% 18%, rgba(79, 70, 229, 0.1), transparent 32%),
        radial-gradient(circle at 82% 8%, rgba(14, 165, 233, 0.1), transparent 26%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.86));
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

body.light-theme .tutorial-empty::before {
    background:
        linear-gradient(90deg, rgba(79, 70, 229, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(14, 165, 233, 0.06) 1px, transparent 1px);
}

body.light-theme .tutorial-empty::after {
    background: rgba(79, 70, 229, 0.1);
}

body.light-theme .tutorial-empty-screen {
    border-color: rgba(148, 163, 184, 0.24);
    background:
        radial-gradient(circle at 24% 8%, rgba(79, 70, 229, 0.1), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(226, 232, 240, 0.88));
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.light-theme .tutorial-empty-screen-top span {
    background: rgba(100, 116, 139, 0.32);
}

body.light-theme .tutorial-empty-play {
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.22);
}

body.light-theme .tutorial-empty-line {
    background: rgba(100, 116, 139, 0.22);
}

body.light-theme .tutorial-empty-orbit {
    border-color: rgba(79, 70, 229, 0.2);
}

body.light-theme .tutorial-empty-orbit-one {
    background: rgba(79, 70, 229, 0.08);
}

body.light-theme .tutorial-empty-orbit-two {
    background: rgba(14, 165, 233, 0.08);
}

body.light-theme .tutorial-empty-step {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.light-theme .tutorial-markdown-body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.84)),
        rgba(255, 255, 255, 0.88);
    border-color: rgba(79, 70, 229, 0.16);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

body.light-theme .tutorial-markdown-body h1 {
    border-bottom-color: rgba(148, 163, 184, 0.28);
}

body.light-theme .tutorial-markdown-body li {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.88);
}

body.light-theme .tutorial-markdown-body pre {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(241, 245, 249, 0.95);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 澶撮儴 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle:focus-visible {
    outline: none;
    background: var(--bg-hover);
    box-shadow: var(--shadow-glow);
}

.theme-icon {
    font-size: 1.25rem;
}

/* 姝ラ鏉?*/
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 0;
    overflow-x: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.step:hover:not(.active):not(.completed) {
    opacity: 0.7;
}

.step.locked {
    cursor: not-allowed;
    opacity: 0.45;
}

.step.locked:hover {
    opacity: 0.45;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.step.active .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    transition: color var(--transition-normal);
}

.step.active .step-label {
    color: var(--accent-primary);
    font-weight: 500;
}

.step.completed .step-label {
    color: var(--success);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    position: relative;
    top: -14px;
    flex-shrink: 0;
}

/* 涓诲唴瀹瑰尯 */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.permission-empty-page .main-content {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-empty-card {
    width: min(100%, 680px);
    padding: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 18% 10%, rgba(99, 102, 241, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(30, 30, 46, 0.96), rgba(18, 18, 26, 0.96));
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.permission-empty-kicker {
    margin-bottom: 0.75rem;
    color: var(--accent-secondary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.permission-empty-card h2 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.permission-empty-card p {
    max-width: 520px;
    margin: 0 auto 1.25rem;
    color: var(--text-secondary);
}

.step-content {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 鎸夐挳鏍峰紡 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* 涓婁紶鍖哄煙 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-active);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* 杩涘害鏉?*/
.upload-progress {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar.large {
    height: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.analysis-progress {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.analysis-current {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--radius-md);
}

.analysis-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(99, 102, 241, 0.22);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    flex: 0 0 auto;
}

.analysis-current-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.analysis-current-message {
    margin-top: 0.2rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.analysis-stage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.625rem;
    margin-top: 0.875rem;
}

.analysis-stage-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.625rem 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.analysis-stage-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-tertiary);
    opacity: 0.55;
    flex: 0 0 auto;
}

.analysis-stage-item.completed {
    color: var(--text-secondary);
    border-color: rgba(34, 197, 94, 0.32);
}

.analysis-stage-item.completed .analysis-stage-dot {
    background: #22c55e;
    opacity: 1;
}

.analysis-stage-item.active {
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.12);
}

.analysis-stage-item.active .analysis-stage-dot {
    background: var(--accent-primary);
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.16);
}

.analysis-stage-item.failed {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
}

.analysis-stage-item.failed .analysis-stage-dot {
    background: #ef4444;
    opacity: 1;
}

.ai-warning-banner {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.875rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid rgba(245, 158, 11, 0.38);
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ai-warning-banner strong {
    color: #fcd34d;
    font-size: 0.875rem;
}

.ai-warning-banner span {
    color: var(--text-secondary);
}

/* 瑙嗛淇℃伅鍗＄墖 */
.video-info {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.video-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 鎿嶄綔鏍?*/
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.action-bar.subtitle-progress-mode {
    justify-content: center;
    align-items: stretch;
}

.action-bar.subtitle-progress-mode > :not(.subtitle-progress-actionbar) {
    display: none !important;
}

#step2Actions:not(.subtitle-progress-mode) > :not(.subtitle-progress-actionbar):not(.project-save-status) {
    animation: step2ActionControlsIn 0.24s ease both;
}

.project-save-status {
    position: absolute;
    left: 50%;
    top: calc(50% + 1rem);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: min(420px, calc(100% - 16rem));
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.project-save-status.hidden {
    display: none;
}

.project-save-copy {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.project-save-dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.project-save-status.dirty .project-save-dot {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.project-save-status.saving .project-save-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
    animation: projectSavePulse 0.9s ease-in-out infinite;
}

.project-save-status.creating .project-save-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
    animation: projectSavePulse 0.75s ease-in-out infinite;
}

.project-save-status.error .project-save-dot {
    background: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.project-save-status .btn {
    flex: 0 0 auto;
    pointer-events: auto;
}

.project-create-new-btn {
    position: relative;
    overflow: hidden;
}

.project-create-new-btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-110%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    animation: projectCreateSweep 1s ease-in-out infinite;
}

@keyframes projectSavePulse {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes projectCreateSweep {
    100% {
        transform: translateX(110%);
    }
}

@media (max-width: 900px) {
    .action-bar {
        flex-wrap: wrap;
    }

    .project-save-status {
        position: static;
        order: 2;
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
        border-radius: 18px;
        transform: none;
    }

    .project-save-copy {
        white-space: normal;
    }
}

/* 鐘舵€佹樉绀?*/
.parsing-status,
.summary-status,
.generating-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.status-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 1.5rem;
}

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

/* 瀛楀箷鍒楄〃 */
.subtitle-result,
.summary-result,
.split-result,
.commentary-result,
.voice-result {
    animation: fadeIn 0.3s ease;
}

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

.result-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.subtitle-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-height: 500px;
    overflow-y: auto;
}

.subtitle-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.subtitle-item:hover {
    background: var(--bg-hover);
}

.subtitle-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.subtitle-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 閿欒娑堟伅 */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-text {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* 鎯呰妭姒傝鍗＄墖 */
.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
}

.summary-regenerate-btn {
    position: relative;
    overflow: hidden;
}

.summary-regenerate-btn.is-loading {
    color: var(--accent-primary);
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.1);
}

.summary-regenerate-btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    animation: summaryRegenerateSweep 1s ease-in-out infinite;
}

.summary-regenerate-btn.is-loading .summary-regenerate-icon {
    display: inline-flex;
    animation: spin 0.8s linear infinite;
}

@keyframes summaryRegenerateSweep {
    to {
        transform: translateX(120%);
    }
}

.video-analysis-document {
    margin: 1rem 1.5rem 0;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.08));
}

.video-analysis-document-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.video-analysis-document-head h4 {
    margin: 0.15rem 0 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.video-analysis-kicker,
.video-analysis-source {
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.video-analysis-source {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    letter-spacing: 0;
    text-transform: none;
}

.video-analysis-summary {
    margin: 0 0 0.875rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
}

.video-analysis-scenes {
    display: grid;
    gap: 0.65rem;
    max-height: 340px;
    overflow: auto;
    padding-right: 0.25rem;
}

.video-analysis-scene {
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.22);
}

.video-analysis-scene-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.video-analysis-scene-head span {
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-size: 0.75rem;
}

.video-analysis-scene-head strong {
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: right;
}

.video-analysis-scene p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.video-analysis-events {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.video-analysis-events span {
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.summary-meta {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.meta-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item span {
    color: var(--text-primary);
    font-weight: 500;
}

/* 鎷嗗垎鐗囨甯冨眬 */
.split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.sync-layout {
    grid-template-columns: 280px minmax(0, 1fr) 280px;
}

.split-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 600px;
}

.split-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 600px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.segment-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.segment-list::-webkit-scrollbar {
    width: 6px;
}

.segment-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.segment-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.segment-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.segment-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.segment-item:hover {
    background: var(--bg-hover);
}

.segment-item.active {
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

.segment-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}

.segment-item.drag-over {
    border: 2px dashed var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.segment-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-item-drag-handle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: grab;
    padding: 0.25rem;
    user-select: none;
    letter-spacing: -2px;
}

.segment-item-drag-handle:hover {
    color: var(--text-primary);
}

.segment-item.dragging .segment-item-drag-handle {
    cursor: grabbing;
}

.segment-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.segment-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.segment-item-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--error);
    border: none;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.segment-item-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.segment-item-play {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: white;
    font-size: 0.625rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.segment-item-play:hover {
    background: #16a34a;
    transform: scale(1.1);
}

.segment-item-play.playing {
    background: var(--warning);
}

.segment-preview-item {
    opacity: 0.9;
    border-color: rgba(148, 163, 184, 0.18);
}

.segment-preview-item.segment-preview-enter {
    animation: segmentPreviewIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.segment-preview-badge {
    flex-shrink: 0;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.segment-stream-empty {
    margin: 0.5rem;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
}

.segment-progress-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@keyframes segmentPreviewIn {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
        filter: blur(0);
    }
}

.segment-item-time-row {
    display: flex;
    align-items: center;
}

.segment-item-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.segment-item-summary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.split-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.video-section video {
    width: 100%;
    height: auto;
    max-height: 320px;
    display: block;
    background: #000;
}

.segment-info {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.info-input,
.info-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast);
}

.info-input:focus,
.info-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.info-textarea {
    min-height: 60px;
    resize: vertical;
}

.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.time-input {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.segment-precision-row {
    align-items: center;
    justify-content: flex-start;
}

.segment-frame-snap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
}

.segment-frame-snap input {
    accent-color: var(--accent-primary);
}

.segment-frame-snap small {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

#step4 .split-main {
    height: 600px;
    min-height: 600px;
}

#step4 .video-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#step4 .video-section video {
    flex: 0 0 auto;
    max-height: 260px;
    object-fit: contain;
}

#step4 .segment-info {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem 0.875rem;
}

#step4 .info-row {
    flex: 0 0 auto;
    padding: 0.5rem 0;
}

#step4 .segment-info .info-row:nth-child(2) {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

#step4 .info-textarea {
    flex: 1 1 auto;
    min-height: 46px;
    height: 100%;
}

#step4 .segment-range-row {
    display: block;
}

#step4 .segment-range-box {
    background: rgba(26, 26, 37, 0.72);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.8rem 0.75rem;
}

#step4 .segment-range-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

#step4 .segment-range-value {
    color: var(--text-primary);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: right;
    white-space: nowrap;
}

#step4 .segment-range-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

#step4 .segment-range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--text-tertiary);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.68rem;
}

#step4 .segment-range-track {
    position: relative;
    height: 34px;
}

#step4 .segment-range-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

#step4 .segment-range-selection {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--accent-gradient);
    border-radius: 999px;
    box-shadow: 0 0 12px var(--accent-glow);
    pointer-events: none;
}

#step4 .segment-range-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 34px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

#step4 .segment-range-input:focus {
    outline: none;
}

#step4 .segment-range-input::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

#step4 .segment-range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--text-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm), 0 0 0 4px rgba(99, 102, 241, 0.12);
    cursor: ew-resize;
    pointer-events: auto;
}

#step4 .segment-range-input::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

#step4 .segment-range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm), 0 0 0 4px rgba(99, 102, 241, 0.12);
    cursor: ew-resize;
    pointer-events: auto;
}

@media (max-width: 768px) {
    #step4 .segment-range-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    #step4 .segment-range-value {
        text-align: left;
        white-space: normal;
    }
}

#step4 .segment-precision-row {
    padding-bottom: 0;
}

#step4 .segment-frame-snap {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    line-height: 1.4;
}

#step4 .segment-frame-snap small {
    flex-basis: 100%;
    margin-left: 1.5rem;
}

.timeline-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    flex: 1;
    min-height: 200px;
}

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

.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-level {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.timeline-container {
    position: relative;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timeline-ruler {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.timeline-track {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: 56px;
    padding: 8px;
}

.timeline-segment {
    position: absolute;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: white;
    cursor: move;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.timeline-segment:hover {
    box-shadow: var(--shadow-glow);
}

.timeline-segment.selected {
    box-shadow: 0 0 0 2px white, var(--shadow-glow);
}

/* 瑙ｈ璇嶅伐浣滃尯 - 涓婁笅甯冨眬 */
.commentary-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step5-requirements-panel {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(59, 130, 246, 0.14), transparent 32%),
        radial-gradient(circle at 92% 12%, rgba(34, 197, 94, 0.1), transparent 30%),
        var(--bg-secondary);
}

.step5-requirements-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
    gap: 1rem;
    align-items: stretch;
}

.step5-demand-column,
.step5-chat-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.85rem;
}

.step5-demand-column {
    position: sticky;
    top: 1rem;
    align-self: start;
}

.step5-column-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.step5-column-title span {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 800;
}

.step5-column-title small {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.step5-requirements-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.step5-requirements-head h3 {
    margin: 0 0 0.35rem;
}

.step5-requirements-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.step5-requirements-status,
.step5-ready-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    font-size: 0.75rem;
    font-weight: 700;
}

.step5-requirements-status.ready,
.step5-ready-badge.ready {
    background: rgba(59, 130, 246, 0.14);
    color: var(--info);
}

.step5-requirements-status.confirmed,
.step5-ready-badge.confirmed {
    background: rgba(34, 197, 94, 0.14);
    color: var(--success);
}

.step5-context-recommendation-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(360px, 1.25fr);
    gap: 0.55rem;
    align-items: stretch;
}

.step5-context-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: 0;
}

.step5-context-strip .config-item.readonly,
.step5-style-card {
    min-height: 86px;
    padding: 0.68rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
        rgba(10, 10, 15, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.step5-context-strip .config-item.readonly .config-value {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 800;
}

.step5-context-strip .config-label {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
}

.step5-chat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 300px;
    max-height: 460px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.1), transparent 28%),
        var(--bg-tertiary);
}

.step5-message {
    max-width: 86%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(26, 26, 37, 0.82);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.step5-message.user {
    align-self: flex-end;
    border-color: rgba(59, 130, 246, 0.34);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.1));
}

.step5-message-role {
    margin-bottom: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
}

.step5-message-content {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.step5-chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: stretch;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.03);
}

.step5-chat-input,
.step5-requirement-card input,
.step5-requirement-card textarea,
.step5-requirement-modal input,
.step5-requirement-modal textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.55;
}

.step5-chat-input:focus,
.step5-requirement-card input:focus,
.step5-requirement-card textarea:focus,
.step5-requirement-modal input:focus,
.step5-requirement-modal textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.step5-recommendations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: 0;
}

.step5-style-card {
    text-align: left;
    min-width: 0;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.step5-style-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(34, 197, 94, 0.07)),
        rgba(10, 10, 15, 0.3);
}

.step5-style-card strong,
.step5-style-card span,
.step5-style-card em {
    display: block;
}

.step5-style-card strong {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.25;
}

.step5-style-card span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.step5-style-card em {
    margin-top: 0.35rem;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
}

.step5-requirement-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.step5-ai-card {
    position: relative;
    padding: 1rem;
    border-color: rgba(59, 130, 246, 0.28);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(34, 197, 94, 0.08)),
        rgba(18, 18, 26, 0.92);
    overflow: hidden;
    min-height: 100%;
}

.step5-ai-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.step5-ai-card-top {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
}

.step5-ai-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.26);
}

.step5-ai-card-heading h4 {
    margin: 0 0 0.2rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.step5-ai-card-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
}

.step5-ai-card-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.step5-ai-card-field {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.28);
}

.step5-ai-card-field span,
.step5-modal-note span {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
}

.step5-ai-card-field strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step5-ai-card-note {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.65;
    padding: 0.75rem 0.85rem;
    border-left: 3px solid rgba(59, 130, 246, 0.55);
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.08);
}

.step5-card-title-row,
.step5-derived-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.step5-card-title-row h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.step5-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.step5-card-grid.secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step5-card-grid label,
.step5-card-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.step5-card-grid span,
.step5-card-field span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.step5-derived-row {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.step5-derived-row strong {
    color: var(--text-primary);
}

.step5-automation-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(59, 130, 246, 0.08));
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.step5-automation-status strong {
    color: var(--text-primary);
    white-space: nowrap;
}

.step5-actions-inline {
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.step5-actions-inline .btn {
    width: 100%;
    min-width: 0;
}

.step5-requirement-modal .modal-content,
.step5-requirement-modal-content {
    max-width: 780px;
    width: min(92vw, 780px);
}

.step5-requirement-modal .modal-header {
    align-items: flex-start;
}

.step5-requirement-modal .modal-header h3 {
    margin: 0 0 0.25rem;
}

.step5-requirement-modal .modal-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
}

.step5-requirement-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: min(68vh, 680px);
    overflow-y: auto;
}

.step5-modal-note {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: var(--radius-lg);
    background: rgba(59, 130, 246, 0.08);
}

.step5-modal-note p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.83rem;
    line-height: 1.65;
}

.step5-requirement-modal-footer {
    align-items: center;
}

.step5-fixed-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1rem;
}

.step5-fixed-card,
.step5-preset-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(34, 197, 94, 0.06)),
        rgba(18, 18, 26, 0.92);
}

.step5-fixed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.step5-fixed-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.step5-fixed-field span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.step5-style-input {
    min-height: 104px;
    resize: vertical;
}

.step5-fixed-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.step5-fixed-summary div {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.28);
}

.step5-fixed-summary span {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
}

.step5-fixed-summary strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-top {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
}

.workspace-top h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.config-list {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.config-item.fullwidth {
    grid-column: 1 / -1;
}

.config-item.readonly .config-value {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.config-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.config-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.config-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.config-list-with-action {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.config-list {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* 澧炲姞杈撳叆妗嗗搴?*/
.config-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    min-width: 140px;
}

.config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.config-item.readonly .config-value {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 140px;
    display: inline-block;
}

.config-actions-inline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* 闄嶄綆鎸夐挳楂樺害锛屼笌杈撳叆妗嗗榻?*/
.config-actions-inline .btn-generate,
.config-actions-inline .btn-regenerate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    white-space: nowrap;
    height: 36px;
    font-size: 0.875rem;
}

/* 鍝嶅簲寮忥細灏忓睆骞曟椂鎭㈠鍨傜洿甯冨眬 */
@media (max-width: 768px) {
    .step5-requirements-head,
    .step5-chat-input-row,
    .step5-card-title-row,
    .step5-derived-row {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .step5-requirements-layout {
        grid-template-columns: 1fr;
    }

    .step5-context-recommendation-row {
        grid-template-columns: 1fr;
    }

    .step5-context-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .step5-demand-column {
        position: static;
    }

    .step5-column-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .step5-card-grid,
    .step5-card-grid.secondary,
    .step5-ai-card-main,
    .step5-recommendations {
        grid-template-columns: 1fr;
    }

    .step5-context-strip .config-item.readonly,
    .step5-style-card {
        min-height: auto;
    }

    .step5-message {
        max-width: 100%;
    }

    .step5-ai-card-top,
    .step5-actions-inline {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .step5-ai-card-top {
        display: flex;
        flex-direction: column;
    }

    .step5-actions-inline .btn {
        width: 100%;
    }

    .config-list-with-action {
        flex-direction: column;
        align-items: stretch;
    }

    .config-list {
        justify-content: flex-start;
    }

    .config-input,
    .config-item.readonly .config-value {
        min-width: auto;
        width: 100%;
    }

    .config-actions-inline {
        flex-direction: row;
        justify-content: flex-start;
    }

    .config-actions-inline .btn-generate,
    .config-actions-inline .btn-regenerate {
        height: auto;
    }
}

/* Step 5 script requirements panel refresh */
.step5-requirements-panel {
    position: relative;
    overflow: hidden;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: calc(var(--radius-xl) + 6px);
    background:
        radial-gradient(circle at 9% 0%, rgba(99, 102, 241, 0.2), transparent 33%),
        radial-gradient(circle at 92% 10%, rgba(59, 130, 246, 0.12), transparent 29%),
        linear-gradient(145deg, rgba(18, 18, 26, 0.98), rgba(10, 10, 15, 0.96));
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.step5-requirements-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 64%);
}

.step5-requirements-panel > * {
    position: relative;
    z-index: 1;
}

.step5-requirements-head {
    align-items: center;
    padding: 0.15rem 0 0.95rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.step5-requirements-head h3 {
    margin: 0 0 0.3rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: -0.015em;
}

.step5-requirements-head p {
    max-width: 660px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.65;
}

.step5-requirements-status {
    gap: 0.45rem;
    padding: 0.38rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.06)),
        rgba(10, 10, 15, 0.28);
    color: #fbbf24;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.step5-requirements-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.step5-requirements-status.ready {
    border-color: rgba(34, 197, 94, 0.3);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(59, 130, 246, 0.08)),
        rgba(10, 10, 15, 0.28);
    color: #86efac;
}

.step5-fixed-layout {
    grid-template-columns: minmax(440px, 1.28fr) minmax(320px, 0.72fr);
    gap: 0.9rem;
    align-items: stretch;
}

.step5-fixed-card,
.step5-preset-card {
    position: relative;
    gap: 0.95rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: calc(var(--radius-xl) + 2px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
        rgba(18, 18, 26, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 14px 34px rgba(0, 0, 0, 0.18);
}

.step5-fixed-card {
    border-left: 3px solid rgba(99, 102, 241, 0.72);
}

.step5-preset-card {
    border-left: 3px solid rgba(59, 130, 246, 0.66);
}

.step5-fixed-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.step5-fixed-field:last-child {
    grid-column: 1 / -1;
}

.step5-fixed-field span {
    display: inline-flex;
    align-items: center;
    min-height: 1rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.step5-fixed-field .config-input,
.step5-style-input {
    width: 100%;
    min-width: 0;
    border-color: rgba(148, 163, 184, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        rgba(10, 10, 15, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.step5-fixed-field .config-input:focus,
.step5-style-input:focus {
    border-color: rgba(99, 102, 241, 0.78);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.step5-style-input {
    min-height: 116px;
    line-height: 1.65;
}

.step5-fixed-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.step5-fixed-summary div {
    position: relative;
    min-height: 76px;
    padding: 0.82rem 0.78rem 0.72rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.09), rgba(255, 255, 255, 0.018)),
        rgba(10, 10, 15, 0.46);
}

.step5-fixed-summary div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-primary), rgba(59, 130, 246, 0.1));
}

.step5-fixed-summary span {
    margin-bottom: 0.38rem;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.step5-fixed-summary strong {
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 850;
}

.step5-derived-row {
    align-items: flex-start;
    max-height: 150px;
    padding: 0.78rem 0.85rem;
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.11), rgba(59, 130, 246, 0.055)),
        rgba(10, 10, 15, 0.34);
    color: var(--text-secondary);
    line-height: 1.55;
    overflow: hidden;
}

.step5-derived-row > span:first-child {
    flex: 0 0 auto;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    font-weight: 750;
}

#step5SummaryStyle {
    flex: 1 1 260px;
    max-height: 122px;
    min-width: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    scrollbar-width: thin;
}

#step5SummaryStyle::-webkit-scrollbar {
    width: 6px;
}

#step5SummaryStyle::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 999px;
}

.step5-actions-inline {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 0.1rem;
}

.step5-actions-inline .btn {
    width: auto;
    min-width: 128px;
}

.step5-actions-inline #generateCommentaryBtn,
.step5-actions-inline #regenerateCommentaryBtn {
    flex: 0 0 100%;
    width: 100%;
    min-height: 42px;
    justify-content: center;
}

.step5-preset-card .step5-column-title {
    padding-bottom: 0.72rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.step5-preset-card .step5-column-title span {
    font-size: 0.94rem;
    letter-spacing: -0.01em;
}

.step5-preset-card .step5-column-title small {
    color: var(--text-tertiary);
    line-height: 1.45;
}

.step5-context-strip {
    gap: 0.55rem;
}

.step5-context-strip .config-item.readonly {
    min-height: 74px;
    justify-content: center;
    border-color: rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.018)),
        rgba(10, 10, 15, 0.4);
}

.step5-context-strip .config-label {
    margin-bottom: 0.35rem;
    color: var(--text-tertiary);
    font-size: 0.69rem;
    letter-spacing: 0.025em;
}

.step5-context-strip .config-item.readonly .config-value {
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 850;
}

.step5-recommendations {
    grid-template-columns: 1fr;
    gap: 0.48rem;
    max-height: calc((5.35rem * 3) + (0.48rem * 2));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.55) rgba(255, 255, 255, 0.06);
}

.step5-recommendations::-webkit-scrollbar {
    width: 6px;
}

.step5-recommendations::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.step5-recommendations::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.72), rgba(59, 130, 246, 0.42));
}

.step5-style-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title ratio"
        "desc ratio";
    column-gap: 0.72rem;
    align-items: center;
    min-height: 5.35rem;
    padding: 0.62rem 0.72rem 0.62rem 0.84rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
        rgba(10, 10, 15, 0.42);
    box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.34);
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-normal),
        box-shadow var(--transition-normal);
}

.step5-style-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(110deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.step5-style-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.45);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.07)),
        rgba(10, 10, 15, 0.5);
    box-shadow:
        inset 3px 0 0 rgba(99, 102, 241, 0.82),
        0 16px 34px rgba(0, 0, 0, 0.24);
}

.step5-style-card:hover::after {
    opacity: 1;
}

.step5-style-card strong {
    grid-area: title;
    margin-bottom: 0.16rem;
    font-size: 0.88rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.step5-style-card span {
    grid-area: desc;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
}

.step5-style-card em {
    grid-area: ratio;
    display: inline-flex;
    justify-self: end;
    align-self: center;
    width: max-content;
    max-width: 6.2rem;
    margin-top: 0;
    padding: 0.2rem 0.46rem;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: #c4b5fd;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

body.light-theme .step5-requirements-panel {
    border-color: rgba(79, 70, 229, 0.18);
    background:
        radial-gradient(circle at 9% 0%, rgba(79, 70, 229, 0.1), transparent 33%),
        radial-gradient(circle at 92% 10%, rgba(14, 165, 233, 0.09), transparent 29%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-theme .step5-fixed-card,
body.light-theme .step5-preset-card {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.light-theme .step5-fixed-field .config-input,
body.light-theme .step5-style-input,
body.light-theme .step5-fixed-summary div,
body.light-theme .step5-context-strip .config-item.readonly,
body.light-theme .step5-style-card,
body.light-theme .step5-derived-row {
    background: rgba(248, 250, 252, 0.78);
}

body.light-theme .step5-style-card em {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.09);
}

@media (max-width: 980px) {
    .step5-fixed-layout {
        grid-template-columns: 1fr;
    }

    .step5-fixed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .step5-requirements-panel {
        padding: 0.9rem;
        border-radius: var(--radius-xl);
    }

    .step5-requirements-head,
    .step5-derived-row {
        align-items: stretch;
        flex-direction: column;
    }

    .step5-fixed-grid,
    .step5-fixed-summary,
    .step5-context-strip {
        grid-template-columns: 1fr;
    }

    .step5-actions-inline {
        flex-direction: column;
    }

    .step5-actions-inline .btn {
        width: 100%;
    }
}

.btn-generate,
.btn-regenerate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
}

.btn-generate .btn-icon,
.btn-regenerate .btn-icon {
    font-size: 1rem;
}

.workspace-bottom {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.result-meta strong {
    color: var(--accent-primary);
}

.commentary-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-empty {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 0.9375rem;
    text-align: center;
    max-width: 300px;
}

.voice-result {
    margin-top: 1.5rem;
    overflow: hidden;
    min-height: 360px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 8% 0%, rgba(139, 92, 246, 0.15), transparent 32%),
        radial-gradient(circle at 92% 8%, rgba(99, 102, 241, 0.16), transparent 30%),
        linear-gradient(145deg, rgba(18, 18, 26, 0.98), rgba(12, 12, 18, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    animation: fadeIn 0.3s ease;
}

.voice-result .result-header {
    margin-bottom: 0;
    background:
        linear-gradient(135deg, rgba(26, 26, 37, 0.96), rgba(22, 18, 35, 0.96));
    border-bottom-color: rgba(139, 92, 246, 0.18);
}

.voice-result-subtitle {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.voice-progress-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(139, 92, 246, 0.26);
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(10, 10, 15, 0.48);
    font-size: 0.78rem;
    font-weight: 650;
}

.voice-progress-strip {
    padding: 1rem 1.25rem 1.15rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.16);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(10, 10, 15, 0.08));
}

.voice-progress-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.voice-progress-status {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.voice-progress-percent {
    color: #c4b5fd;
    font-family: 'SF Mono', monospace;
    font-size: 0.86rem;
    font-weight: 750;
}

.voice-progress-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(10, 10, 15, 0.72);
}

.voice-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, #6366f1 0%, #8b5cf6 48%, #ec4899 100%);
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.48);
    transition: width var(--transition-normal);
}

.voice-progress-message {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.voice-result .voice-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* 瑙ｈ璇嶅垪琛?*/
.commentary-list,
.voice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.commentary-card,
.voice-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: border-color var(--transition-fast);
}

.voice-result .voice-card {
    background:
        linear-gradient(145deg, rgba(30, 30, 46, 0.92), rgba(18, 18, 26, 0.96));
    border-color: rgba(139, 92, 246, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.voice-result .voice-card[data-ready="true"] {
    border-color: rgba(34, 197, 94, 0.3);
}

.voice-result .voice-card[data-ready="false"] {
    border-color: rgba(245, 158, 11, 0.2);
}

.commentary-card:hover,
.voice-card:hover {
    border-color: var(--border-hover);
}

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

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.card-badge-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.card-badge.original {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.card-badge.ai {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

.card-badge.segment {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.card-badge.mixed {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.card-original-ratio {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 650;
}

.card-content {
    margin-bottom: 1rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.voice-script-preview {
    color: var(--text-primary);
    line-height: 1.85;
    white-space: pre-wrap;
}

.voice-script-preview-audio-only .commentary-ai-inline {
    display: inline;
}

.voice-script-empty {
    color: var(--text-muted);
    font-style: italic;
}

.voice-card .commentary-original-inline,
.voice-card .commentary-ai-inline,
.voice-card .commentary-user-inline {
    font-size: 0.9rem;
}

.card-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.card-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* 鍗＄墖鎿嶄綔鎸夐挳鍖哄煙 - 闈犲彸甯冨眬锛屾寜閽湪鍚屼竴琛?*/
.card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.voice-card .card-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.voice-card .card-preview-actions,
.voice-card .voice-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.card-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 纭繚鎵€鏈夋寜閽珮搴︿竴鑷?*/
.card-actions-right .btn {
    height: 32px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

/* 鎸夐挳鎮仠鏁堟灉 */
.card-actions-right .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.card-actions-right .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* 鍘熺墖棰勮鍜岃瘯鍚В璇存寜閽壒娈婃牱寮?*/
.card-actions-right .preview-original:hover {
    border-color: var(--info);
    color: var(--info);
    background: rgba(59, 130, 246, 0.1);
}

.card-actions-right .preview-commentary:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
}

/* 淇濈暀鍘熸湁鐨?card-preview-actions 鏍峰紡鐢ㄤ簬鍏煎鎬?*/
.card-preview-actions .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-preview-actions .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.card-preview-actions .btn-secondary:hover::before {
    width: 200px;
    height: 200px;
}

.card-preview-actions .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.card-preview-actions .btn-secondary:active,
.card-preview-actions .btn-secondary.preview-original:active,
.card-preview-actions .btn-secondary.preview-commentary:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15) !important;
}

/* 鍘熺墖棰勮妯℃€佹鏍峰紡 */
.video-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.video-preview-modal.active {
    display: flex;
}

.video-preview-container {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.video-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.video-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.video-preview-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.video-preview-close:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

.video-preview-content {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-preview-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.video-preview-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', monospace;
}

.video-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 瑙ｈ璇嶄笂浼犲尯鍩熸牱寮?*/
.result-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.smart-match-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.smart-match-toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    color: var(--text-primary);
}

.smart-match-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.smart-match-toggle-ui {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: var(--border-color);
    position: relative;
    flex: 0 0 auto;
    transition: background var(--transition-fast);
}

.smart-match-toggle-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.smart-match-toggle input:checked + .smart-match-toggle-ui {
    background: linear-gradient(135deg, #0ea5e9, #10b981);
}

.smart-match-toggle input:checked + .smart-match-toggle-ui::after {
    transform: translateX(16px);
}

.smart-match-toggle input:checked ~ .smart-match-toggle-text {
    color: var(--text-primary);
}

.commentary-upload-area {
    margin: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.commentary-upload-area:hover,
.commentary-upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: var(--shadow-glow);
}

.upload-area-inner {
    text-align: center;
    cursor: pointer;
}

.upload-area-inner .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-area-inner .upload-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-area-inner .upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 瑙ｈ璇嶅崱鐗囨牱寮忓寮?*/
.commentary-card {
    position: relative;
    overflow: hidden;
}

.commentary-card.has-commentary {
    border-left: 3px solid var(--success);
}

.commentary-card.uploaded {
    border-left: 3px solid var(--accent-secondary);
}

.commentary-card.original {
    border-left: 3px solid var(--success);
}

.commentary-card.mixed {
    border-left: 3px solid #f59e0b;
}

.commentary-full-script-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.11), rgba(245, 158, 11, 0.08)),
        var(--bg-secondary);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.full-script-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.full-script-header > div {
    min-width: 0;
}

.full-script-kicker {
    margin-bottom: 0.25rem;
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.full-script-title {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 750;
}

.full-script-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: thin;
}

.full-script-meta span,
.full-script-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 650;
}

.full-script-badge {
    flex: 0 0 auto;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

.commentary-full-script-preview {
    width: 100%;
    min-height: 360px;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.85;
    max-height: 520px;
    overflow-y: auto;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.commentary-full-script-preview:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.commentary-full-script-preview p + p {
    margin-top: 0.8rem;
}

.commentary-script-body {
    min-height: 300px;
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 2.15;
    white-space: normal;
    word-break: break-word;
}

.commentary-script-empty {
    color: var(--text-tertiary);
}

.commentary-script-block {
    position: relative;
    display: inline;
    margin: 0 0.18rem 0.28rem 0;
    padding: 0.14rem 0.42rem;
    border: 1px solid transparent;
    border-radius: 0.48rem;
    cursor: text;
    font-weight: 680;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.commentary-script-block:hover {
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.12);
}

.commentary-script-block:focus {
    outline: 1px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.full-script-paragraph {
    position: relative;
    min-height: 1.6rem;
    margin: 0;
    padding: 2.25rem 0.85rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.2);
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.full-script-paragraph:hover {
    border-color: rgba(99, 102, 241, 0.32);
    background: rgba(15, 23, 42, 0.28);
    box-shadow: none;
}

.commentary-block-source-chip {
    position: absolute;
    top: 0.48rem;
    right: 0.55rem;
    display: inline-flex;
    max-width: min(22rem, calc(100% - 1.1rem));
    align-items: center;
    padding: 0.22rem 0.55rem;
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.13);
    color: #bfdbfe;
    cursor: pointer;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

.commentary-block-source-chip:hover {
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(59, 130, 246, 0.22);
    color: #dbeafe;
}

.narration-stream-card {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.76), rgba(17, 24, 39, 0.5));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: none;
}

.narration-stream-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.narration-stream-head strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.narration-stream-kicker,
.narration-stream-percent {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.narration-stream-kicker {
    margin-bottom: 0.35rem;
    padding: 0.22rem 0.55rem;
    background: rgba(99, 102, 241, 0.15);
    color: #c4b5fd;
}

.narration-stream-percent {
    padding: 0.28rem 0.65rem;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.narration-stream-track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.narration-stream-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #22c55e);
    transition: width 0.35s ease;
}

.narration-stream-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.narration-stream-meta span {
    padding: 0.24rem 0.52rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
}

.narration-stream-preview {
    min-height: 220px;
    max-height: 520px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-md);
    background: rgba(2, 6, 23, 0.36);
    color: var(--text-primary);
    line-height: 1.85;
    white-space: pre-wrap;
}

.narration-stream-preview p {
    margin: 0;
    animation: none;
}

.narration-stream-preview p + p {
    margin-top: 0.7rem;
}

.narration-stream-placeholder {
    display: grid;
    min-height: 160px;
    place-items: center;
    color: var(--text-tertiary);
    text-align: center;
}

body.light-theme .narration-stream-card {
    border-color: rgba(79, 70, 229, 0.18);
    background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, 0.1), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.88));
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .narration-stream-preview {
    background: rgba(248, 250, 252, 0.78);
}

@keyframes narrationStreamFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.original-inline-completion,
.original-hover-candidate,
.commentary-source-tooltip {
    position: absolute;
    z-index: 30;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-md);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.original-inline-completion {
    align-items: center;
    gap: 0.7rem;
    max-width: min(34rem, calc(100% - 1.5rem));
    padding: 0.58rem 0.7rem;
    pointer-events: none;
}

.original-completion-key {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 2.3rem;
    padding: 0.2rem 0.48rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 850;
}

.original-completion-body {
    min-width: 0;
}

.original-completion-body strong,
.original-completion-body span,
.original-completion-body small {
    display: block;
}

.original-completion-body strong {
    margin-bottom: 0.12rem;
    color: #86efac;
    font-size: 0.78rem;
}

.original-completion-body span {
    overflow: hidden;
    max-width: 26rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.original-completion-body small {
    margin-top: 0.1rem;
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

.commentary-script-block.original-scan-hit {
    border-color: rgba(34, 197, 94, 0.48);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16), inset 0 -2px 0 rgba(34, 197, 94, 0.65);
}

.commentary-script-block.original-scan-hit::after {
    content: '可采用原片';
    display: inline-flex;
    margin-left: 0.3rem;
    padding: 0.02rem 0.28rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #86efac;
    font-size: 0.62rem;
    font-weight: 850;
    pointer-events: none;
    vertical-align: 0.08rem;
}

.full-script-paragraph.original-scan-hit {
    position: relative;
    padding: 2.25rem 5.2rem 0.85rem 0.85rem;
    border-radius: 0.45rem;
    background: rgba(34, 197, 94, 0.08);
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.6);
}

.full-script-paragraph.original-scan-hit::after {
    content: '可用原片';
    position: absolute;
    right: 0.45rem;
    top: 0.3rem;
    padding: 0.12rem 0.42rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #86efac;
    font-size: 0.68rem;
    font-weight: 850;
    pointer-events: none;
}

.original-hover-candidate {
    width: min(22rem, calc(100% - 1.5rem));
    padding: 0.72rem;
}

.commentary-source-tooltip {
    width: min(20rem, calc(100% - 1.5rem));
    padding: 0.62rem 0.72rem;
    cursor: pointer;
    pointer-events: auto;
}

.commentary-source-tooltip:hover {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.38), 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.commentary-source-tooltip strong,
.commentary-source-tooltip span,
.commentary-source-tooltip small {
    display: block;
}

.commentary-source-tooltip strong {
    margin-bottom: 0.2rem;
    color: #93c5fd;
    font-size: 0.78rem;
}

.commentary-source-tooltip span {
    color: var(--text-primary);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 800;
}

.commentary-source-tooltip small {
    margin-top: 0.24rem;
    color: var(--text-tertiary);
    font-size: 0.68rem;
}

.original-hover-title {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.48rem;
}

.original-hover-title strong {
    color: #86efac;
    font-size: 0.82rem;
}

.original-hover-title span,
.original-hover-meta {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.original-hover-text {
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.55;
}

.original-hover-meta {
    margin-bottom: 0.58rem;
}

body.light-theme .original-inline-completion,
body.light-theme .original-hover-candidate,
body.light-theme .commentary-source-tooltip {
    border-color: rgba(34, 197, 94, 0.22);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 244, 0.94));
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .original-completion-key,
body.light-theme .commentary-script-block.original-scan-hit::after,
body.light-theme .full-script-paragraph.original-scan-hit::after {
    background: rgba(240, 253, 244, 0.9);
    color: #15803d;
}

.full-script-helper {
    margin-top: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .full-script-header {
        flex-direction: column;
    }

    .full-script-badge {
        align-self: flex-start;
    }

    .commentary-full-script-preview {
        min-height: 300px;
        font-size: 0.9rem;
    }
}

.commentary-script-preview {
    margin-bottom: 0.75rem;
    padding: 0.8rem;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.13), rgba(34, 197, 94, 0.08)),
        rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
}

.commentary-script-preview-label {
    margin-bottom: 0.4rem;
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 650;
}

.commentary-script-preview p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.925rem;
    line-height: 1.85;
    white-space: pre-wrap;
}

.commentary-original-inline,
.commentary-ai-inline,
.commentary-user-inline,
.commentary-mixed-inline {
    display: inline;
}

.commentary-mixed-inline {
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(59, 130, 246, 0.18));
    border-color: rgba(45, 212, 191, 0.38);
    color: #dffcf7;
    cursor: text;
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.18);
}

.commentary-mixed-inline:focus {
    outline: 1px solid rgba(45, 212, 191, 0.62);
    outline-offset: 2px;
}

.commentary-mixed-original-fragment {
    display: inline;
    margin: 0 0.1rem;
    padding: 0.04rem 0.26rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
    font-weight: 760;
    user-select: text;
    cursor: text;
}

.commentary-mixed-ai-fragment {
    display: inline;
}

.commentary-visual-inline {
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(71, 85, 105, 0.14));
    border-color: rgba(148, 163, 184, 0.34);
    color: #cbd5e1;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    user-select: none;
}

.commentary-visual-inline:hover {
    border-color: rgba(203, 213, 225, 0.52);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.24), rgba(71, 85, 105, 0.2));
}

.commentary-original-inline {
    padding: 0.12rem 0.35rem;
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    cursor: text;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.28);
}

.commentary-original-inline:focus {
    outline: 1px solid rgba(34, 197, 94, 0.58);
    outline-offset: 2px;
}

.commentary-ai-inline {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(167, 139, 250, 0.34);
    color: #ddd6fe;
    cursor: text;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.22);
}

.commentary-ai-inline:focus {
    outline: 1px solid rgba(167, 139, 250, 0.62);
    outline-offset: 2px;
}

.commentary-user-inline {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(251, 191, 36, 0.38);
    color: #fde68a;
    cursor: text;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.22);
}

.commentary-user-inline:focus {
    outline: 1px solid rgba(251, 191, 36, 0.62);
    outline-offset: 2px;
}

.commentary-original-inline.is-playing {
    background: rgba(34, 197, 94, 0.28);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45), 0 0 22px rgba(34, 197, 94, 0.2);
}

.commentary-ai-inline.is-playing {
    background: rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.36);
}

.commentary-user-inline.is-playing {
    background: rgba(245, 158, 11, 0.28);
    color: #fef3c7;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.42);
}

.commentary-source-modal-content {
    display: flex;
    flex-direction: column;
    width: min(920px, calc(100vw - 2rem));
    max-height: min(92vh, 880px);
    overflow: hidden;
}

.commentary-source-modal-footer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
}

.commentary-source-modal-footer .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
}

.commentary-source-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 1rem;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.commentary-source-preview {
    display: grid;
    gap: 0.75rem;
}

.commentary-source-preview video {
    width: 100%;
    max-height: min(38vh, 360px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #000;
}

.commentary-source-summary {
    display: grid;
    gap: 0.28rem;
    padding: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.24);
}

.commentary-source-summary strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.commentary-source-summary span {
    max-height: 5.8rem;
    overflow-y: auto;
    padding-right: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
    scrollbar-gutter: stable;
}

.commentary-source-range-box {
    grid-column: auto;
}

.commentary-source-range-box .video-block-range-track::before {
    background:
        linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02)),
        var(--bg-tertiary);
}

.commentary-source-range-zone {
    position: absolute;
    top: 50%;
    height: 6px;
    border-radius: 999px;
    pointer-events: none;
    transform: translateY(-50%);
}

.commentary-source-range-zone-left {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.06));
}

.commentary-source-range-zone-right {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.18));
}

.commentary-source-range-box .video-block-range-selection {
    height: 8px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.commentary-source-range-box .video-block-range-input {
    pointer-events: none;
}

.commentary-source-range-box .video-block-range-input::-webkit-slider-thumb {
    width: 0;
    height: 0;
    border: 0;
    box-shadow: none;
    pointer-events: none;
}

.commentary-source-range-box .video-block-range-input::-moz-range-thumb {
    width: 0;
    height: 0;
    border: 0;
    box-shadow: none;
    pointer-events: none;
}

.commentary-source-range-handle {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 3px solid var(--accent-primary);
    border-radius: 999px;
    background: var(--text-primary);
    box-shadow: var(--shadow-sm), 0 0 0 5px rgba(99, 102, 241, 0.14);
    cursor: ew-resize;
    transform: translate(-50%, -50%);
}

.commentary-source-range-handle-end {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-sm), 0 0 0 5px rgba(14, 165, 233, 0.14);
}

.commentary-source-range-handle:hover,
.commentary-source-range-handle:focus-visible,
.commentary-source-range-handle.is-dragging {
    outline: none;
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: var(--shadow-md), 0 0 0 6px var(--accent-glow);
}

.commentary-source-type-box {
    display: grid;
    gap: 0.55rem;
    padding: 0.82rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.commentary-source-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.commentary-source-type-header strong {
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.commentary-source-type-select-wrap {
    position: relative;
}

.commentary-source-type-select-wrap::after {
    content: "";
    position: absolute;
    right: 0.95rem;
    top: 50%;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.commentary-source-type-select {
    width: 100%;
    min-height: 42px;
    padding: 0.62rem 2.35rem 0.62rem 0.82rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.commentary-source-type-select:hover {
    border-color: var(--border-hover);
}

.commentary-source-type-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.commentary-source-type-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.commentary-source-type-help {
    color: var(--text-tertiary);
    font-size: 0.74rem;
    line-height: 1.45;
}

body.light-theme .full-script-paragraph {
    background: rgba(248, 250, 252, 0.72);
    border-color: rgba(148, 163, 184, 0.22);
}

body.light-theme .full-script-paragraph:hover {
    background: rgba(239, 246, 255, 0.76);
    border-color: rgba(96, 165, 250, 0.32);
}

body.light-theme .commentary-block-source-chip {
    background: rgba(219, 234, 254, 0.76);
    color: #1d4ed8;
}

body.light-theme .commentary-script-body {
    color: #0f172a;
}

body.light-theme .commentary-original-inline {
    background: rgba(220, 252, 231, 0.92);
    color: #166534;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.32);
}

body.light-theme .commentary-ai-inline {
    background: rgba(237, 233, 254, 0.92);
    border-color: rgba(124, 58, 237, 0.22);
    color: #5b21b6;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.22);
}

body.light-theme .commentary-user-inline {
    background: rgba(254, 243, 199, 0.94);
    border-color: rgba(217, 119, 6, 0.24);
    color: #92400e;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.22);
}

body.light-theme .commentary-visual-inline {
    background:
        linear-gradient(135deg, rgba(226, 232, 240, 0.94), rgba(241, 245, 249, 0.82));
    border-color: rgba(100, 116, 139, 0.26);
    color: #334155;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.18);
}

body.light-theme .commentary-source-summary {
    background: rgba(248, 250, 252, 0.82);
}

body.light-theme .commentary-source-type-box {
    background: rgba(248, 250, 252, 0.9);
}

body.light-theme .commentary-source-type-select {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78)),
        var(--bg-secondary);
}

.commentary-part-label {
    display: inline-flex;
    margin-right: 0.28rem;
    padding: 0.05rem 0.28rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: #bbf7d0;
    font-size: 0.68rem;
    font-weight: 800;
    vertical-align: 0.08rem;
}

.original-commentary-note {
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.original-commentary-transcript {
    margin-bottom: 0.75rem;
    padding: 0.8rem;
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(14, 165, 233, 0.08)),
        rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.original-commentary-transcript-label {
    margin-bottom: 0.35rem;
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
}

.original-commentary-transcript p {
    margin: 0;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.925rem;
    font-weight: 650;
    line-height: 1.8;
    letter-spacing: 0.01em;
    white-space: pre-wrap;
}

.original-commentary-transcript p.is-playing {
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35), 0 0 24px rgba(34, 197, 94, 0.16);
}

.commentary-status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.commentary-status-badge.ai {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.commentary-status-badge.uploaded {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

/* 瑙ｈ璇嶆枃鏈珮浜姩鐢?*/
.commentary-text .highlight-word {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.audio-label {
    color: var(--text-tertiary);
}

.audio-value {
    color: var(--text-primary);
    font-weight: 500;
}

.voice-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    font-size: 0.72rem;
    font-weight: 700;
}

.voice-status-pill.ready {
    border-color: rgba(34, 197, 94, 0.28);
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
}

.voice-status-pill.generating {
    border-color: rgba(139, 92, 246, 0.34);
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.14);
}

.voice-status-pill.pending {
    border-color: rgba(245, 158, 11, 0.28);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.11);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-align: center;
}

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

/* 閰嶉煶璁剧疆 */
.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.voice-presets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.68rem;
    max-height: 300px;
    overflow: hidden;
}

.voice-preset {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon name"
        "icon engine"
        "voice voice"
        "tone tone";
    align-items: center;
    gap: 0.2rem 0.62rem;
    min-height: 138px;
    padding: 0.88rem;
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.24), transparent 42%),
        radial-gradient(circle at 92% 10%, rgba(99, 102, 241, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(24, 18, 38, 0.96), rgba(10, 10, 15, 0.9));
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.voice-preset::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(circle at 92% 18%, rgba(217, 70, 239, 0.18), transparent 34%);
    opacity: 0;
    transform: translateX(-18%);
    transition: opacity var(--transition-fast), transform 0.45s ease;
}

.voice-preset:hover {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.62);
    box-shadow: 0 24px 56px rgba(3, 7, 18, 0.48), 0 0 0 1px rgba(139, 92, 246, 0.18) inset, 0 0 30px rgba(99, 102, 241, 0.16);
}

.voice-preset:hover::before {
    opacity: 1;
    transform: translateX(18%);
}

.voice-more-preset {
    grid-template-columns: 1fr;
    grid-template-areas:
        "icon"
        "name"
        "engine"
        "current";
    justify-items: center;
    align-content: center;
    gap: 0.34rem;
    min-height: 138px;
    padding: 0.9rem 0.82rem;
    border-style: solid;
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(217, 70, 239, 0.1)),
        radial-gradient(circle at 50% 8%, rgba(196, 181, 253, 0.28), transparent 40%),
        rgba(12, 10, 20, 0.9);
    border-color: rgba(196, 181, 253, 0.48);
    box-shadow: 0 18px 42px rgba(79, 70, 229, 0.16), 0 0 0 1px rgba(196, 181, 253, 0.08) inset;
}

.voice-more-preset.has-current-voice {
    grid-template-columns: 1fr;
    grid-template-areas: "current";
    align-content: center;
    gap: 0;
    padding: 0.82rem;
    border-color: rgba(34, 211, 238, 0.52);
    box-shadow: 0 20px 52px rgba(6, 182, 212, 0.18), 0 0 0 1px rgba(34, 211, 238, 0.12) inset;
}

.voice-more-preset::after {
    content: "打开";
    position: absolute;
    top: 0.58rem;
    right: 0.58rem;
    padding: 0.16rem 0.46rem;
    border: 1px solid rgba(196, 181, 253, 0.4);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.2);
    color: #ede9fe;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.voice-more-preset.has-current-voice::after {
    content: "选择更多音色";
    top: 0.56rem;
    right: 0.56rem;
    max-width: calc(100% - 1.12rem);
    padding: 0.15rem 0.42rem;
    background: rgba(8, 145, 178, 0.2);
    border-color: rgba(34, 211, 238, 0.36);
    color: #cffafe;
    font-size: 0.52rem;
    letter-spacing: 0.04em;
}

.voice-more-preset .preset-icon {
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(221, 214, 254, 0.3);
    border-radius: 16px;
    color: #f5f3ff;
    font-size: 0;
    letter-spacing: 0;
    background:
        radial-gradient(circle at 42% 30%, rgba(255, 255, 255, 0.34), transparent 24%),
        linear-gradient(135deg, rgba(99, 102, 241, 0.98), rgba(139, 92, 246, 0.96), rgba(217, 70, 239, 0.86));
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.32);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.voice-more-preset.has-current-voice .preset-icon,
.voice-more-preset.has-current-voice .preset-name,
.voice-more-preset.has-current-voice .preset-engine {
    display: none;
}

.voice-more-preset .preset-icon::before {
    content: "+";
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.voice-more-preset .preset-icon::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px dashed rgba(196, 181, 253, 0.34);
    border-radius: 20px;
}

.voice-more-preset .preset-name {
    color: #f5f3ff;
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.voice-more-preset .preset-engine {
    color: #c4b5fd;
    font-size: 0.62rem;
}

.voice-more-current {
    grid-area: current;
    position: relative;
    display: grid;
    justify-items: start;
    gap: 0.16rem;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    padding: 0.58rem 0.66rem;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.18), rgba(99, 102, 241, 0.12));
    color: #cffafe;
    animation: voiceMoreCurrentReveal 0.42s ease both, voiceMoreCurrentGlow 2.8s ease-in-out infinite;
}

.voice-more-current::after {
    content: "›";
    position: absolute;
    top: 50%;
    right: 0.62rem;
    color: rgba(207, 250, 254, 0.74);
    font-size: 1.35rem;
    font-weight: 500;
    transform: translateY(-50%);
}

.voice-more-current span {
    color: rgba(207, 250, 254, 0.78);
    font-size: 0.54rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.voice-more-current strong,
.voice-more-current em {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-more-current strong {
    color: #f8fafc;
    font-size: 0.96rem;
    font-weight: 900;
}

.voice-more-current em {
    color: rgba(186, 230, 253, 0.82);
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
}

@keyframes voiceMoreCurrentReveal {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes voiceMoreCurrentGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(34, 211, 238, 0);
    }

    50% {
        box-shadow: 0 0 22px rgba(34, 211, 238, 0.18);
    }
}

.voice-more-preset .preset-voice-id {
    display: none;
}

.voice-more-preset:hover {
    border-color: rgba(221, 214, 254, 0.72);
    box-shadow: 0 24px 58px rgba(79, 70, 229, 0.3), 0 0 0 1px rgba(196, 181, 253, 0.16) inset;
}

.voice-more-preset:hover .preset-icon {
    transform: scale(1.04);
    box-shadow: 0 22px 48px rgba(139, 92, 246, 0.44);
}

.voice-preset-badges {
    position: absolute;
    top: 0.72rem;
    right: 0.72rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
}

.voice-hot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

.voice-preset .voice-hot-badge {
    position: static;
}

.voice-picker-option .voice-hot-badge {
    position: absolute;
    top: 0.58rem;
    right: 2.1rem;
    z-index: 2;
}

.voice-last-used-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
    border: 1px solid rgba(167, 139, 250, 0.38);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1.25;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
}

.voice-preset.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
    filter: grayscale(0.8);
    pointer-events: auto;
}

.voice-preset.is-disabled:hover {
    border-color: transparent;
    transform: none;
}

.voice-preset.active {
    border-color: rgba(196, 181, 253, 0.84);
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.34), transparent 44%),
        radial-gradient(circle at 100% 0%, rgba(217, 70, 239, 0.2), transparent 38%),
        linear-gradient(145deg, rgba(67, 56, 202, 0.22), rgba(12, 10, 20, 0.95));
    box-shadow: 0 26px 64px rgba(79, 70, 229, 0.28), 0 0 0 1px rgba(196, 181, 253, 0.18) inset;
}

.voice-preset.is-preview-loading,
.voice-preset.is-previewing {
    border-color: rgba(34, 211, 238, 0.72);
}

.voice-preset.is-previewing {
    box-shadow: 0 26px 64px rgba(6, 182, 212, 0.24), 0 0 0 1px rgba(34, 211, 238, 0.2) inset;
}

.voice-preset.is-preview-loading::after,
.voice-preset.is-previewing::after,
.voice-preset.is-preview-ready::after {
    position: absolute;
    right: 0.72rem;
    bottom: 0.72rem;
    z-index: 2;
    padding: 0.14rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.36);
    background: rgba(8, 145, 178, 0.18);
    color: #cffafe;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.voice-preset.is-preview-loading::after {
    content: "准备试听";
}

.voice-preset.is-previewing::after {
    content: "试听中";
}

.voice-preset.is-preview-ready:not(.is-preview-loading):not(.is-previewing)::after {
    content: "双击试听";
    border-color: rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.36);
    color: rgba(226, 232, 240, 0.76);
}

.voice-preset.is-previewing .preset-icon {
    animation: voicePresetPulse 1.1s ease-in-out infinite;
}

@keyframes voicePresetPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 14px 34px rgba(99, 102, 241, 0.28);
    }

    50% {
        transform: scale(1.06);
        box-shadow: 0 18px 42px rgba(34, 211, 238, 0.36);
    }
}

.preset-icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.36), transparent 28%),
        linear-gradient(135deg, #6366f1, #8b5cf6 58%, #d946ef);
    color: #f5f3ff;
    font-size: 1.15rem;
    font-weight: 950;
    letter-spacing: -0.04em;
    box-shadow: 0 14px 34px rgba(99, 102, 241, 0.28);
}

.preset-name {
    grid-area: name;
    min-width: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.15;
    text-align: left;
}

.preset-status {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    line-height: 1;
}

.voice-preset.active .preset-name {
    color: #f5f3ff;
}

.preset-engine {
    grid-area: engine;
    color: #c4b5fd;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.preset-voice-id {
    grid-area: voice;
    align-self: end;
    min-width: 0;
    margin-top: 0.5rem;
    padding: 0.42rem 0.52rem;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.16);
    color: #ddd6fe;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-tone {
    grid-area: tone;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

body.light-theme .voice-preset {
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.14), transparent 40%),
        radial-gradient(circle at 92% 10%, rgba(99, 102, 241, 0.1), transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 243, 255, 0.9));
    border-color: rgba(139, 92, 246, 0.24);
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.12);
}

body.light-theme .voice-preset:hover {
    border-color: rgba(124, 58, 237, 0.46);
    box-shadow: 0 22px 48px rgba(79, 70, 229, 0.16), 0 0 0 1px rgba(139, 92, 246, 0.12) inset;
}

body.light-theme .voice-preset.active {
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.18), transparent 42%),
        linear-gradient(145deg, rgba(245, 243, 255, 0.98), rgba(238, 242, 255, 0.88));
    box-shadow: 0 24px 56px rgba(79, 70, 229, 0.16), 0 0 0 1px rgba(139, 92, 246, 0.18) inset;
}

body.light-theme .voice-more-preset.has-current-voice {
    border-color: rgba(8, 145, 178, 0.38);
    box-shadow: 0 20px 48px rgba(8, 145, 178, 0.12), 0 0 0 1px rgba(8, 145, 178, 0.08) inset;
}

body.light-theme .voice-more-current {
    background: linear-gradient(135deg, rgba(236, 254, 255, 0.88), rgba(238, 242, 255, 0.76));
    border-color: rgba(8, 145, 178, 0.24);
    color: #155e75;
}

body.light-theme .voice-more-preset.has-current-voice::after {
    background: rgba(236, 254, 255, 0.9);
    border-color: rgba(8, 145, 178, 0.22);
    color: #155e75;
}

body.light-theme .voice-more-current span,
body.light-theme .voice-more-current em {
    color: #0f766e;
}

body.light-theme .voice-more-current::after {
    color: rgba(15, 118, 110, 0.68);
}

body.light-theme .voice-more-current strong {
    color: #0f172a;
}

body.light-theme .voice-preset.is-preview-loading,
body.light-theme .voice-preset.is-previewing {
    border-color: rgba(8, 145, 178, 0.5);
}

body.light-theme .voice-preset.is-preview-loading::after,
body.light-theme .voice-preset.is-previewing::after,
body.light-theme .voice-preset.is-preview-ready::after {
    background: rgba(236, 254, 255, 0.82);
    color: #155e75;
}

body.light-theme .voice-preset.active .preset-name {
    color: #4c1d95;
}

body.light-theme .preset-voice-id {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

body.light-theme .preset-tone {
    color: #64748b;
}

.custom-voice-preset {
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 197, 94, 0.08)),
        var(--bg-tertiary);
    border-style: dashed;
}

.custom-voice-preset::after {
    content: "Custom";
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: var(--accent-primary);
    font-size: 0.625rem;
    line-height: 1.2;
}

.custom-voice-preset.saved::after {
    content: "Saved";
    background: rgba(34, 197, 94, 0.14);
    color: var(--success);
}

.custom-voice-preset.is-disabled {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(148, 163, 184, 0.18);
    border-style: dashed;
}

.custom-voice-preset.is-disabled::after {
    content: "正在开发";
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-tertiary);
}

.custom-voice-preset.is-disabled .preset-icon,
.custom-voice-preset.is-disabled .preset-name {
    color: var(--text-tertiary);
}

.voice-picker-modal {
    z-index: 1080;
}

.voice-picker-content {
    width: min(92vw, 760px);
    max-width: 760px;
    background:
        radial-gradient(circle at 12% 0%, rgba(139, 92, 246, 0.18), transparent 32%),
        radial-gradient(circle at 88% 10%, rgba(99, 102, 241, 0.14), transparent 30%),
        var(--bg-secondary);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
}

.voice-picker-header {
    align-items: flex-start;
    padding: 1.25rem 1.35rem 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent);
}

.voice-picker-title-block {
    display: grid;
    gap: 0.35rem;
}

.voice-picker-kicker {
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(167, 139, 250, 0.28);
    color: #ddd6fe;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.voice-picker-title-block h3 {
    margin: 0;
    font-size: 1.05rem;
}

.voice-picker-title-block p {
    margin: 0;
    max-width: 560px;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    line-height: 1.6;
}

.voice-picker-body {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.voice-picker-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.13), rgba(99, 102, 241, 0.07)),
        rgba(10, 10, 15, 0.28);
}

.voice-picker-orb,
.voice-picker-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    color: #f5f3ff;
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 14px 34px rgba(99, 102, 241, 0.28);
}

.voice-picker-summary span {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.voice-picker-summary strong {
    display: block;
    margin-top: 0.1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.voice-picker-summary small {
    display: block;
    margin-top: 0.15rem;
    color: #c4b5fd;
    font-size: 0.74rem;
}

.voice-picker-search {
    display: grid;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.voice-picker-search input {
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.62);
    color: var(--text-primary);
    outline: none;
}

.voice-picker-search input:focus {
    border-color: rgba(167, 139, 250, 0.62);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.voice-picker-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-height: min(52vh, 324px);
    overflow: auto;
    padding-right: 0.3rem;
}

.voice-picker-grid::-webkit-scrollbar {
    width: 6px;
}

.voice-picker-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.voice-picker-grid::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.42);
    border-radius: 999px;
}

.voice-picker-option {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(116px, 0.82fr) minmax(0, 1.55fr) auto;
    grid-template-areas: "icon main desc count";
    align-items: center;
    column-gap: 0.9rem;
    row-gap: 0.45rem;
    min-height: 100px;
    padding: 0.9rem 3rem 0.9rem 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
        rgba(18, 18, 26, 0.86);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.voice-picker-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-120%);
    transition: transform 0.5s ease;
}

.voice-picker-option:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.voice-picker-option:hover::before {
    transform: translateX(120%);
}

.voice-picker-option.selected {
    border-color: rgba(196, 181, 253, 0.78);
    background:
        linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(99, 102, 241, 0.1)),
        rgba(18, 18, 26, 0.94);
    box-shadow: 0 18px 48px rgba(99, 102, 241, 0.2);
}

.voice-picker-option.is-preview-loading,
.voice-picker-option.is-previewing {
    border-color: rgba(34, 211, 238, 0.72);
}

.voice-picker-option.is-previewing {
    box-shadow: 0 18px 48px rgba(6, 182, 212, 0.2);
}

.voice-picker-option.is-preview-loading::after,
.voice-picker-option.is-previewing::after,
.voice-picker-option.is-preview-ready::after {
    position: absolute;
    right: 0.75rem;
    bottom: 0.65rem;
    z-index: 2;
    padding: 0.14rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.36);
    background: rgba(8, 145, 178, 0.18);
    color: #cffafe;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.voice-picker-option.is-preview-loading::after {
    content: "准备试听";
}

.voice-picker-option.is-previewing::after {
    content: "试听中";
}

.voice-picker-option.is-preview-ready:not(.is-preview-loading):not(.is-previewing)::after {
    content: "双击试听";
    border-color: rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.36);
    color: rgba(226, 232, 240, 0.76);
}

.voice-picker-option.is-previewing .voice-picker-option-icon {
    animation: voicePresetPulse 1.1s ease-in-out infinite;
}

.voice-picker-option.current:not(.selected) {
    border-color: rgba(245, 158, 11, 0.36);
}

.voice-picker-option-check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(10, 10, 15, 0.4);
}

.voice-picker-option.selected .voice-picker-option-check {
    border-color: rgba(196, 181, 253, 0.92);
    background: #8b5cf6;
}

.voice-picker-option.selected .voice-picker-option-check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #f5f3ff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.voice-picker-option-icon {
    grid-area: icon;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 0.95rem;
}

.voice-picker-option-main {
    grid-area: main;
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding-right: 0;
}

.voice-picker-option-main strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.voice-picker-option-main em {
    color: #c4b5fd;
    font-size: 0.72rem;
    font-style: normal;
}

.voice-picker-option-desc {
    grid-area: desc;
    color: var(--text-tertiary);
    font-size: 0.76rem;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.voice-picker-option-count {
    grid-area: count;
    justify-self: end;
    align-self: center;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.voice-picker-empty {
    grid-column: 1 / -1;
    padding: 1.5rem;
    border: 1px dashed rgba(148, 163, 184, 0.26);
    border-radius: var(--radius-lg);
    color: var(--text-tertiary);
    text-align: center;
}

.modal-footer.voice-picker-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    gap: 0.75rem;
    background: rgba(10, 10, 15, 0.72);
}

.modal-footer.voice-picker-footer .btn {
    width: 100%;
    min-height: 44px;
}

@media (max-width: 640px) {
    .voice-picker-content {
        width: 94vw;
        max-height: 92vh;
    }

    .voice-picker-header,
    .voice-picker-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .voice-picker-grid {
        max-height: min(48vh, 336px);
    }

    .voice-picker-option {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon main"
            "desc desc"
            "count count";
        min-height: 112px;
        padding-right: 2.65rem;
    }

    .voice-picker-option-count {
        justify-self: start;
    }

    .modal-footer.voice-picker-footer {
        grid-template-columns: 1fr;
    }

    .modal-footer.voice-picker-footer .btn {
        width: 100%;
    }
}

.speed-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.speed-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.speed-slider input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.speed-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.speed-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.speed-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}

.voice-start-action {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.start-voice-btn {
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.42);
    box-shadow: none;
}

.start-voice-btn:hover:not(:disabled) {
    transform: none;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    box-shadow: none;
}

.start-voice-btn .btn-icon {
    padding: 0;
    background: transparent;
    color: currentColor;
}

.custom-voice-preview {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 197, 94, 0.06));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.custom-voice-template {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.custom-voice-template p {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

#playCustomVoice {
    align-self: center;
    flex-shrink: 0;
}

.preview-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.custom-voice-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-voice-modal-input {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    padding: 0.75rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-voice-modal-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.custom-voice-modal-input::placeholder {
    color: var(--text-muted);
}

#generateCustomVoiceBtn {
    align-self: stretch;
    width: 100%;
}

#customVoiceModal .modal-footer .btn {
    flex: 1 1 0;
}

/* 闊崇敾鍖归厤宸ヤ綔鍖?- 鍩轰簬鎷嗗垎鐗囨甯冨眬 */
.sync-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    gap: 1.5rem;
    align-items: start;
}

.sync-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 650px;
}

.sync-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 650px;
}

/* 闊抽鍒楄〃鏍峰紡 */
.audio-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.video-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
}

.audio-list::-webkit-scrollbar {
    width: 6px;
}

.audio-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.audio-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.audio-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.audio-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.video-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.video-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.video-item.dragging {
    opacity: 0.5;
    border: 2px dashed #3b82f6;
}

.video-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-item-time {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.audio-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.audio-item:active {
    cursor: grabbing;
}

.audio-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}

.audio-item.playing {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.audio-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.audio-item-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.audio-item-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.audio-item-btn.play {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.audio-item-btn.play:hover {
    background: #16a34a;
}

.audio-item-btn.delete:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.audio-item-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.audio-item-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.audio-item-source {
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-family: inherit;
    white-space: nowrap;
}

.audio-item-source.ready {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.audio-item-source.missing {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.audio-list-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    padding: 1rem;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.playback-controls .btn {
    flex: 1 1 0;
    min-width: 0;
}

.playback-controls .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.playback-controls .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-display {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
}

.timeline-panel {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-track {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    padding: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: visible;
}

.track-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.track-icon {
    font-size: 0.875rem;
}

.track-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.track-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.track-duration-editable {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.track-duration-input {
    width: 72px;
    padding: 0.125rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    text-align: center;
}

.track-duration-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.track-content {
    position: relative;
    height: 60px;
    padding: 10px;
    overflow: hidden;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.track-scroll-viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) transparent;
}

.track-scroll-viewport::-webkit-scrollbar {
    height: 8px;
}

.track-scroll-viewport::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.08);
    border-radius: 999px;
}

.track-scroll-viewport::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 999px;
}

.track-scroll-viewport.is-auto-scrolling {
    box-shadow: inset 12px 0 18px -18px var(--accent-primary), inset -12px 0 18px -18px var(--accent-primary);
}

.audio-timeline .track-content,
.video-timeline .track-content {
    height: 82px;
    padding-top: 30px;
    overflow: visible;
    min-width: 100%;
}

.track-content.drag-over {
    background: rgba(99, 102, 241, 0.12);
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

#syncWorkspace .split-main {
    height: 600px;
    min-height: 0;
    gap: 0.75rem;
    overflow: hidden;
}

#syncWorkspace .video-section {
    flex: 1 1 auto;
    min-height: 260px;
    display: flex;
}

#syncWorkspace .video-section video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}

#syncWorkspace .playback-controls {
    flex: 0 0 auto;
    padding: 0.35rem 0.75rem;
}

#syncWorkspace .playback-controls .btn {
    min-height: 32px;
    padding: 0.35rem 1rem;
    font-size: 0.8125rem;
    line-height: 1;
}

#syncWorkspace .playback-controls .btn-icon {
    padding: 0;
    background: transparent;
    color: currentColor;
    font-size: 0.875rem;
    line-height: 1;
}

#syncWorkspace .playback-controls .btn-icon:hover {
    background: transparent;
    color: currentColor;
}

#syncWorkspace .timeline-panel {
    flex: 0 0 auto;
    padding: 0.625rem;
    gap: 0.625rem;
}

#syncWorkspace .track-header {
    padding: 0.4rem 0.75rem;
}

#syncWorkspace .audio-timeline .track-content,
#syncWorkspace .video-timeline .track-content {
    height: 72px;
    padding-top: 26px;
}

@media (max-width: 1200px) {
    #syncWorkspace .split-main {
        height: auto;
        overflow: visible;
    }

    #syncWorkspace .video-section {
        flex: 0 0 auto;
        min-height: 260px;
    }

    #syncWorkspace .video-section video {
        height: 260px;
    }
}

.timeline-drag-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed var(--warning);
    z-index: 7;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.55));
}

.timeline-drag-guide-audio {
    border-left-color: #22c55e;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.5));
}

.timeline-drag-guide-video {
    border-left-color: #3b82f6;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.timeline-drag-guide-label {
    position: absolute;
    left: 8px;
    top: -27px;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: white;
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1;
    white-space: nowrap;
}

.timeline-drag-guide.near-end .timeline-drag-guide-label {
    left: auto;
    right: 8px;
}

.video-clip {
    position: absolute;
    left: 0;
    top: 10px;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.clip-thumb {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-block {
    position: absolute;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    color: white;
    font-size: 0.75rem;
    cursor: move;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
    overflow: hidden;
}

.audio-block:hover {
    box-shadow: var(--shadow-glow);
}

.audio-block.selected {
    box-shadow: 0 0 0 2px white, var(--shadow-glow);
}

.timeline-audio-block {
    position: absolute;
    top: 30px;
    height: 40px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 48%, #059669 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.625rem;
    color: white;
    font-size: 0.75rem;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    overflow: visible;
    z-index: 2;
}

.timeline-video-block {
    position: absolute;
    top: 30px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 48%, #1d4ed8 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.625rem;
    color: white;
    font-size: 0.75rem;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    overflow: visible;
    z-index: 2;
}

.timeline-video-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

.timeline-video-block.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.timeline-audio-block.selected,
.timeline-video-block.selected {
    box-shadow: 0 0 0 2px white, 0 0 18px rgba(245, 158, 11, 0.45);
}

.timeline-audio-block.active-playing,
.timeline-video-block.active-playing {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 22px rgba(245, 158, 11, 0.55);
}

.timeline-audio-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.timeline-audio-block.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.video-block-settings-content {
    max-width: 720px;
}

.video-block-settings-body {
    display: grid;
    gap: 1rem;
}

.video-block-settings-preview {
    display: grid;
    gap: 0.5rem;
}

.video-block-settings-preview video {
    width: 100%;
    max-height: 320px;
    background: #000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.video-block-settings-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.video-block-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.video-block-setting-field,
.video-block-local-toggle {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
}

.video-block-setting-field span,
.video-block-local-toggle span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.video-block-setting-field strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.video-block-setting-field input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

.video-block-range-box {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
}

.video-block-range-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.video-block-range-header span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.video-block-range-header strong {
    color: var(--text-primary);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: right;
    white-space: nowrap;
}

.video-block-range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--text-tertiary);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.68rem;
}

.video-block-range-track {
    position: relative;
    height: 34px;
}

.video-block-range-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.video-block-range-selection {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--accent-gradient);
    border-radius: 999px;
    box-shadow: 0 0 12px var(--accent-glow);
    pointer-events: none;
}

.video-block-range-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 34px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

.video-block-range-input:focus {
    outline: none;
}

.video-block-range-input::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.video-block-range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--text-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm), 0 0 0 4px rgba(99, 102, 241, 0.12);
    cursor: ew-resize;
    pointer-events: auto;
}

.video-block-range-input::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

.video-block-range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm), 0 0 0 4px rgba(99, 102, 241, 0.12);
    cursor: ew-resize;
    pointer-events: auto;
}

@media (max-width: 640px) {
    .video-block-settings-grid {
        grid-template-columns: 1fr;
    }

    .video-block-range-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .video-block-range-header strong {
        text-align: left;
        white-space: normal;
    }
}

.video-block-local-toggle {
    align-content: center;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.video-block-duration-summary {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.video-block-duration-summary strong {
    color: var(--text-primary);
}

.block-title {
    position: absolute;
    left: 0;
    top: -24px;
    max-width: 180px;
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.block-duration {
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    opacity: 0.78;
    flex-shrink: 0;
}

.block-speed {
    padding: 0.075rem 0.3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.block-delete-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.26);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.block-delete-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.05);
}

.playhead-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--warning);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.75);
    z-index: 6;
    cursor: ew-resize;
    pointer-events: auto;
    transform: translateX(-50%);
    touch-action: none;
}

.playhead-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--warning);
    transform: translate(-50%, -50%);
}

body.dragging-playhead {
    cursor: ew-resize;
    user-select: none;
}

.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle.left {
    left: 0;
}

.resize-handle.right {
    right: 0;
}

.resize-handle::after {
    content: '';
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.sync-materials {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.sync-materials h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.material-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
}

.material-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.material-item:active {
    cursor: grabbing;
}

.material-icon {
    font-size: 0.875rem;
}

.material-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 棰勮瀵煎嚭 */
.export-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.25rem;
    align-items: stretch;
}

.export-preview-panel,
.export-side-panel {
    min-width: 0;
    height: 100%;
}

.export-preview-panel,
.option-card,
.export-delivery-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.export-preview-panel {
    padding: 1rem;
}

.export-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.export-panel-header h3,
.option-card h4,
.export-delivery-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.export-panel-header p,
.export-delivery-header p {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.export-status-chip {
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(34, 197, 94, 0.32);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 0.75rem;
    white-space: nowrap;
}

.export-side-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.export-delivery-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.option-card,
.export-delivery-card {
    padding: 1rem;
}

/* 瀵煎嚭閫夐」 */
.export-options {
    margin: 0;
}

.option-card h4 {
    margin-bottom: 0.875rem;
}

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

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.18);
}

.option-label,
.option-desc {
    display: block;
}

.option-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.option-desc {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* 棰勮鍖哄煙 */
.preview-section {
    margin: 0;
}

.preview-video {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: #000;
    border-radius: calc(var(--radius-lg) - 2px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.preview-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.48));
    backdrop-filter: blur(2px);
}

.preview-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* 瀵煎嚭鎸夐挳 */
.export-actions {
    margin: 0;
}

.export-buttons {
    display: grid;
    gap: 0.625rem;
}

.export-buttons .btn {
    justify-content: flex-start;
    gap: 0.625rem;
    min-height: 42px;
    padding: 0.625rem 0.75rem;
    border-color: var(--border-color);
    background: rgba(15, 23, 42, 0.2);
    box-shadow: none;
}

.export-buttons .btn:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.export-delivery-card.is-disabled {
    background: rgba(15, 23, 42, 0.36);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: none;
}

.export-delivery-card.is-disabled .export-delivery-header h4,
.export-delivery-card.is-disabled .export-delivery-header p {
    color: var(--text-tertiary);
}

.export-delivery-card.is-disabled .export-buttons .btn {
    pointer-events: none;
    background: rgba(15, 23, 42, 0.28);
    border-color: rgba(148, 163, 184, 0.14);
    color: var(--text-tertiary);
    filter: grayscale(0.45);
}

.export-buttons .btn-icon {
    width: 1.25rem;
    padding: 0;
    font-size: 1rem;
    background: transparent;
    color: currentColor;
}

.export-buttons .btn-text {
    font-size: 0.8125rem;
    font-weight: 500;
}

.export-delivery-header {
    margin-bottom: 0.875rem;
}

.export-locked-hint {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* 妯℃€佹 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="flex"] {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

#customVoiceModal .modal-content {
    max-width: 560px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.account-status-modal {
    background:
        radial-gradient(circle at 18% 0%, rgba(99, 102, 241, 0.22), transparent 34%),
        radial-gradient(circle at 86% 18%, rgba(34, 197, 94, 0.18), transparent 30%),
        rgba(18, 18, 26, 0.96);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: accountStatusEnter 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes accountStatusEnter {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.account-status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    padding: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(34, 197, 94, 0.08)),
        rgba(26, 26, 37, 0.72);
    text-align: center;
    overflow: hidden;
}

.account-status-card::before {
    content: '';
    position: absolute;
    inset: -40% -20% auto;
    height: 96px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    transform: rotate(-8deg);
    animation: accountStatusShine 2.8s ease-in-out infinite;
}

@keyframes accountStatusShine {
    0%, 46% {
        transform: translateX(-55%) rotate(-8deg);
        opacity: 0;
    }
    62% {
        opacity: 1;
    }
    100% {
        transform: translateX(55%) rotate(-8deg);
        opacity: 0;
    }
}

.account-status-badge {
    position: relative;
    z-index: 1;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.28);
}

.account-status-title {
    position: relative;
    z-index: 1;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.account-status-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
}

.account-status-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.account-status-grid span {
    padding: 0.55rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.32);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.close-modal {
    color: var(--text-tertiary);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-header .btn-icon.close-modal {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
    border-radius: var(--radius-md);
}

.modal-header .btn-icon.close-modal:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
    transform: translateY(-1px);
}

/* 灏忓瀷妯℃€佹 */
.modal-sm .modal-content {
    max-width: 400px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.account-status-modal > .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
}

.account-status-modal > .modal-footer .btn-primary.close-modal {
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-height: 44px;
    box-sizing: border-box;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.32);
}

.account-status-modal > .modal-footer .btn-primary.close-modal:hover {
    color: #ffffff;
}

.confirm-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.confirm-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.confirm-message p {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.confirm-message p + p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-error:hover:not(:disabled) {
    background: #dc2626;
}

.upload-subtitle-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-subtitle-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-subtitle-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-active);
}

/* Toast 鎻愮ず */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    margin-left: auto;
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 鍝嶅簲寮忚璁?*/
@media (max-width: 1200px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .split-sidebar {
        height: 300px;
        max-height: 300px;
    }

    .split-main {
        height: auto;
    }

    .stepper {
        padding: 1rem;
    }

    .step-label {
        display: none;
    }

    .step-connector {
        width: 20px;
    }

    .voice-presets {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .video-info {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .voice-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .voice-preset {
        min-height: 138px;
        padding: 0.9rem;
    }

    .preset-voice-id {
        font-size: 0.62rem;
    }

    .custom-voice-preview {
        flex-direction: column;
    }

    #playCustomVoice,
    #generateCustomVoiceBtn {
        width: 100%;
    }

    .start-voice-btn {
        align-self: stretch;
    }

    .action-bar {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .export-workspace {
        grid-template-columns: 1fr;
    }

    .preview-video {
        max-width: 100%;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons .btn {
        flex-direction: row;
        padding: 0.625rem 0.75rem;
    }
}

/* 婊氬姩鏉℃牱寮?*/
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* 閫変腑鏂囨湰鏍峰紡 */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* 绂佺敤鏂囨湰閫夋嫨 */
.no-select {
    user-select: none;
}

/* 闅愯棌鍏冪礌 */
.hidden {
    display: none !important;
}

/* 楠ㄦ灦灞忓姩鐢?*/
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==================== 瀛楀箷缂栬緫鍣ㄦ牱寮?==================== */

.subtitle-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 600px;
}

.subtitle-video-section {
    display: flex;
    flex-direction: column;
    background: #000;
    border-right: 1px solid var(--border-color);
    height: 100%;
}

.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a25 100%);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.video-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.video-filename {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.subtitle-list-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    height: 100%;
    overflow: hidden;
}

.subtitle-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.subtitle-list-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subtitle-list-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.reparse-subtitles-btn {
    position: relative;
    overflow: hidden;
}

.reparse-subtitles-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.14) 45%, transparent 72%);
    transform: translateX(-120%);
    pointer-events: none;
}

.reparse-subtitles-btn.is-loading::after {
    animation: reparseSweep 1.2s ease-in-out infinite;
}

.reparse-subtitles-btn .reparse-icon {
    display: inline-flex;
    margin-right: 0.25rem;
    transform-origin: center;
}

.reparse-subtitles-btn.is-loading .reparse-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes reparseSweep {
    to {
        transform: translateX(120%);
    }
}

.subtitle-source-hint-panel {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding: 0.75rem 0.75rem 0;
    background: var(--bg-secondary);
}

.subtitle-source-hint-panel:empty {
    display: none;
}

.subtitle-edit-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.subtitle-edit-list::-webkit-scrollbar {
    width: 6px;
}

.subtitle-edit-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.subtitle-edit-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.subtitle-edit-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.subtitle-edit-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.subtitle-edit-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.subtitle-edit-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-glow);
}

.subtitle-edit-item:has(.subtitle-review-badge) {
    border-color: rgba(245, 158, 11, 0.42);
}

.subtitle-source-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-size: 0.85rem;
}

.subtitle-source-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.subtitle-source-main strong {
    color: var(--text-primary);
}

.subtitle-review-next-btn {
    flex-shrink: 0;
    border: 1px solid rgba(245, 158, 11, 0.36);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.subtitle-review-next-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.56);
}

.subtitle-preview-item {
    opacity: 0.9;
}

.subtitle-preview-item.subtitle-preview-enter {
    animation: subtitlePreviewIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.subtitle-preview-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-size: 0.72rem;
    white-space: nowrap;
}

.subtitle-stream-empty {
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    text-align: center;
}

.subtitle-progress-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-tertiary) 92%, transparent);
    box-shadow: var(--shadow-sm);
}

.subtitle-progress-actionbar {
    position: static;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-xl);
    border-color: var(--border-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        var(--bg-secondary);
    box-shadow: var(--shadow-md);
    animation: subtitleActionProgressIn 0.32s ease both;
}

.subtitle-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.subtitle-progress-top strong {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.subtitle-progress-top strong::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--accent-primary);
    box-shadow: 0 0 0 5px var(--accent-glow);
}

.subtitle-progress-top > span {
    padding: 0.26rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}

.subtitle-progress-track {
    position: relative;
    height: 0.72rem;
    margin: 0.9rem 0 0.85rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-tertiary);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.24);
}

.subtitle-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-gradient);
    box-shadow: 0 0 14px var(--accent-glow);
    transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.subtitle-progress-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.subtitle-progress-meta span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.52rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 700;
    white-space: nowrap;
}

.subtitle-progress-message {
    margin-top: 0.75rem;
    padding: 0.58rem 0.72rem;
    border-left: 3px solid var(--accent-primary);
    border-radius: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.55;
}

.subtitle-progress-footer.is-failed {
    border-color: color-mix(in srgb, var(--error) 42%, var(--border-color));
    background:
        linear-gradient(180deg, rgba(248, 113, 113, 0.08), transparent),
        var(--bg-secondary);
}

.subtitle-progress-footer.is-failed .subtitle-progress-top strong::before {
    background: var(--error);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.16);
}

.subtitle-progress-footer.is-failed .subtitle-progress-top > span {
    border-color: color-mix(in srgb, var(--error) 36%, var(--border-color));
    color: var(--error);
}

.subtitle-progress-footer.is-failed .subtitle-progress-track span {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.92), rgba(248, 113, 113, 0.96));
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.18);
}

.subtitle-progress-footer.is-failed .subtitle-progress-message {
    border-left-color: var(--error);
    color: var(--text-primary);
}

@keyframes subtitleActionProgressIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes step2ActionControlsIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitlePreviewIn {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
        filter: blur(0);
    }
}

.subtitle-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.subtitle-play-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.subtitle-item-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
}

.subtitle-item-play {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: white;
    font-size: 0.875rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.subtitle-item-play:hover {
    background: #16a34a;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.subtitle-item-play.playing {
    background: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.subtitle-item-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.subtitle-item-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.subtitle-item-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.subtitle-item-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.subtitle-item-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subtitle-text-edit {
    width: 100%;
    min-height: 60px;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.subtitle-text-edit:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.subtitle-text-edit::placeholder {
    color: var(--text-muted);
}

.subtitle-time-edit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.subtitle-time-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.subtitle-time-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.subtitle-time-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: 'SF Mono', monospace;
    transition: border-color var(--transition-fast);
}

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

/* 鍝嶅簲寮忚皟鏁?*/
@media (max-width: 1200px) {
    .subtitle-editor-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 80vh;
    }

    .subtitle-video-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 350px;
        flex-shrink: 0;
    }

    .subtitle-list-section {
        height: 350px;
    }

    .subtitle-edit-list {
        max-height: none;
    }

    .subtitle-progress-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .subtitle-progress-actionbar {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }

    .subtitle-progress-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .subtitle-progress-meta {
        grid-template-columns: 1fr;
    }

    .subtitle-item-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .subtitle-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }
}

/* ==================== 鍏ㄥ眬瀵艰埅涓庨〉闈㈠垏鎹?==================== */

.page-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.page-content.active {
    display: flex;
}

/* 椤堕儴瀵艰埅鏍忓寮?*/
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.nav-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 妯″紡鍒囨崲 */
.mode-switch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    gap: 0.45rem;
    padding: 0.4rem 0.875rem;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.mode-switch:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.mode-switch:focus-visible {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.mode-switch.is-standard {
    background: rgba(30, 30, 46, 0.82);
}

.mode-switch.is-pro {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.34);
    background: rgba(20, 83, 45, 0.18);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08) inset;
}

.mode-switch.is-pro::before {
    content: '';
    width: 0.42rem;
    height: 0.42rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.mode-switch.is-pro:hover {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(20, 83, 45, 0.24);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.mode-label {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: currentColor;
    white-space: nowrap;
}

.toggle-sm {
    width: 36px;
    height: 20px;
}

.toggle-sm .toggle-slider::before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-sm input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* 鐢ㄦ埛鑿滃崟 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 1rem;
    background-position: center;
    background-size: cover;
    color: #fff;
    overflow: hidden;
}

.user-avatar.has-image {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.user-dropdown a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ==================== 浣跨敤璁板綍 ==================== */

.history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.history-filters {
    margin-bottom: 1.5rem;
}

/* 鍘嗗彶璁板綍绛涢€夋爮 鈥斺€?涓庢帹骞夸腑蹇?promo-filter-bar 缁熶竴椋庢牸 */
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* 鎼滅储杈撳叆妗嗗寘瑁?*/
.filter-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 0.5rem 0.875rem 0.5rem 2.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--bg-secondary);
}

.filter-search-input::placeholder {
    color: var(--text-muted);
}

/* 绛涢€夋寜閽粍 */
.filter-btn-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.filter-btn.active {
    color: var(--accent-primary);
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.1);
    font-weight: 600;
}

/* 鎺掑簭閫夋嫨 */
.filter-sort-group {
    display: flex;
    align-items: center;
}

.filter-sort-select {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.filter-sort-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* 缁撴灉璁℃暟 */
.filter-search-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

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

.history-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-height: 0;
    margin: 0;
    padding: 0 1rem;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: var(--radius-lg);
    transition: max-height 220ms ease, margin 220ms ease, padding 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.history-bulk-bar.is-active {
    max-height: 72px;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.history-bulk-summary,
.history-bulk-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}

.history-bulk-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
}

.history-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1.45fr) minmax(82px, 0.65fr) minmax(108px, 0.8fr) minmax(86px, 0.65fr) minmax(156px, 1fr);
    gap: 0.75rem;
    align-items: center;
    justify-items: center;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transform-origin: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), opacity 180ms ease, transform 180ms ease;
    animation: historyItemEnter 220ms ease both;
}

.history-item.is-selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.09), rgba(34, 197, 94, 0.05));
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.history-item.is-deleting {
    opacity: 0;
    transform: translateX(-16px) scale(0.985);
    pointer-events: none;
}

.history-col-select,
.th-select {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-select-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.history-select-control input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.history-checkmark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-hover);
    border-radius: 7px;
    background: var(--bg-primary);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.history-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: translate(-50%, -58%) rotate(45deg) scale(0.5);
    transform-origin: center;
    transition: opacity 120ms ease, transform 160ms ease;
}

.history-select-control input:checked + .history-checkmark {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.12);
    transform: scale(1.05);
}

.history-select-control input:checked + .history-checkmark::after {
    opacity: 1;
    transform: translate(-50%, -58%) rotate(45deg) scale(1);
}

.history-select-control input:focus-visible + .history-checkmark {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.history-select-control input:disabled + .history-checkmark {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-item .history-col-video {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
}

.history-item .history-col-cost,
.history-item .history-col-storage,
.history-item .history-col-status,
.history-item .history-col-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 琛ㄦ牸琛ㄥご */
@keyframes historyItemEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-table-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1.45fr) minmax(82px, 0.65fr) minmax(108px, 0.8fr) minmax(86px, 0.65fr) minmax(156px, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.history-table-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* 琛ㄥご涓庡垪琛ㄩ棿璺?*/
.history-table-header + .history-list .history-item:first-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: none;
}

/* 鍒楄〃鍦嗚淇 */
.history-list .history-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.history-list .history-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.history-list .history-item:only-child {
    border-radius: var(--radius-lg);
}

/* 鏈夎〃澶存椂鐨勯椤?*/
.history-table-header + .history-list .history-item:first-child {
    border-radius: 0;
}

/* 鏈夎〃澶存椂鍒楄〃鐨勯椤?*/
.history-table-header + .history-list {
    margin-top: 0;
}

.history-table-header + .history-list .history-item {
    border-top: none;
    border-radius: 0;
}

.history-table-header + .history-list .history-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 鍒楄〃鏁翠綋 */
.history-list {
    display: flex;
    flex-direction: column;
}

.history-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.history-thumb {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
            align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.history-info {
    min-width: 0;
}

.history-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
}

.history-status {
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: nowrap;
}

.history-status.completed {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.history-status.processing {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.history-status.failed {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

.history-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.history-status.paused {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-action-disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.history-action-disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* 鑺辫垂閲戦 */
.history-cost {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.8125rem;
}

.history-cost-clickable {
    cursor: pointer;
    border-bottom: 1px dashed var(--accent-primary);
    transition: all var(--transition-fast);
}

.history-cost-clickable:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

/* 鎵ｈ垂鏄庣粏寮圭獥 */
.cost-detail-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-align: center;
}

.cost-detail-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cost-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.cost-detail-group {
    border-radius: var(--radius-md);
}

.cost-detail-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 0;
    border-radius: var(--radius-md);
    gap: 0.75rem;
    font: inherit;
    text-align: left;
    cursor: default;
}

.cost-detail-item.is-expandable {
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.cost-detail-item.is-expandable:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.cost-detail-item.is-expandable:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.cost-detail-step {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.cost-step-num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.cost-step-name {
    font-size: 0.8125rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cost-step-sub-count {
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.12);
    color: var(--accent-primary);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.cost-step-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cost-step-amount {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.cost-step-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform 0.22s ease, border-color 0.18s ease;
}

.cost-detail-item[aria-expanded="true"] .cost-step-chevron {
    transform: rotate(225deg);
    border-color: var(--accent-primary);
}

.cost-sub-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 0.75rem;
    transition: max-height 0.24s ease, opacity 0.2s ease, padding 0.24s ease;
}

.cost-detail-group.expanded .cost-sub-list {
    max-height: 320px;
    opacity: 1;
    padding: 0.45rem 0.75rem 0.15rem 2.125rem;
}

.cost-sub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.375rem 0;
    border-top: 1px dashed var(--border-color);
}

.cost-sub-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cost-sub-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.75;
    flex-shrink: 0;
}

.cost-sub-name {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cost-sub-count {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    white-space: nowrap;
}

.cost-sub-amount {
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 浣跨敤璁板綍璇︽儏寮圭獥 */
.history-detail-modal-content {
    max-width: 760px;
}

.history-detail-body {
    max-height: 70vh;
    overflow-y: auto;
}

.history-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.history-detail-heading {
    min-width: 0;
}

.history-detail-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}

.history-detail-subtitle {
    margin-top: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    word-break: break-all;
}

.history-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.history-detail-meta-item {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-detail-meta-item span {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.history-detail-meta-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    word-break: break-word;
}

.history-detail-section {
    margin-top: 1.25rem;
}

.history-detail-section h4 {
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.history-detail-summary {
    padding: 0.875rem;
    min-height: 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.history-detail-summary.is-error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.history-detail-modules,
.history-detail-renders {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-detail-module,
.history-detail-render,
.history-detail-event,
.history-detail-empty,
.history-detail-loading {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-detail-module-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
}

.history-detail-module-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.history-detail-module-top strong {
    color: var(--text-primary);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-detail-module-status,
.history-detail-render-status {
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.history-detail-module-status.completed,
.history-detail-render-status.completed {
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
}

.history-detail-module-status.processing,
.history-detail-render-status.processing {
    color: var(--info);
    background: rgba(59, 130, 246, 0.12);
}

.history-detail-module-status.pending,
.history-detail-render-status.pending {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
}

.history-detail-module-status.failed,
.history-detail-render-status.failed {
    color: var(--error);
    background: rgba(239, 68, 68, 0.12);
}

.history-detail-module-status.paused,
.history-detail-render-status.paused {
    color: var(--text-tertiary);
    background: rgba(161, 161, 170, 0.12);
}

.history-detail-progress {
    height: 0.375rem;
    margin-top: 0.625rem;
    overflow: hidden;
    background: var(--bg-primary);
    border-radius: 999px;
}

.history-detail-progress span {
    display: block;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: inherit;
}

.history-detail-module-message {
    margin-top: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.history-detail-event {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.history-detail-event strong {
    color: var(--text-primary);
    font-weight: 600;
}

.history-detail-render {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
}

.history-detail-render strong,
.history-detail-render span {
    display: block;
}

.history-detail-render strong {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.history-detail-render div > span {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.history-detail-render a {
    color: var(--accent-primary);
    font-size: 0.8125rem;
    text-decoration: none;
}

.history-detail-render a:hover {
    color: var(--accent-secondary);
}

.history-detail-empty,
.history-detail-loading {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* 浣跨敤璁板綍鍒犻櫎纭 */
.history-delete-modal-content {
    border-color: rgba(239, 68, 68, 0.28);
}

.history-delete-confirm {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 12% 0%, rgba(239, 68, 68, 0.18), transparent 34%),
        rgba(239, 68, 68, 0.08);
}

.history-delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--error);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.history-delete-copy {
    min-width: 0;
}

.history-delete-title {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.history-delete-copy p {
    margin-top: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .history-detail-head,
    .history-detail-event {
        flex-direction: column;
    }

    .history-detail-grid,
    .history-detail-render {
        grid-template-columns: 1fr;
    }

    .history-detail-module-top {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .history-detail-module-status {
        grid-column: 2;
        justify-self: start;
    }
}

/* 瀛樺偍涓庣姸鎬佸窘绔犲鍣?*/
.history-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

/* 瀛樺偍鐘舵€佹爣绛?*/
.history-storage {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: nowrap;
}

.history-storage .storage-icon {
    font-size: 0.75rem;
}

.history-storage .storage-label {
    font-size: 0.6875rem;
}

/* 浜戠瀛樺偍 */
.history-storage.storage-cloud {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

/* 鏈湴瀛樺偍 */
.history-storage.storage-local {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

/* 鏈瓨鍌?*/
.history-storage.storage-unsaved {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
}

.history-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== 浣跨敤鏁欑▼ ==================== */

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.tutorial-state {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-tertiary);
    text-align: center;
    background: var(--bg-secondary);
}

.tutorial-state-error {
    color: var(--error, #ef4444);
    border-color: rgba(239, 68, 68, 0.35);
}

.tutorial-empty {
    position: relative;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
    grid-template-areas:
        "visual copy"
        "visual steps"
        "visual actions";
    align-items: center;
    align-content: center;
    column-gap: clamp(2rem, 5vw, 5.5rem);
    row-gap: 1.15rem;
    overflow: hidden;
    min-height: min(820px, calc(100vh - 284px));
    min-height: min(820px, calc(100svh - 284px));
    padding: clamp(1.5rem, 3vw, 3rem);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.22), transparent 32%),
        radial-gradient(circle at 82% 8%, rgba(34, 197, 94, 0.14), transparent 26%),
        linear-gradient(145deg, rgba(18, 18, 26, 0.96), rgba(26, 26, 37, 0.78));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: left;
}

.tutorial-empty::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 76%);
    pointer-events: none;
}

.tutorial-empty::after {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    right: -160px;
    bottom: -170px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.16);
    filter: blur(18px);
    pointer-events: none;
}

.tutorial-empty-visual,
.tutorial-empty-copy,
.tutorial-empty-steps,
.tutorial-empty-actions {
    position: relative;
    z-index: 1;
}

.tutorial-empty-visual {
    grid-area: visual;
    width: min(100%, 380px);
    height: min(38vh, 320px);
    min-height: 240px;
    justify-self: center;
}

.tutorial-empty-screen {
    position: absolute;
    inset: 11% 7% 4%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 1.75rem);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(37, 37, 53, 0.96), rgba(18, 18, 26, 0.96));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tutorial-empty-screen-top {
    position: absolute;
    top: 1.1rem;
    left: 1.25rem;
    display: flex;
    gap: 0.35rem;
}

.tutorial-empty-screen-top span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(161, 161, 170, 0.45);
}

.tutorial-empty-play {
    width: clamp(4.2rem, 7vw, 6rem);
    height: clamp(4.2rem, 7vw, 6rem);
    margin: 1rem 0 1.25rem;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 26px rgba(99, 102, 241, 0.45);
    clip-path: polygon(30% 20%, 78% 50%, 30% 80%);
}

.tutorial-empty-line {
    width: 44%;
    height: 0.45rem;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: rgba(161, 161, 170, 0.18);
}

.tutorial-empty-line-wide {
    width: 68%;
}

.tutorial-empty-orbit {
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.26);
}

.tutorial-empty-orbit-one {
    width: 46%;
    height: 46%;
    top: 0;
    left: 1%;
    background: rgba(99, 102, 241, 0.1);
}

.tutorial-empty-orbit-two {
    width: 30%;
    height: 30%;
    right: 0;
    bottom: 9%;
    background: rgba(34, 197, 94, 0.09);
}

.tutorial-empty-copy {
    grid-area: copy;
    max-width: 680px;
    margin: 0;
    align-self: end;
}

.tutorial-empty h3 {
    max-width: 620px;
    margin: 0 0 0.8rem;
    color: var(--text-primary);
    font-size: clamp(1.8rem, 3.2vw, 2.85rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.tutorial-empty p {
    max-width: 620px;
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(0.98rem, 1.45vw, 1.12rem);
    line-height: 1.72;
}

.tutorial-empty-steps {
    grid-area: steps;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    align-self: center;
    margin-top: 0.25rem;
}

.tutorial-empty-step {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 78px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.tutorial-empty-step strong {
    color: var(--accent-primary);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

.tutorial-empty-step span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.tutorial-empty-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem;
    align-self: start;
    margin-top: 0.25rem;
}

@media (max-width: 980px) {
    .tutorial-empty {
        grid-template-columns: 1fr;
        grid-template-areas:
            "visual"
            "copy"
            "steps"
            "actions";
        height: auto;
        min-height: auto;
        padding: clamp(1.5rem, 4vw, 2.5rem);
        text-align: center;
    }

    .tutorial-empty-copy {
        justify-self: center;
    }

    .tutorial-empty p {
        margin: 0 auto;
    }

    .tutorial-empty-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 520px);
        justify-self: center;
    }

    .tutorial-empty-actions {
        justify-content: center;
    }
}

.tutorial-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tutorial-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.tutorial-thumb {
    height: 160px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.tutorial-thumb.has-cover {
    padding: 0;
    background: var(--bg-tertiary);
}

.tutorial-thumb.has-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tutorial-content {
    padding: 1.25rem;
}

.tutorial-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.6875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.tutorial-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tutorial-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* 鏁欑▼妯℃€佹 */
.tutorial-modal-content {
    display: flex;
    flex-direction: column;
    width: min(920px, calc(100vw - 2rem));
    max-width: 920px;
    max-height: min(88vh, 860px);
    max-height: min(88svh, 860px);
    background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, 0.18), transparent 34%),
        radial-gradient(circle at 92% 12%, rgba(34, 197, 94, 0.12), transparent 28%),
        var(--bg-secondary);
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
}

.tutorial-modal-content .modal-header {
    flex: 0 0 auto;
    padding: 1.1rem 1.5rem;
    background: rgba(10, 10, 15, 0.28);
}

.tutorial-modal-content .modal-header h3 {
    max-width: calc(100% - 3rem);
    color: var(--text-primary);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.35;
}

.tutorial-modal-content .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    scrollbar-gutter: stable;
}

.tutorial-modal-content .modal-body::-webkit-scrollbar {
    width: 8px;
}

.tutorial-modal-content .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.tutorial-modal-content .modal-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45);
    border-radius: 999px;
}

.tutorial-modal-content .modal-footer {
    flex: 0 0 auto;
    background: rgba(10, 10, 15, 0.34);
}

.tutorial-modal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tutorial-modal-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.tutorial-modal-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tutorial-modal-video-placeholder,
.tutorial-modal-render {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    margin-bottom: 1.25rem;
    text-align: center;
}

.tutorial-modal-render {
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
}

.tutorial-modal-video {
    display: block;
    width: 100%;
    max-height: 420px;
    background: #000;
    border-radius: var(--radius-lg);
}

.tutorial-modal-html-frame {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
}

.tutorial-markdown-body {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
        rgba(18, 18, 26, 0.72);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 24px;
    padding: clamp(1.25rem, 2.4vw, 2rem);
    color: var(--text-secondary);
    line-height: 1.8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tutorial-markdown-body::before {
    content: '';
    position: absolute;
    inset: 0;
    height: 5px;
    background: var(--accent-gradient);
    pointer-events: none;
}

.tutorial-markdown-body h1 {
    position: relative;
    color: var(--text-primary);
    margin: 0 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.18;
    letter-spacing: -0.04em;
}

.tutorial-markdown-body h2 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 1.45rem 0 0.65rem;
    color: var(--text-primary);
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
    line-height: 1.35;
}

.tutorial-markdown-body h2::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.12);
    flex: 0 0 auto;
}

.tutorial-markdown-body h3 {
    margin: 1.25rem 0 0.55rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.tutorial-markdown-body p,
.tutorial-markdown-body ul,
.tutorial-markdown-body pre {
    margin: 0 0 1.05rem;
}

.tutorial-markdown-body p {
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.tutorial-markdown-body ul {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    list-style: none;
}

.tutorial-markdown-body li {
    position: relative;
    padding: 0.7rem 0.85rem 0.7rem 2.15rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary);
}

.tutorial-markdown-body li::before {
    content: '';
    position: absolute;
    top: 1.05rem;
    left: 0.9rem;
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.tutorial-markdown-body pre {
    overflow: auto;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(10, 10, 15, 0.82);
}

.tutorial-markdown-body code {
    padding: 0.16rem 0.38rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-size: 0.9em;
}

.tutorial-markdown-body pre code {
    padding: 0;
    background: transparent;
}

.tutorial-markdown-body a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.35);
}

.tutorial-video-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.tutorial-modal-video-placeholder p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.tutorial-modal-video-placeholder span {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.tutorial-modal-desc {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: 16px;
    background: rgba(34, 197, 94, 0.065);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .tutorial-modal-content {
        width: calc(100vw - 1rem);
        max-height: min(92vh, 760px);
        max-height: min(92svh, 760px);
    }

    .tutorial-modal-content .modal-header,
    .tutorial-modal-content .modal-body,
    .tutorial-modal-content .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tutorial-modal-meta {
        gap: 0.5rem;
    }

    .tutorial-modal-stat,
    .tutorial-modal-tag {
        font-size: 0.75rem;
    }

    .tutorial-markdown-body {
        border-radius: 18px;
        padding: 1.1rem;
    }

    .tutorial-markdown-body h1 {
        font-size: 1.45rem;
    }

    .tutorial-markdown-body li {
        padding-right: 0.75rem;
    }
}

/* ==================== 鍏呭€艰闃?==================== */

/* --- 1. 婵€娲荤姸鎬佸崱鐗?--- */
.activation-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.activation-status-card.activated {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.06));
    border-color: rgba(34, 197, 94, 0.3);
}

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

.activation-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.activation-status-card.activated .activation-icon {
    background: rgba(34, 197, 94, 0.15);
}

.activation-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activation-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activation-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.activation-right {
    flex-shrink: 0;
}

/* --- 2. AI 浣欓鍗＄墖 --- */
.balance-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

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

.balance-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.balance-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.balance-bar {
    flex: 1;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
}

.balance-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.balance-fill.low {
    background: var(--error);
}

.balance-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: 'SF Mono', monospace;
    font-weight: 500;
}

.balance-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.free-quota-info {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Top balance badge in header --- */
.storage-badge,
.balance-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    cursor: pointer;
    user-select: none;
}

.storage-badge {
    color: #38bdf8;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(20, 184, 166, 0.08));
    border-color: rgba(56, 189, 248, 0.22);
}

.storage-badge.is-warning {
    color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(99, 102, 241, 0.08));
    border-color: rgba(245, 158, 11, 0.32);
}

.storage-badge.is-full {
    color: var(--error);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(99, 102, 241, 0.08));
    border-color: rgba(239, 68, 68, 0.34);
}

.storage-badge:hover {
    border-color: rgba(56, 189, 248, 0.44);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(20, 184, 166, 0.12));
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.balance-badge:hover {
    border-color: rgba(99, 102, 241, 0.42);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.storage-badge-icon,
.balance-badge-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.storage-badge-label,
.storage-badge-text,
.balance-badge-text {
    white-space: nowrap;
}

.storage-badge-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Cloud storage modal --- */
.cloud-storage-modal-content {
    max-width: 760px;
    background:
        radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.2), transparent 34%),
        radial-gradient(circle at 90% 10%, rgba(20, 184, 166, 0.16), transparent 30%),
        var(--bg-secondary);
    border-color: rgba(56, 189, 248, 0.24);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: accountStatusEnter 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.cloud-storage-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cloud-storage-overview {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.125rem;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(20, 184, 166, 0.06)),
        rgba(18, 18, 26, 0.58);
    overflow: hidden;
}

.cloud-storage-overview::after {
    content: '';
    position: absolute;
    right: -34px;
    top: -42px;
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.11);
    filter: blur(2px);
}

.cloud-storage-overview-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cloud-storage-kicker {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.cloud-storage-overview-main strong {
    color: #e0f2fe;
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.cloud-storage-overview-main p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.cloud-storage-meter {
    position: relative;
    z-index: 1;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.cloud-storage-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #14b8a6);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.34);
    transition: width var(--transition-normal);
}

.cloud-storage-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
}

.cloud-storage-stats div {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
}

.cloud-storage-stats span,
.cloud-storage-section-head em,
.cloud-storage-item-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.cloud-storage-stats strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.cloud-storage-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cloud-storage-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.cloud-storage-section-head span {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 700;
}

.cloud-storage-section-head em {
    font-style: normal;
}

.cloud-storage-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cloud-storage-category {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.08);
    color: #bae6fd;
    font-size: 0.75rem;
    font-weight: 700;
}

.cloud-storage-category small {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
}

.cloud-storage-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 340px;
    overflow: auto;
    padding-right: 0.25rem;
}

.cloud-storage-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.875rem;
    align-items: center;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(18, 18, 26, 0.62);
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.cloud-storage-item:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.32);
    background: rgba(30, 30, 46, 0.84);
}

.cloud-storage-item-main {
    min-width: 0;
}

.cloud-storage-item-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 700;
}

.cloud-storage-item-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cloud-storage-type {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.11);
    color: #7dd3fc;
    font-size: 0.6875rem;
    font-weight: 700;
}

.cloud-storage-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.cloud-storage-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cloud-storage-item-actions .btn {
    min-width: 64px;
}

.cloud-storage-state,
.cloud-storage-empty-inline {
    padding: 1.25rem;
    border: 1px dashed rgba(56, 189, 248, 0.22);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-align: center;
    background: rgba(56, 189, 248, 0.05);
}

.cloud-storage-empty-inline {
    display: inline-flex;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.cloud-storage-modal-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cloud-storage-modal-footer .btn {
    width: 100%;
    min-width: 0;
}

.cloud-storage-modal-footer .btn-primary.close-modal {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.32);
}

.cloud-storage-modal-footer .btn-primary.close-modal:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .cloud-storage-stats,
    .cloud-storage-item {
        grid-template-columns: 1fr;
    }

    .cloud-storage-section-head,
    .cloud-storage-item-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cloud-storage-item-actions .btn {
        width: 100%;
    }
}

/* --- Withdrawal modal --- */
.withdraw-modal-content {
    max-width: 500px;
}

.withdraw-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.withdraw-balance-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 92% 0%, rgba(99, 102, 241, 0.24), transparent 44%),
        linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.03)),
        var(--bg-tertiary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.withdraw-balance-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.withdraw-balance-card p {
    max-width: 15rem;
    margin-top: 0.4rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    line-height: 1.55;
}

.withdraw-balance-card strong {
    flex-shrink: 0;
    color: var(--accent-primary);
    font-size: 1.45rem;
    line-height: 1.25;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
}

.withdraw-form {
    gap: 0.95rem;
}

.withdraw-form-panel {
    padding: 1rem;
    border: 1px solid rgba(39, 39, 58, 0.82);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30%),
        rgba(18, 18, 26, 0.58);
}

.withdraw-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.15rem;
}

.withdraw-section-title span {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 650;
}

.withdraw-section-title em {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-style: normal;
}

.withdraw-field-hint {
    margin-top: 0.35rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.withdraw-amount-input {
    padding-right: 0.95rem;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-align: left;
    appearance: textfield;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.withdraw-amount-input:placeholder-shown {
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0;
}

.withdraw-amount-input::-webkit-outer-spin-button,
.withdraw-amount-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.withdraw-amount-input::placeholder {
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-align: left;
}

.withdraw-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
    margin-top: 0.1rem;
}

.withdraw-preview div {
    padding: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 0.75rem;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 45%),
        var(--bg-tertiary);
}

.withdraw-preview span,
.withdraw-preview strong {
    display: block;
}

.withdraw-preview span {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
}

.withdraw-preview strong {
    margin-top: 0.35rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
}

.withdraw-confirm-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.5;
}

.withdraw-confirm-row input {
    margin-top: 0.15rem;
    accent-color: var(--accent-primary);
}

@media (max-width: 560px) {
    .withdraw-balance-card,
    .withdraw-section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .withdraw-preview {
        grid-template-columns: 1fr;
    }
}

/* --- Subscription card info rows --- */
.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subscription-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.subscription-status-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), rgba(99, 102, 241, 0.035));
}

.subscription-status-panel.storage {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.07), rgba(255, 255, 255, 0.02));
}

.subscription-status-panel.ai {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(255, 255, 255, 0.02));
}

.subscription-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.subscription-panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subscription-panel-badge {
    flex-shrink: 0;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-tertiary);
    font-size: 0.68rem;
    font-weight: 700;
}

.subscription-panel-badge.active {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.subscription-panel-bar {
    margin: 0.875rem 0 0.5rem;
}

.subscription-panel-foot {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: right;
}

.sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sub-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.sub-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sub-value.active {
    color: var(--success);
}

@media (max-width: 760px) {
    .subscription-status-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 3. 鏈縺娲婚伄缃?--- */
.activation-lock-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

.lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.lock-icon {
    font-size: 3rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.lock-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* --- 4. 鎷撳睍鏈嶅姟鍖烘 --- */
.service-section {
    margin-bottom: 2.5rem;
}

.service-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-section-header span:first-child {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.service-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* --- Module Entry Cards (4-column grid) --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.module-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.module-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.module-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.module-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.module-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
}

.module-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.module-status.active {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.module-btn {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.875rem;
}

/* --- Legacy service plans grid --- */
.service-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.service-plans.flex-plans {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Legacy service card --- */
.service-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all var(--transition-fast);
    position: relative;
}

.service-card:hover {
    border-color: var(--border-hover);
}

.service-card.recommended {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* ==================== Subscription Modal Plans ==================== */

/* Large modal */
.modal-lg {
    max-width: 1100px;
    width: 95%;
}

.service-modal-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.service-modal-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.service-modal-plans.plan-carousel {
    display: flex;
    grid-template-columns: none;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0.25rem 0.75rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) var(--bg-tertiary);
    -webkit-overflow-scrolling: touch;
}

.service-modal-plans.plan-carousel::-webkit-scrollbar {
    height: 6px;
}

.service-modal-plans.plan-carousel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.service-modal-plans.plan-carousel::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.service-modal-plans.plan-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Modal plan card */
.modal-plan-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.service-modal-plans.plan-carousel .modal-plan-card {
    flex: 0 0 calc((100% - 2rem) / 3);
    min-width: 0;
    scroll-snap-align: start;
}

.modal-plan-card:hover {
    border-color: var(--border-hover);
}

.modal-plan-card.selected {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.modal-plan-card.current {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.04), rgba(16, 185, 129, 0.03));
}

/* Single centered tag at top */
.modal-plan-tag {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.75rem;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.modal-plan-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.modal-plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.modal-plan-price .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.modal-plan-price .unit {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.modal-plan-highlight {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.modal-plan-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.modal-plan-total {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.modal-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.modal-plan-features li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-plan-usage {
    margin-bottom: 1rem;
}

.modal-plan-usage .usage-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.modal-plan-usage .usage-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.modal-plan-usage .usage-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.modal-plan-btn {
    width: 100%;
    margin-top: auto;
}

/* Modal balance card 鈥?horizontal scroll */
.modal-balance-grid {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0.25rem 1rem 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.modal-balance-grid::-webkit-scrollbar {
    height: 6px;
}

.modal-balance-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.modal-balance-grid::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.modal-balance-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.modal-balance-card {
    flex: 1 0 calc((100% - 2rem) / 3);
    min-width: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    text-align: center;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
    cursor: pointer;
}

.modal-balance-card:hover {
    border-color: var(--border-hover);
}

.modal-balance-card.selected {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.modal-balance-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.modal-balance-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.375rem;
}

.modal-balance-desc {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    line-height: 1.35;
    flex: 1;
}

.modal-balance-btn {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    margin-top: auto;
}

/* ==================== Redeem Module ==================== */

.redeem-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    grid-column: 1 / -1;
    width: 100%;
}

/* 鍏戞崲杈撳叆鍖?*/
.redeem-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.redeem-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.redeem-code-input {
    flex: 1;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.redeem-code-input::placeholder {
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    font-size: 0.8125rem;
}

.redeem-code-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.redeem-submit-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9375rem;
    white-space: nowrap;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.redeem-submit-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.redeem-input-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* 鍏戞崲缁撴灉 */
.redeem-result {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.35s ease both;
}

.redeem-result.fail {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.redeem-result-main {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
}

.redeem-result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.redeem-result-content {
    flex: 1;
    min-width: 0;
}

.redeem-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.redeem-result-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    line-height: 1.4;
}

.redeem-result-close {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
    padding: 0;
}

.redeem-result-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* 鍏戞崲璁板綍 */
.redeem-history {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.redeem-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.redeem-history-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.redeem-history-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.redeem-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 88px;
    overflow-y: auto;
    padding-right: 0.25rem;
    padding-bottom: 0.25rem;
}

.redeem-history-list::-webkit-scrollbar {
    width: 4px;
}

.redeem-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.redeem-history-list::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 2px;
}

.redeem-history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--success);
    transition: background var(--transition-fast);
}

.redeem-history-item.fail {
    border-left-color: var(--danger);
}

.redeem-history-item:hover {
    background: var(--bg-hover);
}

.redeem-history-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.125rem;
}

.redeem-history-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.redeem-history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.redeem-history-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.redeem-history-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    line-height: 1.4;
}

.redeem-history-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.redeem-history-tag {
    align-self: flex-start;
    display: inline-flex;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    line-height: 1.4;
}

.redeem-history-tag.fail {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.redeem-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-align: center;
}

.redeem-empty::before {
    content: '\1F4CB';
    font-size: 1.5rem;
    opacity: 0.5;
    filter: grayscale(0.6);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================== 涓汉璧勬枡 ==================== */
/* ==================== 涓汉璧勬枡 ==================== */

.profile-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}

.profile-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 2.5rem;
    background-position: center;
    background-size: cover;
    color: #fff;
    overflow: hidden;
}

.profile-avatar.has-image {
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-hover);
    font-size: 0;
}

.profile-avatar-hint {
    max-width: 160px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: center;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-nav-item {
    display: block;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.profile-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.profile-nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.profile-main {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 500px;
}

.profile-tab {
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-tab.active {
    display: block;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

/* 鍩烘湰淇℃伅涓ゅ垪甯冨眬 */
.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
}

.profile-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.profile-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form-grid .form-group .form-input,
.profile-form-grid .form-group textarea {
    width: 100%;
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-form .form-input {
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    width: 100%;
}

.profile-form .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.profile-form .form-input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    padding-top: 0.5rem;
}

/* ===== Profile 鏂板竷灞€缁勪欢 ===== */

/* 鍖哄潡鏍囬 */
.profile-section-header {
    margin-bottom: 0.5rem;
}

.profile-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.profile-section-header p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* 涓ゅ垪琛ㄥ崟 */
.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
}

.profile-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.profile-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== 淇敼瀵嗙爜 & 閭鎵惧洖 妯℃€佹鏍峰紡 ===== */

/* 琛ㄥ崟瀹瑰櫒 */
.cp-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

/* 琛ㄥ崟椤?*/
.cp-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* 鏍囩 */
.cp-form .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding-left: 0.125rem;
}

/* 杈撳叆妗?*/
.cp-form .form-input {
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    width: 100%;
}

.cp-form .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--bg-secondary);
}

.cp-form .form-input::placeholder {
    color: var(--text-muted);
}

/* 鍙閭灞曠ず */
.cp-form .form-input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: default;
    border-style: dashed;
}

/* 蹇樿瀵嗙爜閾炬帴 */
.cp-forgot {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

.cp-forgot .btn-text {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.cp-forgot .btn-text:hover {
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.1);
    transform: translateY(-1px);
}

/* 甯︽寜閽殑杈撳叆妗嗭紙楠岃瘉鐮佸尯鍩燂級 */
.input-with-btn {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-btn .form-input {
    flex: 1;
    min-width: 0;
}

.input-with-btn .btn {
    flex-shrink: 0;
    padding: 0 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.input-with-btn .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

/* 閭鎵惧洖瀵嗙爜妯℃€佹锛氶偖绠辨彁绀哄崱鐗?*/
.fp-email-hint {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.fp-email-hint-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.fp-email-hint-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.fp-email-hint-text strong {
    color: var(--text-primary);
}

/* 閫氱煡鍗＄墖缃戞牸 */
.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.profile-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-secondary);
}

.profile-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.08);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.profile-card-body {
    flex: 1;
    min-width: 0;
}

.profile-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.profile-card-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.profile-basic-shell {
    max-width: 1040px;
    margin: 0 auto;
    gap: 1.25rem;
}

.profile-basic-hero {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-basic-copy {
    min-width: 0;
}

.profile-basic-copy h3 {
    margin: 0 0 0.25rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
}

.profile-basic-copy p {
    max-width: 720px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.profile-basic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
    align-items: start;
}

.profile-basic-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    box-shadow: none;
}

.profile-basic-card-main {
    padding: 1.25rem;
}

.profile-basic-side {
    position: sticky;
    top: 96px;
    padding: 1.125rem;
    overflow: hidden;
}

.profile-basic-side::before {
    content: none;
}

.profile-security-badge {
    width: max-content;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-basic-side h4 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.profile-basic-side p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.65;
}

.profile-security-steps {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.profile-security-steps div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.625rem;
    align-items: center;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.profile-security-steps span {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-basic-shell .profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.25rem;
}

.profile-basic-shell .profile-section-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-basic-shell .profile-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.profile-basic-shell .profile-section-header p {
    color: var(--text-secondary);
}

.profile-basic-shell .form-group {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.profile-basic-shell .form-label {
    color: var(--text-primary);
    font-weight: 700;
}

.profile-basic-shell .form-input {
    min-height: 42px;
    background: var(--bg-secondary);
}

.profile-basic-shell .form-input[readonly] {
    cursor: not-allowed;
    opacity: 0.72;
}

.profile-field-hint {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.profile-password-field {
    grid-column: 1 / -1;
}

.profile-email-field {
    grid-column: 1 / -1;
}

.profile-password-display {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.profile-password-mask {
    letter-spacing: 0.18em;
}

.profile-password-change-btn {
    min-width: 104px;
    white-space: nowrap;
}

.profile-password-panel {
    margin-top: 0.85rem;
    padding: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.profile-password-panel[hidden] {
    display: none;
}

.profile-password-panel-head {
    margin-bottom: 0.75rem;
}

.profile-password-title {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.profile-password-desc {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
}

.profile-password-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.profile-bio-input {
    min-height: 116px;
    resize: vertical;
}

.profile-basic-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.25rem;
}

.profile-save-btn {
    min-width: 148px;
    min-height: 44px;
    border-radius: var(--radius-md);
    font-weight: 700;
}

.profile-email-verify {
    margin-top: 0.85rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.profile-email-verify[hidden] {
    display: none;
}

.profile-email-verify-hint {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
}

.profile-email-verify-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    margin-bottom: 0.75rem;
}

.profile-email-verify-icon {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.45rem;
    display: inline-flex;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.profile-email-verify-title {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.profile-email-verify-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.625rem;
}

.profile-email-code-btn {
    min-width: 110px;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .profile-basic-layout {
        grid-template-columns: 1fr;
    }

    .profile-basic-side {
        position: static;
    }
}

@media (max-width: 640px) {
    .profile-basic-hero {
        padding-bottom: 0.875rem;
    }

    .profile-basic-card-main,
    .profile-basic-side {
        padding: 1rem;
    }

    .profile-basic-shell .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-basic-shell .form-input,
    .profile-basic-shell .btn {
        max-width: 100%;
        min-width: 0;
    }

    .profile-basic-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-save-btn {
        width: 100%;
    }

    .profile-email-verify-row {
        grid-template-columns: 1fr;
    }

    .profile-password-display,
    .profile-password-grid {
        grid-template-columns: 1fr;
    }

    .profile-password-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-password-change-btn,
    .profile-password-actions .btn {
        width: 100%;
    }
}

.profile-notify-footnote {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 197, 94, 0.16), transparent 34%),
        rgba(34, 197, 94, 0.06);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.profile-notify-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

.profile-notify-save-btn {
    min-width: 168px;
    min-height: 48px;
    padding: 0 1.6rem;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 28px rgba(var(--accent-rgb, 139, 92, 246), 0.24);
}

.profile-notify-save-btn:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

@media (max-width: 640px) {
    .profile-notify-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-notify-save-btn {
        width: 100%;
    }
}

/* 璁よ瘉鏂瑰紡鍗＄墖 */
.profile-auth-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.profile-auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.profile-auth-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-secondary);
}

.profile-auth-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.08);
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-auth-icon.wechat {
    background: rgba(34, 197, 94, 0.08);
}

.profile-auth-icon.email {
    background: rgba(59, 130, 246, 0.08);
}

.profile-auth-body {
    flex: 1;
    min-width: 0;
}

.profile-auth-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-auth-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.success {
    background: var(--success);
}

/* API 瀵嗛挜灞曠ず */
.api-key-showcase {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.api-key-showcase-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.api-key-showcase-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-key-showcase-value {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    letter-spacing: 0.02em;
    word-break: break-all;
}

.api-key-showcase-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.api-key-showcase-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.api-key-showcase-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* API 鏂囨。鍗＄墖 */
.api-docs-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 0.5rem;
}

.api-docs-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.08);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.api-docs-body {
    flex: 1;
    min-width: 0;
}

.api-docs-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.api-docs-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.api-docs-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.api-docs-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.api-docs-card .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ========== 婵€娲荤爜妯℃€佹鏂板竷灞€ ========== */
.activate-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* 鏉冪泭鍗＄墖缃戞牸 */
.activate-perks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.activate-perk-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.activate-perk-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.activate-perk-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.activate-perk-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activate-perk-desc {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* 杈撳叆鍖哄煙 */
.activate-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activate-input-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.activate-form-input {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-weight: 500;
    letter-spacing: 0.055em;
    text-align: center;
    transition: all var(--transition-fast);
    width: 100%;
}

.activate-form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-secondary);
}

.activate-form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.035em;
    opacity: 0.72;
}

.activate-input-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

.activate-invite-summary {
    margin-top: 0.75rem;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.activate-invite-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.activate-invite-summary strong {
    color: var(--accent-primary);
    font-size: 1.05rem;
}

.activate-invite-summary p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    line-height: 1.55;
}

.activate-payment-result {
    margin-top: 0.875rem;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(20, 184, 166, 0.08));
}

.activate-payment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.activate-payment-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.activate-payment-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
}

.activate-payment-meta div {
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.activate-payment-meta span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
}

.activate-payment-meta strong {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.activate-payment-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 164px;
    min-height: 164px;
    padding: 0.625rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.activate-payment-qr canvas {
    width: 144px;
    height: 144px;
}

.activate-payment-hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.55;
}

.activate-payment-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.service-payment-result-wrap {
    display: block;
}

.service-payment-card {
    max-width: 520px;
    margin: 0 auto;
}

.payment-order-modal {
    z-index: 1120;
}

.payment-order-modal-content {
    width: min(92vw, 860px);
    max-width: 860px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 18% 0%, rgba(99, 102, 241, 0.18), transparent 34%),
        radial-gradient(circle at 92% 12%, rgba(34, 197, 94, 0.12), transparent 32%),
        var(--bg-secondary);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.payment-order-header {
    align-items: flex-start;
    gap: 1rem;
}

.payment-order-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
}

.payment-order-header p {
    margin: 0.35rem 0 0;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.payment-modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
    border-radius: var(--radius-md);
}

.payment-modal-close:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
    transform: translateY(-1px);
}

.payment-order-modal-body {
    display: grid;
    gap: 1rem;
    overflow: auto;
}

.payment-plan-confirm {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 197, 94, 0.06)),
        rgba(15, 23, 42, 0.34);
}

.payment-plan-main {
    min-width: 0;
}

.payment-plan-kicker {
    display: inline-flex;
    margin-bottom: 0.45rem;
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.payment-plan-main strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.payment-plan-main p {
    margin: 0.45rem 0 0;
    max-width: 560px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.payment-plan-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.payment-plan-tags span {
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.payment-plan-price {
    flex: 0 0 auto;
    min-width: 128px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
    text-align: right;
}

.payment-plan-price span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.payment-plan-price strong {
    color: var(--accent-primary);
    font-size: 1.45rem;
    font-weight: 900;
}

.payment-method-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.3);
}

.payment-method-copy span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.payment-method-copy strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 800;
}

.payment-method-options {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
}

.payment-method-option {
    min-width: 96px;
    padding: 0.5rem 0.8rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-method-option:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

.payment-method-option.is-active {
    color: #ffffff;
    background: var(--accent-gradient);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.28);
}

.payment-method-option.is-loading {
    opacity: 0.72;
    cursor: progress;
}

.payment-method-option:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.payment-order-panel {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1rem;
    align-items: stretch;
}

.payment-qr-stage,
.payment-order-detail {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.32);
}

.payment-qr-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    padding: 1rem;
}

.payment-qr-frame {
    width: 196px;
    height: 196px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 1.15rem;
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.payment-qr-frame canvas,
.payment-qr-frame img,
.payment-qr-frame svg {
    width: 168px;
    height: 168px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.payment-qr-frame canvas,
.payment-qr-frame svg {
    image-rendering: pixelated;
}

.payment-qr-caption {
    max-width: 220px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.55;
    text-align: center;
}

.payment-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 700;
}

.payment-qr-loading span {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(15, 23, 42, 0.14);
    border-top-color: var(--accent-primary);
    border-radius: 999px;
    animation: paymentQrSpin 0.9s linear infinite;
}

@keyframes paymentQrSpin {
    to {
        transform: rotate(360deg);
    }
}

.payment-qr-state {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 900;
}

.payment-qr-state.is-success {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 0 16px 36px rgba(34, 197, 94, 0.28);
}

.payment-qr-state.is-error {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 16px 36px rgba(239, 68, 68, 0.28);
}

.payment-order-detail {
    padding: 1rem;
}

.payment-status-pill {
    width: fit-content;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.payment-status-pill.is-pending {
    background: rgba(250, 204, 21, 0.12);
    color: #fde68a;
    border: 1px solid rgba(250, 204, 21, 0.24);
}

.payment-status-pill.is-processing {
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.24);
}

.payment-status-pill.is-completed {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.26);
}

.payment-status-pill.is-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.26);
}

.payment-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.95rem;
}

.payment-detail-grid div {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
}

.payment-detail-grid span {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.payment-detail-grid strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.payment-order-hint {
    margin: 0.95rem 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.65;
}

.payment-order-footer {
    flex-wrap: wrap;
}

.payment-order-footer .btn {
    min-width: 112px;
}

@media (max-width: 768px) {
    .payment-order-modal-content {
        width: 94vw;
        max-height: 94vh;
    }

    .payment-plan-confirm,
    .payment-order-panel {
        grid-template-columns: 1fr;
    }

    .payment-plan-confirm {
        flex-direction: column;
    }

    .payment-plan-price {
        width: 100%;
        text-align: left;
    }

    .payment-method-confirm {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-method-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .payment-method-option {
        min-width: 0;
        width: 100%;
    }

    .payment-detail-grid {
        grid-template-columns: 1fr;
    }

    .payment-order-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payment-order-footer .btn {
        width: 100%;
    }
}

/* 鍒嗛殧绾?*/
.activate-divider {
    height: 1px;
    background: var(--border-color);
}

/* 璐拱鍖哄煙 */
.activate-buy-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.activate-buy-text {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.activate-buy-area .btn-outline {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
}

.activate-buy-area .btn-outline:hover {
    background: var(--accent-primary);
    color: #fff;
}

.activate-footer {
    display: flex;
    gap: 0.75rem;
}

.activate-footer .activate-footer-btn {
    flex: 1;
    width: 100%;
}

/* ===== Tab 鍒囨崲 ===== */
.activate-tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
}

.activate-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    text-align: center;
}

.activate-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.activate-tab-btn.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.activate-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.activate-tab-content {
    display: none;
    padding: 1rem 0;
    animation: fadeIn 0.3s ease;
}

.activate-tab-content.active {
    display: block;
}

/* ===== 涓€鍙ｄ环璐拱鍗＄墖 ===== */
.activate-onetime-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.activate-onetime-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.activate-onetime-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activate-onetime-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.activate-onetime-price .price-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.activate-onetime-price .price-num {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.activate-onetime-price .price-suffix {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.activate-onetime-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 0 0.5rem;
}

.onetime-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: left;
}

.onetime-feature svg {
    flex-shrink: 0;
}

.activate-onetime-notice {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* 瀹夊叏椤甸潰 */
.security-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.device-list {
    display: grid;
    gap: 0.75rem;
}

.device-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background:
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.08), transparent 42%),
        var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.device-item.is-current {
    border-color: rgba(34, 197, 94, 0.34);
    background:
        radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.11), transparent 42%),
        var(--bg-tertiary);
}

.device-info {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    min-width: 0;
}

.device-icon {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    font-size: 1.25rem;
}

.device-copy {
    min-width: 0;
}

.device-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.device-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.device-meta.muted {
    opacity: 0.78;
}

.device-status {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

.device-status.current {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.device-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.device-revoke-btn {
    min-height: 1.9rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
}

.device-revoke-btn:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.device-empty {
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    font-size: 0.85rem;
}

.device-empty.is-error {
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 640px) {
    .device-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .device-status {
        width: max-content;
    }

    .device-actions {
        justify-content: flex-start;
    }
}

/* 閫氱煡璁剧疆 */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* API 瀵嗛挜 */
.api-key-card {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.api-key-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.api-key-value {
    font-family: 'SF Mono', monospace;
    font-size: 0.9375rem;
    color: var(--text-primary);
    word-break: break-all;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.api-key-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.api-docs h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.api-docs-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* 鍝嶅簲寮?*/
@media (max-width: 1200px) {
    .header {
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .history-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-modal-plans {
        grid-template-columns: 1fr;
    }

    .service-modal-plans.plan-carousel .modal-plan-card {
        flex-basis: calc((100% - 1rem) / 2);
    }

    .service-plans,
    .subscription-plans {
        grid-template-columns: 1fr;
    }

    .service-plans.flex-plans {
        flex-direction: column;
    }

    .balance-card-item {
        max-width: none;
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .history-table-header {
        grid-template-columns: 38px minmax(0, 1.35fr) minmax(76px, 0.65fr) minmax(96px, 0.75fr) minmax(78px, 0.65fr) minmax(140px, 1fr);
    }

    .history-item {
        grid-template-columns: 38px minmax(0, 1.35fr) minmax(76px, 0.65fr) minmax(96px, 0.75fr) minmax(78px, 0.65fr) minmax(140px, 1fr);
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .history-storage .storage-label {
        display: none;
    }
}

@media (max-width: 768px) {
    .tutorial-empty {
        min-height: auto;
        padding: 1.5rem 1rem;
    }

    .tutorial-empty-visual {
        width: min(100%, 280px);
        height: 180px;
        min-height: 180px;
    }

    .tutorial-empty-steps {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .tutorial-empty-step {
        min-height: 74px;
        padding: 0.75rem;
    }

    .tutorial-empty-actions {
        width: 100%;
        flex-direction: column;
    }

    .tutorial-empty-actions .btn {
        width: 100%;
    }

    .history-stats {
        grid-template-columns: 1fr 1fr;
    }

    .service-modal-plans.plan-carousel .modal-plan-card {
        flex-basis: 100%;
    }

    .current-plan-card {
        flex-direction: column;
        align-items: stretch;
    }

    .plan-usage {
        max-width: none;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search-wrap,
    .filter-btn-group,
    .filter-sort-group {
        width: 100%;
    }

    .filter-btn-group {
        justify-content: center;
    }

    .filter-search-count {
        margin-left: 0;
        text-align: center;
    }

    .history-bulk-bar.is-active {
        align-items: stretch;
        flex-direction: column;
        max-height: 120px;
    }

    .history-bulk-actions {
        justify-content: stretch;
    }

    .history-bulk-actions .btn {
        flex: 1;
    }

    .history-table-header {
        display: none;
    }

    .history-item {
        grid-template-columns: 36px 1fr;
        gap: 0.75rem;
        justify-items: stretch;
    }

    .history-col-select {
        grid-row: 1 / span 5;
        align-self: start;
        padding-top: 0.25rem;
    }

    .history-item .history-col-video,
    .history-item .history-col-cost,
    .history-item .history-col-storage,
    .history-item .history-col-status,
    .history-item .history-col-action {
        grid-column: 2;
        justify-content: flex-start;
    }

    .history-thumb {
        display: none;
    }

    .history-actions {
        justify-content: flex-end;
    }

    .user-name {
        display: none;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 鎺ㄥ箍涓績 ==================== */

.promo-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.promo-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.promo-stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.promo-stat-card.highlight {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.promo-stat-card.highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.promo-stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.promo-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.promo-stat-card.highlight .promo-stat-value {
    color: var(--accent-primary);
}

.promo-stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* 鎺ㄥ箍閾炬帴鍖哄煙 */
.promo-link-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.promo-link-card,
.promo-code-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.promo-link-header {
    margin-bottom: 1rem;
}

.promo-link-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.promo-link-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.promo-link-box {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.promo-link-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'SF Mono', monospace;
    font-size: 0.8125rem;
}

.promo-code-box {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.promo-code-display {
    flex: 1;
    padding: 0.625rem 0.875rem;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-family: 'SF Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
}

/* 鎻愮幇鍖哄煙 */
.promo-withdraw-section {
    margin-bottom: 2rem;
}

.promo-withdraw-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.promo-withdraw-info {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.promo-withdraw-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.promo-withdraw-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.promo-withdraw-min {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* 鎺ㄥ箍 Tab */
.promo-tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.promo-tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.promo-tab-btn {
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.promo-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.promo-tab-btn.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.promo-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.promo-tab-content {
    display: none;
    padding: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.promo-tab-content.active {
    display: block;
}

/* 瑙勫垯鍗＄墖 */
.promo-rule-card {
    padding: 0.5rem;
}

.promo-rule-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.promo-rule-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.promo-rule-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1rem;
    position: relative;
}

.promo-rule-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
}

/* ===== 閭€璇疯褰?- 琛ㄦ牸鏍峰紡 ===== */

/* 鎼滅储鏍?*/
/* 鎼滅储涓庣瓫閫夋爮 */
.promo-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

/* 鎼滅储杈撳叆妗嗗寘瑁?*/
.promo-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.promo-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.promo-search-input {
    width: 100%;
    padding: 0.5rem 0.875rem 0.5rem 2.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.promo-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--bg-secondary);
}

.promo-search-input::placeholder {
    color: var(--text-muted);
}

/* 绛涢€夋寜閽粍 */
.promo-filter-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.promo-filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.promo-filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.promo-filter-btn.active {
    color: var(--accent-primary);
    background: rgba(var(--accent-rgb, 139, 92, 246), 0.1);
    font-weight: 600;
}

.promo-search-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-left: auto;
    white-space: nowrap;
}

/* 琛ㄥご */
.promo-invite-table-header {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 0.7fr 1.2fr 1.2fr;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.promo-invite-table-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 閭€璇峰垪琛?- 鍥哄畾楂樺害 + 婊氬姩 */
.promo-invite-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-height: 310px;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.promo-invite-list::-webkit-scrollbar {
    width: 5px;
}

.promo-invite-list::-webkit-scrollbar-track {
    background: transparent;
}

.promo-invite-list::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

/* 绌虹姸鎬?*/
.promo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.045), rgba(20, 184, 166, 0.025));
    border: 1px dashed rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
}

.promo-empty::before {
    content: '馃攳';
    font-size: 2rem;
    opacity: 0.72;
    filter: drop-shadow(0 0 14px rgba(99, 102, 241, 0.35));
}

.promo-empty::after {
    content: 'Try another keyword';
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.promo-empty.compact {
    min-height: 120px;
}

.promo-commission-tbody .promo-empty {
    min-height: 250px;
    margin: 0.5rem 1rem 0;
}

.promo-invite-item {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 0.7fr 1.2fr 1.2fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.promo-invite-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.promo-invite-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.promo-invite-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.promo-invite-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-invite-cell {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-invite-plan {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    border: 1px solid;
    width: fit-content;
}

.promo-invite-status {
    font-size: 0.8125rem;
    font-weight: 500;
}

.promo-invite-status.activated {
    color: var(--success);
}

.promo-invite-status.inactive {
    color: var(--text-tertiary);
}

/* ===== 鍒嗛〉鏍?===== */
.promo-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin-top: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.promo-page-size {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.promo-page-select {
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
}

.promo-page-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.promo-page-info {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.promo-page-btns {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.promo-page-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 2rem;
    text-align: center;
}

.promo-page-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.promo-page-btn.active {
    color: #fff;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    font-weight: 600;
}

.promo-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 浣ｉ噾鏄庣粏 - 琛ㄦ牸鏍峰紡 ===== */

.promo-commission-table {
    display: flex;
    flex-direction: column;
}

.promo-commission-thead {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 1.4fr 0.8fr 0.7fr;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.promo-commission-thead span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-commission-tbody {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.promo-commission-item {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 1.4fr 0.8fr 0.7fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.promo-commission-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.promo-commission-cell {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-commission-cell.time {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.promo-commission-cell.type {
    font-weight: 500;
    color: var(--text-primary);
}

.promo-commission-cell.source {
    color: var(--text-secondary);
}

.promo-commission-cell.amount {
    font-weight: 600;
    color: var(--success);
}

.promo-commission-cell.amount.negative {
    color: var(--danger);
}

.promo-commission-cell.status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    width: fit-content;
}

.promo-commission-cell.status.settled {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.promo-commission-cell.status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.promo-commission-cell.status.revoked {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

/* 鎺ㄥ箍涓績鍝嶅簲寮?*/
@media (max-width: 1200px) {
    .promo-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .promo-link-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .promo-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .promo-link-box,
    .promo-code-box {
        flex-direction: column;
        align-items: stretch;
    }
    .promo-withdraw-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .promo-tab-header {
        overflow-x: auto;
    }
    .promo-tab-btn {
        white-space: nowrap;
    }
    .promo-commission-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .promo-commission-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .promo-invite-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .promo-invite-right {
        justify-content: space-between;
    }
}

/* ==================== 鎺ㄥ箍涓績 v2锛氳繍钀ュ闀垮伐浣滃彴 ==================== */

.promotion-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.promo-hero-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 1.5rem;
    padding: 1.75rem;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 211, 238, 0.18), transparent 28%),
        radial-gradient(circle at 88% 4%, rgba(139, 92, 246, 0.28), transparent 34%),
        linear-gradient(135deg, rgba(18, 18, 26, 0.96), rgba(10, 10, 15, 0.98));
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.promo-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 78%);
}

.promo-hero-copy,
.promo-hero-board {
    position: relative;
    z-index: 1;
}

.promo-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.875rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(34, 211, 238, 0.26);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    color: #67e8f9;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.promo-hero-copy h2 {
    max-width: 720px;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: clamp(1.85rem, 4vw, 3.15rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.promo-hero-copy p {
    max-width: 760px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.85;
}

.promo-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.promo-hero-board {
    align-self: stretch;
    min-height: 220px;
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.08)),
        rgba(12, 12, 20, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.promo-board-label {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.promo-board-title {
    margin-top: 0.75rem;
    color: #f8fafc;
    font-size: 1.65rem;
    font-weight: 800;
}

.promo-board-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.promo-board-rates span {
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.promo-board-rates strong {
    display: block;
    margin-top: 0.25rem;
    color: #67e8f9;
    font-size: 1.35rem;
}

.promo-board-line {
    height: 1px;
    margin: 1.15rem 0;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.55), transparent);
}

.promo-board-foot {
    color: var(--text-tertiary);
    font-size: 0.82rem;
}

.promo-board-foot span {
    color: var(--text-primary);
    font-weight: 700;
}

.promotion-workspace .promo-stats-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
}

.promotion-workspace .promo-stat-card {
    align-items: flex-start;
    min-height: 138px;
    padding: 1.15rem;
    text-align: left;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        var(--bg-secondary);
}

.promotion-workspace .promo-stat-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 1.25rem;
}

.promotion-workspace .promo-stat-value {
    font-size: 1.85rem;
    line-height: 1;
}

.promo-asset-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1.25rem;
}

.promo-link-card,
.promo-poster-card,
.promo-overview-card,
.promo-level-card {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent), var(--bg-secondary);
}

.promo-link-card {
    padding: 1.35rem;
}

.promo-link-card-wide {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.promo-link-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
}

.promo-link-header h3 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.promo-asset-status {
    flex-shrink: 0;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    font-size: 0.74rem;
    font-weight: 700;
}

.promo-code-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 40%, rgba(99, 102, 241, 0.25), transparent 36%),
        rgba(26, 26, 37, 0.84);
}

.promo-code-hero span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.promo-code-hero strong {
    color: #f8fafc;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: clamp(1.25rem, 3vw, 2rem);
    letter-spacing: 0.16em;
}

.promotion-workspace .promo-link-box {
    align-items: stretch;
}

.promotion-workspace .promo-link-input {
    min-height: 44px;
    border-radius: 14px;
}

.promotion-workspace .promo-withdraw-card {
    margin-top: 0;
    border-radius: 18px;
    background: rgba(34, 211, 238, 0.07);
}

.promo-poster-card {
    padding: 1rem;
}

.promo-poster-preview {
    position: relative;
    min-height: 100%;
    padding: 1.5rem;
    overflow: hidden;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 0%, rgba(103, 232, 249, 0.28), transparent 34%),
        linear-gradient(160deg, #131326, #090910 72%);
}

.promo-poster-glow {
    position: absolute;
    right: -40px;
    bottom: -50px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.32);
    filter: blur(26px);
}

.promo-poster-topline {
    position: relative;
    color: #67e8f9;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.28em;
}

.promo-poster-preview h3 {
    position: relative;
    margin: 1.15rem 0 0.6rem;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1.1;
}

.promo-poster-preview p {
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.promo-poster-code {
    position: relative;
    width: fit-content;
    margin-top: 2rem;
    padding: 0.8rem 1rem;
    border: 1px dashed rgba(103, 232, 249, 0.45);
    border-radius: 16px;
    background: rgba(103, 232, 249, 0.08);
    color: #f8fafc;
    font-family: 'SF Mono', Consolas, monospace;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.promo-poster-link {
    position: relative;
    margin-top: 0.9rem;
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.promotion-workspace .promo-tabs {
    border-radius: 22px;
}

.promotion-workspace .promo-tab-header {
    gap: 0.4rem;
    padding: 0.45rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
}

.promotion-workspace .promo-tab-btn {
    border-radius: 14px;
    white-space: nowrap;
}

.promotion-workspace .promo-tab-btn.active::after {
    display: none;
}

.promo-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.promo-overview-card {
    padding: 1.1rem;
}

.promo-overview-card span {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.promo-overview-card strong {
    display: block;
    margin-top: 0.65rem;
    color: #67e8f9;
    font-size: 1.6rem;
}

.promo-overview-card p {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.6;
}

.promo-level-card {
    margin-top: 1rem;
    padding: 1.15rem;
}

.promo-level-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.promo-level-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-tertiary);
}

.promo-level-item.active {
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.08);
}

.promo-level-item span {
    color: var(--text-tertiary);
    font-size: 0.74rem;
}

.promo-level-item strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.promo-level-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.promo-level-metrics span {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.promo-invite-mail {
    margin-top: 0.15rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-empty.compact {
    min-height: 96px;
}

.promo-empty.compact::after {
    content: '';
}

@media (max-width: 1200px) {
    .promo-hero-card,
    .promo-asset-grid {
        grid-template-columns: 1fr;
    }

    .promo-overview-grid,
    .promo-level-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem;
        overflow-x: clip;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .header-actions {
        max-width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .mode-switch {
        max-width: 164px;
    }

    .storage-badge {
        max-width: 112px;
    }

    .storage-badge-label {
        display: none;
    }

    .mode-label,
    .storage-badge-text,
    .user-name {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-menu {
        padding-right: 0;
    }

    .promo-hero-card {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .promotion-workspace .promo-stats-row,
    .promo-overview-grid,
    .promo-level-list {
        grid-template-columns: 1fr;
    }

    .promo-board-rates,
    .promo-code-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .promo-link-header,
    .promo-withdraw-card {
        flex-direction: column;
        align-items: stretch;
    }

    .promo-invite-table-header,
    .promo-commission-thead {
        display: none;
    }

    .promo-invite-item,
    .promo-commission-item {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
}

/* ==================== 鎺ㄥ箍涓績 v3锛氬弬鑰冮」鐩湰鍦板寲甯冨眬 ==================== */

.promo-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.promo-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.promo-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1.5rem;
    align-items: end;
    padding: 1.8rem;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 28px;
    background:
        radial-gradient(circle at 10% 20%, rgba(34, 211, 238, 0.14), transparent 30%),
        radial-gradient(circle at 94% 8%, rgba(99, 102, 241, 0.22), transparent 34%),
        linear-gradient(135deg, rgba(18, 18, 26, 0.98), rgba(10, 10, 15, 0.98));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.promo-page-intro {
    min-width: 0;
}

.promo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.42rem 0.75rem;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.075);
    color: #8feeff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.promo-chip b {
    color: #fff;
}

.promo-chip-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.85);
}

.promo-page-title {
    margin: 0.9rem 0 0.75rem;
    color: var(--text-primary);
    font-size: clamp(2.15rem, 4.5vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.promo-page-desc {
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.9;
}

.promo-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.promo-head-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.promo-panel,
.promo-panel-soft,
.promo-table-shell {
    border: 1px solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        var(--bg-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.promo-panel {
    padding: 1.25rem;
    border-radius: 24px;
}

.promo-panel-soft {
    padding: 1rem;
    border-radius: 20px;
}

.promo-head-card span,
.promo-section-eyebrow {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.promo-head-card strong {
    display: block;
    margin-top: 0.55rem;
    color: #67e8f9;
    font-size: 1.7rem;
    line-height: 1;
}

.promo-head-card:first-child strong {
    color: #86efac;
}

.promo-head-card p {
    margin-top: 0.65rem;
    color: var(--text-tertiary);
    font-size: 0.76rem;
    line-height: 1.55;
}

.promo-invite-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
    gap: 1.2rem;
    align-items: stretch;
}

.promo-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.promo-panel-heading h3 {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    font-size: 1.16rem;
    line-height: 1.25;
}

.promo-panel-heading p {
    max-width: 680px;
    margin-top: 0.45rem;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    line-height: 1.65;
}

.promo-invite-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.promotion-workspace .promo-code-hero {
    padding: 1.15rem;
}

.promotion-workspace .promo-code-hero strong {
    word-break: break-all;
}

.promotion-workspace .promo-link-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.promotion-workspace .promo-link-input {
    width: 100%;
}

.promotion-workspace .promo-poster-card {
    display: flex;
    flex-direction: column;
}

.promotion-workspace .promo-poster-preview {
    flex: 1;
    min-height: 360px;
}

@media (max-width: 1200px) {
    .promo-page-head,
    .promo-invite-layout {
        grid-template-columns: 1fr;
    }

    .promo-head-summary {
        max-width: 640px;
    }
}

@media (max-width: 768px) {
    .promo-shell {
        max-width: 100%;
    }

    .promo-page-head {
        padding: 1.25rem;
        border-radius: 22px;
    }

    .promo-head-summary,
    .promo-invite-layout {
        grid-template-columns: 1fr;
    }

    .promo-head-actions,
    .promo-panel-heading,
    .promotion-workspace .promo-link-box {
        flex-direction: column;
        align-items: stretch;
    }

    .promotion-workspace .promo-link-box {
        display: flex;
    }

}

/* 鎺ㄥ箍涓績 v4锛氱畝鍖栦负鏀剁泭鎽樿 + 閭€璇锋帹骞?*/
.promo-simple .promo-page-head {
    align-items: stretch;
}

.promo-simple .promo-head-summary {
    align-self: stretch;
}

.promo-simple .promo-head-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 150px;
}

.promo-invite-section {
    display: block;
}

.promo-invite-note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.promo-invite-note-grid article {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.promo-invite-note-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    margin-bottom: 0.7rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    font-size: 0.78rem;
    font-weight: 800;
}

.promo-invite-note-grid strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.promo-invite-note-grid p {
    margin-top: 0.45rem;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .promo-invite-note-grid {
        grid-template-columns: 1fr;
    }
}

/* 鎺ㄥ箍涓績 v5锛氶個璇枫€佸洟闃熴€佹敹鐩婁笁妯″潡 */
.promo-console {
    padding: 0;
}

.promo-console .promo-content {
    width: min(1280px, 100%);
}

.promo-console .promo-page-head {
    align-items: stretch;
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.18), transparent 36%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.94));
}

.promo-user-tabbar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.72);
}

.promo-user-tab {
    border: 0;
    border-radius: 14px;
    padding: 0.75rem 1.1rem;
    background: transparent;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.promo-user-tab:hover,
.promo-user-tab.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(16, 185, 129, 0.12));
    color: #e0f2fe;
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.18);
}

.promo-user-panel {
    display: none;
}

.promo-user-panel.active {
    display: block;
}

.promo-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.promo-console .promo-code-hero {
    min-height: 116px;
    border-color: rgba(34, 211, 238, 0.18);
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.64), rgba(15, 23, 42, 0.72));
}

.promo-scripts-panel {
    margin-top: 1rem;
}

.promo-script-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.promo-script-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.72);
}

.promo-script-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.promo-script-card-head span {
    display: inline-block;
    margin-bottom: 0.3rem;
    color: #67e8f9;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.promo-script-card-head strong {
    display: block;
    color: #f8fafc;
}

.promo-script-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.promo-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.promo-metric-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.promo-console .promo-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.12), transparent 38%),
        rgba(15, 23, 42, 0.82);
}

.promo-console .promo-stat-card span {
    display: block;
    color: #94a3b8;
    font-size: 0.86rem;
}

.promo-console .promo-stat-card strong {
    display: block;
    margin-top: 0.8rem;
    color: #f8fafc;
    font-size: 2rem;
    line-height: 1;
}

.promo-console .promo-stat-card p {
    margin-top: 0.8rem;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.5;
}

.promo-table-headline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.promo-table-headline h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.1rem;
}

.promo-table-headline p {
    margin: 0.35rem 0 0;
    color: #94a3b8;
    font-size: 0.86rem;
}

.promo-table-wrap {
    overflow-x: auto;
}

.promo-data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.promo-data-table th {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-align: left;
    text-transform: uppercase;
}

.promo-data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    vertical-align: middle;
}

.promo-data-table tr:last-child td {
    border-bottom: 0;
}

.promo-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.promo-user-cell > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 14px;
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    font-size: 0.82rem;
    font-weight: 800;
}

.promo-user-cell strong {
    display: block;
    color: #f8fafc;
    font-size: 0.92rem;
}

.promo-user-cell small {
    display: block;
    margin-top: 0.18rem;
    color: #64748b;
    font-size: 0.76rem;
}

.promo-status,
.promo-reward-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.promo-status.active {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.promo-status.inactive,
.promo-status.pending {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.promo-status.revoked {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.promo-reward-type {
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
}

.promo-money {
    color: #6ee7b7;
    font-weight: 800;
    white-space: nowrap;
}

.promo-money.negative {
    color: #fca5a5;
}

.promo-source-cell {
    max-width: 460px;
    overflow: hidden;
    color: #cbd5e1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-empty-state,
.promo-empty-cell {
    padding: 2rem;
    color: #64748b;
    text-align: center;
}

@media (max-width: 980px) {
    .promo-code-grid,
    .promo-script-grid,
    .promo-metric-grid,
    .promo-metric-grid-two {
        grid-template-columns: 1fr;
    }

    .promo-user-tabbar {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .promo-console .promo-page-head {
        padding: 1.2rem;
    }

    .promo-console .promo-stat-card strong {
        font-size: 1.65rem;
    }
}

/* 鎺ㄥ箍涓績 v6锛氬洖褰掑厖鍊艰闃呴〉鐨勫師鐢熷崱鐗囬鏍?*/
.promo-native {
    width: 100%;
}

.promo-native .promo-content {
    width: 100%;
    max-width: none;
    gap: 1rem;
}

.promo-native-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.promo-native .balance-card,
.promo-native .promo-panel,
.promo-native .promo-table-shell {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: none;
}

.promo-native .balance-card {
    margin-bottom: 1rem;
}

.promo-native-income-card {
    min-height: 116px;
}

.promo-native-income-value {
    color: var(--accent-primary);
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.promo-native-income-value.success {
    color: var(--success);
}

.promo-native-tabbar {
    display: flex;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.promo-native .promo-user-tab {
    flex: 1;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
}

.promo-native .promo-user-tab:hover {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.promo-native .promo-user-tab.active {
    border-color: rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.1));
    color: var(--accent-primary);
    box-shadow: none;
}

.promo-native .promo-user-panel {
    display: none;
}

.promo-native .promo-user-panel.active {
    display: block;
}

.promo-native .promo-invite-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.promo-native .promo-panel {
    padding: 1.25rem 1.5rem;
}

.promo-native .promo-invite-card {
    align-self: start;
    height: fit-content;
    gap: 0.75rem;
    padding-bottom: 1rem;
}

.promo-native .promo-panel-heading {
    margin-bottom: 0.75rem;
}

.promo-native .promo-panel-heading h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.promo-native .promo-section-eyebrow {
    display: none;
}

.promo-native .promo-panel-heading p {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.promo-native .promo-chip {
    padding: 0.25rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
}

.promo-native .promo-code-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.promo-native .promo-code-hero {
    min-height: auto;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(255, 255, 255, 0.02));
}

.promo-native .promo-code-hero span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.promo-native .promo-code-hero strong {
    margin-top: 0.35rem;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-size: 1.125rem;
    letter-spacing: 0.04em;
}

.promo-native .promo-link-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.promo-native .promo-link-input {
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.promo-native .promo-invite-note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.promo-native .promo-invite-note-grid article {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 0.75rem;
}

.promo-native .promo-invite-note-grid span {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.45rem;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-size: 0.75rem;
}

.promo-native .promo-invite-note-grid strong {
    font-size: 0.875rem;
}

.promo-native .promo-invite-note-grid p {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.promo-native .promo-poster-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
}

.promo-native .promo-poster-preview {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    height: var(--promo-poster-preview-height, auto);
    min-height: 0;
    padding: 1rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background:
        radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
        var(--bg-tertiary);
}

.promo-native .promo-poster-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 126px;
    grid-template-rows: 34px 52px 42px 32px 56px 14px;
    gap: 0.42rem 0.75rem;
    width: min(calc(100% - 0.75rem), 720px);
    height: 300px;
    max-height: calc(100% - 0.75rem);
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.85rem;
    transform: translate(-50%, -50%) scale(var(--promo-poster-scale, 1));
    transform-origin: center;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 24px;
    background:
        radial-gradient(circle at 88% 10%, rgba(34, 211, 238, 0.2), transparent 30%),
        radial-gradient(circle at 0% 88%, rgba(59, 130, 246, 0.18), transparent 32%),
        linear-gradient(135deg, #0b1120 0%, #101827 55%, #06111d 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.promo-native .promo-poster-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 70%);
    pointer-events: none;
}

.promo-native .promo-poster-header {
    position: relative;
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.promo-native .promo-poster-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 0.5rem;
}

.promo-native .promo-poster-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 12px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.26);
}

.promo-native .promo-poster-topline {
    color: #e2e8f0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

.promo-native .promo-poster-badge {
    max-width: 44%;
    overflow: hidden;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #7dd3fc;
    font-size: 0.7rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-native .promo-poster-visual {
    position: relative;
    display: flex;
    grid-column: 1;
    grid-row: 2 / 5;
    flex-direction: column;
    min-height: 0;
    height: auto;
    padding: 0.72rem;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 15% 0%, rgba(34, 211, 238, 0.14), transparent 38%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.66));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.promo-native .promo-poster-visual-head {
    display: flex;
    gap: 0.28rem;
    margin-bottom: 0.55rem;
}

.promo-native .promo-poster-visual-head span {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: #475569;
}

.promo-native .promo-poster-screen {
    display: grid;
    flex: 1;
    grid-template-columns: 1.1fr 0.75fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    min-height: 0;
}

.promo-native .promo-poster-screen span {
    position: relative;
    display: block;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.9);
}

.promo-native .promo-poster-screen span:first-child {
    grid-row: 1 / span 2;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(20, 184, 166, 0.22)),
        #0f2a3b;
}

.promo-native .promo-poster-screen span:nth-child(2) {
    background: rgba(14, 165, 233, 0.2);
}

.promo-native .promo-poster-screen span:nth-child(3) {
    background: rgba(20, 184, 166, 0.22);
}

.promo-native .promo-poster-timeline {
    display: grid;
    grid-template-columns: 0.22fr 1fr 0.62fr 0.38fr;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.55rem;
}

.promo-native .promo-poster-timeline i {
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.promo-native .promo-poster-timeline span {
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.16);
}

.promo-native .promo-poster-timeline span:nth-child(2) {
    background: linear-gradient(90deg, #0ea5e9, #14b8a6);
}

.promo-native .promo-poster-frame h3 {
    position: relative;
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    margin: 0;
    overflow: hidden;
    color: #f8fafc;
    font-size: clamp(1.36rem, 2vw, 1.62rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-native .promo-poster-frame p {
    position: relative;
    grid-column: 2;
    grid-row: 3;
    margin: 0;
    overflow: hidden;
    color: #cbd5e1;
    font-size: 0.76rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.promo-native .promo-poster-tags {
    position: relative;
    display: flex;
    grid-column: 2;
    grid-row: 4;
    align-self: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow: hidden;
}

.promo-native .promo-poster-tags span {
    padding: 0.18rem 0.42rem;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #67e8f9;
    font-size: 0.62rem;
    font-weight: 700;
}

.promo-native .promo-poster-proof {
    position: relative;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
}

.promo-native .promo-poster-proof span {
    min-width: 0;
    padding: 0.38rem 0.32rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
    font-size: 0.53rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.promo-native .promo-poster-code-row {
    position: relative;
    display: contents;
    margin-top: 0;
}

.promo-native .promo-poster-code-box {
    display: flex;
    grid-column: 1 / 3;
    grid-row: 5;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 0;
    padding: 0.58rem 0.8rem;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 18px;
    background: linear-gradient(135deg, #020617, #0f172a);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.promo-native .promo-poster-code-box span {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.promo-native .promo-poster-code-box strong {
    margin-top: 0;
    overflow: hidden;
    color: #f8fafc;
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-size: 0.98rem;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-native .promo-poster-qr {
    display: flex;
    grid-column: 3;
    grid-row: 2 / 6;
    align-items: center;
    align-self: center;
    justify-content: center;
    justify-self: center;
    min-width: 0;
    width: 100%;
    max-width: 118px;
    aspect-ratio: 1;
    padding: 0.42rem;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.promo-native .promo-poster-qr svg,
.promo-native .promo-poster-qr canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.promo-native .promo-qr-fallback {
    color: #94a3b8;
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: center;
}

.promo-native .promo-poster-link {
    position: relative;
    grid-column: 1 / 3;
    grid-row: 6;
    align-self: end;
    margin-top: 0;
    overflow: hidden;
    padding-top: 0;
    border-top: 0;
    color: #64748b;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-native .promo-scripts-panel {
    margin-top: 0;
}

.promo-native .promo-script-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.promo-native .promo-script-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 1rem;
}

.promo-native .promo-script-card-head span {
    color: var(--text-tertiary);
    letter-spacing: 0;
    text-transform: none;
}

.promo-native .promo-script-card-head strong {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.promo-native .promo-script-card p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.promo-native .promo-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.promo-native .promo-metric-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.promo-native .promo-stat-card {
    min-height: 132px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--bg-secondary);
    padding: 1.25rem;
}

.promo-native .promo-stat-card span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.promo-native .promo-stat-card strong {
    color: var(--accent-primary);
    font-family: 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
    font-size: 1.85rem;
}

.promo-native .promo-stat-card p {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.promo-native .promo-table-shell {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.promo-native .promo-table-headline {
    margin-bottom: 1rem;
}

.promo-native .promo-table-headline h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.promo-native .promo-table-headline p {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.promo-native .promo-data-table {
    min-width: 760px;
}

.promo-native .promo-data-table th {
    padding: 0.75rem 0.875rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0;
    text-transform: none;
}

.promo-native .promo-data-table td {
    padding: 0.875rem;
}

.promo-native .promo-user-cell > span {
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    color: var(--accent-primary);
}

.promo-native .promo-reward-type {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.promo-native .promo-money {
    color: var(--success);
}

.promo-native .promo-empty-state,
.promo-native .promo-empty-cell {
    color: var(--text-tertiary);
}

@media (max-width: 1100px) {
    .promo-native .promo-invite-layout {
        grid-template-columns: 1fr;
    }

    .promo-native .promo-poster-preview {
        height: auto;
        min-height: 360px;
    }

    .promo-native .promo-poster-frame {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }
}

@media (max-width: 760px) {
    .promo-native .promo-poster-preview {
        min-height: 0;
        padding: 0.75rem;
    }

    .promo-native .promo-poster-frame {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 0.65rem;
        width: 100%;
        height: auto;
        max-height: none;
        padding: 0.9rem;
    }

    .promo-native .promo-poster-header,
    .promo-native .promo-poster-visual,
    .promo-native .promo-poster-frame h3,
    .promo-native .promo-poster-frame p,
    .promo-native .promo-poster-tags,
    .promo-native .promo-poster-proof,
    .promo-native .promo-poster-code-row,
    .promo-native .promo-poster-link {
        grid-column: 1;
        grid-row: auto;
    }

    .promo-native .promo-poster-badge {
        max-width: 46%;
    }

    .promo-native .promo-poster-visual {
        min-height: 138px;
        height: auto;
    }

    .promo-native .promo-poster-frame h3 {
        white-space: normal;
    }

    .promo-native .promo-poster-code-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 96px;
    }

    .promo-native .promo-poster-code-box,
    .promo-native .promo-poster-qr {
        grid-column: auto;
        grid-row: auto;
    }

    .promo-native .promo-poster-code-box {
        flex-direction: column;
        align-items: flex-start;
        min-height: 78px;
    }

    .promo-native .promo-poster-qr {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .promo-native-summary,
    .promo-native .promo-code-grid,
    .promo-native .promo-script-grid,
    .promo-native .promo-metric-grid,
    .promo-native .promo-metric-grid-two {
        grid-template-columns: 1fr;
    }

    .promo-native .promo-link-box {
        grid-template-columns: 1fr;
    }

    .promo-native-tabbar {
        display: grid;
        grid-template-columns: 1fr;
    }
}
