/* ==========================================================================
   Wilderness Survival Toolkit — Design System
   原生 CSS，无框架。移动优先；断点 480/768/1024/1440。
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --green-900: #102019;
  --green-800: #1c3a2e;
  --green-700: #27503f;
  --green-600: #3f7d5c;
  --green-500: #5a9b78;
  --green-100: #dcebe2;
  --green-50:  #eef5f0;

  --ink-900: #1e2526;
  --ink-700: #3e4849;
  --ink-500: #687173;
  --ink-400: #8a9395;
  --ink-200: #c8cece;
  --ink-100: #e4e7e6;
  --paper:   #f7f4ec;
  --paper-2: #f1ece0;
  --white:   #ffffff;

  --amber: #e8a33d;
  --amber-d: #b9791f;
  --red: #c0392b;
  --red-d: #93271b;
  --orange: #d97706;
  --yellow-bg: #fdf6d8;
  --info: #2f6f8f;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --shadow-s: 0 1px 3px rgba(16, 32, 25, .08), 0 1px 2px rgba(16, 32, 25, .06);
  --shadow: 0 6px 24px rgba(16, 32, 25, .10);
  --shadow-l: 0 16px 48px rgba(16, 32, 25, .16);
  --maxw: 1180px;
  --topbar-h: 60px;
  --tabbar-h: 58px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--green-900); margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--green-800); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(28, 58, 46, .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,.25);
}
.topbar__inner { display: flex; align-items: center; gap: 14px; height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; font-size: 1.02rem; letter-spacing: .2px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand small { display: block; font-size: .62rem; font-weight: 500; color: var(--green-100); letter-spacing: 1.5px; text-transform: uppercase; }
.nav { display: none; align-items: center; gap: 2px; margin-left: auto; }
.nav a, .nav button {
  color: #e9f1ec; background: none; border: 0; font-size: .92rem;
  padding: 9px 11px; border-radius: var(--radius-s); cursor: pointer; white-space: nowrap;
}
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { background: rgba(255,255,255,.12); text-decoration: none; }
.nav .has-drop { position: relative; }
.nav .drop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; color: var(--ink-900); border-radius: var(--radius);
  box-shadow: var(--shadow-l); padding: 8px; min-width: 250px;
}
.nav .has-drop.open .drop { display: grid; gap: 2px; }
.nav .drop a { color: var(--ink-900); padding: 8px 10px; display: flex; flex-direction: column; border-radius: 8px; }
.nav .drop a:hover { background: var(--green-50); }
.nav .drop a b { font-size: .9rem; }
.nav .drop a span { font-size: .76rem; color: var(--ink-500); }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; }
.lang-switch button { padding: 6px 12px !important; font-size: .82rem !important; color: #fff; }
.lang-switch button[aria-pressed="true"] { background: var(--amber); color: var(--green-900); font-weight: 700; }
.fav-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--amber); color: var(--green-900); border-radius: 999px;
  font-size: .68rem; font-weight: 800; margin-left: 3px;
}
.fav-count.is-zero { display: none; }
.icon-btn {
  background: none; border: 0; color: #fff; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: var(--radius-s); cursor: pointer; font-size: 1.25rem;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.burger { margin-left: auto; }
@media (min-width: 1024px) { .nav { display: flex; } .burger { display: none; } .brand { margin-right: 4px; } }

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 150; display: none;
}
.drawer.open { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(10,20,15,.55); border: 0; width: 100%; cursor: default; }
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(84vw, 360px);
  background: var(--green-900); color: #e9f1ec; padding: 18px 16px 28px; overflow-y: auto;
  animation: slide-in .22s ease;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer__panel h4 { color: var(--green-100); font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 18px 6px 8px; }
.drawer__panel a { display: block; color: #fff; padding: 12px 10px; border-radius: var(--radius-s); font-size: .98rem; }
.drawer__panel a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.drawer__close { position: absolute; right: 10px; top: 8px; }

/* mobile bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.98); border-top: 1px solid var(--ink-100);
  box-shadow: 0 -4px 18px rgba(16,32,25,.07);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); color: var(--ink-500); font-size: .68rem; font-weight: 600;
}
.tabbar a[aria-current="page"] { color: var(--green-700); }
.tabbar .tab-ico { font-size: 1.25rem; line-height: 1; }
@media (min-width: 1024px) { .tabbar { display: none; } body { --tabbar-h: 0px; } }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* ---------- Breadcrumb ---------- */
.crumb { padding: 14px 0 0; font-size: .82rem; color: var(--ink-500); }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumb li::after { content: "›"; margin-left: 6px; color: var(--ink-300, #b9c0c1); }
.crumb li:last-child::after { content: ""; }
.crumb a { color: var(--ink-500); display: inline-flex; align-items: center; min-height: 40px; padding: 6px 2px; border-radius: 6px; }
.crumb a:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.crumb [aria-current="page"] { color: var(--ink-900); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; font-weight: 700; font-size: .95rem;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); text-decoration: none; }
.btn-amber { background: var(--amber); color: var(--green-900); }
.btn-amber:hover { background: #f0b254; text-decoration: none; }
.btn-outline { border-color: var(--green-700); color: var(--green-700); background: transparent; }
.btn-outline:hover { background: var(--green-50); text-decoration: none; }
.btn-ghost { background: var(--ink-100); color: var(--ink-900); }
.btn-ghost:hover { background: var(--ink-200); text-decoration: none; }
.btn-sm { min-height: 44px; padding: 10px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--green-900);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,32,25,.62) 0%, rgba(16,32,25,.42) 42%, rgba(16,32,25,.82) 100%);
}
.hero__inner { position: relative; z-index: 1; padding: 84px 0 72px; max-width: 760px; }
.hero--page .hero__inner { padding: 46px 0 40px; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 3.1rem); letter-spacing: -.5px; }
.hero p { font-size: clamp(1rem, 2.2vw, 1.18rem); color: rgba(255,255,255,.92); max-width: 640px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 30px; }
.hero__stats b { display: block; font-size: 1.5rem; color: var(--amber); }
.hero__stats span { font-size: .82rem; color: rgba(255,255,255,.85); }
.search-hero { display: flex; gap: 8px; margin-top: 24px; max-width: 560px; }
.search-hero input {
  flex: 1; min-height: 48px; border-radius: 999px; border: 0; padding: 0 20px; font-size: 1rem; min-width: 0;
}
/* compact page hero used on tool/article pages */
.page-hero { position: relative; color: #fff; overflow: hidden; background: var(--green-900); }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16,32,25,.88) 0%, rgba(16,32,25,.55) 70%, rgba(16,32,25,.35)); }
.page-hero__inner { position: relative; z-index: 1; padding: 34px 0 30px; }
.page-hero h1 { color: #fff; font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,.9); margin: 0; max-width: 720px; font-size: .96rem; }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section--alt { background: var(--white); }
.section--green { background: var(--green-50); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin: 0; }
.section-head p { color: var(--ink-500); margin: 4px 0 0; font-size: .92rem; }
.section-head a { white-space: nowrap; font-weight: 700; font-size: .9rem; }

/* ---------- Photo cards ---------- */
.card-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.photo-card {
  position: relative; display: block; border-radius: var(--radius-l); overflow: hidden;
  min-height: 190px; color: #fff; isolation: isolate;
  box-shadow: var(--shadow-s); background: var(--green-800);
}
.photo-card:hover { text-decoration: none; transform: translateY(-3px); transition: transform .18s ease; box-shadow: var(--shadow); }
.photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.photo-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16,32,25,.12) 0%, rgba(16,32,25,.28) 48%, rgba(16,32,25,.88) 100%);
}
.photo-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px 14px; }
.photo-card__icon {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(4px); font-size: 1.15rem; margin-bottom: 8px;
}
.photo-card h3 { color: #fff; font-size: 1.04rem; margin: 0 0 4px; padding-right: 40px; }
.photo-card p { color: rgba(255,255,255,.86); font-size: .82rem; margin: 0; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card__top { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.photo-card .fav-btn { position: absolute; top: 10px; right: 10px; z-index: 3; }
.card-lg { min-height: 240px; }
.card-lg h3 { font-size: 1.2rem; }

/* hub cards on home (wider) */
.hub-card { min-height: 170px; }
.hub-card .hub-meta { font-size: .76rem; color: rgba(255,255,255,.8); margin-top: 5px; }

/* badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff;
}
.pill-upgraded { background: var(--amber); color: var(--green-900); }
.pill-new { background: rgba(255,255,255,.25); }
.chip {
  display: inline-block; font-size: .74rem; font-weight: 600; color: var(--green-700);
  background: var(--green-50); border: 1px solid var(--green-100);
  padding: 3px 10px; border-radius: 999px; margin: 0 6px 6px 0;
}

/* favorite heart button */
.fav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(16,32,25,.45); color: #fff; backdrop-filter: blur(4px);
}
.fav-btn:hover { background: rgba(16,32,25,.65); }
.fav-btn.is-on { background: var(--red); color: #fff; }

/* ---------- Filters / search ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0 24px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box input {
  width: 100%; min-height: 46px; border: 1px solid var(--ink-200); border-radius: 999px;
  padding: 0 18px 0 44px; font-size: .98rem; background: #fff;
}
.search-box input:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 3px var(--green-100); }
.search-box .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pills button {
  min-height: 40px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--ink-200);
  background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-700);
}
.filter-pills button[aria-pressed="true"] { background: var(--green-800); border-color: var(--green-800); color: #fff; }

/* ---------- Generic content panels ---------- */
.panel {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-l);
  box-shadow: var(--shadow-s); padding: 22px;
}
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.2rem; }
.panel h3 { font-size: 1.02rem; }

/* ---------- Tool layout ---------- */
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 22px 0 10px; }
@media (min-width: 1024px) { .tool-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } .tool-grid__results { position: sticky; top: calc(var(--topbar-h) + 16px); } }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: .92rem; margin-bottom: 7px; color: var(--ink-900); }
.field .control { display: flex; gap: 8px; align-items: center; }
.field input[type="number"], .field input[type="text"], .field select, .field textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--ink-200); border-radius: var(--radius-s);
  padding: 10px 13px; font-size: 1rem; background: #fff; color: var(--ink-900);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 3px var(--green-100); }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.field .suffix { white-space: nowrap; color: var(--ink-500); font-size: .88rem; min-width: 52px; }
