/* ============================================================
   阳光导航 · 样式表
   ------------------------------------------------------------
   结构：
     1. 设计令牌（暖橙浅色一套，不做深色）
     2. 基础重置
     3. 顶栏（站名 + 靠右的搜索按钮）
     4. 两栏外壳 + 左侧分类目录
     5. 小屏分类快捷条
     6. 首屏
     7. 分类区块与卡片栅格
     8. 常见问题 / 关于本站
     9. 页脚与回顶
    10. 响应式 / 打印 / 无障碍
   想换主色：只改 --brand / --brand-ink / --brand-soft 三处即可。
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: light;
  --bg: #fdfaf5;
  --surface: #ffffff;
  --surface-2: #f7f1e8;
  --line: #ece3d7;
  --line-2: #ddd1bf;
  --text: #241d15;
  --text-2: #4d4237;
  --muted: #7f7466;
  --brand: #f0861c;
  --brand-ink: #b85d06;
  --brand-soft: #fff3e1;
  --brand-line: #ffd7a3;

  --radius: 13px;
  --radius-lg: 18px;
  --sh1: 0 1px 2px rgba(60, 40, 15, .05);
  --sh2: 0 8px 22px -8px rgba(90, 60, 20, .18);
  --sh3: 0 16px 42px -14px rgba(90, 60, 20, .26);
  --ring: 0 0 0 3px rgba(240, 134, 28, .22);

  --hdr-h: 64px;
  --wrap: 1320px;

  /* 站点首字徽章的 8 组配色 */
  --c0-fg:#b85d06; --c0-bg:#fff3e1;
  --c1-fg:#7c4ddb; --c1-bg:#f3edff;
  --c2-fg:#d6356e; --c2-bg:#ffecf3;
  --c3-fg:#d94141; --c3-bg:#ffeceb;
  --c4-fg:#0f8f6d; --c4-bg:#e5f8f1;
  --c5-fg:#2f6bd8; --c5-bg:#eaf1ff;
  --c6-fg:#0a7fa0; --c6-bg:#e3f6fb;
  --c7-fg:#5b5bd6; --c7-bg:#ededfd;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* 任何带 hidden 属性的元素都必须真的隐藏 ——
   否则会被下面更具体的 display 规则（如 .totop{display:grid}）反压过去 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC",
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 9px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 9px 15px; border-radius: 0 0 9px 0;
}
.skip:focus { left: 0; }

/* ---------- 3. 顶栏 ---------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.hdr-in {
  max-width: var(--wrap);
  margin: 0 auto;
  min-height: var(--hdr-h);
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; }
.brand-logo { display: flex; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-nm { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.brand-tag { font-size: 11.5px; color: var(--muted); font-style: normal; letter-spacing: .3px; }

.hdr-tools {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex: none; position: relative;
}

.btn {
  height: 38px; padding: 0 13px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn .ico { width: 18px; height: 18px; display: block; flex: none; }
.btn kbd {
  font-family: inherit; font-size: 11px; line-height: 1;
  padding: 3px 5px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); }
/* 搜索：平时只是一颗按钮，点一下才出输入框 */
.searchbox > summary { list-style: none; cursor: pointer; }
.searchbox > summary::-webkit-details-marker { display: none; }
.searchbox[open] > summary {
  background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink);
}

.search-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(400px, calc(100vw - 32px));
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--sh3);
  z-index: 70;
}

.search { position: relative; }
.search input {
  width: 100%; height: 42px; padding: 0 40px 0 14px;
  border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface-2); color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring); background: var(--surface);
}
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 25px; height: 25px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: 15px; line-height: 1;
}
.search-clear:hover { background: var(--line); color: var(--text); }

