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

:root {
    --primary: #2B579A;
    --primary-light: #3B6FBF;
    --primary-dark: #1A3A6E;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

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

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

a { text-decoration: none; color: inherit; }

/* ========== Header ========== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.logo-icon { font-size: 28px; }
.logo-text { font-size: 20px; color: var(--primary); }
.logo-sub {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 400;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.nav-link { color: var(--text-secondary); }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-divider { color: var(--border); }
.coming-soon { color: #BBB; cursor: not-allowed; }

/* ========== Main ========== */
.main-content { flex: 1; }

/* ========== Hero ========== */
.hero {
    text-align: center;
    padding: 64px 0 40px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ========== Tools Grid ========== */
.tools-section { padding-bottom: 64px; }

.category-group { margin-bottom: 40px; }

.category-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tools-grid.upcoming { opacity: 0.6; }

.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
}

.tool-card:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tool-card.disabled {
    cursor: default;
    opacity: 0.7;
}

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

.tool-card-body { flex: 1; min-width: 0; }

.tool-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tool-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-card-arrow {
    color: var(--text-secondary);
    font-size: 18px;
    flex-shrink: 0;
}

.badge-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--warning);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* ========== Tool Page ========== */
.tool-hero {
    text-align: center;
    padding: 48px 0 24px;
}

.tool-hero-icon { font-size: 48px; margin-bottom: 12px; }

.tool-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tool-work-area {
    padding: 0 0 64px;
}

/* ========== Upload Zone ========== */
.upload-zone {
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(43, 87, 154, 0.04);
}

.upload-icon { font-size: 48px; margin-bottom: 12px; }

.upload-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 24px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { background: #A0B4D0; cursor: not-allowed; }

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.btn-text:hover { color: var(--error); }

/* ========== File List ========== */
.file-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow);
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-list-header h3 {
    font-size: 16px;
    font-weight: 600;
}

#fileItems {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
}

#fileItems li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

#fileItems li:last-child { border-bottom: none; }

.file-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-item-size { color: var(--text-secondary); margin-left: 12px; flex-shrink: 0; }

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    margin-left: 12px;
    padding: 0 4px;
}

.file-item-remove:hover { color: var(--error); }

/* ========== Messages ========== */
.message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

.message.success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.message.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.message.info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ========== Spinner ========== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========== Footer ========== */
.site-footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
    .hero { padding: 40px 0 24px; }
    .hero h1 { font-size: 26px; }
    .tools-grid { grid-template-columns: 1fr; }
    .upload-zone { padding: 32px 16px; }
}
