/* ========================================
   新造 · AI 内容工厂
   xinzao.com v2.0
   ======================================== */

:root {
    /* 主色调 - 深邃蓝紫渐变 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* 强调色 - 珊瑚橙 */
    --accent: #f97316;
    --accent-light: #fb923c;
    
    /* 中性色 */
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(10, 15, 26, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    /* 成功/错误 */
    --success: #22c55e;
    --error: #ef4444;
    
    /* 间距 */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ========== Reset & Base ========== */

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

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== Background ========== */

.app {
    position: relative;
    min-height: 100vh;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -2;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

/* ========== Navbar ========== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-2xl);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.75rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

/* ========== User Area ========== */

.user-area {
    display: flex;
    align-items: center;
}

.user-guest,
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.btn-login {
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.user-balance {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-phone {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-logout {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ========== Login Modal ========== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.code-input-group {
    display: flex;
    gap: var(--space-sm);
}

.code-input-group input {
    flex: 1;
}

.btn-send-code {
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-send-code:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit {
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.login-tip {
    margin-top: var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========== Main ========== */

.main {
    padding-top: 100px;
    min-height: 100vh;
}

/* ========== Hero ========== */

.hero {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.title-line {
    display: block;
    color: var(--text-secondary);
}

.title-highlight {
    display: block;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ========== Input Container ========== */

.input-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    text-align: left;
}

/* ========== 底部操作栏 ========== */

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
}

/* ========== 模式选择器（Cursor 风格） ========== */

.mode-selector {
    position: relative;
}

.mode-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.mode-trigger:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-trigger-icon {
    font-size: 1.2rem;
}

.mode-trigger-arrow {
    transition: transform var(--transition-fast);
}

.mode-selector.open .mode-trigger-arrow {
    transform: rotate(180deg);
}

/* 向上弹出的面板 */
.mode-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    min-width: 280px;
    background: rgba(25, 25, 40, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.mode-selector.open .mode-panel {
    display: block;
    animation: slideUp 0.2s ease;
}

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

/* 选项列表 */
.mode-options {
    padding: 6px 0;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.mode-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.mode-option.selected {
    background: rgba(99, 102, 241, 0.12);
}

.mode-opt-icon {
    font-size: 1.1rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.mode-opt-info {
    flex: 1;
    min-width: 0;
}

.mode-opt-name {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.mode-opt-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.mode-opt-check {
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0;
    flex-shrink: 0;
}

.mode-option.selected .mode-opt-check {
    opacity: 1;
}

/* 参数区域 */
.mode-params {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    display: none;
}

.mode-params.has-params {
    display: block;
}

.mode-param {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.mode-param.visible {
    display: flex;
}

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

.param-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.param-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.param-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.param-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* 语音选择 */
.param-voices {
    display: flex;
    gap: 6px;
}

.voice-chip {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-chip:hover {
    border-color: var(--primary-light);
    color: var(--text-secondary);
}

.voice-chip.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

/* 输入框 */
#prompt-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    resize: vertical;
    font-family: inherit;
    transition: all var(--transition-fast);
}

#prompt-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#prompt-input::placeholder {
    color: var(--text-muted);
}

/* 按钮行 */
.action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

.btn-generate {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    transition: transform var(--transition-fast);
}

.btn-generate:hover .btn-icon {
    transform: translateX(4px);
}

/* ========== Progress Section ========== */

.progress-section {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-xl);
}

.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.progress-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-status {
    font-size: 1.125rem;
    color: var(--text-primary);
}

.progress-bar {
    height: 6px;
    background: var(--bg-card-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-detail {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========== Result Section ========== */

.result-section {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.result-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-md);
    overflow-x: auto;
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
    background: var(--bg-card);
}

.tab.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.result-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-panel {
    display: none;
    padding: var(--space-xl);
}

.result-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Article Panel */
.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.article-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.word-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-copy {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* Image Panel */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.image-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card-hover);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-download {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.image-item:hover .image-download {
    opacity: 1;
}

/* Audio Panel */
.audio-container {
    text-align: center;
}

#result-audio {
    width: 100%;
    max-width: 500px;
    margin-bottom: var(--space-lg);
}

.subtitle-preview {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.audio-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

/* Video Panel */
.video-preview {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.video-preview video {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.video-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.btn-download {
    padding: var(--space-sm) var(--space-xl);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-download:hover {
    background: var(--primary-dark);
}

/* ========== Features ========== */

.features {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-2xl);
    color: var(--text-primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== Footer ========== */

.footer {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

/* ========== Toast ========== */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.toast-error {
    background: var(--error);
}

/* ========== Responsive ========== */

@media (max-width: 768px) {
    .navbar {
        padding: var(--space-md);
    }
    
    .nav-links {
        gap: var(--space-md);
    }
    
    .hero {
        padding: var(--space-xl) var(--space-md);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .input-container {
        padding: var(--space-lg);
    }
    
    .mode-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mode-dropdown {
        max-width: none;
    }
    
    .params-row {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .param-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .param-group input,
    .param-group select {
        flex: 1;
    }
    
    .action-row {
        justify-content: stretch;
    }
    
    .btn-generate {
        width: 100%;
        justify-content: center;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 图片大图预览 ========== */

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-lg);
    box-sizing: border-box;
    cursor: zoom-out;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.image-modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 60px);
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    cursor: default;
}

.image-modal-actions {
    display: flex;
    gap: var(--space-md);
}

.image-modal-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.image-modal-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.image-modal-btn.close-btn {
    background: transparent;
}

/* 图片项可点击样式 */
.image-item img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* ========== 导航栏用户区调整 ========== */
.nav-link-dashboard {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link-dashboard:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-recharge {
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-recharge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ========== 充值弹窗 ========== */
.recharge-modal {
    max-width: 480px;
    width: 90%;
}

.packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.package-card {
    padding: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.package-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.package-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.package-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.package-amount {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.package-bonus {
    font-size: 0.75rem;
    color: #22c55e;
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.recharge-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recharge-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.recharge-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 10000;
    animation: toast-in 0.3s ease;
}

.toast-success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.toast-error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== 视频参数区域（新布局） ========== */

.video-params {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.param-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-group .param-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.param-group .param-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.param-group .param-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.param-group .param-btn:hover {
    background: var(--primary);
    color: white;
}

.param-group .param-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
}

.param-select {
    padding: 8px 32px 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 120px;
}

.param-select:hover {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.param-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.param-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .input-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .video-params {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .param-group {
        justify-content: space-between;
    }

    .param-select {
        flex: 1;
        min-width: 0;
    }

    .btn-generate {
        width: 100%;
        justify-content: center;
    }
}

/* ========== 进度区域增强 ========== */
.progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-percent {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.progress-steps {
    margin-top: 24px;
    padding: 20px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
}

.step-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.step-item .step-icon {
    font-size: 1rem;
    line-height: 1;
}

.step-item .step-name {
    font-size: 0.75rem;
    white-space: nowrap;
    text-align: center;
}

.step-item .step-count {
    font-size: 0.7rem;
    color: var(--primary-light);
    position: absolute;
    top: 0;
    right: 0;
}

.step-connector {
    width: 24px;
    height: 2px;
    background: var(--border);
    margin: 0 2px;
    margin-bottom: 24px;
    transition: background 0.3s ease;
}

.step-item.active {
    color: var(--primary-light);
}

.step-item.active .step-icon-wrap {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.step-item.active .step-icon {
    color: var(--primary);
    animation: pulse 1s infinite;
}

.step-item.completed {
    color: #22c55e;
}

.step-item.completed .step-icon-wrap {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.step-item.completed .step-icon {
    color: #22c55e;
}

.step-item.completed + .step-connector {
    background: #22c55e;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 图片预览区 */
.progress-preview {
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.preview-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--border);
}

.preview-thumb:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* 进度步骤响应式 */
@media (max-width: 600px) {
    .progress-steps {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .step-connector {
        display: none;
    }

    .step-item {
        flex: 0 0 calc(33.33% - 8px);
        padding: 8px 4px;
    }

    .step-icon-wrap {
        width: 32px;
        height: 32px;
    }

    .step-item .step-name {
        font-size: 0.7rem;
    }
}

/* ========== 任务历史列表 ========== */

.task-history {
    max-width: 900px;
    margin: var(--space-xl) auto 0;
    padding: 0 var(--space-xl) var(--space-2xl);
}

.history-header {
    margin-bottom: var(--space-lg);
}

.history-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

.history-item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-summary {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 4px;
}

.history-item-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-queued {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.status-badge.status-processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-badge.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.status-cancelled {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* 进度条 */
.history-item-progress {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.mini-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.mini-progress-text {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-weight: 500;
    min-width: 36px;
    text-align: right;
}

/* 链接 */
.history-item-link {
    display: inline-block;
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.history-item-link:hover {
    color: var(--accent);
}

.history-item-link-success {
    color: #22c55e;
}

.history-item-link-success:hover {
    color: #16a34a;
}

/* 响应式 */
@media (max-width: 768px) {
    .task-history {
        padding: 0 var(--space-md) var(--space-xl);
    }

    .history-item {
        padding: var(--space-md);
    }

    .history-item-main {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .history-item-status {
        align-self: flex-start;
    }
}

