/* ==========================================================================
   Open Compressor - Global Stylesheet
   Flat Design | Blue #2563EB + Green #10B981
   ========================================================================== */

:root {
    --primary: #2563EB;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #10B981;
    --accent-dark: #059669;
    --accent-light: #d1fae5;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --max-width: 1200px;
    --header-h: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    padding-top: var(--header-h);
}

/* CJK fonts */
html[lang="zh-cn"], html[lang="zh-tw"] body {
    font-family: 'Noto Sans SC', var(--font);
}
html[lang="ja"] body {
    font-family: 'Noto Sans JP', var(--font);
}
html[lang="ko"] body {
    font-family: 'Noto Sans KR', var(--font);
}
html[lang="ar"] body {
    font-family: 'Noto Sans Arabic', var(--font);
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ========== HEADER ========== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--header-h);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}
.site-header > .container,
.header-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: var(--gray-900);
    text-decoration: none;
}
.logo:hover { color: var(--gray-900); }
.logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px; font-weight: 800;
}

/* Nav */
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a {
    padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--gray-600); font-size: 15px; font-weight: 500;
    transition: all .15s;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-light); }
.main-nav a.active { color: var(--primary); background: var(--primary-light); }

/* Header actions (right side) */
.header-actions {
    display: flex; align-items: center; gap: 12px;
}

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: flex; align-items: center; gap: 4px; }
.nav-dropdown > a::after {
    content: ''; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; transition: transform .15s;
}
.dropdown-menu {
    position: absolute; top: 100%; left: 0; min-width: 200px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 8px 0;
    box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
    transform: translateY(8px); transition: all .15s;
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown:hover > a::after { transform: rotate(180deg); }
.dropdown-menu a {
    display: block; padding: 8px 16px; color: var(--gray-600);
    font-size: 14px; border-radius: 0;
}
.dropdown-menu a:hover { background: var(--gray-50); color: var(--primary); }

/* Language switcher */
.lang-switcher {
    position: relative;
}
.lang-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 14px; color: var(--gray-600); background: var(--white);
    transition: all .15s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.lang-dropdown {
    position: absolute; top: calc(100% + 4px); right: 0; min-width: 160px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 8px 0;
    box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
    transform: translateY(8px); transition: all .15s;
    max-height: 400px; overflow-y: auto; z-index: 100;
}
.lang-dropdown.open {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.lang-dropdown a {
    display: block; padding: 6px 16px; color: var(--gray-600);
    font-size: 14px; border-radius: 0; text-decoration: none;
}
.lang-dropdown a:hover { background: var(--gray-50); color: var(--primary); }
.lang-dropdown a.current { color: var(--primary); font-weight: 600; background: var(--primary-light); }

/* Mobile menu */
.mobile-toggle,
.hamburger {
    display: none; background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; position: relative; padding: 0;
}
.mobile-toggle span,
.hamburger span {
    display: block; width: 22px; height: 2px; background: var(--gray-700);
    position: absolute; left: 7px; top: 17px; transition: all .2s;
}
.mobile-toggle span::before,
.hamburger span::before {
    content: ''; display: block; width: 22px; height: 2px;
    background: var(--gray-700); position: absolute;
    top: -7px; left: 0;
}
.mobile-toggle span::after,
.hamburger span::after {
    content: ''; display: block; width: 22px; height: 2px;
    background: var(--gray-700); position: absolute;
    top: 7px; left: 0;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    padding: 16px 0; font-size: 14px; color: var(--gray-400);
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep, .breadcrumb span { margin: 0 8px; color: var(--gray-300); }
.breadcrumb .current { color: var(--gray-700); font-weight: 500; }

/* ========== HERO ========== */
.hero {
    text-align: center; padding: 64px 24px 48px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}
.hero h1 {
    font-size: 42px; font-weight: 800; color: var(--gray-900);
    line-height: 1.2; margin-bottom: 16px;
}
.hero h1 span { color: var(--primary); }
.hero p {
    font-size: 18px; color: var(--gray-500); max-width: 600px; margin: 0 auto 32px;
}
.hero-search {
    max-width: 480px; margin: 0 auto;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--white);
    border: 2px solid var(--gray-200); border-radius: 999px;
    transition: border-color .15s;
}
.hero-search:focus-within { border-color: var(--primary); }
.hero-search input {
    flex: 1; border: none; outline: none; font-size: 16px;
    background: transparent; color: var(--gray-800);
}
.hero-search svg { width: 20px; height: 20px; color: var(--gray-400); flex-shrink: 0; }

/* Privacy badge */
.privacy-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 20px; margin-top: 24px;
    background: var(--accent-light); color: var(--accent-dark);
    border-radius: 999px; font-size: 14px; font-weight: 600;
}
.privacy-badge svg { width: 16px; height: 16px; }

/* ========== TOOL GRID (Homepage) ========== */
.section { padding: 48px 0; }
.section-title {
    font-size: 24px; font-weight: 700; color: var(--gray-900);
    margin-bottom: 8px;
}
.section-desc {
    font-size: 16px; color: var(--gray-500); margin-bottom: 32px;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.tool-card {
    display: block; padding: 24px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); transition: all .2s;
    text-decoration: none; color: inherit;
}
.tool-card:hover {
    border-color: var(--primary); box-shadow: var(--shadow-md);
    transform: translateY(-2px); color: inherit;
}
.tool-card-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 16px;
}
.tool-card-icon.image { background: #fef3c7; color: #d97706; }
.tool-card-icon.doc { background: var(--primary-light); color: var(--primary); }
.tool-card-icon.video { background: #fce7f3; color: #db2777; }
.tool-card-icon.audio { background: #ede9fe; color: #7c3aed; }
.tool-card-icon.pdf { background: #fee2e2; color: #dc2626; }
.tool-card-icon.tool { background: var(--accent-light); color: var(--accent-dark); }
.tool-card h3, .tool-card h4 {
    font-size: 16px; font-weight: 600; color: var(--gray-800);
    margin-bottom: 6px;
}
.tool-card p {
    font-size: 14px; color: var(--gray-500); line-height: 1.5;
}
.tool-card .badge {
    display: inline-block; margin-top: 10px; padding: 2px 10px;
    font-size: 12px; font-weight: 500; border-radius: 999px;
    background: var(--gray-100); color: var(--gray-500);
}
.tool-card .badge.client { background: var(--accent-light); color: var(--accent-dark); }

/* Category cards (homepage) */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.cat-card {
    display: block; padding: 28px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); transition: all .2s;
    text-decoration: none; color: inherit;
}
.cat-card:hover {
    border-color: var(--primary); box-shadow: var(--shadow-md);
    transform: translateY(-2px); color: inherit;
}
.cat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
    margin-bottom: 16px;
}
.cat-card h3 {
    font-size: 18px; font-weight: 700; color: var(--gray-900);
    margin-bottom: 8px;
}
.cat-card p {
    font-size: 14px; color: var(--gray-500); line-height: 1.5;
    margin-bottom: 12px;
}
.cat-count {
    display: inline-block; padding: 2px 10px;
    font-size: 12px; font-weight: 500; border-radius: 999px;
    background: var(--gray-100); color: var(--gray-500);
}

/* Tool list (category pages) */
.tool-list { display: flex; flex-direction: column; gap: 12px; }
.tool-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 16px 20px;
    transition: all .2s; text-decoration: none; color: inherit;
}
.tool-item:hover {
    border-color: var(--primary); box-shadow: var(--shadow-sm);
    color: inherit;
}
.tool-item .info { display: flex; align-items: center; gap: 16px; }
.tool-item .info .icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.tool-item .info h4 { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.tool-item .info p  { font-size: .85rem; color: var(--gray-500); margin-top: 2px; }
.tool-item .arrow { color: var(--gray-400); transition: transform .2s; }
.tool-item:hover .arrow { transform: translateX(4px); color: var(--primary); }

/* Hero badges */
.hero-badges {
    display: flex; gap: 12px; justify-content: center;
    flex-wrap: wrap; margin-top: 20px;
}
.hero-badges .badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 500;
    background: var(--white); border: 1px solid var(--gray-200);
    color: var(--gray-600);
}
.hero-badges .badge svg { width: 16px; height: 16px; }

/* Privacy notice */
.privacy-notice {
    display: flex; align-items: center; gap: 8px;
    max-width: 640px; margin: 16px auto;
    padding: 12px 20px; border-radius: var(--radius-sm);
    background: var(--accent-light); color: var(--accent-dark);
    font-size: 14px; font-weight: 500;
}
.privacy-notice svg { flex-shrink: 0; }

/* Badge small (category pages) */
.badge-sm {
    display: inline-block; padding: 2px 8px;
    font-size: 11px; font-weight: 500; border-radius: 999px;
    margin-top: 4px;
}
.badge-client { background: var(--accent-light); color: var(--accent-dark); }
.badge-server { background: var(--primary-light); color: var(--primary); }

/* Cookie consent banner */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 24px;
    background: var(--white); border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
}
.cookie-banner p {
    font-size: 14px; color: var(--gray-600); margin: 0;
}
.cookie-banner a { color: var(--primary); }

