/* ===== CSS Variables ===== */
:root {
    --primary: #4f6ef7;
    --primary-dark: #3a5ae0;
    --primary-light: #6d88ff;
    --bg-dark: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #232734;
    --text-primary: #e8eaf0;
    --text-secondary: #9ba3b4;
    --text-muted: #6b7280;
    --border: #2a2e3a;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.4);
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

img {
    max-width: 100%;
    display: block;
}

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: linear-gradient(180deg, rgba(79, 110, 247, 0.08) 0%, transparent 100%);
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e8eaf0 0%, #6d88ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Section ===== */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 24px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===== Tools Grid ===== */
.tools-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
}

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

.tool-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: rgba(79, 110, 247, 0.12);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 4px;
}

.tool-icon svg {
    width: 24px;
    height: 24px;
}

.tool-card h3 {
    font-size: 18px;
    font-weight: 600;
}

.tool-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tool-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ===== Features ===== */
.features-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== About ===== */
.about-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.about-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 16px;
}

/* ===== Button ===== */
.btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.4);
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: 40px;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.modal > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.donate-content {
    display: flex;
    gap: 24px;
    flex-direction: column;
    align-items: center;
}

.donate-qr {
    width: 100%;
    max-width: 280px;
}

.donate-placeholder {
    text-align: center;
    padding: 20px;
}

.donate-placeholder > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: var(--bg-dark);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--text-muted);
}

.qr-placeholder svg {
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 13px;
    color: var(--text-muted);
}

.donate-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

.donate-text {
    text-align: left;
    width: 100%;
}

.donate-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.donate-text ul {
    list-style: none;
    padding: 0;
}

.donate-text ul li {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.donate-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    text-align: center;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.tool-card {
    animation: slideUp 0.4s ease backwards;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== Tool Page Common Styles ===== */
.tool-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.tool-header {
    margin-bottom: 32px;
}

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

.tool-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.tool-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.tool-breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.tool-breadcrumb a:hover {
    color: var(--primary);
}

.tool-card-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(79, 110, 247, 0.05);
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.drop-zone-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

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

.btn-blue {
    background: var(--primary);
    color: white;
}

.btn-blue:hover {
    background: var(--primary-dark);
}

.btn-green {
    background: var(--success);
    color: white;
}

.btn-green:hover {
    background: #16a34a;
}

.btn-gray {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-gray:hover {
    background: var(--border);
    color: var(--text-primary);
}

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

/* Results */
.result-area {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: none;
}

.result-area.active {
    display: block;
}

.result-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.result-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.result-info-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.result-info-item strong {
    color: var(--text-primary);
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-box-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-box-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tool Description (SEO) */
.tool-description {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tool-description h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.tool-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--text-primary);
}

.tool-description p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.tool-description ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.tool-description ul li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* FAQ */
.faq-item {
    margin-bottom: 16px;
}

.faq-item h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.faq-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-num {
        font-size: 28px;
    }

    .section-header h2 {
        font-size: 24px;
    }

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

    .donate-content {
        flex-direction: column;
    }

    .tool-header h1 {
        font-size: 24px;
    }

    .tool-card-box {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }
}
