/* ============================================================
   ConvertZen — Global Design System
   Pure static site. No frameworks. No external fonts.
   Palette: emerald primary #10B981, bg #F9FAFB, text #1F2937
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --primary: #10B981;
  --primary-dark: #0D9488;
  --primary-deep: #047857;
  --primary-soft: #D1FAE5;
  --primary-soft-2: #ECFDF5;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-soft: #4B5563;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --amber: #F59E0B;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --header-h: 64px;
  --content-max: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* Dark mode (automatic, respects system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --card: #111B2E;
    --card-2: #16223A;
    --text: #E5E7EB;
    --text-soft: #C7CDD6;
    --text-muted: #94A3B8;
    --border: #24314B;
    --border-strong: #334466;
    --primary-soft: #10311F;
    --primary-soft-2: #0C1F16;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --danger-soft: #3B1616;
  }
  body { background: var(--bg); color: var(--text); }
  .tool-panel, .post, .dropzone, .result-card, .file-card,
  .article-card, .feature-card, .faq details, .static-card { background: var(--card); }
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden; /* never allow horizontal scroll on mobile */
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { a { color: #34D399; } }
ul, ol { padding-left: 1.4rem; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { color: var(--text-soft); }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 8px; }
.section-sub { color: var(--text-muted); max-width: 640px; margin-bottom: 32px; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hidden { display: none !important; }

/* ---------- Buttons (min touch height 48px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; box-shadow: 0 8px 22px rgba(16, 185, 129, 0.36); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-deep); text-decoration: none; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn-outline-light:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; text-decoration: none; }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: 1.05rem; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Top bar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) { .site-header { background: rgba(17,27,46,.85); } }
.header-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.18rem; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, #10B981, #059669);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(16,185,129,.35);
}
.logo-text em { color: var(--primary); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--text-soft); font-weight: 500; padding: 9px 12px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown > button {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-weight: 500; color: var(--text-soft);
  padding: 9px 12px; border-radius: 8px;
}
.dropdown > button:hover { color: var(--text); background: var(--bg); }
.dropdown > button .caret { font-size: .7em; transition: transform .15s ease; }
.dropdown.open > button .caret { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 8px; display: none; z-index: 120; max-height: 420px; overflow-y: auto;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: .95rem; font-weight: 500;
}
.dropdown-menu a:hover { background: var(--primary-soft-2); text-decoration: none; }
.dropdown-menu a small { color: var(--text-muted); font-weight: 400; }
.dropdown-group-title {
  padding: 10px 12px 4px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); font-weight: 700;
}

/* Header icon buttons */
.icon-btn {
  min-height: 48px; min-width: 40px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: none; border: 1px solid transparent; border-radius: 9px;
  cursor: pointer; font: inherit; font-size: .95rem; color: var(--text-soft);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.lang-toggle { font-weight: 600; }
.fav-btn { font-size: 1.05rem; position: relative; }
.fav-btn .fav-count {
  position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px;
  background: var(--primary); color: #fff; border-radius: 8px;
  font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px;
}
.premium-btn {
  min-height: 40px; padding: 8px 16px; border-radius: 999px;
  background: #F3F4F6; color: #9CA3AF; border: 1px solid var(--border-strong);
  font-weight: 700; font-size: .88rem; cursor: pointer;
}
.premium-btn:hover { color: #6B7280; }
.hamburger { display: none; min-height: 48px; min-width: 48px; background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--text); border-radius: 8px; }
.hamburger:hover { background: var(--bg); }

/* Mobile nav drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: var(--bg);
}
.mobile-menu.open { display: block; }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.mobile-menu-body { padding: 12px 20px 60px; overflow-y: auto; max-height: calc(100vh - 70px); }
.mobile-menu-body a { display: block; padding: 13px 4px; font-size: 1.05rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.mobile-menu-body .mm-group { margin-top: 22px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; padding: 84px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 260px at 12% 8%, rgba(16,185,129,.16), transparent 60%),
    radial-gradient(500px 240px at 88% 20%, rgba(59,130,246,.10), transparent 60%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-soft); color: var(--primary-deep);
  font-size: .86rem; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  margin-bottom: 20px;
}
.hero-title { margin-bottom: 16px; }
.hero-sub { font-size: 1.13rem; color: var(--text-soft); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-proof { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-proof .proof-item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .92rem; font-weight: 600; }
.hero-proof .proof-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.hero-visual {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  box-shadow: var(--shadow-lg);
}
.hero-visual img { width: 100%; height: 300px; object-fit: cover; }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,.05), rgba(15,23,42,.55)); }
.hero-visual figcaption {
  position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 2;
  color: #fff; font-weight: 700; font-size: .95rem;
}
.hero-visual figcaption small { display: block; font-weight: 400; color: rgba(255,255,255,.85); }

/* ---------- Photo-backed cards (tool / feature / article) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tool-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 230px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.tool-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tool-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,0) 20%, rgba(15,23,42,.82) 100%); }
.tool-card-body { position: relative; z-index: 2; padding: 22px; width: 100%; color: #fff; }
.tool-card-body h3 { color: #fff; font-size: 1.18rem; margin-bottom: 5px; }
.tool-card-body p { color: rgba(255,255,255,.82); font-size: .93rem; margin-bottom: 12px; }
.tool-card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .92rem; font-weight: 700; color: #A7F3D0;
}
.tool-card-cta .arrow { transition: transform .15s ease; }
.tool-card:hover .tool-card-cta .arrow { transform: translateX(4px); }
.tool-card .fav-float {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 48px; height: 48px; border-radius: 12px; border: none; cursor: pointer;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; font-size: 1.1rem;
  transition: background .15s ease;
}
.tool-card .fav-float:hover { background: rgba(255,255,255,.32); }
.tool-card .fav-float.active { color: #FDE68A; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.feature-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,.1) 0%, rgba(15,23,42,.8) 100%); }
.feature-card-body { position: relative; z-index: 2; padding: 18px; color: #fff; }
.feature-card-body h3 { color: #fff; font-size: 1.02rem; margin-bottom: 4px; }
.feature-card-body p { color: rgba(255,255,255,.82); font-size: .86rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-deep); font-weight: 800; font-size: 1.05rem;
  margin-bottom: 14px;
}
.step h3 { margin-bottom: 6px; }
.step p { font-size: .95rem; }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease; text-decoration: none; color: var(--text);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.article-card-img { position: relative; height: 170px; overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.article-card:hover .article-card-img img { transform: scale(1.05); }
.article-card-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(15,23,42,.55)); }
.article-card-img .ac-cat {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  background: rgba(15,23,42,.6); color: #A7F3D0; font-size: .74rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.article-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card-body h3 { font-size: 1.05rem; line-height: 1.4; }
.article-card-body p { font-size: .9rem; color: var(--text-muted); flex: 1; }
.article-card-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 10px; align-items: center; }

/* ---------- Tool page hero ---------- */
.tool-hero { position: relative; padding: 56px 0 48px; overflow: hidden; color: #fff; }
.tool-hero img.tool-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tool-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,.72), rgba(15,23,42,.62)); }
.tool-hero > .container { position: relative; z-index: 2; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .86rem; color: rgba(255,255,255,.75); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb a:hover { color: #fff; }
.tool-hero h1 { color: #fff; margin-bottom: 10px; }
.tool-hero .tool-hero-sub { color: rgba(255,255,255,.88); max-width: 680px; font-size: 1.05rem; }

/* ---------- Tool panel & converter ---------- */
.tool-main { margin-top: -28px; position: relative; z-index: 5; }
.tool-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 26px; margin-bottom: 40px;
}
.tool-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tool-panel-title h2 { font-size: 1.15rem; }
.fav-inline {
  min-height: 48px; min-width: 48px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: none; cursor: pointer; font-size: 1.05rem; color: var(--text-muted);
}
.fav-inline:hover { border-color: var(--primary); }
.fav-inline.active { color: var(--amber); border-color: var(--amber); }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--primary-soft-2); padding: 46px 20px; text-align: center;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
  min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone.dz-active { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.005); }
.dropzone-icon { font-size: 2.4rem; line-height: 1; }
.dropzone-title { font-weight: 700; font-size: 1.12rem; color: var(--text); }
.dropzone-hint { color: var(--text-muted); font-size: .92rem; }
.dropzone-hint kbd {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 2px 7px; font-size: .84rem; font-family: var(--font);
}

/* Settings row */
.settings-row {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end;
  margin: 18px 0; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting label { font-size: .84rem; font-weight: 700; color: var(--text-soft); }
.setting select, .setting input[type="number"], .setting input[type="text"] {
  min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font: inherit; font-size: .95rem;
}
.setting select:focus, .setting input:focus { border-color: var(--primary); outline: none; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg-btn {
  min-height: 48px; padding: 8px 16px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 600; color: var(--text-muted);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--card); color: var(--primary-deep); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .seg-btn.active { color: #34D399; } }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--primary); height: 24px; }
.slider-val { min-width: 44px; text-align: center; font-weight: 700; color: var(--primary-deep); background: var(--primary-soft); border-radius: 8px; padding: 4px 8px; font-size: .9rem; }

/* Progress */
.progress-wrap { display: none; margin-top: 18px; }
.progress-wrap.show { display: block; }
.progress-label { font-size: .9rem; color: var(--text-soft); margin-bottom: 8px; display: flex; justify-content: space-between; }
.progress { height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), #34D399); border-radius: 999px; transition: width .2s ease; }

/* File cards */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.file-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.file-card.dragging { border-color: var(--primary); opacity: .6; }
.file-card.drag-over { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.file-thumb {
  width: 100%; height: 96px; border-radius: 8px; overflow: hidden; object-fit: cover;
  background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
}
.file-thumb.placeholder { color: var(--primary); }
.file-info { margin-top: 8px; }
.file-name { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-badge { background: var(--primary-soft); color: var(--primary-deep); font-weight: 700; font-size: .68rem; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.file-status { font-size: .72rem; color: var(--primary-deep); font-weight: 600; }
.file-status.error { color: var(--danger); }
.file-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border-radius: 50%; border: none; background: rgba(15,23,42,.55); color: #fff;
  cursor: pointer; font-size: .85rem; line-height: 1;
}
.file-remove:hover { background: var(--danger); }
.file-card .drag-handle { position: absolute; bottom: 6px; right: 6px; color: var(--text-muted); font-size: .8rem; cursor: grab; }

/* Results */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.result-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow);
}
.result-card .rc-img { width: 100%; height: 120px; object-fit: cover; cursor: zoom-in; background: var(--bg); }
.result-card .rc-body { padding: 10px 12px 12px; }
.result-card .rc-name { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-card .rc-meta { font-size: .74rem; color: var(--text-muted); margin: 2px 0 8px; }
.compare-note {
  display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600;
  color: var(--primary-deep); background: var(--primary-soft); border-radius: 999px; padding: 5px 13px;
}
.compare-note .down { color: var(--primary-dark); }
.result-actions { display: flex; gap: 8px; margin-top: 8px; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
  background: rgba(15,23,42,.88); padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff;
  font-size: 1.2rem; cursor: pointer;
}

/* Tool info / FAQ / related */
.tool-info { padding: 8px 0 24px; }
.tool-info h2, .faq h2, .tool-related h2 { margin-bottom: 16px; }
.tool-info p { max-width: 760px; margin-bottom: 14px; }
.tool-info ul { max-width: 760px; margin-bottom: 14px; }
.tool-info li { margin-bottom: 6px; color: var(--text-soft); }
.faq { padding: 32px 0; }
.faq details {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.2rem; color: var(--primary); transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details .faq-body { padding: 0 20px 16px; color: var(--text-soft); font-size: .95rem; }
.faq details .faq-body p { margin-bottom: 8px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Privacy note (bottom of every tool page) */
.privacy-note {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: var(--primary-soft-2); border: 1px solid var(--primary-soft);
  color: var(--primary-deep); border-radius: var(--radius-sm);
  padding: 13px 18px; font-size: .9rem; font-weight: 600; margin-top: 34px;
}
@media (prefers-color-scheme: dark) { .privacy-note { color: #6EE7B7; } }

/* ---------- Ad slot placeholder (AdSense) ---------- */
.ad-slot {
  min-height: 120px; margin: 36px 0; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); font-size: .82rem; text-align: center; padding: 16px;
}
.ad-slot .ad-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }

/* ---------- Static pages (about / privacy / contact) ---------- */
.static-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 34px; max-width: 820px; margin: 40px auto;
}
.static-card h1 { margin-bottom: 18px; }
.static-card h2 { margin: 28px 0 12px; font-size: 1.3rem; }
.static-card h3 { margin: 20px 0 8px; }
.static-card p { margin-bottom: 14px; color: var(--text-soft); }
.static-card ul, .static-card ol { margin-bottom: 14px; color: var(--text-soft); }
.static-card li { margin-bottom: 6px; }
.static-card table { width: 100%; max-width: 100%; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.static-card th, .static-card td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.static-card th { background: var(--bg); font-weight: 700; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; }
.contact-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--bg); text-align: center; }
.contact-tile .ct-icon { font-size: 1.9rem; margin-bottom: 8px; }
.contact-tile a { font-weight: 700; }

/* ---------- Blog ---------- */
.blog-layout { display: grid; grid-template-columns: 1fr 280px; gap: 34px; align-items: start; }
.post {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.post-hero { position: relative; height: 340px; }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(15,23,42,.7)); }
.post-hero .ph-meta {
  position: absolute; left: 26px; right: 26px; bottom: 18px; z-index: 2; color: #fff;
}
.post-hero .ph-cat { display: inline-block; background: rgba(16,185,129,.85); color: #fff; font-size: .74rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.post-hero h1 { color: #fff; font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.post-body { padding: 30px 34px 40px; }
.post-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: .86rem; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.post h2 { margin: 34px 0 14px; padding-top: 6px; }
.post h3 { margin: 26px 0 10px; }
.post h4 { margin: 20px 0 8px; }
.post p { margin-bottom: 16px; color: var(--text-soft); }
.post ul, .post ol { margin-bottom: 16px; color: var(--text-soft); }
.post li { margin-bottom: 7px; }
.post img { border-radius: var(--radius-sm); margin: 18px 0; }
.post blockquote {
  border-left: 4px solid var(--primary); background: var(--primary-soft-2);
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 18px 0; color: var(--text-soft);
}
.post code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.post pre {
  background: #0F172A; color: #E2E8F0; border-radius: var(--radius-sm);
  padding: 18px; overflow-x: auto; margin: 18px 0; font-size: .9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.post pre code { background: none; border: none; padding: 0; color: inherit; }
.post table { width: 100%; max-width: 100%; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.post th, .post td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.post th { background: var(--bg); font-weight: 700; }
.post details {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 12px; padding: 14px 18px;
}
.post details summary { cursor: pointer; font-weight: 700; color: var(--text); }
.post details p { margin: 10px 0 0; }
.post .toc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 26px; font-size: .92rem; }
.post .toc strong { display: block; margin-bottom: 6px; }
.post .toc ul { margin: 0; padding-left: 1.2rem; }
.post .toc a { color: var(--primary-deep); }
.post-cta {
  margin-top: 30px; padding: 22px; border-radius: var(--radius); background: var(--primary-soft-2);
  border: 1px solid var(--primary-soft); text-align: center;
}
.post-cta p { margin-bottom: 12px; font-weight: 600; color: var(--text); }

/* Blog sidebar */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 18px; }
.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.side-card h3 { font-size: .95rem; margin-bottom: 12px; }
.side-card ul { list-style: none; padding: 0; }
.side-card li { margin-bottom: 8px; }
.side-card a { font-size: .88rem; color: var(--text-soft); }
.side-card a:hover { color: var(--primary-deep); }
.side-card .side-cta { display: block; text-align: center; margin-top: 10px; }

/* Blog list page */
.blog-list-head { padding: 48px 0 8px; }
.blog-list-head h1 { margin-bottom: 10px; }
.blog-list-head p { color: var(--text-muted); max-width: 640px; }
.blog-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 28px 0 60px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--card); margin-top: 40px; }
.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: 40px 20px 30px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 30px; }
.footer-brand p { color: var(--text-muted); font-size: .9rem; margin-top: 10px; max-width: 280px; }
.footer-col h4 { font-size: .9rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
.footer-col a { display: block; color: var(--text-soft); font-size: .9rem; padding: 5px 0; }
.footer-col a:hover { color: var(--primary-deep); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  color: var(--text-muted); font-size: .86rem;
}
.footer-bottom .fb-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--primary-deep); }

/* ---------- Favorites drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(15,23,42,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(360px, 92vw);
  background: var(--card); box-shadow: var(--shadow-lg); transform: translateX(100%);
  transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 1.05rem; }
.drawer-close { width: 48px; height: 48px; border: none; background: none; font-size: 1.15rem; cursor: pointer; color: var(--text-soft); border-radius: 10px; }
.drawer-close:hover { background: var(--bg); }
.drawer-body { padding: 14px 20px; overflow-y: auto; flex: 1; }
.drawer-empty { color: var(--text-muted); text-align: center; padding: 40px 10px; font-size: .92rem; }
.drawer-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
}
.drawer-item:hover { background: var(--primary-soft-2); text-decoration: none; }
.drawer-item .di-icon {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.drawer-item .di-title { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.drawer-item .di-type { font-size: .75rem; color: var(--text-muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(120%);
  z-index: 400; background: #111827; color: #F9FAFB; padding: 13px 22px;
  border-radius: 999px; font-size: .92rem; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: transform .25s ease; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
@media (prefers-color-scheme: dark) { .toast { background: #E5E7EB; color: #111827; } }

/* A2HS tip */
.a2hs-tip {
  display: none; position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  z-index: 350; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 18px; font-size: .9rem; max-width: min(420px, 92vw);
  text-align: center; font-weight: 600;
}
.a2hs-tip.show { display: block; }
.a2hs-tip .close-x { position: absolute; top: 6px; right: 10px; background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 90px 20px 70px; }
.notfound h1 { font-size: clamp(3rem, 10vw, 6rem); color: var(--primary); margin-bottom: 6px; }
.notfound p { margin-bottom: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .steps { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-list { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .header-actions .premium-btn { display: none; }
}
@media (max-width: 560px) {
  .section { padding: 44px 0; }
  .tool-grid, .related-grid, .article-grid, .blog-list { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .tool-panel { padding: 18px 14px; }
  .settings-row { gap: 14px; }
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .post-body { padding: 22px 18px 30px; }
  .post-hero { height: 220px; }
  .static-card { padding: 24px 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 20px; }
  .hero { padding: 56px 0 48px; }
  .dropzone { min-height: 180px; padding: 30px 16px; }
  .btn-lg { width: 100%; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .header-inner { gap: 10px; padding: 0 14px; }
  .tool-card { min-height: 200px; }
}