/* FAQ section */
.faq-list {
    max-width: 800px; margin: 0 auto;
}
.faq-question {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 16px 20px;
    background: none; border: none; border-bottom: 1px solid var(--gray-200);
    cursor: pointer; text-align: left;
    font-size: 16px; font-weight: 600; color: var(--gray-800);
    transition: background .2s;
}
.faq-question:hover { background: var(--gray-50); }
.faq-question svg {
    flex-shrink: 0; transition: transform .2s;
    color: var(--gray-400);
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 20px 16px;
}
.faq-answer p {
    font-size: 15px; color: var(--gray-600); line-height: 1.6;
    margin: 12px 0 0;
}

/* Contact info */
.contact-info h3 {
    font-size: 18px; font-weight: 600; color: var(--gray-800);
    margin: 24px 0 8px;
}
.contact-info a { color: var(--primary); }

/* ========== TOOL PAGE ========== */
.tool-hero {
    text-align: center; padding: 48px 24px 32px;
    background: var(--gray-50);
}
.tool-hero h1 {
    font-size: 32px; font-weight: 800; color: var(--gray-900);
    margin-bottom: 12px;
}
.tool-hero p {
    font-size: 17px; color: var(--gray-500); max-width: 640px; margin: 0 auto;
}
.tool-hero p.desc {
    font-size: 16px; color: var(--gray-500); margin-bottom: 8px;
}

