:root{
  color-scheme: light;

  /* Use solid colors (no gradients/translucency) to avoid "background shifting" while scrolling. */
  --outer-bg: #f4f6fd;
  --outer-bg2: #edf1ff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --border: rgba(178, 190, 222, 0.42);
  --divider: rgba(146, 161, 198, 0.22);
  --shadow: 0 18px 40px rgba(20, 24, 44, 0.16);
  --shadow-soft: 0 12px 32px rgba(40, 56, 110, 0.10);

  --text: #1f2742;
  --text-dim: #7480a3;

  --accent: #4c7df0;
  --accent-strong: #2c57d8;
  --accent-soft: rgba(76, 125, 240, 0.12);

  --success: #36c98c;
  --warning: #f0b24b;
  --danger: #dd4a68;

  --code-bg: #0b1020;
  --code-border: rgba(76, 125, 240, 0.18);

  --radius: 18px;
  --radius2: 14px;

  --topbar-h: 64px;
  --shell-max: 1240px;

  --font-sans: 'Source Han Sans SC', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'SF Pro Display', 'Source Han Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

*{box-sizing:border-box}

html{
  color:var(--text);
  background: var(--outer-bg);
  -webkit-text-size-adjust:100%;
  scroll-behavior:auto;
}

body{
  margin:0;
  min-height:100vh;
  background: var(--outer-bg);
  font-family:var(--font-sans);
  font-size:16px;
  line-height:1.75;
  letter-spacing:0.01em;
  text-rendering:optimizeLegibility;
}

::selection{background:rgba(76,125,240,0.22)}

a{color:var(--accent); text-decoration:none}
a:hover{color:var(--accent-strong); text-decoration:underline}
a:visited{color:rgba(76,125,240,0.92)}

:target{scroll-margin-top:calc(var(--topbar-h) + 18px)}
h2, h3, h4, h5, h6{scroll-margin-top:calc(var(--topbar-h) + 18px)}

/* Topbar */
.docs-topbar{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter:none;
  background:var(--surface);
  border-bottom:1px solid rgba(178,190,222,0.34);
  box-shadow:0 1px 0 rgba(15, 23, 42, 0.04);
}

.docs-topbar-inner{
  height:var(--topbar-h);
  max-width:var(--shell-max);
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  gap:14px;
}

.docs-brand{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.docs-brand a{
  font-family:var(--font-display);
  font-weight:800;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:var(--accent);
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.docs-brand small{
  color:var(--text-dim);
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.docs-spacer{flex:1}

.docs-home-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(146,161,198,0.28);
  background:var(--surface);
  color:var(--text-dim);
  font-size:12.5px;
  font-weight:650;
  line-height:1;
  text-decoration:none;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}
.docs-home-btn:visited{color:var(--text-dim)}
.docs-home-btn:hover{
  background:rgba(76,125,240,0.10);
  border-color:rgba(76,125,240,0.24);
  color:var(--text);
  text-decoration:none;
}
.docs-home-btn:active{transform:translateY(1px)}
.docs-home-btn:focus-visible{
  outline:3px solid rgba(76,125,240,0.22);
  outline-offset:3px;
}
.docs-home-ico{width:16px; height:16px; color:currentColor; opacity:0.9}
.docs-home-text{white-space:nowrap}

/* Shell */
.docs-shell{
  max-width:var(--shell-max);
  margin:18px auto 64px;
  padding:0 20px;
  display:grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap:18px;
}

/* TOC */
aside.docs-toc{
  position:sticky;
  top:calc(var(--topbar-h) + 12px);
  align-self:start;
  padding:16px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow-soft);
  max-height: calc(100vh - (var(--topbar-h) + 32px));
  overflow:auto;
}

nav[role="doc-toc"] > h2{
  margin:0 0 10px;
  font-size:12px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--text-dim);
}

nav[role="doc-toc"] ul{list-style:none; margin:0; padding:0}
nav[role="doc-toc"] li{margin:0; padding:0}

nav[role="doc-toc"] a{
  display:block;
  padding:8px 10px;
  border-radius:12px;
  color:#334155;
  border:1px solid transparent;
  position:relative;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
}

nav[role="doc-toc"] a:hover{
  color:var(--text);
  background:rgba(76,125,240,0.08);
  border-color:rgba(76,125,240,0.14);
  text-decoration:none;
}

nav[role="doc-toc"] a.is-active{
  color:var(--text);
  background:rgba(76,125,240,0.07);
  border-color:rgba(76,125,240,0.12);
  box-shadow:inset 2px 0 0 rgba(76,125,240,0.50);
  font-weight:650;
}

nav[role="doc-toc"] ul ul a{padding-left:20px; font-size:14px}
nav[role="doc-toc"] ul ul ul a{padding-left:30px; font-size:13.5px}

/* Main card */
main.docs-main{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
  overflow:hidden;
  animation: docsEnter .35s ease;
}

@keyframes docsEnter{
  from{opacity:0; transform:translateY(8px)}
  to{opacity:1; transform:translateY(0)}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  main.docs-main{animation:none}
  .docs-home-btn{transition:none}
  .docs-heading-anchor{transition:none}
}

/* Title block */
header#title-block-header{
  position:relative;
  padding:24px 30px 18px;
  background:var(--surface);
  border-bottom:1px solid rgba(146,161,198,0.18);
}
header#title-block-header::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:12px;
  /* Subtle horizontal highlight; avoids "whole page gradient" while adding a bit of polish. */
  background:linear-gradient(90deg,
    rgba(76,125,240,0.00),
    rgba(76,125,240,0.28),
    rgba(76,125,240,0.00)
  );
  box-shadow: inset 0 -1px 0 rgba(76,125,240,0.16);
  pointer-events:none;
}

