@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #0F1115;
  --ink-2: #131720;
  --ink-3: #171C25;
  --line: #262C37;
  --line-2: #1B2029;
  --yellow: #F5C518;
  --blue: #2D7DF6;
  --text: #E7EAEF;
  --text-2: #C6CDD7;
  --muted: #98A1AE;
  --max: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
  font-weight: 400;
}

p { margin: 0 0 16px; }
img, svg { max-width: 100%; }
a { color: var(--text); }

::selection {
  background: var(--yellow);
  color: #12151C;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.topbar-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 9px 18px;
}

.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brand .mark { flex: 0 0 auto; }
.brand:hover .brand-name { color: var(--yellow); }

.dept { position: relative; }

.dept summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 16px;
  font-weight: 500;
  transition: color .16s ease, border-color .16s ease;
}

.dept summary::-webkit-details-marker { display: none; }
.dept summary::marker { content: ''; }

.dept summary:hover { color: var(--yellow); border-color: var(--yellow); }
.dept[open] summary { color: var(--yellow); border-color: var(--yellow); }

.bars {
  display: block;
  width: 14px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.bars::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 2px;
  background: currentColor;
}

.drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  min-width: 216px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--yellow);
}

.drop-right { left: auto; right: 0; }

.drop a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 16px;
  border-left: 2px solid transparent;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.drop a:hover {
  color: var(--yellow);
  background: var(--ink-3);
  border-left-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--text);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

.btn-solid {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #12151C;
}

.btn-solid:hover { background: transparent; color: var(--yellow); }

.btn-line {
  border-color: var(--yellow);
  border-bottom-width: 3px;
  color: var(--yellow);
}

.btn-line:hover { background: var(--yellow); color: #12151C; }

/* ---------- 粘性锚点条 ---------- */
.anchors {
  position: sticky;
  top: 0;
  z-index: 55;
  overflow-x: auto;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.anchors-list {
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: max-content;
  min-width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 12px;
  list-style: none;
}

.anchors a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}

.anchors .num {
  font-size: 12px;
  color: #4E5867;
  font-variant-numeric: tabular-nums;
}

.anchors a:hover,
.anchors a[aria-current="true"] {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

.anchors a[aria-current="true"] .num { color: var(--blue); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background-color: var(--ink);
  background-image: radial-gradient(rgba(45, 125, 246, .30) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
}

.hero-in {
  display: flex;
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
  min-height: 70vh;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) 18px;
}

.hero-copy { flex: 1 1 auto; min-width: 0; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .26em;
  color: var(--blue);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 50px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
}

.lede {
  max-width: 52ch;
  margin: 18px 0 26px;
  color: var(--text-2);
  font-size: 17px;
}

.hero-art {
  flex: 0 0 clamp(150px, 26vw, 260px);
  padding-left: clamp(12px, 2vw, 24px);
  border-left: 1px solid var(--line);
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 3px solid var(--blue);
}

/* ---------- 主体 ---------- */
.wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 68px) 18px clamp(48px, 7vw, 84px);
}

.toc {
  position: sticky;
  top: 70px;
  border-top: 3px solid var(--yellow);
  padding-top: 16px;
}

.toc h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--text);
}

.toc hr {
  margin: 0 0 14px;
  border: 0;
  border-top: 1px solid var(--line);
}

.toc-list {
  counter-reset: toc;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list li { counter-increment: toc; }

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
  border-bottom: 1px solid var(--line-2);
  transition: color .16s ease;
}

.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: 12px;
  color: #535D6C;
  font-variant-numeric: tabular-nums;
}

.toc-list a:hover { color: var(--yellow); }

.doc { min-width: 0; }

/* ---------- 正文 ---------- */
.prose {
  max-width: 74ch;
  overflow-wrap: break-word;
}

.prose > section {
  scroll-margin-top: 76px;
  padding-bottom: clamp(24px, 3.4vw, 38px);
  border-bottom: 2px solid var(--line-2);
}

.prose > section + section {
  margin-top: clamp(24px, 3.4vw, 38px);
  padding-top: clamp(24px, 3.4vw, 38px);
  border-top: 1px solid var(--line-2);
}

.prose h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  letter-spacing: -.01em;
  font-weight: 700;
}

.prose h2 + hr {
  width: 64px;
  margin: 0 0 20px;
  border: 0;
  border-top: 3px solid var(--blue);
}

.prose h3 {
  margin: 26px 0 8px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
}

.prose p { color: var(--text-2); }
.prose li { color: var(--text-2); margin-bottom: 8px; }
.prose strong { color: #fff; }
.prose em { color: var(--yellow); font-style: normal; }

.prose ul,
.prose ol { padding-left: 1.25em; margin: 0 0 16px; }

.prose a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 125, 246, .5);
}

.prose a:hover {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--blue);
  background: var(--ink-2);
}

.prose blockquote p:last-child { margin: 0; }

.prose hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose img {
  display: block;
  margin: 20px 0;
  border-bottom: 3px solid var(--yellow);
}

.prose table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
}

.prose th { background: var(--ink-3); color: #fff; font-weight: 600; }

.prose code {
  padding: 1px 5px;
  background: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
}

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: 1.3fr .9fr .9fr 1.5fr;
  gap: clamp(18px, 3vw, 36px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 56px) 18px 0;
  border-top: 3px solid var(--yellow);
}

.foot > section {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-2);
}

.foot h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--muted);
}

.f-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.foot ul { margin: 0; padding: 0; list-style: none; }

.foot li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 3px 0;
  text-decoration: none;
  color: var(--text-2);
  font-size: 16px;
  transition: color .16s ease;
}

.foot li a:hover { color: var(--yellow); }

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub input {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.sub input::placeholder { color: #68717E; }

.sub input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.sub button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--yellow);
  border-radius: 0;
  background: var(--yellow);
  color: #12151C;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.sub button:hover { background: transparent; color: var(--yellow); }

.f-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 14px 0 22px;
  border-top: 1px solid var(--line-2);
  font-size: 15px;
  color: var(--muted);
}

.f-base p { margin: 0; }

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  text-decoration: none;
  color: var(--yellow);
  font-size: 15px;
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rv {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease;
  }
  .rv.in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .hero-in { flex-direction: column; align-items: flex-start; min-height: 0; }
  .hero-art {
    order: 2;
    flex: 0 0 auto;
    width: clamp(140px, 34vw, 200px);
    padding-left: 0;
    border-left: 0;
  }
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
  .foot { grid-template-columns: 1fr 1fr; }
  .f-brand,
  .f-sub { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .topbar-in { gap: 6px; padding: 8px 12px; }
  .topbar-right .dept { display: none; }
  .brand { font-size: 16px; }
  .brand .mark { width: 18px; height: 18px; }
  h1 { font-size: 30px; }
  .lede { font-size: 16px; margin: 14px 0 22px; }
  .anchors-list { padding: 0 8px; }
  .anchors a { padding: 0 10px; font-size: 15px; }
  .wrap { padding: 26px 14px 48px; }
  .toc-list { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; padding: 26px 14px 0; }
  .f-brand, .f-sub { grid-column: auto; }
  .prose > section { scroll-margin-top: 64px; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