/* Upload zone */
.upload-zone {
    max-width: 640px; margin: 32px auto;
    border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
    padding: 48px 24px; text-align: center;
    background: var(--white); transition: all .2s; cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary); background: var(--primary-light);
}
.upload-zone svg { width: 48px; height: 48px; color: var(--gray-400); margin: 0 auto 16px; }
.upload-zone .upload-icon { margin-bottom: 16px; }
.upload-zone .upload-icon svg { width: 32px; height: 32px; margin: 0; }
.upload-zone h3 { font-size: 18px; color: var(--gray-700); margin-bottom: 8px; }
.upload-zone p { font-size: 14px; color: var(--gray-500); }
.upload-zone .file-input { display: none; }

/* Settings panel */
.settings-panel {
    max-width: 640px; margin: 0 auto 32px;
    padding: 24px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius);
}
.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--gray-100);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.setting-control select, .setting-control input[type="range"] {
    padding: 6px 12px; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-700);
    background: var(--white);
}

/* Action button */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: var(--primary); color: var(--white);
    border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all .15s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; background: var(--white); color: var(--primary);
    border: 2px solid var(--primary); border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { background: var(--primary-light); }

/* Progress bar */
.progress-bar {
    max-width: 640px; margin: 0 auto 24px;
    height: 8px; background: var(--gray-200); border-radius: 999px;
    overflow: hidden; display: none;
}
.progress-bar.active { display: block; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px; width: 0%; transition: width .3s;
}

/* Convert button (alias for btn-primary in tool pages) */
.convert-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: var(--primary); color: var(--white);
    border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all .15s;
    max-width: 640px; margin: 0 auto 24px;
}
.convert-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Upload sources */
.upload-sources {
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
    margin-top: 16px;
}
.source-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); background: var(--white);
    font-size: 13px; color: var(--gray-600); cursor: pointer;
    transition: all .15s;
}
.source-btn:hover { border-color: var(--primary); color: var(--primary); }
.source-btn svg { width: 16px; height: 16px; }
.copy-btn { margin-top: 4px; }
.file-limit {
    margin-top: 12px; font-size: 12px; color: var(--gray-400);
}

