/* ── 基础 ─────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); }

.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

/* ── 导航 ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; width: min(1120px, calc(100% - 40px)); }
.logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 16px; letter-spacing: -.3px; color: var(--ink);
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
}
.nav-spacer { flex: 1; }
.nav-link { color: var(--muted); font-size: 14px; padding: 6px 4px; }
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active { color: var(--ink); font-weight: 600; }

/* ── 按钮 ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .16s ease; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--brand); }
.btn-ghost { background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── 首页：Hero ───────────────────────────────────── */
.hero { padding: 84px 0 56px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 20% auto;
  height: 420px; z-index: -1; opacity: .5; filter: blur(80px);
  background: radial-gradient(circle at 30% 40%, var(--brand), transparent 62%),
              radial-gradient(circle at 70% 60%, var(--accent), transparent 60%);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px); line-height: 1.14; letter-spacing: -1.6px;
  margin: 0 0 18px; font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* ── 首页：展示厅 ─────────────────────────────────── */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.section-head h2 { font-size: 22px; margin: 0; letter-spacing: -.5px; }
.section-head span { font-size: 13px; color: var(--muted); }
.section-head .spacer { flex: 1; }

.gallery {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 18px; overflow: hidden;
  transition: .18s ease; box-shadow: var(--shadow-sm); display: block; color: inherit;
}
.card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none;
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.card-thumb {
  height: 96px; border-radius: var(--r-sm); margin: -4px -4px 14px;
  display: grid; place-items: center; color: #fff;
  font-size: 30px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  position: relative; overflow: hidden;
}
.card:nth-child(3n+2) .card-thumb { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.card:nth-child(3n+3) .card-thumb { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.card-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 75% 15%, rgba(255,255,255,.34), transparent 55%);
}
.card-title { font-weight: 650; font-size: 15px; margin: 0 0 4px; }
.card-sub { font-size: 12.5px; color: var(--muted); font-family: var(--mono); word-break: break-all; }
.card-time { position: absolute; top: 14px; right: 16px; font-size: 11.5px; color: var(--muted); }

.empty {
  border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: 44px 24px; text-align: center; color: var(--muted); background: var(--surface);
}
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.skeleton {
  height: 168px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* ── 首页：特性 ───────────────────────────────────── */
.feats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feat {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px;
  background: var(--surface);
}
.feat-ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-weak); color: var(--brand-ink); font-size: 17px; margin-bottom: 12px;
}
.feat h3 { margin: 0 0 6px; font-size: 15px; }
.feat p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ── 页脚 ─────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line); padding: 28px 0 40px;
  color: var(--muted); font-size: 13px;
}
.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.foot .spacer { flex: 1; }

/* ── 文档页 ───────────────────────────────────────── */
.doc { padding: 48px 0 80px; }
.doc-layout { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
.doc-toc { position: sticky; top: 84px; font-size: 13.5px; }
.doc-toc a { display: block; color: var(--muted); padding: 5px 0; }
.doc-toc a:hover { color: var(--brand); text-decoration: none; }
.doc-body h2 { font-size: 21px; margin: 40px 0 12px; letter-spacing: -.4px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 16px; margin: 26px 0 8px; }
.doc-body p, .doc-body li { color: var(--ink-2); font-size: 14.5px; }
.doc-body code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 13px;
  border: 1px solid var(--line);
}
.doc-body pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; overflow: auto; font-size: 13px;
}
.doc-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 14px 0; }
.doc-body th, .doc-body td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.doc-body th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.callout {
  border-left: 3px solid var(--brand); background: var(--surface);
  padding: 14px 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 18px 0;
  font-size: 14px; border: 1px solid var(--line); border-left-width: 3px;
}
.callout.warn { border-left-color: var(--warn); }

/* ── 弹窗：弱高斯模糊遮罩（沿用你了了了游的规矩）──────── */
.modal-mask {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(16, 24, 40, .32);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 26px;
  transform: translateY(8px) scale(.985); transition: .18s ease;
}
.modal-mask.open .modal { transform: none; }
.modal h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.3px; }
.modal p { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.key-box {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; font-family: var(--mono); font-size: 13px; user-select: all;
}
.key-box .copy { margin-left: auto; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }

/* ── 响应式 ───────────────────────────────────────── */
@media (max-width: 820px) {
  .doc-layout { grid-template-columns: 1fr; gap: 24px; }
  .doc-toc { position: static; display: none; }
  .hero { padding: 56px 0 40px; }
}
