/* ============================================================
   Common design system for the tool-site network.
   Single file, no external requests. Copied into every site as
   assets/style.css — edit here and re-copy to all sites.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-inset: #eef2f8;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff4ff;
  --ok: #059669;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --maxw: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small { color: var(--text-muted); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.site-header .container {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.06rem; color: var(--text);
  letter-spacing: -.02em; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: grid; place-items: center; color: #fff;
  font-size: .82rem; font-weight: 800; letter-spacing: -.03em;
}
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-soft); font-size: .92rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.site-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 34px; background: linear-gradient(180deg, var(--bg-soft), #fff 82%); border-bottom: 1px solid var(--border); }
.hero h1 { max-width: 760px; }
.hero .lede { font-size: 1.08rem; color: var(--text-soft); max-width: 680px; margin-bottom: 0; }
.eyebrow {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; margin-bottom: 14px;
}

/* ---------- Layout ---------- */
main { display: block; padding: 34px 0 56px; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.section { padding: 30px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head p { color: var(--text-muted); margin: 0; font-size: .95rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; background: var(--bg); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--text-soft); font-size: .95rem; margin-bottom: 10px; }
.card-link { font-weight: 600; font-size: .92rem; }
.card-ico {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 1rem;
}

/* ---------- Tool panel ---------- */
.tool {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow); padding: 22px; margin-bottom: 26px;
}
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--text-soft); }
.field-grow { flex: 1 1 240px; }

input[type="text"], input[type="number"], input[type="url"], input[type="email"], select, textarea {
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 130px; font-family: var(--mono); font-size: .88rem; line-height: 1.55; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); vertical-align: -2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--text-soft); }

button, .btn {
  font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 16px; border: 1px solid transparent;
  background: var(--accent); color: #fff; transition: background .15s ease, transform .05s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { background: var(--border-strong); color: #fff; cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-soft); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 6px 8px; }
.btn-ghost:hover { background: var(--accent-soft); }

/* drop zone */
.drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  background: var(--bg-soft); cursor: pointer; transition: .15s ease;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop strong { display: block; color: var(--text); font-size: 1.02rem; margin-bottom: 4px; }

/* result / status */
.status { font-size: .9rem; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; display: none; }
.status.show { display: block; }
.status.ok { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.status.err { background: #fef2f2; color: var(--err); border: 1px solid #fecaca; }
.status.info { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #dbeafe; }

.result-box { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); padding: 14px; margin-top: 12px; }
.result-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .82rem; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.kv div { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv span { display: block; font-size: .76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.kv strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 1.2em; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
tbody tr:hover { background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Article / prose ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; color: var(--text-soft); }
.prose blockquote {
  margin: 1.2em 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-soft);
}
.prose code { font-family: var(--mono); font-size: .88em; background: var(--bg-inset); padding: 1px 5px; border-radius: 5px; }
.note { border: 1px solid var(--border); background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; color: var(--text-soft); }

.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { margin: 0 6px; }

/* ---------- Ad slots ---------- */
.ad-slot { display: block; margin: 26px 0; min-height: 90px; }
.ad-slot .ad-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; text-align: center; }
.ad-slot ins { display: block; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 30px 0 40px; margin-top: 10px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.footer-links a { color: var(--text-soft); }
.footer-note { color: var(--text-muted); font-size: .84rem; max-width: 420px; }

/* ---------- Misc ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.hidden { display: none !important; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: var(--bg-soft); color: var(--text-soft); border: 1px solid var(--border); }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 700px) {
  .site-nav { gap: 0; font-size: .88rem; }
  .site-nav a { padding: 6px 8px; }
  .hero { padding: 36px 0 26px; }
  .tool { padding: 16px; }
}

@media print { .site-header, .site-footer, .ad-slot, .site-nav { display: none; } }