/* ─────────────────────────────────────────────────────────────
   temp-api · design system
   一套字号 / 一套 4px 间距 / 一套圆角 / 一套语义色
   ───────────────────────────────────────────────────────────── */

:root {
  /* 颜色：中性 + 一个强调色，全部语义化 */
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --text: #14141f;
  --text-2: #52525f;
  --text-3: #71717f;
  --line: #e8e3dc;
  --line-2: #d9d3ca;
  --brand: #c0414a;
  --brand-ink: #9c333b;
  --brand-soft: #fdf3f3;
  --brand-line: #f0d6d7;
  --ok: #17694a;
  --ok-soft: #eff7f2;
  --ok-line: #cfe6da;
  --danger: #a8281f;
  --danger-soft: #fdf3f1;
  --danger-line: #f0d0cc;

  /* 深色框架：顶栏、页脚、代码块 —— 暖黑，与米白底同色温 */
  --chrome: #221f1e;
  --chrome-soft: #2c2825;
  --chrome-text: #f7f3ed;
  --chrome-muted: #b0aaa3;
  --chrome-line: rgba(255, 245, 235, .09);
  /* 深底专用提亮红：砖红压在暖黑上会发闷，这里单独一档 */
  --brand-on-dark: #d9535c;

  /* 字体：拉丁用 DM Sans，中文走系统黑体，顺序保证逐字回退 */
  --font: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* 间距：4px 栅格，只有 6 档 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* 圆角：一套 */
  --r: 12px;
  --r-sm: 8px;

  --shadow: 0 1px 2px rgba(20, 20, 31, .04), 0 12px 32px -16px rgba(20, 20, 31, .14);
  --shadow-pop: 0 24px 64px -16px rgba(20, 20, 31, .28);
  --ring: 0 0 0 3px rgba(192, 65, 74, .22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ── 顶栏 ───────────────────────────────────────────────── */

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: #fbfaf8;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease, box-shadow .2s ease;
}

/* 吸顶后收紧：底色更实 + 一道极轻的投影 */
.topbar-wrap.is-stuck {
  box-shadow: 0 1px 0 rgba(20, 20, 31, .05), 0 10px 24px -18px rgba(20, 20, 31, .32);
}

/* 支持毛玻璃时用半透明白，内容从顶栏下滚过时更干净 */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar-wrap {
    background: rgba(255, 255, 255, .66);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
  }

  .topbar-wrap.is-stuck {
    background: rgba(255, 255, 255, .90);
  }
}

.topbar {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 10px var(--s6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex: none;
}

.brand-mark { width: 26px; height: 26px; color: var(--brand); flex: none; }

.nav { display: flex; align-items: center; gap: 20px; }

.nav a {
  position: relative;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: var(--s1) 0;
  white-space: nowrap;
  transition: color .18s ease;
}

.nav a:hover { color: var(--text); }

.nav a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav a.active { color: var(--text); font-weight: 600; }

.nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav .lang-switch {
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-2);
  transition: color .18s ease, border-color .18s ease;
}

.nav .lang-switch:hover {
  color: var(--text);
  border-color: var(--text-2);
}

/* ── 标题区 ─────────────────────────────────────────────── */

.hero {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 var(--s6);
  animation: fade-up .5s ease-out both;
}

.hero h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: var(--s2);
}

/* 破折号后面的描述：小一档、灰一点，和标题同一行 */
.hero-sub {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0;
}

.hero p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: none;
}

.hero p + p { margin-top: var(--s2); }

.hero p strong {
  color: var(--text);
  font-weight: 600;
}

.hero p a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, .18);
  text-underline-offset: 3px;
}

.hero p a:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── 卡片 ───────────────────────────────────────────────── */

.main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--s5) var(--s6) var(--s6);
  flex: 1;
  animation: fade-up .5s ease-out .08s both;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: var(--s5) var(--s6) var(--s6);
}

.card-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding-bottom: var(--s4);
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
}

.card-head svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }

.card-title { font-size: 17px; font-weight: 600; letter-spacing: 0; }

.card-note { font-size: 13px; color: var(--text-3); margin-left: auto; }

/* ── 表单 ───────────────────────────────────────────────── */

.grid { display: grid; gap: var(--s5); }

.col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

.field { display: flex; flex-direction: column; min-width: 0; }

.field > label,
.field > .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--s2);
  display: flex;
  align-items: baseline;
  gap: var(--s1);
}