.field .hint { display: block; margin-top: 6px; font-size: .79rem; color: var(--ink-500); line-height: 1.45; }
.field .error { display: none; margin-top: 6px; font-size: .79rem; color: var(--red); font-weight: 600; }
.field.has-error .error { display: block; }
.field-range { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.field-range input[type="range"] { width: 100%; accent-color: var(--green-600); min-height: 30px; }
.field-range .range-val { min-width: 74px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* segmented control */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; flex: 1 1 auto; min-width: 0; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 8px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--ink-200); background: #fff; font-size: .86rem; font-weight: 600; color: var(--ink-700);
}
.segmented input:checked + span { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }

/* radio cards */
.radio-cards { display: grid; gap: 8px; }
.radio-cards label {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-s); background: #fff; cursor: pointer;
}
.radio-cards label:has(input:checked) { border-color: var(--green-700); background: var(--green-50); }
.radio-cards b { display: block; font-size: .92rem; }
.radio-cards span.sub { font-size: .78rem; color: var(--ink-500); }
.radio-cards input { margin-top: 2px; accent-color: var(--green-700); width: 20px; height: 20px; flex: none; }

/* checkbox */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--green-700); flex: none; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink-100); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 11px 16px; font-size: .92rem; font-weight: 700;
  color: var(--ink-500); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; min-height: 44px;
}
.tabs button[aria-selected="true"] { color: var(--green-800); border-bottom-color: var(--amber); }
.tab-panel[hidden] { display: none; }

