/* =========================================================
   守门的小窝 · 站点样式
   轻量静态站，无外部依赖
   ========================================================= */

:root {
  --bg: #f6f3ee;
  --bg-deep: #efeae2;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --ink: #1a222c;
  --ink-2: #3f4b58;
  --muted: #77828f;
  --line: #e5dfd5;
  --line-strong: #d6cec1;
  --brand: #2b6f8c;
  --brand-deep: #1c4f66;
  --brand-soft: #e4f0f5;
  --accent: #e89aae;
  --accent-soft: #fbeef1;
  --ok: #3f8f6b;
  --warn: #b9773a;
  --danger: #b3524a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(26, 34, 44, .04), 0 12px 32px -18px rgba(26, 34, 44, .28);
  --shadow-lg: 0 2px 4px rgba(26, 34, 44, .05), 0 28px 60px -30px rgba(26, 34, 44, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1160px;
}

[data-theme="dark"] {
  --bg: #11151a;
  --bg-deep: #0d1115;
  --surface: #171d24;
  --surface-2: #1b222a;
  --ink: #e9eef4;
  --ink-2: #c3ccd6;
  --muted: #8b98a6;
  --line: #262f39;
  --line-strong: #34404d;
  --brand: #74c1dd;
  --brand-deep: #a5d9ec;
  --brand-soft: #17303c;
  --accent: #e9a7b8;
  --accent-soft: #2a1c21;
  --ok: #6cc79a;
  --warn: #dfa96d;
  --danger: #e0857c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -20px rgba(0, 0, 0, .8);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 30px 60px -30px rgba(0, 0, 0, .9);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 480px at 12% -6%, rgba(43, 111, 140, .10), transparent 70%),
    radial-gradient(560px 420px at 92% 2%, rgba(232, 154, 174, .12), transparent 72%),
    radial-gradient(900px 500px at 50% 106%, rgba(43, 111, 140, .06), transparent 70%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(680px 480px at 12% -6%, rgba(116, 193, 221, .12), transparent 70%),
    radial-gradient(560px 420px at 92% 2%, rgba(233, 167, 184, .08), transparent 72%);
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
kbd {
  font-family: var(--mono);
  font-size: .85em;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-2);
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

mark { background: rgba(232, 154, 174, .38); color: inherit; border-radius: 3px; padding: 0 2px; }

::selection { background: rgba(43, 111, 140, .18); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.narrow { max-width: 820px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); flex: 0 0 auto; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), #3d8aa8);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(43, 111, 140, .9);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .02em; }
.brand-sub { font-size: 10.5px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }

.nav { display: flex; gap: 2px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink-2);
  font-size: 14.5px;
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand); color: #fff; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: none; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  white-space: nowrap;
  font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(26, 34, 44, .8);
}
[data-theme="dark"] .btn-primary { background: #e9eef4; color: #11151a; }
.btn-primary:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 14px 28px -14px rgba(26, 34, 44, .75); }
[data-theme="dark"] .btn-primary:hover { color: #11151a; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 60px;
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--line-strong);
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 64px);
  letter-spacing: -.035em;
  line-height: 1.06;
  font-weight: 800;
}
.hero h1 .thin { display: block; font-weight: 300; color: var(--muted); font-size: .46em; letter-spacing: .04em; margin-top: 14px; }
.hero-lead {
  margin-top: 24px;
  font-size: 17px;
  color: var(--ink-2);
  max-width: 33em;
}
.hero-meta {
  margin-top: 34px;
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hero-meta span { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

/* search */
.search-hero { margin-top: 30px; max-width: 520px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow);
}
.search-box svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 9px 0;
  outline: none;
}
.search-box input::placeholder { color: var(--muted); }
.search-box .btn { padding: 8px 16px; font-size: 13.5px; }
.search-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.search-hint a { color: var(--muted); text-decoration: underline dotted; text-underline-offset: 4px; }
.search-hint a:hover { color: var(--brand); }

/* chat mock */
.chat-mock {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
  transform: rotate(-.6deg);
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.chat-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.chat-head > div { min-width: 0; }
.chat-head .name {
  font-size: 13.5px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-head .sub { font-size: 11.5px; color: var(--muted); }
.chat-head .dot {
  margin-left: auto;
  font-size: 11px;
  color: var(--ok);
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
}
.chat-head .dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.chat-body { padding: 18px 4px 8px; display: flex; flex-direction: column; gap: 14px; min-height: 268px; }
.bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.7;
}
.bubble.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble.bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.bubble.bot code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--brand-soft);
  padding: 1px 5px;
  border-radius: 4px;
}
.bubble .cmd { color: var(--brand); font-family: var(--mono); }
.chat-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--muted);
  padding-top: 12px; border-top: 1px dashed var(--line);
}
.qr-float {
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 106px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
}
.qr-float img { border-radius: 6px; }
.qr-float span { display: block; text-align: center; font-size: 10px; color: var(--muted); margin-top: 4px; letter-spacing: .04em; }

