/* ===== CSS 变量 ===== */
:root {
    --primary: #4f46e5;         /* 靛蓝 */
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg: #f4f7fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e9edf4;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 10px 40px rgba(79, 70, 229, 0.08);
    --max-width: 800px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    padding: 30px 20px 60px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: var(--max-width);
    width: 100%;
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    padding: 20px 0 30px;
}
.header h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header h1 span {
    -webkit-text-fill-color: transparent;
}
.header .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.header .subtitle strong {
    color: var(--primary);
    font-weight: 700;
}

/* 头部信任标识 */
.trust-badge-header {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px 36px;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--card-bg);
    border-radius: 60px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.trust-badge-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== 广告位 ===== */
.ad-banner, .ad-footer {
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 16px 0 24px;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
}
.ad-footer {
    margin-top: 40px;
}

/* ===== 主工具卡片 ===== */
.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    border: 1px solid var(--border);
    margin-bottom: 40px;
    transition: box-shadow 0.3s;
}
.tool-card:hover {
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.12);
}

/* ===== 上传区域 ===== */
.drop-zone {
    border: 2px dashed #d1d9e8;
    border-radius: var(--radius-sm);
    padding: 56px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbff;
}
.drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}
.drop-zone .icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}
.drop-zone .title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.drop-zone .sub {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}
.drop-zone .formats {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.drop-zone .formats span {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
}
#fileInput { display: none; }

/* ===== 质量控制 ===== */
.quality-section {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}
.quality-section label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.quality-section input[type="range"] {
    flex: 1;
    min-width: 140px;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 4px;
    outline: none;
}
.quality-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.quality-section .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    min-width: 48px;
    text-align: center;
}
.quality-section .hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 文件列表 ===== */
.file-list {
    margin-top: 24px;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}
.file-list.active { display: flex; }
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
    gap: 12px;
    transition: background 0.2s;
}
.file-item:hover { background: #f1f4f9; }
.file-item .info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex: 1;
}
.file-item .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.file-item .name a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}
.file-item .name a:hover { text-decoration: underline; }
.file-item .size {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}
.file-item .status {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.file-item .status.done { color: #16a34a; }
.file-item .status.pending { color: var(--text-secondary); }
.file-item .status.error { color: #dc2626; }

/* ===== 统计栏 ===== */
.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}
.stats .count {
    font-weight: 700;
    color: var(--text);
}

/* ===== 操作按钮 ===== */
.actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.btn {
    padding: 14px 36px;
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.4);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-success {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(22, 163, 74, 0.4);
}

.hint-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== 信息区块 (如何使用/特点/FAQ) ===== */
.info-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 36px 32px;
    margin-top: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.info-section h2 {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
    color: var(--text);
}

/* 步骤 */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}
.step {
    text-align: center;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}
.step h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}
.step p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 特点网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}
.feature-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}
.feature-item h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}
.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 常见问题 */
.faq-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-item h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}
.faq-item p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 页脚 ===== */
.footer {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
    border-top: 1px solid var(--border);
    padding-top: 28px;
}
.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 8px;
}
.footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
    body { padding: 16px 12px 40px; }
    .header h1 { font-size: 28px; }
    .header .subtitle { font-size: 16px; }
    .trust-badge-header {
        gap: 12px 20px;
        padding: 10px 16px;
        border-radius: 40px;
        font-size: 13px;
        flex-wrap: wrap;
    }
    .tool-card { padding: 24px 16px; }
    .drop-zone { padding: 36px 16px; }
    .drop-zone .title { font-size: 17px; }
    .quality-section { padding: 12px 16px; }
    .actions .btn {
        flex: 1;
        justify-content: center;
        padding: 14px 16px;
        font-size: 15px;
    }
    .info-section { padding: 24px 16px; }
    .info-section h2 { font-size: 22px; }
    .steps, .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .file-item {
        flex-wrap: wrap;
        padding: 12px;
    }
    .file-item .status { margin-left: auto; }
}