@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --white: #1e293b;
    --bg: #0f172a;
    --bg2: #334155;
    --surface: #1e293b;
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --blue-bg: rgba(59, 130, 246, 0.15);
    --blue-light: rgba(59, 130, 246, 0.3);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.15);
    --orange: #f97316;
    --orange-bg: rgba(249, 115, 22, 0.15);
    --purple: #a855f7;
    --purple-bg: rgba(168, 85, 247, 0.15);
    --pink: #ec4899;
    --pink-bg: rgba(236, 72, 153, 0.15);
    --teal: #14b8a6;
    --teal-bg: rgba(20, 184, 166, 0.15);
    --text: #f8fafc;
    --text2: #cbd5e1;
    --text3: #94a3b8;
    --border: #475569;
    --border-light: #334155;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
    --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
    font-family: 'Inter', 'Google Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.2s;
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text); font-size: 1rem;
}
.nav-logo strong { font-weight: 700; }
.logo-img {
    width: 32px; height: 32px; border-radius: 6px;
    object-fit: contain;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 14px; border-radius: 20px;
    text-decoration: none; color: var(--text2);
    font-size: 0.875rem; font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--blue); background: var(--blue-bg); }
.nav-menu-btn {
    display: none; background: none; border: none;
    font-size: 22px; color: var(--text2); cursor: pointer; padding: 6px;
}

@media (max-width: 640px) {
    .nav-links {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: var(--white); border-bottom: 1px solid var(--border-light);
        flex-direction: column; padding: 8px 12px;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-menu-btn { display: block; }
    .nav-link { border-radius: 8px; padding: 10px 14px; }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 20px; border-radius: 20px;
    font-size: 0.875rem; font-weight: 500; font-family: inherit;
    cursor: pointer; border: none; text-decoration: none;
    transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: var(--shadow); }
.btn-outline { background: var(--white); color: var(--blue); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--blue-bg); border-color: var(--blue-light); }
.btn-flat { background: var(--bg2); color: var(--text); }
.btn-flat:hover { background: var(--border-light); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ===== TOOL SECTION ===== */
.tool-section {
    padding: 32px 0 48px;
    background: var(--white);
    min-height: calc(100vh - 56px);
    display: flex; align-items: flex-start;
}
.tool-header { text-align: center; margin-bottom: 32px; }
.tool-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700; color: var(--text);
    margin-bottom: 8px;
}
.tool-header p { color: var(--text2); font-size: 0.95rem; }

/* Upload Card */
.upload-view { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-card {
    width: 100%; max-width: 600px; margin: 0 auto;
    padding: 48px 32px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.upload-card:hover, .upload-card.dragover {
    border-color: var(--blue);
    background: var(--blue-bg);
}
.upload-icon-area {
    width: 64px; height: 64px; margin: 0 auto 20px;
    border-radius: 50%; background: var(--blue-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--blue);
    transition: var(--transition);
}
.upload-card:hover .upload-icon-area { background: var(--blue-light); transform: scale(1.05); }
.upload-card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.upload-card p { color: var(--text3); font-size: 0.85rem; margin-bottom: 16px; }
.format-pills { display: flex; gap: 6px; justify-content: center; }
.format-pills span {
    padding: 3px 10px; background: var(--white);
    border: 1px solid var(--border-light); border-radius: 12px;
    font-size: 0.7rem; font-weight: 600; color: var(--text3);
}
.hint-text { color: var(--text3); font-size: 0.8rem; display: flex; align-items: center; gap: 4px; }

/* Result View */
.result-view { display: none; }
.result-view.active { display: block; }
.result-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
@media (max-width: 768px) { .result-grid { grid-template-columns: 1fr; } }

.result-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.result-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}
.status-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 16px;
    font-size: 0.8rem; font-weight: 500;
}
.status-chip.success { background: var(--green-bg); color: var(--green); }
.result-img-wrap {
    padding: 16px; display: flex; align-items: center; justify-content: center;
    min-height: 280px; background: var(--bg);
}
.result-img-wrap img { max-width: 100%; max-height: 450px; object-fit: contain; border-radius: 8px; }

