/* ============= Reset & Base ============= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #f8fafc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============= Header ============= */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo-icon { width: 32px; height: 32px; }
.logo-text { color: #1e293b; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; color: #64748b; }
.nav a:hover { color: #2563EB; }

/* ============= Button ============= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 10px; cursor: pointer; font-weight: 600;
    font-size: 15px; transition: all 0.2s; text-decoration: none;
}
.btn-sm { padding: 6px 18px; font-size: 14px; border-radius: 8px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: #2563EB; color: #fff; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; border: 1.5px solid #cbd5e1; color: #475569; padding: 10px 24px; }
.btn-outline:hover { border-color: #2563EB; color: #2563EB; }
.btn-icon { background: none; border: none; font-size: 22px; color: #94a3b8; cursor: pointer; line-height: 1; }
.btn-icon:hover { color: #ef4444; }

/* ============= Hero ============= */
.hero {
    text-align: center; padding: 100px 24px 80px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}
.hero-title { font-size: 48px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; color: #0f172a; }
.gradient-text {
    background: linear-gradient(135deg, #2563EB, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { font-size: 18px; color: #64748b; max-width: 580px; margin: 0 auto 36px; }

/* ============= Section ============= */
.section { padding: 80px 0; }
.section-alt { background: #f1f5f9; }
.section-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 48px; color: #0f172a; }

/* ============= Features ============= */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-card {
    background: #fff; border-radius: 16px; padding: 32px 24px;
    border: 1px solid #e2e8f0; transition: all 0.25s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.06); border-color: #bfdbfe; }
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: #64748b; font-size: 14px; }

/* ============= Steps ============= */
.steps { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.step { text-align: center; background: #fff; border-radius: 16px; padding: 32px 28px; border: 1px solid #e2e8f0; min-width: 200px; }
.step-number {
    display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center;
    border-radius: 50%; background: #2563EB; color: #fff; font-weight: 700; font-size: 20px; margin-bottom: 16px;
}
.step h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.step p { color: #64748b; font-size: 14px; }
.step-arrow { font-size: 28px; color: #94a3b8; }

/* ============= Generator Card ============= */
.generator-card {
    max-width: 680px; margin: 0 auto;
    background: #fff; border-radius: 20px; padding: 40px;
    border: 1px solid #e2e8f0; box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

/* Upload area */
.upload-area {
    border: 2px dashed #cbd5e1; border-radius: 16px; padding: 48px 24px;
    text-align: center; transition: all 0.2s; cursor: pointer;
}
.upload-area:hover, .upload-area.drag-over { border-color: #2563EB; background: #eff6ff; }
.upload-icon { margin-bottom: 12px; }
.upload-text { font-size: 16px; color: #475569; margin-bottom: 4px; }
.upload-link { color: #2563EB; cursor: pointer; font-weight: 600; }
.upload-hint { font-size: 13px; color: #94a3b8; }

/* File info */
.file-info { margin-bottom: 16px; }
.file-info-inner {
    display: flex; align-items: center; gap: 12px;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 14px 18px;
}
.file-icon { flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 15px; display: block; }
.file-size { font-size: 13px; color: #94a3b8; }
.file-info-inner > div { flex: 1; min-width: 0; }
.file-info-inner .btn-icon { flex-shrink: 0; }

/* Options */
.options-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.option-group { flex: 1; min-width: 140px; }
.option-group label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.option-group select {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; color: #1e293b; background: #fff; cursor: pointer; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.option-group select:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Progress */
.progress-area { margin-top: 24px; }
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill {
    height: 100%; width: 0; background: linear-gradient(90deg, #2563EB, #7c3aed);
    border-radius: 4px; transition: width 0.4s ease;
}
.progress-text { text-align: center; font-size: 14px; color: #64748b; margin-top: 12px; }

/* Result */
.result-area { margin-top: 24px; }
.result-success { text-align: center; padding: 24px 0; }
.result-success h3 { font-size: 22px; font-weight: 700; color: #16a34a; margin: 12px 0 8px; }
.result-success p { color: #64748b; margin-bottom: 20px; }

/* Error */
.error-area { margin-top: 24px; }
.error-inner {
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 20px 24px;
    text-align: center;
}
.error-inner strong { color: #dc2626; font-size: 16px; }
.error-inner p { color: #64748b; font-size: 14px; margin: 8px 0 16px; word-break: break-all; }

/* ============= Footer ============= */
.footer { border-top: 1px solid #e2e8f0; padding: 24px 0; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #94a3b8; }
.footer-links { display: flex; gap: 8px; }
.footer-links a:hover { color: #2563EB; }

/* ============= Responsive ============= */
@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero { padding: 64px 16px 48px; }
    .generator-card { padding: 24px; }
    .options-row { flex-direction: column; }
    .steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
    .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
    .nav { gap: 16px; font-size: 14px; }
}

/* ============= Animations ============= */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.progress-text.loading { animation: pulse 1.5s ease-in-out infinite; }