/* Progress area */
.progress-area {
    max-width: 640px; margin: 0 auto 24px;
    display: none;
}
.progress-area.active { display: block; }
.progress-bar-track {
    height: 8px; background: var(--gray-200); border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px; width: 0%; transition: width .3s;
}
.progress-text {
    text-align: center; margin-top: 12px;
    font-size: 14px; color: var(--gray-500); font-weight: 500;
}

/* Download area */
.download-area {
    max-width: 640px; margin: 0 auto 32px; padding: 32px 24px;
    background: var(--accent-light); border-radius: var(--radius);
    text-align: center; display: none;
}
.download-area.active { display: block; }
.download-area h3 { color: var(--accent-dark); margin-bottom: 8px; font-size: 20px; }
.download-area p { color: var(--gray-600); margin-bottom: 16px; }
.check-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: var(--white);
    margin-bottom: 16px;
}
.download-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; background: var(--accent); color: var(--white);
    border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all .15s;
}
.download-btn:hover { background: var(--accent-dark); }
.convert-another {
    display: inline-block; margin-top: 16px;
    font-size: 14px; color: var(--primary); text-decoration: underline;
}

/* Result area */
.result-area {
    max-width: 640px; margin: 0 auto 32px; padding: 24px;
    background: var(--accent-light); border-radius: var(--radius);
    text-align: center; display: none;
}
.result-area.active { display: block; }
.result-area h3 { color: var(--accent-dark); margin-bottom: 8px; }
.result-stats {
    display: flex; justify-content: center; gap: 32px; margin: 16px 0;
}
.result-stat { text-align: center; }
.result-stat .label { font-size: 12px; color: var(--gray-500); }
.result-stat .value { font-size: 20px; font-weight: 700; color: var(--gray-800); }

/* ========== SEO CONTENT ========== */
.seo-content {
    max-width: 800px; margin: 0 auto; padding: 48px 24px;
}
.seo-content h2 {
    font-size: 24px; font-weight: 700; color: var(--gray-900);
    margin: 32px 0 16px; padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}
.seo-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.seo-content h3 {
    font-size: 18px; font-weight: 600; color: var(--gray-800);
    margin: 24px 0 12px;
}
.seo-content p {
    font-size: 16px; color: var(--gray-600); line-height: 1.7;
    margin-bottom: 16px;
}
.seo-content ul, .seo-content ol {
    margin: 0 0 16px 24px; color: var(--gray-600);
}
.seo-content li { margin-bottom: 8px; line-height: 1.6; }

/* Comparison table */
.comparison-table {
    width: 100%; border-collapse: collapse; margin: 16px 0 24px;
    font-size: 14px;
}
.comparison-table th {
    background: var(--gray-50); padding: 12px 16px;
    text-align: left; font-weight: 600; color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}
.comparison-table td {
    padding: 10px 16px; border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
}
.comparison-table tr:hover td { background: var(--gray-50); }

/* Steps */
.steps { margin: 16px 0 24px; }
.step {
    display: flex; gap: 16px; padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}
