/* ==========================================================================
   Newsongbird Tools — shared design system
   One stylesheet, no external fonts, no build step. Light + dark from tokens.
   Class names here are part of the tool contract: see docs/05-tool-contract.md
   ========================================================================== */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f7f8fb;
  --bg-elev: #ffffff;
  --bg-sunken: #eef1f6;
  --ink: #131824;
  --ink-2: #414b5f;
  --ink-3: #667186;
  --line: #dfe4ec;
  --line-strong: #c6cede;

  --accent: #0f7a5a;
  --accent-ink: #0b5f46;
  --accent-soft: #e2f5ee;
  --brand: #0b1020;

  --ok: #0f7a5a;
  --ok-soft: #e2f5ee;
  --warn: #8a5a00;
  --warn-soft: #fdf3dd;
  --bad: #a32020;
  --bad-soft: #fdeaea;
  --info: #14568f;
  --info-soft: #e7f0fa;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px -16px rgba(16, 24, 40, 0.28);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.06), 0 18px 40px -22px rgba(16, 24, 40, 0.35);
  --maxw: 74rem;
  --maxw-prose: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e17;
    --bg-elev: #121826;
    --bg-sunken: #0d1320;
    --ink: #e8edf7;
    --ink-2: #b3bece;
    --ink-3: #8b97a9;
    --line: #232c3d;
    --line-strong: #33405a;

    --accent: #4fd1a5;
    --accent-ink: #6ee7b7;
    --accent-soft: #10291f;
    --brand: #e8edf7;

    --ok: #4fd1a5;
    --ok-soft: #10291f;
    --warn: #f0c04a;
    --warn-soft: #2a2210;
    --bad: #ff8a8a;
    --bad-soft: #2c1414;
    --info: #86bdf5;
    --info-soft: #10202f;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -20px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 24px 48px -24px rgba(0, 0, 0, 0.8);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  line-height: 1.22;
  letter-spacing: -0.018em;
  margin: 0 0 0.5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.6rem);
  letter-spacing: -0.028em;
}
h2 {
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
}
h3 {
  font-size: 1.05rem;
}
p {
  margin: 0 0 1em;
  color: var(--ink-2);
  text-wrap: pretty;
}
a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
img,
svg,
canvas {
  max-width: 100%;
  height: auto;
}
code,
kbd,
samp,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.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;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 60;
  background: var(--bg-elev);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
}

/* ---------- header / nav ------------------------------------------------ */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.15rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.02rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 7px;
  background: var(--brand);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--mono);
}
.nav-links {
  display: flex;
  gap: 1.1rem;
  font-size: 0.92rem;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem 1.15rem 5rem;
}

/* ---------- breadcrumbs / hero ----------------------------------------- */
.crumbs {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin: 0.4rem 0 1.1rem;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--line-strong);
}
.crumbs a {
  color: var(--ink-3);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.tool-hero {
  max-width: var(--maxw-prose);
  margin-bottom: 1.6rem;
}
.tool-hero h1 {
  margin-bottom: 0.35rem;
}
.tagline {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
  color: var(--ink-2);
  margin-bottom: 0.9rem;
  max-width: 42rem;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
}
.meta-local {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.meta-data {
  color: var(--info);
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
}

/* ---------- tool panel ------------------------------------------------- */
.tool-panel-wrap {
  max-width: var(--maxw-prose);
  margin-bottom: 3rem;
}
.tool-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
}
.tool-card + .tool-card {
  margin-top: 1rem;
}
@media (min-width: 720px) {
  .tool-card {
    padding: 1.5rem;
  }
}
.tool-card > h2,
.tool-card > h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin: 0 0 0.9rem;
  font-weight: 650;
}

.grid {
  display: grid;
  gap: 0.9rem;
}
.grid-2 {
  grid-template-columns: 1fr;
}
.grid-3 {
  grid-template-columns: 1fr;
}
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.row-between {
  justify-content: space-between;
}
.stack > * + * {
  margin-top: 0.9rem;
}

/* form controls */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.field > label,
.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.field-hint {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin: 0;
}
.input,
.textarea,
.select {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--ink-3);
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.textarea {
  min-height: 9rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
}
.input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .input-suffix {
  display: grid;
  place-items: center;
  padding: 0 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-3);
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--bg-sunken);
  border-color: var(--ink-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--bg-sunken);
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}
.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* results */
.result {
  border-top: 1px dashed var(--line);
  margin-top: 1.15rem;
  padding-top: 1.15rem;
}
.result-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}
.stat-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.15rem;
}
.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.stat-sub {
  display: block;
  font-size: 0.79rem;
  color: var(--ink-3);
  margin-top: 0.1rem;
}
.stat-hero .stat-value {
  font-size: 1.9rem;
  color: var(--accent-ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 32%, transparent);
}
.badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 32%, transparent);
}
.badge-bad {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 32%, transparent);
}
.badge-info {
  color: var(--info);
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 32%, transparent);
}
.badge-muted {
  color: var(--ink-3);
  background: var(--bg-sunken);
  border-color: var(--line);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table th,
.table td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--bg-sunken);
  font-weight: 650;
  position: sticky;
  top: 0;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.table .num,
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

