/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --secondary-color: #69F0AE;
    --accent-color: #B9F6CA;
    --text-primary: #212121;
    --text-secondary: #9ca3af;
    --text-light: #9E9E9E;
    --bg-primary: #ffffff;
    --bg-secondary: #FAFAFA;
    --bg-gradient: linear-gradient(135deg, #4CAF50 0%, #69F0AE 100%);
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 32px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary-color); }

/* ==================== 导航栏 ==================== */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: '🎬';
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

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

.nav-auth-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white !important;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.nav-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.nav-auth-btn.nav-logout-btn {
    background: transparent;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.nav-auth-btn.nav-logout-btn:hover {
    border-color: #EF4444;
    color: #EF4444 !important;
}

.nav-link-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link-btn:hover {
    color: var(--primary-color);
}

/* ==================== Hero 区域 ==================== */
.hero {
    padding: 2rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ==================== 输入区域 ==================== */
.input-section {
    max-width: 75%;
    margin: 0 auto;
    padding: 0 2rem;
}

.input-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.input-label {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.url-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.1);
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-batch-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-batch-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffffff;
}

.btn-batch-link .batch-icon {
    font-size: 1.1rem;
}

.btn-batch-link .batch-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ==================== 视频信息展示 ==================== */
.video-info-section {
    max-width: 900px;
    margin: 2rem auto 0;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-info-header {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-gradient);
    color: white;
}

.video-thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--text-secondary);
}

.video-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-details p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.video-options {
    padding: 1.5rem;
}

.format-selector {
    margin-bottom: 1rem;
}

.format-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.format-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-primary);
    cursor: pointer;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 分辨率按钮样式 */
.resolution-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.resolution-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 80px;
}

.resolution-btn:hover {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.resolution-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.resolution-btn.active .res-main,
.resolution-btn.active .res-detail {
    color: #fff;
}

.resolution-btn .res-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.resolution-btn.active .res-main {
    color: #fff;
}

.resolution-btn .res-detail {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.resolution-btn.active .res-detail {
    color: rgba(255, 255, 255, 0.9);
}

.download-btn-container {
    text-align: center;
}

/* ==================== 进度条 ==================== */
.progress-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.progress-bar-container {
    margin-bottom: 1rem;
}

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

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

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==================== 步骤说明 ==================== */
.steps-section {
    max-width: 75%;
    margin: 2rem auto;
    padding: 0 2rem;
}

.steps-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

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

.step-number {
    width: 48px;
    height: 48px;
    background: var(--bg-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== 支持平台 ==================== */
.platforms-section {
    padding: 3rem 2rem;
}

.platforms-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.platforms-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .platforms-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .platforms-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.platform-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.15);
    border-color: var(--primary-color);
}

.platform-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.platform-item:hover .platform-icon {
    transform: scale(1.15);
}

.platform-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.platform-item:hover .platform-name {
    color: var(--primary-color);
}

/* ==================== 常见问题 ==================== */
.faq-section {
    padding: 3rem 2rem;
    max-width: 75%;
    margin: 0 auto;
}

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

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

.faq-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.faq-answer {
    padding: 0 1.5rem 1.25rem 4rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-answer p {
    margin: 0;
}

/* ==================== 页脚 ==================== */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* ==================== 消息提示 ==================== */
.message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

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

.message-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.message-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.message-info {
    background: #E3F2FD;
    color: #1976D2;
    border: 1px solid #90CAF9;
}

/* ==================== 认证弹窗 ==================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.auth-modal {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: scaleIn 0.3s ease;
    position: relative;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 关闭按钮 */
.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-close:hover {
    color: #666;
}

/* 标签切换 */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
}

.auth-tab {
    flex: 1;
    padding: 20px 0;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: #4CAF50;
}

.auth-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

/* 表单容器 */
.auth-form-container {
    padding: 30px 24px;
}

/* 隐藏的表单 */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* 表单组 */
.auth-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.auth-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.auth-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}

.auth-form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.auth-form-input::placeholder {
    color: #999;
}

/* 密码输入框容器 */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.password-toggle:hover {
    color: #666;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 忘记密码 */
.forgot-password {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 16px;
}

.forgot-password a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
}

.forgot-password a:hover {
    color: #4CAF50;
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-submit-btn:hover {
    background: #388E3C;
}

.auth-submit-btn:disabled {
    background: #81C784;
    cursor: not-allowed;
}

/* 分隔线 */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
    color: #999;
    font-size: 13px;
}

/* 底部链接 */
.auth-footer-link {
    text-align: center;
    margin-top: 20px;
}

.auth-footer-link a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ==================== 旧样式兼容 ==================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.login-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

.login-modal h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.login-modal p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== 加载动画 ==================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    .video-info-header {
        flex-direction: column;
    }

    .video-thumbnail {
        width: 100%;
        height: 180px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 辅助类 ==================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-secondary { color: var(--text-secondary); }

/* ==================== 视频预览模态框 ==================== */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.2s ease;
}

.preview-modal {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.preview-header {
    background: linear-gradient(135deg, #00C853 0%, #69F0AE 100%);
    padding: 20px 24px;
    color: #fff;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-content {
    padding: 24px;
    background: #000;
    display: flex;
    justify-content: center;
}

#preview-video-player {
    max-height: 65vh;
    background: #000;
}

.preview-footer {
    padding: 16px 24px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 视频预览按钮 */
.btn-preview {
    background: linear-gradient(135deg, #6366f1 0%, #2b2d42 100%);
    color: #fff;
    border: 2px solid #4a4d63;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #7b7f9e 0%, #363852 100%);
    border-color: #5c5f7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
