/* mima-fingerprint 文档页 —— 简洁蓝色主题 */

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --ink: #0b1220;
  --ink-2: #46556b;
  --ink-3: #76839a;
  --ink-4: #a3aec0;

  --surface: #ffffff;
  --border: #e4e9f2;
  --line: rgba(37, 99, 235, .12);
  --line-soft: #eef1f6;

  /* 顶部与首页共用的玻璃材质 */
  --sky-100: #e0f2fe;
  --indigo-100: #e0e7ff;
  --glass: rgba(255, 255, 255, .78);
  --glass-line: rgba(37, 99, 235, .09);
  --r-pill: 999px;
  --sh-glass: 0 10px 34px rgba(30, 64, 175, .07), inset 0 1px 0 rgba(255, 255, 255, .92);
  --sh-btn: 0 8px 20px rgba(37, 99, 235, .26), inset 0 1px 0 rgba(255, 255, 255, .45);
  --sh-btn-h: 0 12px 26px rgba(37, 99, 235, .34), inset 0 1px 0 rgba(255, 255, 255, .55);

  --code-bg: #0f172a;
  --code-ink: #cbd5e1;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 40px; --s8: 48px; --s9: 64px; --s10: 80px;

  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", "SF Pro Text", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", "Roboto Mono", Consolas, "Microsoft YaHei", ui-monospace, monospace;

  --r-card: 14px;
  --r-ctl: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(37, 99, 235, .18); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #ffffff;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue-700); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 3px; border-radius: 6px; }

/* ---------- 公告条（与首页一致） ---------- */
.announce {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, .5);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  font-size: 13px; color: var(--ink-2);
}
.announce-inner { height: 44px; display: flex; align-items: center; justify-content: center; gap: var(--s2); position: relative; }
.tag {
  font-size: 11px; font-weight: 650;
  color: var(--blue-700); background: rgba(37, 99, 235, .09);
  padding: 3px 9px; border-radius: 8px; letter-spacing: .3px;
}
.announce a {
  color: var(--blue-700); font-weight: 500;
  background-image: linear-gradient(var(--blue-500), var(--blue-500));
  background-repeat: no-repeat; background-size: 0 1px; background-position: 0 100%;
  transition: background-size .25s ease;
}
.announce a:hover { background-size: 100% 1px; }

/* ---------- 导航（与首页一致的悬浮玻璃胶囊） ---------- */
.nav {
  position: sticky; top: 12px; z-index: 50;
  max-width: 1160px; margin: 12px auto 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: 0 8px 30px rgba(30, 64, 175, .08), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: height .25s ease, box-shadow .25s ease, background .25s ease, margin .25s ease;
}
.nav.compact { margin-top: 8px; box-shadow: 0 6px 22px rgba(30, 64, 175, .10), inset 0 1px 0 rgba(255, 255, 255, .95); }
.nav-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; transition: height .25s ease; }
.nav.compact .nav-inner { height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.2px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 9px; display: inline-block; flex: none;
  background: url("logo.svg") center / 100% 100% no-repeat;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .32);
}
.nav-links { display: flex; gap: var(--s6); font-size: 14px; color: var(--ink-2); }
.nav-links a { position: relative; padding: 6px 0; transition: color .2s ease; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
  transform: scaleX(0); transform-origin: left; transition: transform .24s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  height: 36px; padding: 0 18px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; color: #fff;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: var(--sh-btn);
  white-space: nowrap; flex: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.nav-cta:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--sh-btn-h); }
.nav-cta:active { transform: translateY(0); }

/* ---------- 布局 ---------- */
.doc-layout {
  display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: var(--s8);
  padding: var(--s7) 0 var(--s10);
}
.toc {
  position: sticky; top: 84px; align-self: start;
  max-height: calc(100vh - 112px); overflow-y: auto;
  font-size: 14px; padding: 0 var(--s4) 0 0;
  scrollbar-width: thin;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: rgba(37, 99, 235, .18); border-radius: 4px; }