.code-out {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin: 0;
  max-height: 22rem;
  overflow: auto;
  color: var(--ink);
}

.note,
.callout {
  font-size: 0.86rem;
  color: var(--ink-2);
  background: var(--bg-sunken);
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.6rem 0.8rem;
  margin: 0.9rem 0 0;
}
.callout-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
  color: var(--ink-2);
}
.callout-bad {
  background: var(--bad-soft);
  border-left-color: var(--bad);
  color: var(--ink-2);
}
.callout-ok {
  background: var(--ok-soft);
  border-left-color: var(--ok);
  color: var(--ink-2);
}

.meter {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
.meter-fill.is-warn {
  background: var(--warn);
}
.meter-fill.is-bad {
  background: var(--bad);
}

.empty {
  color: var(--ink-3);
  font-size: 0.88rem;
  font-style: italic;
}

/* ---------- prose sections --------------------------------------------- */
.prose-sec {
  max-width: var(--maxw-prose);
  margin: 0 0 3rem;
}
.prose-sec h2 {
  margin-bottom: 0.9rem;
}
.prose-sec p {
  font-size: 1rem;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.steps li {
  display: grid;
  grid-template-columns: 1.9rem 1fr;
  gap: 0.75rem;
  align-items: start;
}
.step-num {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.steps h3 {
  margin: 0.15rem 0 0.15rem;
  font-size: 0.98rem;
}
.steps p {
  margin: 0;
  font-size: 0.92rem;
}
.data-note {
  font-size: 0.84rem;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  margin-top: 1.2rem;
}
.data-note strong {
  color: var(--ink-2);
}

.faq {
  display: grid;
  gap: 0.5rem;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  color: var(--ink-3);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item summary:hover {
  background: var(--bg-sunken);
}
.faq-body {
  padding: 0 0.9rem 0.8rem;
}
.faq-body p {
  margin: 0;
  font-size: 0.92rem;
}

/* ---------- cards (hub + related) -------------------------------------- */
.card-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  color: var(--ink);
}
.card-chip {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  color: var(--accent-ink);
}
.card-title {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}
.card-desc {
  font-size: 0.87rem;
  color: var(--ink-3);
  line-height: 1.5;
}
.card-cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-ink);
}

/* ---------- hub -------------------------------------------------------- */
.hub-hero {
  max-width: 52rem;
  padding: 1.6rem 0 2.2rem;
}
.hub-hero h1 {
  margin-bottom: 0.6rem;
}
.hub-sub {
  font-size: 1.02rem;
  color: var(--ink-2);
  margin-bottom: 1rem;
}
.hub-sec {
  margin-bottom: 2.8rem;
  scroll-margin-top: 5rem;
}
.hub-sec-head {
  max-width: 46rem;
  margin-bottom: 1rem;
}
.hub-sec-head h2 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.hub-sec-head p {
  font-size: 0.92rem;
  color: var(--ink-3);
  margin: 0;
}
.hub-method .prose {
  max-width: 46rem;
}
.notfound {
  padding: 3rem 1.15rem;
}
.notfound h1 {
  margin-bottom: 0.5rem;
}

/* ---------- footer ----------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  margin-top: 2rem;
}
.foot-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.15rem 1rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .foot-grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
  }
}
.foot-col h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.foot-col a {
  font-size: 0.86rem;
  color: var(--ink-2);
  text-decoration: none;
}
.foot-col a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}
.foot-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.foot-note {
  font-size: 0.83rem;
  color: var(--ink-3);
  max-width: 24rem;
}
.foot-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.15rem 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.foot-bottom p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-3);
}

/* ---------- motion / print -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
@media print {
  .site-nav,
  .site-footer,
  .meta-row,
  .card-cta,
  .skip-link {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- language switcher + Chinese typography --------------------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.75rem;
  font-size: 0.78rem;
}
.lang-switch a {
  font-weight: 400;
  color: var(--ink-3);
  text-decoration: none;
  padding: 0.05rem 0.2rem;
  border-radius: 4px;
}
.lang-switch a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.lang-switch a:hover {
  background: var(--accent-soft);
}

/* CJK needs a different rhythm: looser lines, no negative tracking, and a font
   stack that prefers the platform's Chinese face before falling back. */
html[lang^="zh"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Segoe UI", sans-serif;
  line-height: 1.78;
}
html[lang^="zh"] h1,
html[lang^="zh"] h2,
html[lang^="zh"] h3,
html[lang^="zh"] h4 {
  letter-spacing: 0;
  line-height: 1.35;
}
html[lang^="zh"] p {
  line-height: 1.78;
}
html[lang^="zh"] .tagline,
html[lang^="zh"] .card-desc {
  line-height: 1.7;
}
html[lang^="zh"] .stat-value {
  letter-spacing: 0;
}