/* Comparison Tool */
.compare-box { margin-top: 16px; }
.compare-tabs {
    display: flex; gap: 4px; margin-bottom: 12px;
    background: var(--bg); border-radius: 10px; padding: 4px;
}
.cmp-tab {
    flex: 1; padding: 8px 12px; border: none; background: transparent;
    border-radius: 8px; font-family: inherit; font-size: 0.8rem;
    font-weight: 500; color: var(--text2); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    transition: var(--transition);
}
.cmp-tab:hover { color: var(--text); }
.cmp-tab.active { background: var(--white); color: var(--blue); box-shadow: var(--shadow-sm); font-weight: 600; }
.cmp-single {
    border: 1px solid var(--border-light); border-radius: var(--radius);
    overflow: hidden; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    min-height: 200px; padding: 12px;
}
.cmp-full-img { max-width: 100%; max-height: 400px; object-fit: contain; border-radius: 6px; }
/* Slider compare */
.cmp-slider-wrap { }
.cmp-slider-box {
    position: relative; overflow: hidden;
    border: 1px solid var(--border-light); border-radius: var(--radius);
    background: var(--bg); cursor: ew-resize; touch-action: none;
    user-select: none; -webkit-user-select: none;
}
.cmp-s-img { display: block; width: 100%; height: auto; pointer-events: none; }
.cmp-s-reveal {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 50%; overflow: hidden;
}
.cmp-s-reveal .cmp-s-img {
    position: absolute; top: 0; right: 0;
    width: auto; min-width: 100%;
    height: 100%;
}
.cmp-s-handle {
    position: absolute; top: 0; bottom: 0; left: 50%;
    transform: translateX(-50%); z-index: 5;
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none;
}
.cmp-s-line { width: 2px; flex: 1; background: var(--blue); }
.cmp-s-grip {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--blue);
    display: flex; align-items: center; justify-content: center;
    color: var(--blue); font-size: 14px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}
.cmp-s-label {
    position: absolute; top: 50%; transform: translateY(-50%); padding: 3px 10px;
    border-radius: 10px; font-size: 0.7rem; font-weight: 600;
    background: rgba(0,0,0,0.55); color: #fff; z-index: 6;
    pointer-events: none;
}
.cmp-s-l-left { left: 8px; }
.cmp-s-l-right { right: 8px; }

/* Side Panel */
.side-panel {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.side-panel h3 {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.9rem; font-weight: 600; margin-bottom: 16px;
}
.field-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.field-select {
    width: 100%; padding: 9px 12px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 0.85rem; cursor: pointer;
    margin-bottom: 16px;
}
.field-select:focus { outline: none; border-color: var(--blue); }
.side-btns { display: flex; flex-direction: column; gap: 8px; }
.side-btns .btn { width: 100%; justify-content: center; }
.status-msg { margin-top: 12px; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; display: none; }
.status-msg.status-success { display: block; background: var(--green-bg); color: var(--green); }
.status-msg.status-warn { display: block; background: var(--red-bg); color: var(--red); }

/* Comparison */
.compare-box { margin-top: 16px; }
.compare-inner {
    position: relative; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border-light); background: var(--bg);
    aspect-ratio: 16/10;
}
.cmp-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-before { z-index: 1; clip-path: inset(0 50% 0 0); }
.cmp-after { z-index: 2; clip-path: inset(0 0 0 50%); }
.cmp-slider { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 10; margin: 0; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.cmp-line { width: 2px; flex: 1; background: var(--blue); }
.cmp-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--blue);
    display: flex; align-items: center; justify-content: center;
    color: var(--blue); font-size: 14px;
    box-shadow: var(--shadow);
}
.cmp-label {
    position: absolute; top: 50%; transform: translateY(-50%); padding: 3px 10px;
    border-radius: 10px; font-size: 0.7rem; font-weight: 600;
    background: rgba(0,0,0,0.6); color: #fff; z-index: 6;
}
.cmp-l-before { left: 8px; }
.cmp-l-after { right: 8px; }

/* Batch */
.batch-view { display: none; }
.batch-view.active { display: block; }
.batch-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.batch-top h3 { display: flex; align-items: center; gap: 6px; font-size: 1rem; }
.batch-list { display: grid; gap: 8px; margin-bottom: 16px; max-height: 350px; overflow-y: auto; }
.batch-btns { display: flex; gap: 8px; }
.batch-btns .btn { flex: 1; justify-content: center; }
.b-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--bg);
    border: 1px solid var(--border-light); border-radius: 10px;
}
.b-card-thumb { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.b-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.b-card-info { flex: 1; min-width: 0; }
.b-card-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-card-status { font-size: 0.75rem; color: var(--text3); display: flex; align-items: center; gap: 3px; }
.b-card-rm {
    background: none; border: 1px solid var(--border-light); border-radius: 6px;
    padding: 4px 8px; cursor: pointer; color: var(--text3); font-size: 14px;
}
.b-card-rm:hover { color: var(--red); border-color: var(--red); }

/* ===== SECTIONS ===== */
.section { padding: 72px 0; }
.features-section { background: var(--white); }
.how-section { background: var(--bg); }
.faq-section { background: var(--white); }

.sec-head { text-align: center; margin-bottom: 48px; }
.sec-label {
    display: inline-block; padding: 4px 14px; border-radius: 16px;
    background: var(--blue-bg); color: var(--blue);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 12px;
}
.sec-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 8px; }
.sec-head p { color: var(--text2); font-size: 0.95rem; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .features-grid { grid-template-columns: 1fr; } }
.fcard {
    padding: 24px; border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); background: var(--bg);
    transition: var(--transition);
}
.fcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border); }
.fcard h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.fcard p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }
.ficon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 14px;
}
.ficon.blue { background: var(--blue-bg); color: var(--blue); }
.ficon.green { background: var(--green-bg); color: var(--green); }
.ficon.purple { background: var(--purple-bg); color: var(--purple); }
.ficon.orange { background: var(--orange-bg); color: var(--orange); }
.ficon.pink { background: var(--pink-bg); color: var(--pink); }
.ficon.teal { background: var(--teal-bg); color: var(--teal); }