/* ---------- ticker / notice ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--ink-2);
}
.notice .tag {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 9px;
  border-radius: 6px;
}
.notice p { flex: 1; }
.notice .arrow { color: var(--muted); flex: 0 0 auto; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.025em; }
.section-head p { color: var(--muted); font-size: 14.5px; margin-top: 10px; max-width: 46em; }
.section-head .link { font-size: 13.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.section-head .link svg { width: 14px; height: 14px; }
.page-head { padding: 54px 0 34px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.03em; }
.page-head p { margin-top: 14px; color: var(--ink-2); max-width: 48em; font-size: 16px; }
.page-head .meta { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.page-head .meta span { border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; background: var(--surface); }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
a.card { color: inherit; display: block; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); color: inherit; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 14px; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.entry-card { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.entry-card .ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.entry-card .ico svg { width: 20px; height: 20px; }
.entry-card .arrow { position: absolute; top: 26px; right: 24px; color: var(--muted); transition: transform .25s var(--ease); }
a.card:hover .arrow { transform: translateX(4px); color: var(--brand); }
.entry-card .arrow svg { width: 16px; height: 16px; }

/* ---------- QR / contact ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.qr-card { text-align: center; padding: 28px 24px; }
.qr-card .frame {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  display: inline-block;
  margin-bottom: 18px;
}
.qr-card img { width: 168px; height: 168px; object-fit: contain; border-radius: 6px; }
.qr-card .role { font-size: 11.5px; letter-spacing: .18em; color: var(--brand); font-weight: 700; text-transform: uppercase; }
.qr-card h3 { margin: 8px 0 4px; font-size: 17px; }
.qr-card .qq { font-family: var(--mono); font-size: 14px; color: var(--ink-2); letter-spacing: .02em; }
.qr-card .note { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 40px; }
.qr-card .actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- code / copy ---------- */
.code {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  color: var(--ink);
  white-space: nowrap;
}
.copy {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 11.5px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); padding: 2px 0;
}
.copy:hover { color: var(--brand); }
.copy svg { width: 13px; height: 13px; }
.copy.done { color: var(--ok); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-weight: 600; }

/* ---------- rules ---------- */
.layout-doc { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; padding: 48px 0 80px; }
.toc { position: sticky; top: 92px; font-size: 13.5px; }
.toc .toc-title { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block;
  padding: 7px 0 7px 16px;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color .2s, border-color .2s;
}
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

.doc { max-width: 760px; }
.doc-section { padding: 12px 0 26px; scroll-margin-top: 96px; }
.doc-section + .doc-section { border-top: 1px solid var(--line); padding-top: 38px; margin-top: 14px; }
.doc-section h2 {
  font-size: 22px;
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}
.doc-section h2 .no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  flex: 0 0 auto;
}
.doc-section h3 { font-size: 16px; margin: 24px 0 10px; color: var(--ink); }
.doc-section p { color: var(--ink-2); margin: 10px 0; font-size: 15px; }
.doc-section ul, .doc-section ol { color: var(--ink-2); padding-left: 22px; margin: 10px 0; font-size: 15px; }
.doc-section li { margin: 7px 0; }
.doc-section li::marker { color: var(--brand); }
.doc-section strong { color: var(--ink); font-weight: 650; }

