:root {
  --bg: #f6f8fb;
  --surface: #fff;
  --text: #1a2332;
  --text-muted: #5c6b7f;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e5e9f0;
  --warn-bg: #fff7ed;
  --warn-border: #fdba74;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --prompt-bg: #f1f5f9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.9;
}

.shell {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
}

.brand {
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:not(.brand) {
  color: var(--text-muted);
}

header.page-head {
  margin-bottom: 1.75rem;
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 1rem;
  color: #0f172a;
}

.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
}

.note-inline {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  font-size: 0.95rem;
}

.note-inline strong {
  color: var(--text);
}

nav.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

nav.toc strong {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

nav.toc ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
}

nav.toc li {
  margin: 0.35rem 0;
}

article section {
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.28rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  color: #0f172a;
}

h3 {
  font-size: 1.08rem;
  margin: 1.35rem 0 0.5rem;
  color: #172033;
}

p {
  margin: 0 0 0.9rem;
}

ul,
ol {
  margin: 0 0 0.95rem;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.35rem;
}

.callout-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

.callout-warn strong {
  color: #9a3412;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
}

pre.prompt {
  background: var(--prompt-bg);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}

pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article-figure {
  margin: 1.4rem 0 1.7rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.article-figure figcaption {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-list {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.article-card h2 {
  border: 0;
  padding: 0;
  margin-bottom: 0.45rem;
  font-size: 1.15rem;
}

.article-card h2 a {
  color: inherit;
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.article-card .doc-meta {
  margin-bottom: 0.35rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #0f172a;
  background: #eef3f8;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin-top: 0;
  font-size: 1.02rem;
}

footer.page-foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.back-to-top {
  position: fixed;
  right: max(1rem, calc((100vw - 44rem) / 2 - 4rem));
  bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: #0f172a;
  box-shadow: var(--shadow);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.back-to-top:hover,
.back-to-top:focus {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

@media (max-width: 560px) {
  .shell {
    padding-top: 1.25rem;
  }

  .site-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    min-width: 42rem;
  }

  .back-to-top {
    right: 1rem;
    bottom: 1rem;
  }
}