/* Steps */
.steps-row { display: flex; align-items: flex-start; justify-content: center; gap: 0; flex-wrap: wrap; }
.step {
    flex: 1; min-width: 180px; max-width: 260px;
    text-align: center; padding: 28px 20px;
    background: var(--white); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); position: relative;
    transition: var(--transition);
}
.step:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.step h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.step p { font-size: 0.8rem; color: var(--text2); }
.step-num {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.step-ico { font-size: 32px; color: var(--blue); margin-bottom: 12px; }
.step-arrow { display: flex; align-items: center; padding: 0 8px; color: var(--text3); font-size: 18px; }
@media (max-width: 640px) {
    .steps-row { flex-direction: column; align-items: center; gap: 12px; }
    .step-arrow { transform: rotate(90deg); }
}

/* FAQ */
.faq-list { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    background: var(--bg); border: 1px solid var(--border-light);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition);
}
.faq-item.active { border-color: var(--blue-light); }
.faq-q {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: none; border: none;
    color: var(--text); font-size: 0.9rem; font-weight: 600;
    font-family: inherit; cursor: pointer; text-align: left;
}
.faq-arr { transition: transform 0.25s; font-size: 16px; color: var(--text3); flex-shrink: 0; }
.faq-item.active .faq-arr { transform: rotate(180deg); color: var(--blue); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease; }
.faq-item.active .faq-a { max-height: 150px; padding: 0 18px 14px; }
.faq-a p { color: var(--text2); font-size: 0.85rem; line-height: 1.6; }

/* Article Section */
.article-section { background: var(--bg); }
.article-container { max-width: 800px; margin: 0 auto; }
.article-content { color: var(--text2); line-height: 1.8; text-align: left; padding: 0 16px; }
.article-content h3 { color: var(--text); font-size: 1.25rem; font-weight: 600; margin: 36px 0 16px; display: block; }
.article-content p { font-size: 1rem; margin-bottom: 24px; display: block; }

/* Ad Slot */
.ad-slot { max-width: 1100px; margin: 0 auto; padding: 12px 20px; min-height: 10px; }

/* Footer */
.footer { background: var(--white); border-top: 1px solid var(--border-light); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 400px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--text3); font-size: 0.85rem; margin-top: 12px; line-height: 1.5; }
.footer-col h4 { font-size: 0.8rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text3); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { border-top: 1px solid var(--border-light); padding-top: 20px; text-align: center; }
.footer-bottom p { color: var(--text3); font-size: 0.8rem; }
.foot-note { margin-top: 4px; font-size: 0.75rem !important; }

/* Modal */
.modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.active { display: flex; }
.modal-box {
    background: var(--white); border-radius: var(--radius-lg);
    max-width: 560px; width: 100%; max-height: 75vh;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.modal-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.modal-top h3 { font-size: 1rem; font-weight: 600; }
.modal-x { background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer; padding: 4px; }
.modal-x:hover { color: var(--text); }
.modal-content { padding: 20px; overflow-y: auto; color: var(--text2); font-size: 0.85rem; line-height: 1.6; }
.modal-content h4 { color: var(--text); margin: 14px 0 6px; font-size: 0.9rem; }
.modal-content p { margin-bottom: 10px; }

/* Loading */
.loader-bg {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px); z-index: 300;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.loader-bg.active { opacity: 1; pointer-events: all; }
.loader-box { text-align: center; }
.loader-spin {
    width: 44px; height: 44px; margin: 0 auto 16px;
    border: 3px solid var(--border-light);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-txt { font-size: 1rem; font-weight: 600; color: var(--text); }
.loader-sub { font-size: 0.8rem; color: var(--text3); margin-top: 4px; }

/* Scroll Top */
.scroll-top {
    position: fixed; bottom: 20px; right: 20px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--white); border: 1px solid var(--border);
    color: var(--text2); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: var(--transition);
    box-shadow: var(--shadow-sm); z-index: 50;
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--blue); color: #fff; border-color: var(--blue); }