*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; color: #1a1a2e; background: #f5f6fa; line-height: 1.6; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
header { background: #fff; border-bottom: 1px solid #e8e8ef; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { font-size: 1.3rem; font-weight: 800; text-decoration: none; color: #1a1a2e; }
.logo span { color: #4361ee; }
nav a { color: #666; text-decoration: none; margin-left: 24px; font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: #4361ee; }

/* Hero */
.hero { padding: 80px 0 60px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero h1 span { color: #4361ee; }
.hero p { color: #666; font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Section */
.section-title { font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 36px; }

/* Tools Grid */
.tools-section { padding: 40px 0 80px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tool-card { background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; cursor: pointer; transition: all 0.25s ease; border: 2px solid transparent; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); border-color: #4361ee; }
.tool-card.active { border-color: #4361ee; background: #f0f3ff; }
.tool-icon { font-size: 2.4rem; margin-bottom: 12px; }
.tool-card h3 { font-size: 1rem; margin-bottom: 6px; }
.tool-card p { color: #888; font-size: 0.8rem; }

/* Work Area */
.work-area { padding: 40px 0 80px; }
.work-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.work-header h2 { font-size: 1.4rem; font-weight: 700; }
.back-btn { background: none; border: 2px solid #ddd; padding: 8px 20px; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 0.85rem; color: #555; transition: all 0.2s; }
.back-btn:hover { border-color: #4361ee; color: #4361ee; }

/* Upload Zone */
.upload-zone { border: 3px dashed #d0d0dd; border-radius: 20px; padding: 60px 24px; text-align: center; cursor: pointer; transition: all 0.3s; background: #fafbff; }
.upload-zone:hover, .upload-zone.dragover { border-color: #4361ee; background: #f0f3ff; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-zone h3 { font-size: 1.2rem; margin-bottom: 6px; }
.upload-zone p { color: #999; font-size: 0.9rem; }

/* Tool Options */
.tool-option { display: inline-flex; align-items: center; gap: 8px; margin: 4px 8px; padding: 8px 16px; border-radius: 30px; background: #fff; border: 2px solid #ddd; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; }
.tool-option:hover { border-color: #4361ee; }
.tool-option.selected { border-color: #4361ee; background: #f0f3ff; }
.tool-option select, .tool-option input { border: none; background: none; font-size: 0.85rem; outline: none; padding: 4px; font-family: inherit; }
.pages-input { width: 60px; text-align: center; border: 2px solid #ddd !important; border-radius: 8px; padding: 6px 8px !important; }

/* File List */
.file-list { margin-top: 20px; }
.file-item { background: #fff; border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.file-item .file-icon { font-size: 1.5rem; }
.file-item .file-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.file-item .file-size { color: #999; font-size: 0.8rem; }
.file-item .file-remove { background: none; border: none; color: #e53935; cursor: pointer; font-size: 1.2rem; padding: 4px; }
.file-item .file-pages { color: #4361ee; font-weight: 600; font-size: 0.8rem; background: #f0f3ff; padding: 4px 12px; border-radius: 20px; }

/* Process Button */
.process-btn { display: block; width: 100%; max-width: 400px; margin: 24px auto 0; padding: 16px 32px; background: #4361ee; color: #fff; border: none; border-radius: 50px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: all 0.3s; }
.process-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(67,97,238,0.3); }
.process-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Progress */
.progress-area { margin-top: 28px; text-align: center; }
.progress-bar { height: 8px; background: #e8e8ef; border-radius: 4px; overflow: hidden; max-width: 400px; margin: 0 auto 12px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4361ee, #7209b7); border-radius: 4px; transition: width 0.3s; width: 0%; }
#progressText { color: #666; font-size: 0.9rem; }

/* Result */
.result-area { margin-top: 28px; text-align: center; padding: 40px; background: #fff; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.result-icon { font-size: 3rem; margin-bottom: 12px; }
.result-area h3 { font-size: 1.3rem; margin-bottom: 6px; }
.result-area p { color: #666; margin-bottom: 20px; }
.download-btn { display: inline-block; padding: 14px 40px; background: #4361ee; color: #fff; border-radius: 50px; text-decoration: none; font-weight: 700; margin: 0 8px 12px; transition: all 0.3s; }
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(67,97,238,0.3); }

/* How it works */
.how-section { padding: 80px 0; background: #fff; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 40px; }
.how-step { text-align: center; }
.how-num { width: 56px; height: 56px; border-radius: 50%; background: #f0f3ff; color: #4361ee; font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.how-step h3 { font-size: 1rem; margin-bottom: 6px; }
.how-step p { color: #888; font-size: 0.85rem; max-width: 260px; margin: 0 auto; }

/* Footer */
footer { background: #1a1a2e; color: rgba(255,255,255,0.5); padding: 40px 0; text-align: center; font-size: 0.85rem; }
footer p { margin-bottom: 4px; }

/* Responsive */
@media (max-width: 768px) {
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .how-steps { grid-template-columns: 1fr; }
  .hero { padding: 50px 0 40px; }
  .upload-zone { padding: 40px 16px; }
}