.step:last-child { border-bottom: none; }
.step-num {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--primary); color: var(--white);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 14px; font-weight: 700;
}
.step-content h4 { font-size: 16px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.step-content p { font-size: 14px; color: var(--gray-500); margin: 0; }

/* ========== FAQ ========== */
.faq-section {
    max-width: 800px; margin: 0 auto; padding: 48px 24px;
}
.faq-section h2 {
    font-size: 24px; font-weight: 700; color: var(--gray-900);
    margin-bottom: 24px; text-align: center;
}
.faq-item {
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    margin-bottom: 12px; overflow: hidden;
}

/* ========== RELATED TOOLS ========== */
.related-tools {
    padding: 48px 0; background: var(--gray-50);
}
.related-tools h2 {
    font-size: 20px; font-weight: 700; color: var(--gray-900);
    margin-bottom: 24px; text-align: center;
}
.related-grid, .related-tools .tool-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; max-width: 800px; margin: 0 auto; padding: 0 24px;
}
.related-card {
    display: block; padding: 16px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    text-align: center; transition: all .15s; text-decoration: none;
}
.related-card:hover { border-color: var(--primary); color: inherit; }
.related-card h4 { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.related-card p { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ========== CATEGORY PAGE ========== */
.category-hero {
    text-align: center; padding: 48px 24px 32px;
    background: var(--gray-50);
}
.category-hero h1 {
    font-size: 32px; font-weight: 800; color: var(--gray-900);
    margin-bottom: 12px;
}
.category-hero p {
    font-size: 17px; color: var(--gray-500); max-width: 640px; margin: 0 auto;
}
.category-tools {
    max-width: var(--max-width); margin: 0 auto; padding: 48px 24px;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--gray-900); color: var(--gray-400); padding: 64px 0 32px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px; max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
}
.footer-brand .logo {
    font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 12px;
}
.footer-brand .logo .logo-icon {
    width: 32px; height: 32px; border-radius: 8px; font-size: 14px;
}
.footer-brand p { font-size: 14px; line-height: 1.6; color: var(--gray-400); }
.footer-col h4 {
    font-size: 14px; font-weight: 600; color: var(--white);
    margin-bottom: 16px; text-transform: uppercase; letter-spacing: .5px;
}
.footer-col a {
    display: block; padding: 4px 0; color: var(--gray-400);
    font-size: 14px; transition: color .15s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
    max-width: var(--max-width); margin: 48px auto 0; padding: 24px 24px 0;
    border-top: 1px solid var(--gray-700);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px;
}
.footer-bottom a { color: var(--gray-400); }
.footer-bottom a:hover { color: var(--white); }

/* ========== AD PLACEHOLDER ========== */
.ad-slot {
    max-width: var(--max-width); margin: 24px auto;
    padding: 16px; background: var(--gray-50);
    border: 1px dashed var(--gray-300); border-radius: var(--radius);
    text-align: center; color: var(--gray-400); font-size: 13px;
    min-height: 90px; display: flex; align-items: center; justify-content: center;
}

/* ========== 404 PAGE ========== */
.error-page {
    text-align: center; padding: 120px 24px;
}
.error-page h1 { font-size: 72px; color: var(--primary); margin-bottom: 16px; }
.error-page p { font-size: 18px; color: var(--gray-500); margin-bottom: 32px; }

/* ========== AUX PAGES ========== */
.aux-page {
    max-width: 800px; margin: 0 auto; padding: 48px 24px;
}
.aux-page h1 {
    font-size: 32px; font-weight: 800; color: var(--gray-900);
    margin-bottom: 24px;
}
.aux-page h2 {
    font-size: 22px; font-weight: 700; color: var(--gray-800);
    margin: 32px 0 16px;
}
.aux-page p {
    font-size: 16px; color: var(--gray-600); line-height: 1.7;
    margin-bottom: 16px;
}
.aux-page ul { margin: 0 0 16px 24px; color: var(--gray-600); }
.aux-page li { margin-bottom: 8px; line-height: 1.6; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .hero h1 { font-size: 32px; }
    .tool-hero h1 { font-size: 26px; }
}

@media (max-width: 640px) {
    .main-nav { display: none; }
    .main-nav.open {
        display: flex; flex-direction: column;
        position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
        background: var(--white); padding: 24px;
        z-index: 999; overflow-y: auto;
    }
    .main-nav.open a { padding: 12px 0; font-size: 18px; }
    .hamburger, .mobile-toggle { display: block; }
    .dropdown-menu {
        position: static; box-shadow: none; border: none;
        opacity: 1; visibility: visible; transform: none;
        padding-left: 16px;
    }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    .tool-grid { grid-template-columns: 1fr; }
    .result-stats { flex-direction: column; gap: 12px; }
    .related-grid, .related-tools .tool-grid { grid-template-columns: 1fr 1fr; }
}

/* ========== RTL SUPPORT ========== */
html[dir="rtl"] .breadcrumb .sep { transform: scaleX(-1); }
html[dir="rtl"] .tool-card:hover { transform: translateY(-2px); }
/* Only apply RTL to text elements, NOT layout containers */
html[dir="rtl"] p, html[dir="rtl"] h1, html[dir="rtl"] h2,
html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] li,
html[dir="rtl"] span, html[dir="rtl"] label, html[dir="rtl"] a {
    direction: rtl; text-align: right;
}

/* ========== PRINT ========== */
@media print {
    .site-header, .site-footer, .ad-slot, .upload-zone, .btn-primary { display: none; }
    body { padding-top: 0; }
}