.callout {
  display: flex; gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 4px 12px 12px 4px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: var(--shadow);
}
.callout.warn { border-left-color: var(--danger); }
.callout .ct { font-weight: 700; color: var(--ink); display: block; margin-bottom: 3px; font-size: 13.5px; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; font-size: 14px; margin: 16px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

/* ---------- commands / search ---------- */
.search-page { padding: 34px 0 80px; }
.search-toolbar { position: sticky; top: 68px; z-index: 20; padding: 14px 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.search-toolbar .search-box { max-width: 620px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { opacity: .55; margin-left: 5px; font-size: 11.5px; }

.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 18px; font-size: 13px; color: var(--muted); }
.result-meta b { color: var(--ink); font-weight: 600; }

.cmd-list { display: grid; gap: 12px; }
.cmd-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.cmd-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.cmd-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmd-name { font-size: 15.5px; font-weight: 700; }
.cmd-cat { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.badge-admin { font-size: 10.5px; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 5px; padding: 2px 7px; font-weight: 700; letter-spacing: .04em; }
.cmd-desc { color: var(--ink-2); font-size: 13.8px; margin-top: 6px; }
.cmd-line { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmd-line code {
  font-family: var(--mono);
  font-size: 12.8px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent);
  overflow-wrap: anywhere;
}
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin-bottom: 14px; opacity: .5; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 14px; }
.empty .sugg { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- steps ---------- */
.steps { display: grid; gap: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 46px 1fr; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .no {
  counter-increment: step;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brand);
  background: var(--surface);
}
.step .no::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-size: 16px; margin-bottom: 5px; }
.step p { color: var(--ink-2); font-size: 14.2px; }
.step .code { margin-top: 10px; }

/* ---------- faq ---------- */
details.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 20px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
details.faq[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  font-size: 14.5px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  flex: 0 0 auto;
}
details.faq[open] summary::after { content: "−"; }
details.faq .body { padding: 0 0 18px; color: var(--ink-2); font-size: 14.2px; }

/* ---------- timeline ---------- */
.timeline { border-left: 1px solid var(--line); margin-left: 6px; padding-left: 26px; display: grid; gap: 26px; }
.tl-item { position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -32px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand);
}
.tl-item time { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.tl-item h3 { font-size: 15.5px; margin: 4px 0 3px; }
.tl-item p { font-size: 13.8px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 46px 0 34px; margin-top: 40px; background: color-mix(in srgb, var(--surface) 45%, transparent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-grid h4 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.footer-grid a { color: var(--ink-2); }
.footer-grid a:hover { color: var(--brand); }
.footer-about p { font-size: 13.5px; color: var(--muted); margin-top: 14px; max-width: 30em; line-height: 1.8; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.icp {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.icp:hover { color: var(--ink-2); border-bottom-color: var(--line-strong); }

.footer-bottom .ver { font-family: var(--mono); font-size: 11.5px; display: inline-flex; align-items: center; gap: 8px; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); display: inline-block; }

/* ---------- 条例验证口令（故意做得不显眼：正文里的小标签） ---------- */
.gc-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 3px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 1px;
}
.gc-inline .gc-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-2);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.gc-inline .gc-timer { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gc-inline .gc-timer b { color: var(--muted); font-weight: 600; }
.gc-inline .gc-sep { color: var(--line-strong); }

/* ---------- quota query list ---------- */
.query-list { display: grid; gap: 14px; }
.query-list .cmd-line { margin-bottom: 0; }
.query-list .cmd-line code { flex: 1; }
.query-list p { margin-top: 6px; }

/* ---------- home CTA ---------- */
.cta-split { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; }
.cta-copy { padding: 42px; }
.cta-qrs {
  padding: 28px; background: var(--surface-2); border-left: 1px solid var(--line);
  display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cta-qrs img {
  width: 132px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; padding: 6px; height: auto;
}

/* ---------- misc ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}
.divider-pattern {
  height: 1px; border: 0;
  background-image: linear-gradient(90deg, var(--line-strong) 0 12px, transparent 12px 20px);
  background-size: 20px 1px;
  margin: 0;
}
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.pill b { color: var(--ink); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.8px; }
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--ink); color: var(--bg);
  padding: 8px 14px; border-radius: 8px; z-index: 99;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { padding: 52px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .chat-mock { transform: none; }
  .qr-float { display: none; }
  .grid-3, .grid-4, .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-doc { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 0 64px; }
  .layout-doc > * { min-width: 0; }
  .toc { position: static; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
  .toc ol { columns: 2; column-gap: 20px; border-left: 0; }
  .toc li a { padding-left: 0; border-left: 0; }
  .toc li a.active { font-weight: 700; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .header-inner { height: auto; gap: 8px; padding-top: 9px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .brand { gap: 8px; }
  .nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 6px 0 0;
    padding: 8px 0 9px;
    gap: 4px;
    border-top: 1px solid var(--line);
  }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .nav a[href="index.html"] { display: none; }
  .header-actions .btn { display: none; }
  .search-toolbar { top: 103px; padding: 10px 0 12px; }
  .search-toolbar .search-box { max-width: none; }
  .filters { margin-top: 10px; gap: 6px; }
  .chip { font-size: 12.5px; padding: 4px 10px; }
  .result-meta { flex-direction: column; align-items: flex-start; gap: 4px; margin: 16px 0 14px; }
  .result-meta .small { display: none; }
  .toc { top: 0; }
  .toc ol { columns: 1; }
  .cta-split { grid-template-columns: 1fr; }
  .cta-copy { padding: 28px 22px; }
  .cta-qrs { border-left: 0; border-top: 1px solid var(--line); padding: 20px 16px; gap: 10px; }
  .cta-qrs img { width: calc(33.333% - 8px); min-width: 86px; padding: 4px; }
  .section { padding: 52px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .grid-3, .grid-4, .grid-2, .qr-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 24px; }
  .hero-meta b { font-size: 19px; }
  .nav { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .doc { max-width: 100%; }
  .search-page { padding: 20px 0 60px; }
  .search-box { padding-left: 13px; }
  .qr-card img { width: 200px; height: 200px; }
}
@media (max-width: 420px) {
  .nav a { padding: 6px 8px; font-size: 13px; }
  .brand-mark { width: 30px; height: 30px; }
}

/* picture 只做格式协商，不参与布局，避免多出行内空白 */
picture { display: contents; }

/* ---- 双机器人徽章（2026-11-01 新增） ---- */
.badge-bot {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 5px; padding: 2px 7px;
}
.badge-bot.mai { color: #9c4a63; background: var(--accent-soft); }
[data-theme="dark"] .badge-bot.mai { color: var(--accent); }
.bot-chip { font-weight: 600; }
.bot-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bot-chip.active .n { background: rgba(255,255,255,.22); color: #fff; }
.bots-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }

/* ---- 洛天依页（2026-11-01） ---- */
.bot-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bot-steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 12px; font-weight: 700; margin-right: 8px; vertical-align: 2px;
}
.page-head .meta .copy { margin-left: 6px; }
@media (max-width: 560px) {
  .bot-grid, .bot-steps { grid-template-columns: 1fr; }
  .page-head .meta { flex-wrap: wrap; gap: 8px; }
}

/* ---------- 机器人档案（多机器人可扩展） ---------- */
.bot-roster {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.bot-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bot-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: var(--shadow-lg);
}
.bot-card.ghost {
  border-style: dashed;
  background: transparent;
  align-items: flex-start;
}
.bot-card.ghost:hover { transform: none; box-shadow: none; border-color: var(--line); }

.bot-avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  font-size: 19px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-deep);
  letter-spacing: 0;
}
.bot-avatar.mai { background: var(--accent-soft); color: #9c4a63; }
.bot-avatar.ghost {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 400;
  font-size: 22px;
}
[data-theme="dark"] .bot-avatar.mai { color: var(--accent); }

.bot-main { min-width: 0; flex: 1; }
.bot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.bot-alias {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin-left: 6px;
}
.bot-live {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border-radius: 5px; padding: 2px 7px;
}
.bot-live.off { color: var(--muted); background: var(--surface-2); }
.bot-tagline {
  font-size: 12.5px; color: var(--muted);
  margin-top: 5px;
}
.bot-model {
  font-size: 11px; color: var(--muted);
  opacity: .8; margin-top: 2px;
  word-break: break-all;
}
.bot-desc {
  font-size: 13.5px; line-height: 1.65; color: var(--ink-2);
  margin-top: 8px;
}
.bot-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bot-skill {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.bot-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted);
}
.bot-meta b { color: var(--ink); font-weight: 600; }
.bot-go {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand); font-weight: 600;
}
.bot-go svg { width: 14px; height: 14px; }

/* ---------- 聊天演示的机器人切换 ---------- */
.chat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chat-tab {
  font: inherit;
  font-size: 11.5px; font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  transition: all .18s ease;
}
.chat-tab:hover { color: var(--ink); }
.chat-tab.active {
  color: #fff; background: var(--brand); border-color: var(--brand);
}
.chat-ava {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 15px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-deep);
}
.chat-ava.mai { background: var(--accent-soft); color: #9c4a63; }
[data-theme="dark"] .chat-ava.mai { color: var(--accent); }

@media (max-width: 560px) {
  .bot-roster { grid-template-columns: 1fr; }
  .bot-card { padding: 16px; gap: 13px; }
  .bot-avatar { width: 40px; height: 40px; font-size: 17px; border-radius: 12px; }
  .bot-meta { gap: 10px; }
  .bot-go { margin-left: 0; }
}

/* ---------- 机器人详情页切换条（2026-11-01，随机器人数自动增长） ---------- */
.bot-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.bot-switch a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.bot-switch a:hover { border-color: var(--brand); color: var(--ink); }
.bot-switch a[aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.bot-switch a[aria-current="page"] .sw-ava { background: rgba(255,255,255,.22); color: #fff; }
.sw-ava {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-deep);
}
.sw-ava.mai { background: var(--accent-soft); color: #9c4a63; }
[data-theme="dark"] .sw-ava.mai { color: var(--accent); }
.sw-alias { font-weight: 400; color: var(--muted); font-size: 12px; }
.bot-switch a[aria-current="page"] .sw-alias { color: rgba(255,255,255,.78); }
.sw-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  margin-left: -2px;
}
.bot-switch a[aria-current="page"] .sw-dot { background: #fff; }

@media (max-width: 560px) {
  .bot-switch a { padding: 6px 12px 6px 7px; font-size: 12.5px; }
}