/* ---------- 4. 两栏外壳 ---------- */
.shell {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px 44px;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.side {
  position: sticky;
  top: calc(var(--hdr-h) + 14px);
  max-height: calc(100vh - var(--hdr-h) - 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 0 12px;
  scrollbar-width: thin;
}
.side-cap {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 8px;
  font-size: 12px; color: var(--muted); letter-spacing: .6px;
}
.side-n {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-i {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border-radius: 9px;
  font-size: 13px; color: var(--text-2);
  transition: background .14s, color .14s, opacity .14s;
}
.side-i .side-ico { font-size: 14px; line-height: 1; flex: none; }
.side-i .side-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-i b {
  margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.side-i:hover { background: var(--surface-2); }
.side-i.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.side-i.is-active b { color: var(--brand-ink); }
.side-i.is-dim { opacity: .32; }

.main { min-width: 0; }

/* ---------- 5. 小屏分类快捷条 ---------- */
.chips { display: none; }

/* ---------- 6. 首屏 ---------- */
.hero {
  margin: 22px 0 26px;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 64%);
  box-shadow: var(--sh1);
}
.hero-h1 {
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.32;
}
.hero-sub { margin-top: 9px; max-width: 760px; color: var(--muted); font-size: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 18px; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats b {
  font-size: 20px; font-weight: 800; color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}
.hero-stats span { font-size: 12px; color: var(--muted); }

/* ---------- 7. 分类区块与卡片 ---------- */
.cats { display: flex; flex-direction: column; gap: 38px; }

.cat-head {
  margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.cat h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; letter-spacing: -.2px;
}
.cat-ico { font-size: 17px; line-height: 1; }
.cat-n {
  display: inline-grid; place-items: center; min-width: 22px; height: 19px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.cat-desc { margin-top: 7px; max-width: 920px; color: var(--muted); font-size: 13px; line-height: 1.72; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}

.card { min-width: 0; }

.card-a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-height: 66px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh1);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card-a::after {
  content: "↗";
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--brand); opacity: 0;
  transition: opacity .16s ease;
}
.card-a:hover {
  transform: translateY(-2px);
  border-color: var(--brand-line);
  box-shadow: var(--sh2);
}
.card-a:hover::after { opacity: 1; }
.card-a:active { transform: translateY(0); }

.card-ico {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-size: 16px; font-weight: 700;
  background: var(--c0-bg); color: var(--c0-fg);
  user-select: none;
}
.card-ico[data-c="1"] { background: var(--c1-bg); color: var(--c1-fg); }
.card-ico[data-c="2"] { background: var(--c2-bg); color: var(--c2-fg); }
.card-ico[data-c="3"] { background: var(--c3-bg); color: var(--c3-fg); }
.card-ico[data-c="4"] { background: var(--c4-bg); color: var(--c4-fg); }
.card-ico[data-c="5"] { background: var(--c5-bg); color: var(--c5-fg); }
.card-ico[data-c="6"] { background: var(--c6-bg); color: var(--c6-fg); }
.card-ico[data-c="7"] { background: var(--c7-bg); color: var(--c7-fg); }

/* 有真图标时底色换成中性色，让图标本身干净地显出来 */
.card-ico.has-img { background: var(--surface-2); overflow: hidden; }
.card-ico.has-img img { width: 20px; height: 20px; object-fit: contain; display: block; }

.card-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-right: 12px; }
.card-nm {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-dc {
  font-size: 12px; color: var(--muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-a:hover .card-nm { color: var(--brand-ink); }

/* 搜索筛掉的卡片与分类 */
.card.is-hit .card-a { border-color: var(--brand); }
.card.is-dim { display: none; }
.cat.is-empty { display: none; }

.hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.empty { margin: 56px auto; text-align: center; color: var(--muted); font-size: 14.5px; }

/* ---------- 8. 常见问题 / 关于本站 ---------- */
.qa-wrap, .about { margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line); }
.blk-h { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

.qa-list { display: flex; flex-direction: column; gap: 10px; }
.qa {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.qa > summary {
  position: relative;
  list-style: none; cursor: pointer;
  padding: 14px 46px 14px 16px;
  font-size: 14px; font-weight: 600;
  transition: color .15s;
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::after {
  content: "+";
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--brand-ink); font-size: 19px; font-weight: 400; line-height: 1;
}
.qa[open] > summary { color: var(--brand-ink); }
.qa[open] > summary::after { content: "−"; }
.qa-a { border-top: 1px dashed var(--line); padding: 0 16px 15px; }
.qa-a p { padding-top: 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.85; }

.about p {
  max-width: 980px;
  margin-bottom: 10px;
  color: var(--text-2); font-size: 13.5px; line-height: 1.9;
}

/* ---------- 9. 页脚与回顶 ---------- */
.ft { margin-top: 46px; border-top: 1px solid var(--line); background: var(--surface); }
.ft-in { max-width: var(--wrap); margin: 0 auto; padding: 26px 20px 34px; text-align: center; }
.ft-note { max-width: 780px; margin: 0 auto; color: var(--muted); font-size: 13px; }
.ft-meta { margin-top: 9px; color: var(--text-2); font-size: 13px; }
.ft-meta b { color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.ft-copy { margin-top: 9px; color: var(--muted); font-size: 12.5px; }

.totop {
  position: fixed; right: 22px; bottom: 26px; z-index: 50;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--sh2);
  transition: background .15s, color .15s;
}
.totop svg { width: 19px; height: 19px; display: block; }
.totop:hover { background: var(--brand); color: #fff; border-color: transparent; }

/* ---------- 10. 响应式 / 打印 / 无障碍 ---------- */
/* ---------- 10. 分类独立页 / 提交收录页 / 最近访问 ---------- */

/* 子页不用左栏：内容就一个分类，再留 238px 会挤；
   而且左栏项是「回首页的锚点」，放子页里容易让人以为留在本页。 */
.shell.is-single { grid-template-columns: minmax(0, 1fr); }

/* 面包屑 */
.crumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 22px 0 -4px;
  font-size: 13px; color: var(--muted);
}
.crumb a { color: var(--brand-ink); }
.crumb a:hover { text-decoration: underline; }
.crumb span[aria-hidden] { color: var(--line-2); }
.crumb-cur { color: var(--text-2); font-weight: 600; }
.hero-cat { margin-top: 14px; }

/* 分类页的独立引言：每页独一份，否则分类页会被判成首页的重复内容 */
.intro {
  margin: 4px 0 26px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 12px;
  background: var(--surface);
}
.intro p { color: var(--text-2); font-size: 14px; line-height: 1.95; }

/* 首页分类标题右侧的「查看分类页」 */
.cat-more {
  margin-left: auto; flex: none;
  font-size: 12.5px; color: var(--brand-ink);
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--brand-line); background: var(--brand-soft);
  transition: background .14s, color .14s, border-color .14s;
}
.cat-more:hover { background: var(--brand); color: #fff; border-color: transparent; }

/* 左栏分组标题 */
.side-grp {
  margin: 12px 0 5px; padding: 0 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .8px;
  color: var(--brand-ink);
}
.side-grp:first-child { margin-top: 2px; }

/* 「其他分类」交叉内链 */
.more, .doc { margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line); }
.more-grp { margin-bottom: 16px; }
.more-cap { margin-bottom: 8px; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.more-list { display: flex; flex-wrap: wrap; gap: 8px; }
.more-list a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--text-2);
  transition: border-color .14s, color .14s, background .14s;
}
.more-list a:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.more-list a span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.more-list a.is-cur {
  background: var(--brand-soft); border-color: var(--brand-line);
  color: var(--brand-ink); font-weight: 600;
}
.more-list a.is-cur span { color: var(--brand-ink); }

/* 提交收录页的正文块 */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-list li {
  position: relative; padding-left: 22px;
  color: var(--text-2); font-size: 14px; line-height: 1.85;
}
.doc-list li::before {
  content: ""; position: absolute; left: 7px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.step-list { counter-reset: st; display: flex; flex-direction: column; gap: 14px; }
.step-list li { position: relative; padding-left: 40px; }
.step-list li::before {
  counter-increment: st; content: counter(st);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 13px; font-weight: 700;
}
.step-list b { display: block; font-size: 14.5px; }
.step-list span { color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.doc-mail p { color: var(--text-2); font-size: 14px; line-height: 1.85; }
.mail-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; }
.mail {
  font-size: 16px; font-weight: 700; color: var(--brand-ink);
  padding: 8px 14px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.copy-btn {
  height: 34px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; color: var(--text-2);
}
.copy-btn:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.copy-btn.is-done { background: var(--brand); color: #fff; border-color: transparent; }
.doc-note { color: var(--muted); font-size: 12.5px; line-height: 1.8; }

/* 最近访问 */
.recent { margin: 0 0 22px; }
.recent-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.recent-head .blk-h { margin-bottom: 0; font-size: 15px; }
.recent-clr {
  margin-left: auto; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; color: var(--muted);
}
.recent-clr:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list a {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 210px; padding: 7px 12px 7px 8px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); font-size: 13px; color: var(--text-2);
  transition: border-color .14s, box-shadow .14s;
}
.recent-list a:hover { border-color: var(--brand-line); box-shadow: var(--sh1); }
.recent-list img { width: 18px; height: 18px; border-radius: 5px; object-fit: contain; flex: none; }
.recent-list .rl-badge {
  flex: none; width: 18px; height: 18px; border-radius: 5px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  /* 首字徽章统一用品牌色：这里只有 18px，做 8 色区分反而看不清 */
  background: var(--brand-soft); color: var(--brand-ink);
}
.recent-list .rl-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 顶栏的「提交收录」与子页搜索表单 */
.btn-sub { text-decoration: none; }
.btn-sub:hover { border-color: var(--brand-line); color: var(--brand-ink); background: var(--brand-soft); }
.search-top {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 6px 0 12px;
  border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface);
}
.search-top input {
  width: 190px; height: 100%; border: 0; background: transparent;
  font: inherit; font-size: 13.5px; color: var(--text); outline: none;
}
.search-top input::placeholder { color: var(--muted); }
.search-top input::-webkit-search-cancel-button { display: none; }
.search-top:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.search-go {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px;
  display: grid; place-items: center; background: transparent; color: var(--muted);
}
.search-go .ico { width: 16px; height: 16px; }
.search-go:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* 搜索时的键盘高亮 */
.card.is-cur .card-a { border-color: var(--brand); box-shadow: var(--ring); }

/* 屏外区块跳过渲染。317 张卡片在手机上要滚近 2.9 万像素，
   97% 的内容从头到尾没人看见，全部渲染是纯浪费。
   contain-intrinsic-size 用 auto + 估算值：渲染过的区块记住真实高度，
   第一次遇到才用估算值，所以估得准不准只影响首次。 */
.cats .cat {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

@media (max-width: 1023px) {
  html { scroll-padding-top: calc(var(--hdr-h) + 62px); }

  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { display: none; }

  /* 分类快捷条：吸在顶栏下面 */
  .chips {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: var(--hdr-h); z-index: 50;
    margin: 0 -20px 20px;
    padding: 0 20px;
    height: 48px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .chips::-webkit-scrollbar { display: none; }
}

.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px; white-space: nowrap;
  transition: background .15s, color .15s, opacity .15s;
}
.chip span { color: var(--muted); font-size: 11.5px; }
.chip:hover { background: var(--brand-soft); color: var(--brand-ink); }
.chip:hover span { color: var(--brand-ink); }
.chip.is-active { background: var(--brand); color: #fff; }
.chip.is-active span { color: rgba(255, 255, 255, .8); }
.chip.is-dim { opacity: .38; }

@media (max-width: 860px) {
  .brand-tag { display: none; }
  .hero { padding: 20px 18px 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  .hdr-in { padding: 9px 14px; gap: 10px; }
  .shell { padding: 0 14px 36px; }
  .chips { margin: 0 -14px 18px; padding: 0 14px; }
  .btn-tx, .btn kbd { display: none; }
  .btn-search { width: 38px; padding: 0; justify-content: center; }
  .hero-h1 { font-size: 20px; }
  .hero-stats { gap: 20px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .search-panel { width: calc(100vw - 28px); }
  .totop { right: 14px; bottom: 16px; }
}

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

@media print {
  .hdr, .side, .chips, .totop, .btn { display: none; }
  body { background: #fff; }
  .card-a { box-shadow: none; }
  .hero { background: #fff; }
}

/* ---------- 12. 分屏下的补充（新增组件的适配） ---------- */
@media (max-width: 1023px) {
  /* 每类高度随列数变化，估算值跟着调，减少首次滚动的跳动 */
  .cats .cat { contain-intrinsic-size: auto 720px; }
}
@media (max-width: 640px) {
  .cats .cat { contain-intrinsic-size: auto 1020px; }
  .cat-more { font-size: 11.5px; padding: 2px 8px; }
  .search-top input { width: 104px; }
  .mail { font-size: 14px; }
  .crumb { margin-top: 16px; }
  .more, .doc { margin-top: 32px; padding-top: 22px; }
}