.field > label .req { color: var(--brand); }

.field > label .opt { font-weight: 400; color: var(--text-3); }

.field > label.label-row {
  justify-content: space-between;
  gap: var(--s2);
}

.label-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  white-space: nowrap;
}

.field .hint { font-size: 12px; color: var(--text-3); margin-top: var(--s2); }

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;               /* ≥16px：避免 iOS 聚焦自动放大 */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 11px var(--s3);
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder, textarea::placeholder { color: #9a9aa6; }

input:hover, select:hover, textarea:hover { border-color: #c9c3b9; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

select {
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2371717f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

textarea {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  resize: vertical;
  min-height: 96px;
  padding: var(--s3) var(--s3);
}

textarea.grow { min-height: 216px; }

/* 动作按钮：手机上跟在表单末尾，桌面端贴到左栏底部 */
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s2);
}

/* 按钮下面那行小字：把使用场景从副标题挪过来 */
.actions-note {
  flex: 0 0 100%;
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-3);
}

/* 请求方法：分段按钮，尺寸对齐右侧示例 chip */
.seg {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.seg-btn {
  padding: 3px 9px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--text); background: var(--surface-2); }
.seg-btn.is-on,
.seg-btn.is-on:hover {
  background: #efece6;
  color: var(--text);
  font-weight: 600;
}

/* JSON 校验状态 */
.json-status { display: none; font-size: 12px; }
.json-status.valid { display: block; color: var(--ok); }
.json-status.invalid { display: block; color: var(--danger); }

textarea.valid-json { border-color: var(--ok-line); }
textarea.invalid-json { border-color: var(--danger-line); }

.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s2);
}

.byte-meter {
  display: none;
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.byte-meter.near { display: block; color: #b45309; }

.byte-meter.over {
  display: block;
  color: var(--danger);
  font-weight: 600;
}

.byte-meter a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fmt-btn {
  background: none;
  border: 0;
  padding: 0;
  margin-left: auto;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .18s ease;
}

.fmt-btn:hover { color: var(--brand); }

/* ── 提示条 ─────────────────────────────────────────────── */

.tip {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--r-sm);
  padding: 10px var(--s3);
  margin-bottom: var(--s4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--brand-ink);
}

.tip svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.tip a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tip a:hover { color: var(--brand); }

/* ── 按钮 ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 44px;
  padding: 0 var(--s5);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .06s ease;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line-2);
}
.btn--ghost:hover { color: var(--text); border-color: #c2bcb2; }

.btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand); }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--block { width: 100%; }

/* ── 错误 / 结果 ────────────────────────────────────────── */

.alert {
  display: none;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s4);
  padding: 10px var(--s3);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.5;
}

.alert--error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-left: 3px solid var(--danger);
  color: var(--danger);
}

.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.result { display: none; margin-top: var(--s4); padding: var(--s4); background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: var(--r-sm); }
.result h3 { display: flex; align-items: center; gap: var(--s2); font-size: 14px; font-weight: 600; color: var(--ok); margin-bottom: var(--s2); }
.result h3 svg { width: 16px; height: 16px; flex: none; }
.result p { font-family: var(--mono); font-size: 13px; color: #235c42; word-break: break-all; margin-bottom: var(--s2); }

/* ── 提示图标（响应页错误状态） ─────────────────────────── */

.modal-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  margin-bottom: var(--s4);
}

.modal-mark svg { width: 20px; height: 20px; }

/* ── 页脚 ───────────────────────────────────────────────── */

.footer-wrap {
  width: 100%;
  background: var(--chrome);
  border-top: 1px solid var(--chrome-line);
}

.footer {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--s4) var(--s6) var(--s5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  font-size: 12px;
  color: var(--chrome-muted);
}

.footer span { display: inline-flex; align-items: center; gap: var(--s2); }

.footer-copy { flex: none; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
}

.footer-icp { flex: none; }

.footer-legal {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
}

.footer-lang { display: none; }

