:root {
  --ink: #172026;
  --muted: #5a6972;
  --line: #d9e0e4;
  --panel: #ffffff;
  --soft: #f5f8f7;
  --soft-2: #eef5f3;
  --brand: #0f766e;
  --brand-2: #245dff;
  --brand-soft: #e8faf5;
  --brand-soft-hover: #eef5f3;
  --brand-border-soft: #b7ded7;
  --accent: #b23b53;
  --warn: #b25f00;
  --ok: #117a44;
  --page-bg: #fbfcfc;
  --surface-soft: #fbfdfc;
  --surface-alt: #f9fbfa;
  --input-bg: #ffffff;
  --input-bg-alt: #fbfdfc;
  --input-text: #152027;
  --danger-text: #a12a2a;
  --danger-border: #ffd6d6;
  --shadow: 0 16px 45px rgba(23, 32, 38, 0.08);
  --shadow-soft: 0 8px 18px rgba(23, 32, 38, 0.08);
  --shadow-card: 0 14px 32px rgba(23, 32, 38, 0.08);
  --hero-tint-1: rgba(15, 118, 110, 0.1);
  --hero-tint-2: rgba(178, 59, 83, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf2;
    --muted: #98a3ad;
    --line: #2a3540;
    --panel: #161e26;
    --soft: #1a232c;
    --soft-2: #1f2a35;
    --brand: #34d3c1;
    --brand-2: #6ea1ff;
    --brand-soft: #11302d;
    --brand-soft-hover: #163934;
    --brand-border-soft: #1f5b53;
    --accent: #f08aa1;
    --warn: #f1a85a;
    --ok: #4cc585;
    --page-bg: #0f161d;
    --surface-soft: #131b23;
    --surface-alt: #131b23;
    --input-bg: #0f161d;
    --input-bg-alt: #121a22;
    --input-text: #d6e0eb;
    --danger-text: #ff8a8a;
    --danger-border: #5a2a2a;
    --shadow: 0 16px 45px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.45);
    --hero-tint-1: rgba(52, 211, 193, 0.08);
    --hero-tint-2: rgba(240, 138, 161, 0.06);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page-bg) 92%, transparent);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--brand-border-soft);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a,
.nav-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--muted);
  font-weight: 750;
}

.nav-links a:hover,
.nav-menu summary:hover {
  color: var(--ink);
  background: var(--brand-soft-hover);
}

.nav-links .nav-primary {
  color: var(--ink);
}

.nav-links .nav-primary:first-child {
  border: 1px solid var(--brand-border-soft);
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  cursor: pointer;
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.nav-menu[open] summary {
  background: var(--brand-soft-hover);
  color: var(--ink);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.nav-menu-panel a {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 700;
}

.nav-menu-panel a:hover {
  background: var(--soft);
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, var(--hero-tint-1), transparent 36%),
    linear-gradient(260deg, var(--hero-tint-2), transparent 30%),
    var(--page-bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 34px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 22px 36px;
}

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.button.danger {
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.mini-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mini-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.mini-title {
  font-size: 14px;
  font-weight: 800;
}

.status-pill {
  border: 1px solid var(--brand-border-soft);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 330px;
}

.mini-grid textarea,
.tool-io textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 16px;
  background: var(--input-bg);
  color: var(--input-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.mini-grid textarea + textarea {
  border-left: 1px solid var(--line);
  background: var(--input-bg-alt);
}

.mini-actions,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 60px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--brand);
  font-weight: 750;
}

.breadcrumb a:hover {
  color: var(--ink);
}

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

h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.section-head p,
.tool-intro p,
.faq p,
.content-band p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.tool-filter {
  width: min(360px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--ink);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  display: flex;
  min-height: 156px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-border-soft);
  box-shadow: var(--shadow-card);
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tool-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 26px;
  align-items: start;
}

.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-intro {
  margin-bottom: 18px;
}

.tool-intro h1 {
  max-width: 850px;
  margin-top: 6px;
  font-size: clamp(34px, 4vw, 58px);
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tool-io {
  min-width: 0;
}

.tool-io + .tool-io {
  border-left: 1px solid var(--line);
}

.io-label {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tool-message {
  min-height: 42px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.tool-message.ok {
  color: var(--ok);
}

.tool-message.warn {
  color: var(--warn);
}

.tool-message.error {
  color: var(--danger-text);
  white-space: pre-wrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.side-rail {
  position: sticky;
  top: 86px;
}

.side-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.side-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.side-links {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.content-band {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.faq {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.faq-item h3 {
  margin: 0;
  font-size: 16px;
}

.link-cluster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.link-item {
  display: grid;
  gap: 6px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.link-item span {
  font-weight: 850;
}

.link-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.link-item:hover {
  border-color: var(--brand-border-soft);
  background: var(--brand-soft);
}

.steps-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.steps-list li::marker {
  color: var(--brand);
  font-weight: 800;
}

.plain-list {
  margin: 14px 0 18px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.75;
}

.plain-list li + li {
  margin-top: 8px;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-inner,
  .tool-page {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-cluster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .nav-links a,
  .nav-menu summary {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    background: var(--panel);
  }

  .nav-menu-panel {
    position: static;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  .nav-menu-panel a {
    justify-content: center;
  }

  .hero-inner {
    padding-top: 34px;
  }

  .mini-grid,
  .tool-layout,
  .tool-grid,
  .link-cluster {
    grid-template-columns: 1fr;
  }

  .mini-grid textarea + textarea,
  .tool-io + .tool-io {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
  }
}

.code-sample {
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1620;
  color: #d6e0eb;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.code-sample code {
  font: inherit;
  color: inherit;
}

.example-list {
  display: grid;
  gap: 18px;
}

.example-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--panel);
}

.example-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.example-label {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.example-item .code-sample {
  margin-top: 0;
}
