/* ============================================================
   Tag Atlas · v3
   Dark “field guide” first; light theme mirrors it on paper.
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --bg: #0c0e0b;
  --bg-2: #10130e;
  --panel: #151912;
  --panel-2: #1b2017;
  --line: #2a3125;
  --line-2: #3b4533;
  --ink: #edf2df;
  --ink-2: #b3bca2;
  --muted: #7d876f;
  --accent: #c9f26b;
  --accent-2: #a4d545;
  --accent-ink: #101408;
  --warn: #f2c46b;
  --danger: #f27b6b;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --top: 64px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f2f1e8;
  --bg-2: #eae8dc;
  --panel: #fbfaf3;
  --panel-2: #f4f2e7;
  --line: #d8d4c4;
  --line-2: #bfb9a3;
  --ink: #171a12;
  --ink-2: #4e5445;
  --muted: #767c6b;
  --accent: #5b8a00;
  --accent-2: #3f6b00;
  --accent-ink: #f8f9ef;
  --warn: #9a6b00;
  --danger: #b23b2b;
  color-scheme: light;
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--accent);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; }
.brand-text i { font-style: normal; font-size: 10.5px; color: var(--muted); letter-spacing: .08em; margin-top: 4px; }

.search {
  flex: 1 1 auto;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.search-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}
.search input::placeholder { color: var(--muted); }
.search kbd {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--bg-2);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
#themeBtn .i-sun { display: none; }
html[data-theme="light"] #themeBtn .i-sun { display: block; }
html[data-theme="light"] #themeBtn .i-moon { display: none; }
.lib-link {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.lib-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 344px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}
.side {
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  overflow: auto;
  padding: 26px 18px 40px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.main { padding: 34px 34px 90px; min-width: 0; }
.bench {
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  overflow: auto;
  padding: 24px 20px 40px;
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  scrollbar-width: thin;
}

.kicker {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.side h2, .bench h2, .sec-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.01em;
}
.side h2 { font-size: 20px; }
.bench h2 { font-size: 24px; }
.sec-head h2 { font-size: 26px; }

/* ---------- side ---------- */

.side-head { margin-bottom: 18px; }
.cat-list { display: flex; flex-direction: column; gap: 1px; margin: 0 0 24px; }
.cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color .12s;
}
.cat:hover { background: var(--panel); color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--panel-2); border-color: var(--line-2); color: var(--accent); }
.cat-count { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.cat[aria-pressed="true"] .cat-count { color: var(--accent); }
.cat-all { color: var(--ink); }

.side-block { padding: 18px 0; border-top: 1px solid var(--line); }
.side-block:first-of-type { border-top: 0; }
.switch {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
}
.switch i {
  width: 30px;
  height: 17px;
  flex: none;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  position: relative;
  transition: border-color .15s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s;
}
.switch[aria-pressed="true"] { color: var(--ink); }
.switch[aria-pressed="true"] i { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.switch[aria-pressed="true"] i::after { transform: translateX(13px); background: var(--accent); }

.side-stats dl { margin: 10px 0 0; display: grid; gap: 5px; }
.side-stats dl div { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.side-stats dt { margin: 0; }
.side-stats dd { margin: 0; font-family: var(--mono); color: var(--ink-2); }

.side-links { display: flex; flex-direction: column; gap: 7px; }
.side-links a { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.side-links a:hover { color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -34px -34px auto -34px;
  height: 260px;
  background:
    radial-gradient(60% 80% at 20% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--line) 55%, transparent) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--line) 55%, transparent) 23px 24px);
  mask-image: linear-gradient(#000 0 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.hero-copy, .hero-mark { position: relative; z-index: 1; }
.hero-copy { max-width: 720px; }
.hero h1 {
  margin: 10px 0 14px;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.025em;
}
.hero p { margin: 0; max-width: 560px; color: var(--ink-2); font-size: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; }
.hero-stats span { font-size: 11.5px; color: var(--muted); }
.hero-stats b { font-family: var(--mono); font-size: 15px; color: var(--accent); margin-right: 4px; }

.hero-mark { flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 12px; }
.crosshair { position: relative; width: 92px; height: 92px; border: 1px solid var(--line-2); border-radius: 50%; }
.ch-x, .ch-y { position: absolute; background: var(--line-2); }
.ch-x { left: 50%; top: -14px; bottom: -14px; width: 1px; }
.ch-y { top: 50%; left: -14px; right: -14px; height: 1px; }
.ch-c { position: absolute; inset: 32px; border: 1px solid var(--accent); border-radius: 50%; }
.ch-c::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--accent); opacity: .9; }
.hero-mark code { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }

/* ---------- sections ---------- */

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.sec-head p { margin: 0; font-size: 12px; color: var(--muted); }
.recipe-tools { display: flex; align-items: center; gap: 12px; }
.recipe-nav { display: flex; gap: 4px; }
.nav-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1;
  transition: border-color .15s, color .15s;
}
.nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.recipes { padding: 30px 0 34px; border-bottom: 1px solid var(--line); }

.recipe-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  cursor: grab;
}
.recipe-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.recipe-list.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
.recipe-list::-webkit-scrollbar { height: 6px; }
.recipe-list::-webkit-scrollbar-track { background: transparent; }
.recipe-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.recipe-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.recipe {
  flex: 0 0 248px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .15s, transform .15s;
}
.recipe:hover { border-color: var(--line-2); transform: translateY(-2px); }
.recipe-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.recipe-index { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: .1em; }
.recipe h3 { margin: 0; font-size: 15px; font-weight: 600; }
.recipe h3 span { display: block; font-family: var(--mono); font-size: 9.5px; font-weight: 400; letter-spacing: .07em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.recipe p { margin: 0; font-size: 11.5px; color: var(--ink-2); min-height: 34px; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.recipe-tags span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.recipe-apply {
  margin-top: auto;
  height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  transition: border-color .15s;
}
.recipe-apply:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.catalog { padding-top: 30px; }
.catalog-head { margin-bottom: 14px; }
.catalog-meta { display: flex; align-items: center; gap: 14px; }
.catalog-meta span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.text-btn {
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--accent); }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-filters button {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  background: var(--panel);
  color: var(--ink-2);
}
.active-filters button b { color: var(--accent); font-weight: 600; }

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 8px;
}
.tag {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 92px;
  padding: 11px 11px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  transition: border-color .13s, transform .13s;
  overflow: hidden;
}
.tag:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag-en {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
  padding-right: 18px;
}
.tag-zh { font-size: 12.5px; color: var(--ink-2); }
.tag[aria-pressed="true"] .tag-zh { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
.tag-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  font-size: 9.5px;
  color: var(--muted);
}
.tag-meta .cat-chip { letter-spacing: .04em; }
.tag-meta code {
  font-family: var(--mono);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.tag[aria-pressed="true"] .tag-meta { color: color-mix(in srgb, var(--accent-ink) 62%, transparent); }
.tag[aria-pressed="true"] .tag-meta code { border-color: color-mix(in srgb, var(--accent-ink) 28%, transparent); color: inherit; }
.tag-flag {
  position: absolute;
  top: 9px;
  right: 9px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .06em;
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  border-radius: 4px;
  padding: 0 4px;
}
.tag[aria-pressed="true"] .tag-flag { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 35%, transparent); }
.tag.is-nsfw { border-style: dashed; }