.footer a {
  color: var(--chrome-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.footer a:hover {
  color: var(--chrome-text);
  border-bottom-color: currentColor;
}

.footer a:focus-visible {
  outline: 2px solid var(--brand-on-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── 联系技术支持弹层 ───────────────────────────────────── */

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: rgba(20, 20, 31, .58);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.contact-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.contact-panel {
  position: relative;
  width: min(288px, 100%);
  padding: var(--s5) var(--s5) var(--s4);
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: 0 24px 64px rgba(20, 20, 31, .28);
  text-align: center;
  transform: translateY(8px);
  transition: transform .18s ease;
}

.contact-modal.is-open .contact-panel { transform: translateY(0); }

.contact-panel:focus { outline: none; }

.contact-panel img {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
  margin: 0 auto var(--s3);
  border-radius: 8px;
  background: #fff;
}

.contact-panel b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.contact-panel span {
  display: block;
  margin-top: var(--s1);
  font-size: 12px;
  color: var(--text-3);
}

.contact-close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
}

.contact-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.contact-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

body.contact-open { overflow: hidden; }

/* 隐私页内嵌技术支持二维码 */
.contact-inline {
  display: flex;
  align-items: center;
  gap: var(--s4);
  max-width: 420px;
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.contact-inline img {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: #fff;
}

.contact-inline--single {
  width: fit-content;
}

.contact-inline b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.contact-inline span {
  display: block;
  margin-top: var(--s1);
  font-size: 12px;
  color: var(--text-3);
}

/* 联系页 */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  align-items: start;
}

.contact-box {
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.contact-box h2 {
  margin: 0 0 var(--s2);
  font-size: 15px;
  font-weight: 600;
}

.contact-box p {
  margin: 0 0 var(--s3);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.contact-mail {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.contact-mail:hover { color: var(--brand); }

.contact-qr {
  display: block;
  width: 160px;
  height: 160px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-qr { width: 140px; height: 140px; }
}

/* 密钥管理页 */
.key-result {
  margin-top: var(--s4);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.key-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
}

.key-summary b {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.key-summary span {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}

.key-title {
  margin: var(--s4) 0 var(--s3);
  font-size: 15px;
  font-weight: 600;
}

.key-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.key-row code {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.key-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}

.key-del {
  flex: none;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.key-del:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.key-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.key-edit {
  margin-top: var(--s2);
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.key-edit label {
  display: block;
  margin: var(--s2) 0 4px;
  font-size: 12px;
  color: var(--text-3);
}

.key-edit label:first-child { margin-top: 0; }

.key-edit select,
.key-edit textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.key-edit textarea { resize: vertical; }

.key-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: var(--s3);
}

.key-empty {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--text-3);
}

@media (max-width: 640px) {
  .key-summary { gap: var(--s4); }
  .key-row { align-items: flex-start; }
}

.page-note {
  margin-top: var(--s4);
  font-size: 13px;
  color: var(--text-3);
}

.page-note a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-note a:hover { color: var(--brand); }

.claim-result {
  margin-top: var(--s4);  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.claim-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.claim-key code {
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.btn--small {
  padding: 5px 10px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .contact-panel { width: min(272px, 100%); }
  .contact-panel img { width: 188px; height: 188px; }
  .contact-inline { gap: var(--s3); padding: var(--s3); }
  .contact-inline img { width: 104px; height: 104px; }
}

.wx { position: relative; display: inline-block; }

.wx-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brand-ink);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  transition: color .18s ease;
}

.wx-link:hover { color: var(--brand); }

.wx-card {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translate(-50%, -4px);
  width: 208px;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}

/* 触发器与卡片之间的透明桥，避免鼠标移过去时闪断 */
.wx-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.wx-card img {
  display: block;
  width: 176px;
  height: 176px;
  margin: 0 auto var(--s2);
  border-radius: 6px;
  background: #fff;
}

.wx-card b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.wx-card span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

.wx.is-open .wx-card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  .wx:hover .wx-card,
  .wx:focus-within .wx-card {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* 二维码图片尚未上传时：保留文字，隐藏空卡片与交互 */
.wx--noimg .wx-link {
  color: inherit;
  cursor: default;
  text-decoration: none;
  pointer-events: none;
}
.wx--noimg .wx-card { display: none; }

/* ── 后台入口（长期页保留原行为） ───────────────────────── */

#adminReveal { display: none; position: fixed; right: var(--s4); bottom: var(--s4); z-index: 50; }
#adminReveal.show { display: block; }
#adminReveal a {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 8px var(--s4);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
}
#adminReveal a:hover { border-color: var(--brand); color: var(--brand); }
#adminReveal .close-reveal {
  background: none; border: 0; padding: var(--s1);
  color: var(--text-3); font-size: 12px; margin-left: var(--s1); cursor: pointer;
}

/* ── 快速开始页 ─────────────────────────────────────────── */

.guide { max-width: 720px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.step {
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.step b {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--brand);
}

.step span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* ── 快速开始：三条路径 ── */
.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.path-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}

.path-card:hover {
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

.path-card strong {
  font-size: 15px;
  font-weight: 600;
}

.path-index {
  color: inherit;
  font-weight: 600;
}

.path-card span {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.path-card em {
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--brand-ink);
}

.guide h2[id] { scroll-margin-top: 80px; }

/* ── 快速开始：吸顶小节导航 + 三步 + 折叠 ── */

.guide-nav {
  position: sticky;
  top: 64px;
  z-index: 5;
  display: flex;
  gap: 4px;
  margin: 0 0 32px;
  padding: 8px 0;
  overflow-x: auto;
  background: var(--bg, #f7f5f2);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.guide-nav::-webkit-scrollbar { display: none; }

.guide-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}

.guide-nav a:hover { color: var(--text); background: var(--surface); }

.guide-block {
  margin-bottom: 48px;
  scroll-margin-top: 110px;
}

.guide-block h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.guide .block-lead {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--text-2);
}

/* 三步条 */
.quick-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.quick-steps li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.qs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: 11px;
  color: var(--text-3);
}

.quick-steps strong {
  font-size: 14px;
  font-weight: 600;
}

.quick-steps span:last-child {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}

/* 折叠块 */
.fold {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.fold summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: '›';
  margin-left: auto;
  font-size: 15px;
  color: var(--text-3);
  transition: transform .15s ease;
}

.fold[open] summary::after { transform: rotate(90deg); }
.fold summary:hover { background: var(--surface-2); }

.fold-body {
  padding: 0 18px 16px;
  border-top: 1px solid var(--line);
}

.fold-body p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.75; }

.fold-body .code-block { margin: 12px 0; }

@media (max-width: 700px) {
  .quick-steps { grid-template-columns: 1fr; }
  .guide-nav { top: 56px; }
}



@media (max-width: 900px) {
  .path-grid { grid-template-columns: 1fr; gap: var(--s2); }
}

@media (max-width: 640px) {
  .path-card {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px var(--s2);
    padding: var(--s3) var(--s4);
  }
  .path-card em { display: none; }
}

.guide h2 {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin: var(--s5) 0 var(--s3);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.guide h2.guide-group {
  display: block;
  margin: var(--s6) 0 var(--s3);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: 22px;
}

.group-index {
  color: inherit;
}

.guide h2.guide-group:first-of-type {
  margin-top: var(--s4);
  padding-top: 0;
  border-top: 0;
}

.guide h3.guide-step {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin: var(--s5) 0 var(--s2);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.guide h3.guide-step .num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: inherit;
}

.section-cta {
  display: flex;
  margin-top: var(--s5);
}

.bottom-links {
  margin-top: var(--s6);
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.bottom-links a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bottom-links a:hover { color: var(--brand); }

.guide h2 .num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--brand);
}

.guide p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-2);
}

.guide p + p { margin-top: var(--s2); }

.guide p strong {
  color: var(--text);
  font-weight: 600;
}

.guide p.note {
  margin-top: var(--s2);
  font-size: 13px;
  color: var(--text-3);
}

.guide p code {
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .88em;
  color: var(--text);
}

.guide p a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guide p a:hover { color: var(--brand); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s3);
}

.chip {
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

.code-block {
  position: relative;
  margin: var(--s3) 0;
  background: var(--chrome);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: var(--s4) 76px var(--s4) var(--s4);
  overflow-x: auto;
}

.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #f2efe9;
  white-space: pre;
}

.code-block--wrap code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-code {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255, 245, 235, .18);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color: #cdc7bf;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.copy-code:hover { color: #fdfaf6; border-color: rgba(255, 245, 235, .42); }

.status-table {
  width: 100%;
  margin-top: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  border-collapse: collapse;
  overflow: hidden;
  font-size: 14px;
}

.status-table th {
  padding: 10px var(--s3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--text-3);
}

.status-table td {
  padding: 11px var(--s3);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.status-table tr:last-child td { border-bottom: 0; }

.status-table td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
}

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}

/* ── 常用 API 合集 ───────────────────────────────────────── */

.about {
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

/* 首页说明区：卡片 + 步骤 + callout，用间距而不是分割线制造层次 */
.about h2 { margin-bottom: var(--s3); }
.about .about-lead { max-width: 68ch; }

.about-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 32px 0 24px;
}

/* 横条卡片：标题在左、说明在中、箭头在右 */
.about .about-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 4px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.about .about-card:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}

