:root{
  --bg:#ffffff;
  --card:#f8fafc;
  --surface:#ffffff;
  --inputbg:#ffffff;
  --text:#111827;
  --muted:#64748b;
  --primary:#6366f1;
  --accent2:#7c3aed;
  --border:#e5e7eb;
  --shadow:0 10px 30px rgba(0,0,0,.08);
}

body.dark{
  --bg:#0b1220;
  --card:#0f172a;
  --surface:#020617;
  --inputbg:#020617;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --primary:#818cf8;
  --accent2:#a78bfa;
  --border:#1f2937;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.58;
}

a{
  color:var(--primary);
  text-decoration:none;
}

a:hover{
  text-decoration:underline;
}

.site-header{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--bg);
  border-bottom:1px solid var(--border);
}

.wrap{
  max-width:1140px;
  margin:0 auto;
  padding:0 20px;
}

.header-inner{
  min-height:90px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  font-weight:800;
  color:var(--text);
}

.brand:hover{
  text-decoration:none;
}

.brand img{
  width:86px;
  height:auto;
}

.brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}

.brand-text strong{
  font-size:1.35rem;
  color:var(--text);
}

.brand-text small{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}

.nav{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
}

.nav a{
  color:var(--text);
  font-weight:700;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:700;
  box-shadow:var(--shadow);
}

.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--accent2));
  color:#ffffff;
  border:none;
}

.hero{
  padding:56px 0 34px;
  background:
    radial-gradient(circle at top right, rgba(99,102,241,.10), transparent 28%),
    radial-gradient(circle at top left, rgba(124,58,237,.08), transparent 24%);
}

.hero-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:28px;
  align-items:start;
}

h1,h2,h3{
  line-height:1.15;
  margin:0 0 12px;
  color:var(--text);
}

h1{
  font-size:clamp(2.1rem,5vw,4rem);
}

h2{
  font-size:clamp(1.45rem,3vw,2.15rem);
}

.lead{
  font-size:1.08rem;
  color:var(--muted);
  max-width:760px;
}

.hero-card,
.card,
.category-card,
.mini-card{
  background:var(--card);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}

.hero-card,
.card{
  border-radius:22px;
  padding:20px;
}

.category-card,
.tool-link{
  display:block;
  padding:18px;
  border-radius:16px;
  color:var(--text);
}

.category-card{
  background:var(--card);
  border:1px solid var(--border);
}

.category-card:hover,
.tool-link:hover{
  text-decoration:none;
  transform:translateY(-1px);
}

.section{
  padding:30px 0;
}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
}

.tool-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:14px;
}

.tool-link{
  border:1px solid var(--border);
  background:var(--card);
  box-shadow:var(--shadow);
}

.search-box{
  display:flex;
  gap:10px;
  align-items:center;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px 14px;
  box-shadow:var(--shadow);
}

.search-box input{
  width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:var(--text);
  font-size:1rem;
  outline:none;
  margin:0;
}

textarea,
input[type="date"],
input[type="text"],
input[type="number"],
select{
  width:100%;
  padding:12px 14px;
  margin:10px 0;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--inputbg);
  color:var(--text);
}

textarea{
  min-height:180px;
  resize:vertical;
}

.result{
  padding:16px;
  border-radius:16px;
  background:var(--card);
  border:1px solid var(--border);
  min-height:60px;
  white-space:pre-wrap;
  word-break:break-word;
}

.mini-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
}

.mini-card{
  padding:14px;
  border-radius:16px;
}

.footer{
  margin-top:40px;
  padding:34px 0;
  border-top:1px solid var(--border);
  color:var(--muted);
}

.footer-grid{
  display:grid;
  grid-template-columns:1fr auto;
  gap:16px;
  align-items:start;
}

.footer-links{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:8px;
}

.muted{
  color:var(--muted);
}

.breadcrumbs{
  margin:20px 0 12px;
  font-size:.95rem;
  color:var(--muted);
}

.badge{
  display:inline-block;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(99,102,241,.10);
  color:var(--primary);
  font-weight:800;
  font-size:.85rem;
  margin-bottom:10px;
}

.tool-copy h2{
  margin-top:20px;
}

.tool-copy p{
  margin:0 0 14px;
  color:var(--text);
}

.benefits{
  margin:14px 0 0 18px;
  color:var(--muted);
}

@media (max-width:840px){
  .hero-grid{
    grid-template-columns:1fr;
  }

  .header-inner{
    align-items:flex-start;
    padding:16px 0;
  }

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