.more-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 0 0; }
.more-btn {
  height: 36px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12.5px;
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }
.empty { margin: 30px 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- bench ---------- */

.bench-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.bench-head > div { flex: 1; }
.bench-close { display: none; }
.bench-head .text-btn { margin-top: 4px; white-space: nowrap; }

.selected { display: flex; flex-wrap: wrap; gap: 5px; }
.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 4px 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
}
.sel-chip em { font-style: normal; font-family: var(--sans); font-size: 10px; color: var(--muted); }
.sel-chip button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.sel-chip button:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.bench-empty {
  margin: 4px 0 18px;
  padding: 18px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.field { display: block; margin: 14px 0 0; }
.field > span {
  display: block;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .prompt-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  outline: 0;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .prompt-box textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.field textarea { min-height: 58px; }
.field select {
  width: 100%;
  height: 32px;
  margin-bottom: 0;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  color: var(--ink);
  font-size: 11.5px;
  outline: 0;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.prompt-box { margin-top: 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; }
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.prompt-head span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: var(--accent); }
.copy-btn {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 600;
}
.copy-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.prompt-box textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 132px;
  font-size: 11.5px;
}
.prompt-box textarea:focus { box-shadow: none; }

.bench-actions { display: flex; gap: 6px; margin-top: 9px; }
.bench-actions .copy-btn { flex: 1; height: 32px; font-size: 11.5px; }
.bench-actions .ghost-btn { flex: 0 0 96px; }
.ghost-btn {
  flex: 1;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.bench-note { margin: 12px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ---------- fab / backdrop / toast ---------- */

.bench-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}
.bench-fab b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-ink);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
}
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translate(-50%, 16px);
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */

.foot {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 34px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}
.foot b { font-family: var(--mono); letter-spacing: .1em; color: var(--ink-2); font-size: 10px; }
.foot span { display: block; max-width: 780px; margin-top: 4px; line-height: 1.7; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--accent); }
.foot-right { display: flex; gap: 14px; flex: none; }

/* ---------- responsive ---------- */

@media (max-width: 1320px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr) 320px; }
  .main { padding: 30px 26px 80px; }
}

@media (max-width: 1160px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .bench {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(78vh, 720px);
    z-index: 60;
    border-left: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 18px 18px 0 0;
    transform: translateY(104%);
    pointer-events: none;
    transition: none;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
  }
  .bench.open { transform: none; pointer-events: auto; transition: transform .22s ease; }
  .bench-close { display: grid; }
  .bench-fab { display: inline-flex; align-items: center; }
  .bench-head .text-btn { margin-top: 0; }
}

@media (max-width: 860px) {
  :root { --top: 58px; }
  .top { gap: 12px; padding: 0 14px; }
  .brand-text i { display: none; }
  .lib-link { padding: 0 9px; font-size: 11.5px; }
  .search { max-width: none; }
  .search kbd { display: none; }
  .layout { display: block; }
  .side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 14px 12px;
    overflow: visible;
  }
  .side-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
  .side h2 { font-size: 16px; }
  .cat-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    scrollbar-width: thin;
  }
  .cat {
    width: auto;
    flex: none;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 5px 10px;
    font-size: 11.5px;
  }
  .side-block { display: none; }
  .side-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 4px;
    border-top: 0;
  }
  .side-filters .kicker { display: none; }
  .side-filters .switch {
    width: auto;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    font-size: 11.5px;
  }
  .side-filters .switch i { width: 26px; height: 15px; }
  .side-filters .switch i::after { width: 9px; height: 9px; }
  .side-filters .switch[aria-pressed="true"] i::after { transform: translateX(11px); }
  .main { padding: 22px 14px 110px; }
  .hero { display: block; padding-bottom: 22px; }
  .hero::before { inset: -22px -14px auto -14px; }
  .hero h1 { font-size: 34px; }
  .hero-mark { display: none; }
  .hero-stats { gap: 12px; margin-top: 16px; }
  .sec-head { align-items: flex-start; }
  .sec-head h2 { font-size: 21px; }
  .sec-head p { display: none; }
  .recipe { flex-basis: 220px; }
  .tag-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .foot { display: block; padding: 20px 14px 90px; }
  .foot-right { margin-top: 12px; }
}

@media (max-width: 520px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 10px; }
  :root { --top: 104px; }
  .search { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .hero h1 { font-size: 30px; }
  .tag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag { min-height: 96px; }
  .foot { padding-bottom: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