/* unit toggle */
.unit-toggle { display: inline-flex; border: 1px solid var(--ink-200); border-radius: 999px; overflow: hidden; }
.unit-toggle button { border: 0; background: #fff; padding: 8px 14px; cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--ink-500); min-height: 38px; }
.unit-toggle button[aria-pressed="true"] { background: var(--green-800); color: #fff; }

/* ---------- Results ---------- */
.verdict { border-radius: var(--radius); padding: 18px 18px 16px; color: #fff; margin-bottom: 16px; }
.verdict .level { font-size: .72rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; opacity: .9; }
.verdict .verdict-title { font-size: 1.3rem; font-weight: 800; margin: 3px 0 6px; }
.verdict p { margin: 0; font-size: .92rem; color: rgba(255,255,255,.95); }
.verdict.lv-safe { background: #357a58; }
.verdict.lv-caution { background: #9a6b16; }
.verdict.lv-warning { background: #c2710c; }
.verdict.lv-danger { background: var(--red); }
.verdict.lv-extreme { background: #7a1f16; }
.verdict.lv-info { background: var(--info); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 480px) { .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
.stat { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.4rem; color: var(--green-900); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: .76rem; color: var(--ink-500); }

.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 14px; }
.data-table th, .data-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
.data-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-500); background: var(--paper); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; border: 1px solid var(--ink-100); border-radius: var(--radius); margin-bottom: 16px; }
.table-scroll .data-table { margin: 0; }

/* gauge / meter */
.meter { height: 12px; border-radius: 999px; background: var(--ink-100); overflow: hidden; margin: 8px 0 6px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--green-600); }
.meter.amber i { background: var(--amber); }
.meter.red i { background: var(--red); }
.meter-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-500); }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.donut { width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--green-600) 0 var(--p, 60%), var(--ink-100) var(--p, 60%) 100%);
  display: grid; place-items: center; flex: none;
}
.donut .donut-inner { width: 104px; height: 104px; background: #fff; border-radius: 50%; display: grid; place-items: center; text-align: center; }
.donut .donut-inner b { font-size: 1.25rem; color: var(--green-900); display: block; }
.donut .donut-inner span { font-size: .68rem; color: var(--ink-500); }
.legend { font-size: .83rem; display: grid; gap: 5px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; }

/* alerts */
.alert { display: flex; gap: 12px; border-radius: var(--radius); padding: 13px 15px; margin-bottom: 12px; font-size: .9rem; }
.alert .alert-ico { font-size: 1.2rem; line-height: 1.3; }
.alert b { display: block; margin-bottom: 2px; }
.alert p { margin: 0; }
.alert.al-danger { background: #fdecea; border: 1px solid #f5c6c0; color: #7a1f16; }
.alert.al-warning { background: var(--yellow-bg); border: 1px solid #eadf9f; color: #755406; }
.alert.al-caution { background: #fdf0dd; border: 1px solid #f2d4a8; color: #8a4e08; }
.alert.al-safe { background: var(--green-50); border: 1px solid var(--green-100); color: #244c39; }
.alert.al-info { background: #eaf3f8; border: 1px solid #c6ddea; color: #1f4c63; }

/* step list */
.steps { list-style: none; margin: 0 0 14px; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.steps li { position: relative; padding: 12px 14px 12px 52px; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--ink-100); font-size: .9rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}
.steps li.danger-step::before { background: var(--red); }
.steps b { display: block; }

/* coverage matrix */
.matrix { display: grid; gap: 4px; font-size: .82rem; }
.matrix .mx-row { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); align-items: center; gap: 4px; }
.matrix .mx-row span { text-align: center; padding: 7px 4px; border-radius: 6px; background: var(--paper); }
.matrix .mx-row.head span { background: var(--green-800); color: #fff; font-size: .72rem; font-weight: 700; }
.mx-yes { background: #dff0e6 !important; color: #244c39; font-weight: 700; }
.mx-no { background: #fdecea !important; color: #7a1f16; font-weight: 700; }
.mx-partial { background: #fdf0dd !important; color: #8a4e08; font-weight: 700; }
.matrix .mx-row span:first-child { text-align: left; background: none !important; color: var(--ink-900); font-weight: 600; }

/* timer / metronome */
.timer-display { text-align: center; font-variant-numeric: tabular-nms; font-variant-numeric: tabular-nums; }
.timer-display b { font-size: clamp(2.6rem, 9vw, 4rem); color: var(--green-900); display: block; line-height: 1.1; }
.timer-display.ticking b { color: var(--red); }
.metro-dot { width: 46px; height: 46px; border-radius: 50%; background: var(--ink-100); margin: 0 auto 12px; transition: background .08s; }
.metro-dot.beat { background: var(--red); transform: scale(1.12); }
.timer-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* checklist builder */
.checklist-group { margin-bottom: 16px; }
.checklist-group > summary {
  cursor: pointer; font-weight: 800; padding: 12px 14px; background: var(--green-50);
  border: 1px solid var(--green-100); border-radius: var(--radius); list-style: none;
  display: flex; justify-content: space-between; align-items: center; min-height: 46px;
}
.checklist-group > summary::-webkit-details-marker { display: none; }
.checklist-group .cg-body { padding: 8px 6px; }
.cg-item { display: flex; gap: 10px; align-items: center; padding: 11px 8px; border-bottom: 1px solid var(--ink-100); }
.cg-item:last-child { border-bottom: 0; }
.cg-item input { width: 22px; height: 22px; accent-color: var(--green-700); flex: none; }
.cg-item .cg-name { flex: 1 1 auto; min-width: 0; font-size: .9rem; }
.cg-item .cg-qty { flex: 0 1 auto; min-width: 0; font-size: .78rem; color: var(--ink-500); text-align: right; overflow-wrap: anywhere; }
.cg-item .cg-w { font-size: .76rem; color: var(--ink-400); width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.progress { height: 10px; background: var(--ink-100); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-700)); border-radius: 999px; transition: width .25s ease; }

/* dynamic rows editor */
.row-editor { display: grid; gap: 8px; }
.row-editor .re-head, .re-row { display: grid; grid-template-columns: 1fr 110px 120px 44px; gap: 8px; align-items: center; }
.re-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-500); padding: 0 2px; }
.re-row input, .re-row select { min-height: 42px; font-size: .9rem; }
.re-row .re-del { width: 40px; height: 40px; border: 0; border-radius: var(--radius-s); background: #fdecea; color: var(--red); cursor: pointer; font-size: 1rem; }
@media (max-width: 560px) {
  .re-head { display: none; }
  .re-row { grid-template-columns: 1fr 1fr; }
  .re-row input:first-child { grid-column: 1 / -1; }
}

/* ---------- Prose / static content ---------- */
.prose { font-size: 1rem; color: var(--ink-700); max-width: 760px; overflow-wrap: break-word; }
.prose code, .prose a, .panel.sources a, .panel.sources code, .toc a { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.45rem; margin: 1.6em 0 .55em; padding-top: .4em; }
.prose h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--amber); background: var(--paper); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--ink-700); }
.prose figure { margin: 1.4em 0; }
.prose figure img { border-radius: var(--radius); box-shadow: var(--shadow-s); width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.prose figcaption { font-size: .8rem; color: var(--ink-500); margin-top: 7px; text-align: center; }
.prose .lead { font-size: 1.12rem; color: var(--ink-900); }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 26px 0; }
@media (min-width: 1024px) { .content-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } .content-side { position: sticky; top: calc(var(--topbar-h) + 16px); } }

/* TOC */
.toc { background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 16px 18px; font-size: .88rem; }
.toc b { display: block; margin-bottom: 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-500); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--ink-700); }

/* sources */
.sources { font-size: .86rem; }
.sources li { margin-bottom: 7px; }

/* FAQ */
.faq details { border: 1px solid var(--ink-100); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 15px 18px; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.faq details[open] summary { border-bottom: 1px solid var(--ink-100); }
.faq .faq-a { padding: 14px 18px; color: var(--ink-500); font-size: .92rem; }

/* disclaimer */
.disclaimer {
  display: flex; gap: 12px; background: var(--paper-2); border: 1px dashed var(--ink-200);
  border-radius: var(--radius); padding: 14px 16px; font-size: .86rem; color: var(--ink-700); margin: 18px 0;
}
.disclaimer b { color: var(--red-d); }
.emergency-strip {
  display: flex; gap: 12px; align-items: center; background: var(--red); color: #fff;
  border-radius: var(--radius); padding: 12px 16px; font-size: .9rem; margin-bottom: 16px; font-weight: 600;
}
.emergency-strip a { color: #fff; text-decoration: underline; }

/* ---------- Share ---------- */
.tool-disclaimer { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--paper); border-left: 3px solid var(--amber); font-size: .8rem; line-height: 1.5; color: var(--ink-600); }
.tool-disclaimer.is-medical { border-left-color: #b3271f; background: #fcf2f1; }

.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.share-row span.cap { font-size: .82rem; font-weight: 700; color: var(--ink-500); margin-right: 4px; }
.share-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ink-200); background: #fff;
  display: grid; place-items: center; cursor: pointer; font-size: 1.05rem; color: var(--ink-700);
}
.share-btn:hover { border-color: var(--green-600); color: var(--green-700); }

/* related cards */
.related-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related-grid.three { grid-template-columns: repeat(3, 1fr); } }
.mini-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 10px 12px; color: var(--ink-900); }
.mini-card:hover { text-decoration: none; border-color: var(--green-500); }
.mini-card .mc-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--green-50); display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.mini-card b { font-size: .9rem; display: block; }
.mini-card span { font-size: .78rem; color: var(--ink-500); }