.about-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.about .about-card-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
}

.about-card-go {
  justify-self: end;
  color: var(--text-3);
  font-size: 14px;
  transition: transform .15s ease, color .15s ease;
}

.about .about-card:hover .about-card-go {
  transform: translateX(2px);
  color: var(--text-2);
}

/* 卡片下方一行指路：具体步骤交给快速开始 */
.about .about-hint {
  margin: -12px 0 32px;
  font-size: 13px;
  color: var(--text-3);
}

.about .about-hint a { color: var(--brand-ink); }

.about-callout {
  padding: 18px 22px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.about-callout strong { margin-right: 6px; color: var(--text); }

.about .about-more {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-3);
}

@media (max-width: 760px) {
  .about-cards { gap: 10px; }
  .about .about-card {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 4px 12px;
    padding: 14px 16px;
  }
  .about-card h3 { grid-column: 1 / -1; }
  .about .about-hint { margin-top: -6px; }
  .about { margin-top: var(--s4); padding-top: var(--s4); }
}

.about h2 {
  margin-bottom: var(--s3);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.about p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-2);
}

.about p + p { margin-top: var(--s3); }

.about a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about a:hover { color: var(--brand); }

/* ── 隐私 / 条款 ─────────────────────────────────────────── */

.policy { max-width: 720px; }