h1.title{
  margin:0 0 10px;
  font-family:var(--font-display);
  font-size:clamp(28px, 2.5vw, 40px);
  font-weight:820;
  line-height:1.12;
  letter-spacing:0.01em;
  color:var(--text);
}

p.subtitle{margin:0 0 10px; color:var(--text-dim)}
p.author, p.date{margin:0; color:rgba(116,128,163,0.92); font-size:13px}

/* Article */
article.docs-article{
  padding:28px 30px 36px;
}

/* Typography */
h1, h2, h3, h4, h5, h6{
  font-family:var(--font-display);
  color:var(--text);
}

h2{
  margin:32px 0 12px;
  font-size:22px;
  line-height:1.25;
  position:relative;
  padding-top:12px;
}
h2::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:88px;
  height:3px;
  border-radius:999px;
  background:rgba(76,125,240,0.96);
}

h3{margin:22px 0 10px; font-size:18px; line-height:1.3}
h4{margin:18px 0 8px; font-size:16px; line-height:1.35; color:rgba(31,39,66,0.98)}
p{margin:12px 0}
strong{font-weight:760}

/* When navigating via TOC/hash, briefly highlight the target heading. */
h2:target, h3:target, h4:target{
  border-radius:12px;
  box-shadow:0 0 0 4px rgba(76,125,240,0.12);
  background:rgba(76,125,240,0.06);
}

.docs-heading-anchor{
  margin-left:8px;
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid rgba(146,161,198,0.20);
  background:rgba(255,255,255,0.58);
  color:rgba(116,128,163,0.92);
  font-family:var(--font-mono);
  font-size:12px;
  line-height:1;
  opacity:0;
  transform:translateY(-1px);
  transition: opacity .14s ease, transform .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
  text-decoration:none;
}

h2:hover .docs-heading-anchor,
h3:hover .docs-heading-anchor,
h4:hover .docs-heading-anchor,
.docs-heading-anchor:focus-visible{
  opacity:1;
  transform:translateY(0);
}

.docs-heading-anchor:hover{
  background:rgba(76,125,240,0.10);
  border-color:rgba(76,125,240,0.24);
  color:var(--text);
  text-decoration:none;
}

.docs-heading-anchor:focus-visible{
  outline:3px solid rgba(76,125,240,0.22);
  outline-offset:2px;
}

/* Comfortable reading measure for long-form text. */
article.docs-article > :is(h2,h3,h4,h5,h6,p,ul,ol,blockquote,details){
  max-width:78ch;
  margin-left:auto;
  margin-right:auto;
}

hr{
  border:0;
  height:1px;
  background:rgba(146,161,198,0.40);
  margin:26px 0;
}

/* Lists */
ul, ol{padding-left:1.25em}
li{margin:7px 0}
li > p{margin:8px 0}
li::marker{color:rgba(76,125,240,0.70)}

/* Inline code */
code{
  font-family:var(--font-mono);
  font-size:0.92em;
  background:rgba(76,125,240,0.09);
  border:1px solid rgba(76,125,240,0.14);
  padding:2px 7px;
  border-radius:10px;
}