.toc-group { margin-bottom: var(--s5); }
.toc-group:last-child { margin-bottom: 0; }
.toc-title {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-4);
  margin: 0 0 var(--s2); letter-spacing: 1px;
}
.toc a {
  display: block; padding: 6px 0 6px 12px; border-left: 2px solid transparent;
  color: var(--ink-2); line-height: 1.5; border-radius: 0 6px 6px 0;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.toc a:hover { color: var(--ink); background: var(--blue-50); }
.toc a.active { color: var(--blue-700); border-left-color: var(--blue-600); background: var(--blue-50); font-weight: 500; }
.toc-toggle { display: none; }

/* ---------- 正文 ---------- */
.doc-content {
  min-width: 0;
}
.doc-content h1 { font-size: 34px; letter-spacing: -.2px; margin: 0 0 var(--s3); font-weight: 600; line-height: 1.3; }
.doc-content .lead { color: var(--ink-2); font-size: 16px; line-height: 1.75; margin: 0 0 var(--s7); max-width: 62ch; }
.doc-content section { margin-bottom: var(--s9); scroll-margin-top: 96px; }
.doc-content section:last-child { margin-bottom: 0; }
.doc-content h2 {
  font-size: 22px; margin: 0 0 var(--s4); padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border); font-weight: 600; letter-spacing: -.1px;
}
.doc-content h3 { font-size: 16px; margin: var(--s6) 0 var(--s3); font-weight: 600; }
.doc-content > section > h3:first-of-type { margin-top: var(--s5); }
.doc-content p { color: var(--ink-2); max-width: 64ch; margin: 0 0 var(--s4); }
.doc-content ul { color: var(--ink-2); padding-left: 20px; margin: 0 0 var(--s4); }
.doc-content li { margin-bottom: 7px; }
.doc-content code {
  font-family: var(--mono); font-size: 13px;
  background: var(--blue-50);
  padding: 2px 6px; border-radius: 4px; color: var(--blue-700);
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 var(--s5); }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.6; }
.table th { color: var(--ink-4); font-weight: 500; font-size: 12.5px; letter-spacing: .4px; }
.table tbody tr:hover { background: #f8fafc; }
.table td code { background: transparent; padding: 0; color: var(--ink); }

.code-block {
  position: relative; background: #f8fafc; color: #1e293b;
  border-radius: var(--r-ctl); padding: 38px var(--s5) var(--s4); overflow-x: auto;
  margin: 0 0 var(--s5);
  font-family: var(--mono); font-size: 13px; line-height: 1.68;
}
/* pre 保留源码换行与缩进，超长行横向滚动；顶部留白避开右上角复制按钮 */
.code-block code {
  display: block; background: transparent; color: inherit; padding: 0; font-size: inherit;
  white-space: pre; tab-size: 2;
  -webkit-font-smoothing: antialiased;
}
/* 语法高亮配色（浅色代码块） */
.code-block .tok-k { color: #7c3aed; }
.code-block .tok-s { color: #0369a1; }
.code-block .tok-n { color: #b45309; }
.code-block .tok-c { color: #94a3b8; font-style: italic; }
.code-block .tok-m { color: #047857; font-weight: 600; }
.code-block .tok-u { color: #2563eb; }
.code-block .tok-t { color: #be185d; }
.code-block .tok-a { color: #4f46e5; }
.code-block .tok-p { color: #64748b; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--mono); font-size: 11px; color: #64748b;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 3px 9px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.copy-btn:hover { color: #0b1220; border-color: #cbd5e1; }
.copy-btn.copied { color: #2563eb; border-color: #2563eb; }

/* ---------- 平台切换 ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--s3); }
.tab-btn {
  height: 34px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font: inherit; font-size: 14px; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.tab-btn:hover { border-color: var(--blue-300); color: var(--ink); }
.tab-btn.active { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); font-weight: 500; }
.tab-panel { padding-top: var(--s3); }
.tab-panel:first-of-type { padding-top: 0; }
.js-tabs .tab-panel { display: none; }
.js-tabs .tab-panel.active { display: block; }

.callout {
  border-left: 3px solid var(--blue-600);
  background: var(--blue-50);
  border-radius: 0 8px 8px 0;
  padding: var(--s3) var(--s4); font-size: 14px; line-height: 1.66; color: #1e3a8a; margin: 0 0 var(--s5);
}
.callout.warn { border-left-color: #f59e0b; background: #fffbeb; color: #78350f; }

/* ---------- 页脚 ---------- */
.footer { padding: var(--s7) 0 var(--s9); font-size: 13px; color: var(--ink-3); position: relative; z-index: 1; }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.footer a:hover { color: var(--blue-700); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .nav { top: 8px; margin: 8px 12px 0; }
  .nav-links { display: none; }
  .brand { white-space: nowrap; }
  .brand-sub { display: none; }
  .nav-inner { gap: 12px; }
  .doc-layout { grid-template-columns: 1fr; gap: var(--s5); padding: var(--s5) 0 var(--s9); }
  .toc { position: static; max-height: none; padding: 0 0 var(--s3); }
  .toc-toggle {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    padding: 6px 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  }
  .toc-body { display: none; }
  .toc.open .toc-body { display: block; padding-top: var(--s3); }
  .doc-content { padding: 0; }
  .doc-content h1 { font-size: 28px; }
  .wrap { padding: 0 18px; }
}

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

/* 窄屏代码块改用自动折行，避免横向拖动 */
@media (max-width: 720px) {
  .code-block code { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* 公告条窄屏只保留标签与操作入口，避免文字挤压换行 */
  .announce-inner > span:not(.tag) { display: none; }
}