.policy .updated {
  margin-bottom: var(--s5);
  font-size: 12px;
  color: var(--text-3);
}

.policy h2 {
  margin: var(--s6) 0 var(--s3);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.policy p,
.policy li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
}

.policy ul {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin: var(--s3) 0 0 var(--s4);
}

.policy ul + p {
  margin-top: var(--s5);
}

.policy a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.policy a:hover { color: var(--brand); }

.mock-toc-box {
  margin-bottom: var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.mock-toc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-3);
}

.mock-toc-head strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mock-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mock-toc a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.mock-toc a:hover {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-ink);
}

.mock-toc-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

.mock-toc a:hover .mock-toc-count {
  background: var(--brand-line);
  color: var(--brand-ink);
}

.mock-toc-arrow {
  font-size: 12px;
  color: var(--text-3);
  transition: transform .18s ease, color .18s ease;
}

.mock-toc a:hover .mock-toc-arrow {
  transform: translateX(2px);
  color: var(--brand);
}

/* ── Mock 资源页与资源卡片 ─────────────────────────────── */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}

.guide-card:hover {
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

.guide-card strong {
  font-size: 15px;
  font-weight: 600;
}

.guide-card span {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
}

.guide-card code {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand-ink);
}

.guide-back {
  display: inline-block;
  margin-bottom: var(--s3);
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
}

.guide-back:hover { color: var(--brand-ink); }

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin-bottom: var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--text-2);
}

.guide-meta span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-meta b {
  font-weight: 600;
  color: var(--text-3);
  font-size: 12px;
}

.guide-meta code {
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
}

.guide-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.guide-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.guide-table th,
.guide-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.guide-table tr:last-child td { border-bottom: 0; }

.guide-table code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.guide-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: var(--s3) 0 0 var(--s4);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.guide-section { margin-top: var(--s5); }

.guide-mistakes {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s3);
  list-style: none;
}

.guide-mistakes li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.guide-mistakes strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 900px) {
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .guide-grid { grid-template-columns: 1fr; }
}

