:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { font: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.narrow { width: min(760px, calc(100% - 32px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  color: var(--secondary);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 800;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.main-nav a {
  color: var(--muted);
  font-size: 0.96rem;
}
.main-nav a.active, .main-nav a:hover { color: var(--primary); }
.nav-search {
  flex: 0 0 260px;
}
.nav-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 0.75rem 1rem;
}

.hero-section { padding: 5rem 0 4rem; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 2rem;
}
.eyebrow {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
h1, h2, h3 { margin-top: 0; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 4vw, 4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.5rem); margin-bottom: 1rem; }
.hero-copy { color: var(--muted); font-size: 1.07rem; max-width: 620px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 0.88rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(37,99,235,0.18);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--accent)); }
.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--secondary);
}
.popular-tags {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.popular-tags a {
  background: rgba(37,99,235,0.06);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}
.hero-visual {
  position: relative;
  min-height: 360px;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(6,182,212,0.08));
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.visual-card {
  position: absolute;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 16px 32px rgba(15,23,42,0.08);
}
.card-one { top: 56px; left: 36px; }
.card-two { top: 120px; right: 32px; }
.card-three { bottom: 52px; left: 58px; }
.visual-card span {
  display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 0.35rem;
}
.visual-card strong { font-size: 1.8rem; }

.tool-showcase, .category-section, .features-section, .steps-section, .faq-section, .blog-home, .content-page, .tool-content-sections { padding: 1rem 0 4rem; }
.section-head {
  margin-bottom: 1.5rem;
}
.split-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.view-all { color: var(--primary); font-weight: 700; }
.tool-grid, .feature-grid, .step-grid, .blog-grid, .category-grid {
  display: grid;
  gap: 1.2rem;
}
.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.blog-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.category-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.tool-card, .feature-card, .step-item, .category-card, .sidebar-card, .content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(15,23,42,0.04);
}
.tool-card {
  padding: 1.2rem 1.2rem 1.4rem;
}
.tool-card-top { margin-bottom: 0.75rem; }
.tool-badge {
  display: inline-block;
  background: rgba(6,182,212,0.08);
  color: var(--secondary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.tool-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.tool-card p { color: var(--muted); margin-bottom: 1rem; }
.mini-link { font-weight: 700; }

.gray-section {
  background: rgba(148,163,184,0.04);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature-card, .step-item, .category-card, .content-card { padding: 1.4rem; }
.step-item span {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(37,99,235,0.08);
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.faq-list { display: grid; gap: 0.8rem; }
.faq-list details, .content-card details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.faq-list summary, .content-card summary {
  cursor: pointer;
  font-weight: 700;
}

.blog-card { overflow: hidden; }
.image-box { height: 200px; overflow: hidden; }
.image-box img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 1.1rem 1.1rem 1.2rem; }

.page-heading { padding: 3.5rem 0 1.5rem; }
.page-heading h1 { margin-bottom: 0.8rem; }
.search-wrap { margin-top: 1rem; }
#toolSearch, .contact-form input, .contact-form textarea, .tool-interface input, .tool-interface textarea, .tool-interface select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: white;
}
#toolSearch { max-width: 520px; }

.toolbar { margin-bottom: 1rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.chip {
  display: inline-flex;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
}
.chip-active { background: rgba(37,99,235,0.08); color: var(--primary); border-color: rgba(37,99,235,0.12); }
.hidden { display: none !important; }
.empty-state {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a4d00;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-top: 1rem;
}

.tool-page-shell { padding: 0.8rem 0 3rem; }
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 1.3rem;
}
.tool-panel, .tool-sidebar { display: grid; gap: 1rem; }
.tool-interface {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.field-label {
  display: block;
  margin: 1rem 0 0.6rem;
  font-weight: 700;
}
.tool-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1rem 0; }
.output-box {
  margin-top: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  color: var(--secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sidebar-card {
  padding: 1.2rem 1rem;
}
.sidebar-card h3 { margin-bottom: 0.7rem; }
.sidebar-card ul { margin: 0; padding-left: 1.2rem; }

.tool-content-sections { padding-top: 0; }
.content-card { margin-bottom: 1.1rem; }
.content-card p, .content-card li, .content-page p, .content-page li { color: var(--muted); }

.contact-layout { display: grid; justify-content: center; }
.contact-form { width: min(680px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.contact-form label { font-weight: 700; display: grid; gap: 0.6rem; }
.alert {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
}
.alert.success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.15); color: #0f7a59; }
.alert.error { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.12); color: #b91c1c; }
.error-page { text-align: center; }

.site-footer {
  background: var(--secondary);
  color: #dfe7f3;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
}
.footer-brand { color: #fff; }
.site-footer h3 { color: white; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: #dfe7f3; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2rem;
  padding-top: 1rem;
}

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.breadcrumbs a { color: var(--muted); }

.article-shell { padding: 0 0 4rem; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 1.5rem;
}
.article-content, .article-sidebar { display: grid; gap: 1rem; }
.article-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
}
.article-cover { border-radius: 18px; max-height: 300px; object-fit: cover; }
.meta-line { color: var(--muted); }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 1.3rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute;
    right: 16px;
    top: 78px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(255,255,255,0.98);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .nav-wrap { position: relative; }
  .nav-search { flex: 1; }
  .hero-grid, .tool-layout, .article-layout { grid-template-columns: 1fr; }
}

.home-search { margin: 1.5rem 0 1rem; max-width: 620px; }
.search-row { display: flex; gap: 0.75rem; }
.search-row input { flex: 1; border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.stat-grid div {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
}
.stat-grid span { display: block; color: var(--muted); font-size: 0.8rem; }
.option-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; margin: 0.8rem 0; }
.tool-status { min-height: 1.4em; margin: 0.4rem 0 0; }
.tool-status.error { color: #b91c1c; }
.tool-status.success { color: #0f7a59; }
.image-preview, .qr-holder canvas, .qr-holder img {
  max-width: min(100%, 360px);
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.numbered-list { padding-left: 1.2rem; }
.numbered-list li { margin-bottom: 0.8rem; color: var(--muted); }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

@media (max-width: 600px) {
  .hero-section { padding-top: 3.5rem; }
  .tool-actions, .hero-actions, .search-row { flex-direction: column; }
  .btn { width: 100%; }
  .hero-visual { min-height: 260px; }
  .tool-grid { grid-template-columns: 1fr; }
  .container { width: min(100% - 20px, 1120px); }
}