/* prev-next */
.prev-next { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 28px 0 8px; }
@media (min-width: 720px) { .prev-next { grid-template-columns: 1fr 1fr; } }
.pn-card { border: 1px solid var(--ink-100); border-radius: var(--radius); background: #fff; padding: 14px 16px; color: var(--ink-900); }
.pn-card:hover { text-decoration: none; border-color: var(--green-500); }
.pn-card .pn-dir { font-size: .74rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-500); }
.pn-card.next { text-align: right; }

/* ---------- Newsletter / CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--green-800), var(--green-700));
  color: #fff; border-radius: var(--radius-l); padding: 34px 28px; text-align: center; margin: 30px 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 560px; margin: 0 auto 18px; }
.cta-band form { display: flex; gap: 8px; max-width: 460px; margin: 0 auto; }
.cta-band input { flex: 1; min-width: 0; min-height: 48px; border: 0; border-radius: 999px; padding: 0 18px; font-size: .98rem; }
.cta-band .fine { font-size: .76rem; color: rgba(255,255,255,.75); margin-top: 12px; }
@media (max-width: 480px) { .cta-band form { flex-direction: column; } }

/* trust strip */
.trust { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-top: 26px; }
@media (min-width: 768px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust div { text-align: center; font-size: .84rem; color: rgba(255,255,255,.92); }
.trust .t-ico { font-size: 1.6rem; display: block; margin-bottom: 6px; }

/* ---------- Consent banner ---------- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px); z-index: 120;
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-l);
  box-shadow: var(--shadow-l); padding: 16px 18px; display: none; max-width: 760px; margin: 0 auto;
}
@media (min-width: 1024px) { .consent { bottom: 18px; } }
.consent.show { display: block; }
.consent p { font-size: .84rem; color: var(--ink-700); margin: 0 0 12px; }
.consent .consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { background: var(--green-900); color: rgba(255,255,255,.82); margin-top: 56px; padding: 42px 0 22px; font-size: .88rem; }
.footer a { color: rgba(255,255,255,.82); }
.footer-grid { display: grid; gap: 26px; grid-template-columns: 1fr; margin-bottom: 26px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; } }
.footer h4 { color: #fff; font-size: .82rem; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer .foot-brand { display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.footer .foot-brand img { width: 32px; height: 32px; border-radius: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: .78rem; color: rgba(255,255,255,.6); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state .es-ico { font-size: 3rem; display: block; margin-bottom: 12px; }
.ad-slot:empty { display: none; }
.ad-slot { min-height: 0; margin: 18px 0; text-align: center; }
.ad-slot[data-filled="1"] { border: 1px dashed var(--ink-200); border-radius: var(--radius); padding: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: .9rem; }
.kv dt { font-weight: 700; color: var(--ink-900); }
.kv dd { margin: 0; color: var(--ink-500); }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 18px; } .mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.small { font-size: .82rem; color: var(--ink-500); }
.tagline-zh { letter-spacing: 2px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: rgba(255,255,255,.85); position: relative; z-index: 1; }
.article-meta span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Language visibility ---------- */
/* :lang() matches BCP-47 tags such as zh-CN set by i18n.setLang, unlike [lang="zh"] */
[data-lang="zh"] { display: none; }
html:lang(zh) [data-lang="en"] { display: none; }
html:lang(zh) [data-lang="zh"] { display: revert; }
/* block-level bilingual blocks */
html:lang(en) [data-lang-block="zh"] { display: none !important; }
html:lang(zh) [data-lang-block="en"] { display: none !important; }

/* ---------- Form engine supplements ---------- */
.tool-form__bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tool-form__controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-form__bar .tabs { margin-bottom: 0; border-bottom: 0; }
@media (min-width: 680px) { .fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; } }
.fields-grid .field { break-inside: avoid; }
.num-wrap { display: flex; align-items: center; gap: 8px; }
.num-wrap input { flex: 1; min-width: 0; }
.segmented span small { display: block; font-size: .7rem; font-weight: 400; opacity: .82; }
.segmented label { display: flex; }
.data-table td small { display: block; color: var(--ink-400); font-size: .74rem; margin-top: 2px; }
.tool-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.tool-actions .fav-btn { position: static; width: 42px; height: 42px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.donut { display: grid; place-items: center; }
.meter-wrap { margin: 4px 0 12px; }
.stat em { display: block; font-size: .72rem; color: var(--ink-500); font-style: normal; margin-top: 2px; }
.range-val { line-height: 1.2; }

/* ---------- Dynamic rows editor ---------- */
.field-rows { grid-column: 1 / -1; }
.rows-scroll { min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.rows-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 380px; }
.rows-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-500); font-weight: 600; padding: 8px 10px; background: var(--cream-50, #f7f5ef); }
.rows-table td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.rows-table td .num-wrap { gap: 4px; }
.rows-table td .suffix { font-size: .76rem; color: var(--ink-500); white-space: nowrap; }
.rows-table input, .rows-table select { min-height: 40px; padding: 6px 8px; font-size: .88rem; }
.rows-table input[type="number"] { width: 88px; }
.rows-ops { width: 42px; text-align: center; }
.rows-del { min-width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--red);
  font-size: .85rem; cursor: pointer; border-radius: 8px; }