.mock-section { scroll-margin-top: var(--s5); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.mock-rule {
  display: grid;
  gap: var(--s2);
  margin-bottom: var(--s5);
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.mock-rule-row {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

.mock-rule-row > span:first-child {
  flex: none;
  width: 110px;
  font-size: 12px;
  color: var(--text-3);
}

.mock-rule-row code {
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.mock-section { margin-top: var(--s6); }

.mock-section h2 {
  margin-bottom: var(--s3);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.mock-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.mock-endpoint {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.mock-main { flex: 1 1 auto; min-width: 0; }

.mock-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
}

.mock-method {
  flex: none;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.mock-method.get {
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  color: var(--ok);
}

.mock-method.post {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-ink);
}

.mock-path {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.mock-desc {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
}

.mock-desc code {
  padding: 0 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.mock-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.mock-actions button,
.mock-actions a {
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.mock-actions button:hover,
.mock-actions a:hover {
  color: var(--brand-ink);
  border-color: var(--brand-line);
}

/* ── 接口响应的只读视图 ─────────────────────────────────── */

.toast-created {
  position: fixed;
  bottom: 80px;
  left: 50%;
  z-index: 150;
  padding: 8px 16px;
  background: var(--ok);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: toast-in .2s ease-out both;
}

.toast-created.hide {
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity .25s ease, transform .25s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.viewer { max-width: 920px; }

.viewer-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin-bottom: var(--s3);
}

.viewer-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.viewer-badge {
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.api-meta {
  margin-bottom: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 10px var(--s4);
  border-bottom: 1px solid var(--line);
}

.meta-row:last-child { border-bottom: 0; }

.meta-label {
  flex: none;
  width: 84px;
  font-size: 13px;
  color: var(--text-3);
}

.meta-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
  flex: 1 1 auto;
  min-width: 0;
}

.meta-value code,
.meta-value .meta-url {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-2);
  word-break: break-all;
  transition: color .18s ease, border-color .18s ease;
}

.meta-value .meta-url:hover {
  color: var(--brand-ink);
  border-bottom-color: currentColor;
}

.meta-copy {
  flex: none;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.meta-copy:hover { color: var(--brand-ink); border-color: var(--brand-line); }

.method-badge {
  flex: none;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.viewer-status {
  flex: none;
  padding: 3px 10px;
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
}

.json-type {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--chrome-muted);
  opacity: .7;
}

.json-card {
  background: var(--chrome);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: 8px var(--s4);
  border-bottom: 1px solid var(--chrome-line);
  font-size: 12px;
  color: var(--chrome-muted);
}

.json-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.json-actions a {
  color: var(--chrome-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.json-actions a:hover {
  color: var(--chrome-text);
  border-bottom-color: currentColor;
}

.json-actions button {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255, 245, 235, .18);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color: #cdc7bf;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.json-actions button:hover {
  color: #fdfaf6;
  border-color: rgba(255, 245, 235, .42);
}

.json-card pre {
  max-height: 62vh;
  margin: 0;
  padding: var(--s3) var(--s5);
  overflow: auto;
}

.json-card code {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: #f2efe9;
  white-space: pre;
}

.j-key { color: #f0c674; }
.j-str { color: #a8d08d; }
.j-num { color: #e0a96d; }
.j-bool { color: #c792ea; }

.viewer-error {
  max-width: 520px;
  margin: var(--s7) auto;
  padding: var(--s7) var(--s6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  text-align: center;
}

.viewer-error .modal-mark {
  margin: 0 auto var(--s4);
  background: var(--danger-soft);
  color: var(--danger);
}

.viewer-error h1 {
  margin-bottom: var(--s2);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

.viewer-error p {
  margin-bottom: var(--s5);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}

.viewer-error p a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.viewer-error p a:hover { color: var(--brand); }

/* 示例 chip 行 */
.sample-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.pick {
  padding: 2px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.pick:hover { color: var(--text); border-color: #c2bcb2; }

.pick.is-on {
  background: #efece6;
  border-color: #cfc9bf;
  color: var(--text);
}

.field-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
}

.field-toggle .opt { font-weight: 400; color: var(--text-3); }

.field-toggle svg {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--text-3);
  transition: transform .18s ease;
}

.field-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.field-toggle:hover { color: var(--text); }

#paramsBody { margin-top: 2px; }

/* ── 桌面：两列一屏 ─────────────────────────────────────── */

/* 响应内容输入框的默认高度：默认示例是 10 行左右的真实对象，给足高度（仍可拖） */
.grid--temp .field--response textarea { height: 272px; min-height: 96px; }

@media (min-width: 900px) {
  .topbar { padding: var(--s3) var(--s6); }
  .hero { padding-top: var(--s6); }
  .main { padding-top: var(--s4); padding-bottom: var(--s5); }
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s5) var(--s6);
    align-items: start;
  }
  .col { gap: var(--s4); }
  /* 临时页：左栏（方法 / 参数 / 按钮）与右栏（响应）1 : 2；按钮只跟随左栏内容 */
  .grid--temp {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-areas: "left response";
    align-items: start;
  }
  .grid--temp .col--left { grid-area: left; }
  .grid--temp .field--response { grid-area: response; }

  /* 长期页：密钥 / 方法 一行，参数 / 响应 一行，按钮整行 */
  .grid--perm {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "key     method"
      "params  response"
      "actions actions";
    align-items: stretch;
  }
  .grid--perm .field--key { grid-area: key; }
  .grid--perm .field--method { grid-area: method; }
  .grid--perm .field--params { grid-area: params; }
  .grid--perm .field--response { grid-area: response; }
  .grid--perm .actions { grid-area: actions; align-self: start; margin-top: 0; }
  /* 同一行两个输入框等高 */
  .grid--perm .field--params textarea,
  .grid--perm .field--response textarea { flex: 1; }
  .footer { padding-top: var(--s3); padding-bottom: var(--s4); }
}

/* 矮屏笔记本：压缩留白，输入区保持可读高度，仍然一屏放下 */
@media (min-width: 900px) and (max-height: 820px) {
  .card { padding: var(--s4) var(--s6) var(--s4); }
  .card-head { padding-bottom: var(--s3); margin-bottom: var(--s3); }
  .tip { padding: 8px var(--s3); margin-bottom: var(--s3); }
  textarea { min-height: 76px; }
  textarea.grow { min-height: 140px; }
  .main { padding-top: var(--s3); padding-bottom: var(--s4); }
  .actions { margin-top: 0; }
  .footer { padding-top: var(--s2); padding-bottom: var(--s3); }
}

/* ── 单列（< 900px）：按钮必须排在响应框之后 ───────────────── */

@media (max-width: 899px) {
  .grid--temp .col--left { display: contents; }
  .grid--temp .field--response { order: 1; }
  .grid--temp .actions { order: 2; }
}

/* ── 手机 ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar { padding: var(--s3) var(--s4); gap: var(--s3); }
  .hero { padding: var(--s5) var(--s4) 0; }
  .hero h1 { font-size: 22px; }
  .main { padding: var(--s4) var(--s4) var(--s5); }
  .card { padding: var(--s4) var(--s4) var(--s5); }
  .card-note { display: none; }
  textarea { font-size: 16px; }   /* 手机端 ≥16px，避免 iOS 聚焦放大 */
  .footer { padding: var(--s3) var(--s4) var(--s4); flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .footer-nav { gap: var(--s2) var(--s3); }
  .footer-lang { display: inline-flex; }
  .nav { gap: var(--s2); }
  .nav a { font-size: 13px; }
  .nav .lang-switch { display: none; }

  /* 微信二维码：手机上改为居中浮层 */
  .wx-card {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(264px, calc(100vw - 48px));
    padding: var(--s4);
    transform: translate(-50%, -48%);
    z-index: 210;
  }
  .wx-card::after { display: none; }
  .wx-card img { width: 200px; height: 200px; }
  .wx.is-open .wx-card { transform: translate(-50%, -50%); }
  body.wx-open { overflow: hidden; }

  .steps { grid-template-columns: 1fr; gap: var(--s2); }
  .step { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
  .step b { flex: none; }
  .step span { margin-top: 0; }
  .guide h2 { margin-top: var(--s5); }
  .code-block pre { padding-top: var(--s2); padding-right: var(--s4); }
  .copy-code { position: static; display: block; transform: none; margin: var(--s2) var(--s3) 0 auto; }

  .json-card pre { padding: var(--s3) var(--s4); }
  .json-card code { white-space: pre-wrap; word-break: break-word; }
  .viewer-title { font-size: 22px; }
  .meta-row { gap: var(--s3); padding: var(--s3); }
  .meta-label { width: 72px; padding-top: 2px; }
  .meta-row--url { flex-direction: column; align-items: flex-start; gap: 6px; }
  .meta-row--url .meta-label { width: auto; padding-top: 0; }
  .meta-row--url .meta-value { width: 100%; }
  .viewer-error { margin: var(--s5) auto; padding: var(--s6) var(--s4); }

  .mock-rule { padding: var(--s4); }
  .mock-rule-row { flex-direction: column; gap: 2px; }
  .mock-rule-row > span:first-child { width: auto; }
  .mock-endpoint { flex-direction: column; }
  .mock-actions { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* 隐藏滚动条造成的跳动 */
html { scrollbar-gutter: stable; }
