/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f6ef7;
    --primary-dark: #3b5de7;
    --primary-light: #e8edfe;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 12px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== Steps ===== */
.step {
    margin-bottom: 20px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--card-bg);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-lighter);
}

/* ===== File Info ===== */
.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 12px;
    box-shadow: var(--shadow);
}

.file-icon {
    font-size: 20px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-lighter);
    flex-shrink: 0;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-lighter);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #fef2f2;
    color: var(--error);
}

/* ===== Conversion Grid ===== */
.conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.conv-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--card-bg);
    text-align: center;
    position: relative;
}

.conv-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.conv-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.conv-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.conv-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.conv-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.conv-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.conv-desc {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ===== Convert Button ===== */
.btn-convert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

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

.btn-convert:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-icon {
    font-size: 18px;
}

/* ===== Progress ===== */
.progress-section {
    margin-bottom: 20px;
}

.progress-bar-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.progress-percent {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.progress-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

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

/* ===== Result ===== */
.result-section {
    margin-bottom: 20px;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.result-text {
    flex: 1;
}

.result-text h3 {
    font-size: 16px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 2px;
}

.result-text p {
    font-size: 13px;
    color: #15803d;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-download:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* ===== Error ===== */
.error-section {
    margin-bottom: 20px;
}

.error-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.error-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 4px;
}

.error-text p {
    font-size: 13px;
    color: #b91c1c;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.footer p {
    font-size: 12px;
    color: var(--text-lighter);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

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

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

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container {
        padding: 16px 12px 32px;
    }

    .logo h1 {
        font-size: 22px;
    }

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

    .result-card {
        flex-direction: column;
        text-align: center;
    }

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