.rows-del:hover { background: rgba(192,57,43,.08); }
.rows-add { margin-top: 8px; }
.field textarea { width: 100%; min-height: 84px; resize: vertical; font-family: inherit; line-height: 1.5; }

/* ---------- Interactive tool widgets (timers, players, checklist output) ---------- */
.timer-big { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center;
  color: var(--green-900); letter-spacing: .02em; margin: 6px 0 2px; }
.timer-big.is-over { color: var(--red); }
.timer-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.tick-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-300, #bbb);
  margin: 0 3px; }
.tick-dot.on { background: var(--red); }
.checklist-out { list-style: none; margin: 8px 0; padding: 0; }
.checklist-out li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.checklist-out li:last-child { border-bottom: 0; }
.checklist-out input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--green-700); }
.checklist-out .ci-qty { font-size: .74rem; font-weight: 700; color: var(--green-800); background: var(--green-100);
  border-radius: 999px; padding: 1px 9px; margin-left: 6px; white-space: nowrap; }
.checklist-out .ci-g { color: var(--ink-500); font-size: .78rem; white-space: nowrap; margin-left: auto; }
.checklist-out li.done label { text-decoration: line-through; color: var(--ink-500); }
.kit-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500);
  font-weight: 700; margin: 14px 0 2px; }
.progress-bar-big { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0; }
.progress-bar-big i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-500)); }
.morse-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 200; transition: opacity 40ms linear; }
.morse-flash.on { opacity: 1; }
.morse-code-out { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; letter-spacing: .18em;
  word-break: break-all; background: var(--cream-50, #f7f5ef); border-radius: 10px; padding: 12px; }

/* ---------- Print ---------- */
@media print {
  .topbar, .tabbar, .footer, .consent, .share-row, .fav-btn, .ad-slot,
  .cta-band, .search-hero, .hero__cta, .toolbar, .no-print { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .panel, .verdict, .alert { box-shadow: none; break-inside: avoid; }
  .tool-grid, .content-layout { display: block; }
  .tool-grid__results { position: static; }
  a { color: #000; }
  .page-hero::after { background: rgba(255,255,255,.85); }
  .page-hero h1, .page-hero p { color: var(--green-900); text-shadow: none; }
}