/* Code blocks */
pre{
  position:relative;
  margin:16px 0 18px;
  padding:38px 16px 14px;
  background:rgba(11,16,32,0.98);
  border:1px solid var(--code-border);
  border-radius:var(--radius2);
  overflow:auto;
  box-shadow:0 14px 34px rgba(17,24,39,0.18);
  tab-size:2;
}
pre::before{
  content:"";
  position:absolute;
  left:16px;
  top:12px;
  width:10px;
  height:10px;
  border-radius:999px;
  background:#ff5f57;
  box-shadow:18px 0 0 #febc2e, 36px 0 0 #28c840;
  opacity:0.75;
}
pre code{
  font-family:var(--font-mono);
  background:transparent;
  border:0;
  padding:0;
  border-radius:0;
  font-size:13px;
  line-height:1.6;
  color:#e5e7eb;
}

/* Tables */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:16px 0 20px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
}

/* FAQ table (USER.md "6. 常见问题"): make the "问题" column narrower. */
h2#常见问题 + table{
  table-layout:fixed;
  max-width:78ch;
  margin-left:auto;
  margin-right:auto;
}
h2#常见问题 + table colgroup col:nth-child(1){width:28% !important}
h2#常见问题 + table colgroup col:nth-child(2){width:72% !important}
thead th{
  text-align:left;
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:rgba(31,39,66,0.86);
  font-weight:760;
  padding:10px 12px;
  background:rgba(76,125,240,0.06);
  border-bottom:1px solid rgba(178,190,222,0.35);
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid rgba(178,190,222,0.25);
  color:var(--text);
  vertical-align:top;
}
tbody tr:nth-child(2n) td{background:rgba(2,6,23,0.012)}
tbody tr:last-child td{border-bottom:0}

/* Blockquotes */
blockquote{
  position:relative;
  margin:18px 0;
  padding:14px 14px 14px 16px;
  border-left:4px solid rgba(76,125,240,0.60);
  background:rgba(76,125,240,0.06);
  border-radius:14px;
  color:var(--text);
}
blockquote::before{
  content:"";
  position:absolute;
  left:10px;
  top:14px;
  width:6px;
  height:6px;
  border-radius:999px;
  background:rgba(76,125,240,0.72);
  box-shadow:0 0 0 6px rgba(76,125,240,0.12);
}
blockquote p{margin:8px 0}

/* Details */
details{
  margin:14px 0;
  padding:12px 12px 10px;
  border:1px solid rgba(178,190,222,0.34);
  border-radius:14px;
  background:var(--surface-soft);
  box-shadow:0 10px 26px rgba(45,69,140,0.06);
}
details[open]{background:var(--surface)}
summary{
  cursor:pointer;
  font-weight:750;
  color:var(--text);
  list-style:none;
}
summary::-webkit-details-marker{display:none}
summary::after{
  content:"";
  display:inline-block;
  width:10px;
  height:10px;
  margin-left:8px;
  border-right:2px solid rgba(116,128,163,0.85);
  border-bottom:2px solid rgba(116,128,163,0.85);
  transform:rotate(-45deg) translateY(-1px);
  transition:transform .14s ease;
}
details[open] summary::after{transform:rotate(45deg) translateY(-1px)}

/* Media */
img, svg{max-width:100%; height:auto}

/* Small screen */
@media (max-width: 980px){
  .docs-shell{
    grid-template-columns: 1fr;
    gap:12px;
    margin-top:12px;
  }
  aside.docs-toc{
    position:relative;
    top:auto;
    max-height:none;
  }
  header#title-block-header{padding:20px 18px 14px}
  article.docs-article{padding:18px}
  .docs-home-text{display:none}
}

/* Print */
@media print{
  html{background:#fff}
  body{color:#000}
  .docs-topbar, aside.docs-toc{display:none}
  .docs-shell{display:block; padding:0; margin:0}
  main.docs-main{box-shadow:none; border:0; background:transparent}
  header#title-block-header{padding:0; border:0; background:transparent}
  article.docs-article{padding:0}
  a{color:#000; text-decoration:underline}
  code{border:1px solid #ddd; background:#f8fafc}
  pre{border:1px solid #ddd; background:#f8fafc; box-shadow:none; padding:12px}
  pre::before{display:none}
  pre code{color:#111827}
}
