@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Nunito:ital,wght@0,700;0,800;0,900;1,700&display=swap');

:root {
  --paper: #ffffff;
  --cloud: #f5f5f5;
  --ink: #1f1f1f;
  --ink-62: rgba(31, 31, 31, 0.62);
  --ink-38: rgba(31, 31, 31, 0.38);
  --ink-12: rgba(31, 31, 31, 0.12);
  --edge: 2px solid var(--ink);
  --hair: 1px solid var(--ink-12);
  --r-card: 4px;
  --r-soft: 16px;
  --r-pill: 999px;
  --e1: 0 1px 0 var(--ink);
  --e2: 0 2px 0 var(--ink), 0 10px 22px -14px rgba(31, 31, 31, 0.55);
  --e3: 0 4px 0 var(--ink), 0 20px 34px -18px rgba(31, 31, 31, 0.55);
  --e4: 0 8px 0 var(--ink), 0 34px 64px -32px rgba(31, 31, 31, 0.6);
  --shell: 1160px;
  --font-body: "Nunito", "DM Sans", -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-head: "Nunito", "DM Sans", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  font-weight: 400;
  letter-spacing: 0.005em;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.012em;
  margin: 0 0 0.55em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

ol, ul {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

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

/* ---------- 顶部主导航 ---------- */

.masthead {
  background: var(--paper);
  border-bottom: var(--edge);
  position: relative;
  z-index: 20;
}

.rail {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.rail-side {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.rail-left {
  justify-content: flex-start;
}

.rail-right {
  justify-content: flex-end;
}

.rail-side a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 16px;
  border: 2px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rail-side a:hover {
  text-decoration: none;
  background: var(--cloud);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border: var(--edge);
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: var(--e2);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.01em;
  z-index: 3;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  line-height: 1;
}

.brand-name {
  white-space: nowrap;
}

/* ---------- 大图头屏 ---------- */

.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(155deg, #1f1f1f 0%, #454545 55%, #1f1f1f 100%);
  border-bottom: var(--edge);
}

.hero-media {
  position: absolute;
  inset: -24% 0;
  z-index: 0;
  will-change: transform;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 92% at 50% 42%, rgba(31, 31, 31, 0.22), rgba(31, 31, 31, 0.84) 78%),
    linear-gradient(180deg, rgba(31, 31, 31, 0.62) 0%, rgba(31, 31, 31, 0.18) 40%, rgba(31, 31, 31, 0.78) 100%);
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 940px;
  padding: 40px 22px;
  text-align: center;
}

.hero-title {
  color: var(--paper);
  font-size: clamp(1.95rem, 5.4vw, 3.5rem);
  text-shadow: 0 3px 0 rgba(31, 31, 31, 0.42), 0 18px 42px rgba(0, 0, 0, 0.4);
  margin: 0;
  word-break: break-word;
}

.hero-contact {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 2px solid var(--paper);
  border-radius: var(--r-pill);
  color: var(--paper);
  font-weight: 800;
  font-size: 16px;
  background: rgba(31, 31, 31, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, color 0.2s ease;
}

.hero-contact:hover {
  text-decoration: none;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- 锚点条 ---------- */

.anchors {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: var(--edge);
  box-shadow: 0 10px 26px -22px rgba(31, 31, 31, 0.9);
}

.anchors-list {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.anchors-list::-webkit-scrollbar {
  display: none;
}

.anchors-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 15px;
  white-space: nowrap;
  border: 2px solid var(--ink-12);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-62);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.anchors-list a:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: var(--ink);
}

.anchors-list a.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- 主体骨架 ---------- */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 38px 20px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 38px;
  align-items: start;
  position: relative;
  z-index: 2;
}

.doc {
  min-width: 0;
}

.content > section {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--r-card);
  padding: 24px 22px 20px;
  margin: 0 0 20px;
  scroll-margin-top: 96px;
}

.content > section:last-child {
  margin-bottom: 0;
}

.content > section:nth-child(even) {
  background: #fcfcfc;
}

.content > section:nth-child(odd) {
  z-index: 2;
}

.content h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.content h2 > span,
.content h3 > span {
  display: inline-block;
}

.content h2 > span::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 10px;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--ink);
}

.content h3 {
  font-size: 1.16rem;
  margin-top: 1.3em;
}

.content h3 > span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 9px;
  vertical-align: 6px;
  background: var(--ink);
}

.content p,
.content li {
  font-size: 16.5px;
}

.content ul,
.content ol {
  padding-left: 4px;
  margin: 0 0 1em;
}

.content ul > li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.45em;
}

.content ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.content ol {
  counter-reset: point;
}

.content ol > li {
  counter-increment: point;
  position: relative;
  padding-left: 30px;
  margin-bottom: 0.55em;
}

.content ol > li::before {
  content: counter(point, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-weight: 900;
  font-size: 13px;
  color: var(--ink-62);
}

.content blockquote {
  margin: 1.2em 0;
  padding: 14px 16px;
  border-left: 4px solid var(--ink);
  background: var(--cloud);
  border-radius: 0 var(--r-card) var(--r-card) 0;
}

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

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 16px;
}

.content th,
.content td {
  border: var(--hair);
  padding: 9px 11px;
  text-align: left;
}

.content th {
  background: var(--cloud);
  font-weight: 800;
}

.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
  background: var(--cloud);
  border-radius: 4px;
  padding: 1px 5px;
}

.content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* ---------- 侧栏 ---------- */

.side {
  position: sticky;
  top: 74px;
  align-self: start;
  z-index: 3;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 20px 18px;
  border: var(--edge);
  border-radius: var(--r-soft);
  background:
    radial-gradient(120% 90% at 84% -12%, rgba(31, 31, 31, 0.06), transparent 62%),
    var(--cloud);
  box-shadow: var(--e3);
}

.side-h {
  font-size: 15px;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
  color: var(--ink);
}

.side-h + .toc {
  margin-bottom: 20px;
}

.side-h > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--ink);
}

.toc li + li {
  margin-top: 2px;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-62);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.toc a:hover {
  text-decoration: none;
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

.toc em {
  font-style: normal;
  font-weight: 900;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-38);
}

.side-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  border: var(--edge);
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--e1);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.side-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--e2);
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-62);
  border: 2px dashed var(--ink-38);
}

.side-top:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: var(--ink);
  border-style: solid;
}

/* ---------- 页脚 ---------- */

.foot {
  position: relative;
  z-index: 4;
  border-top: var(--edge);
  background: var(--cloud);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 22px 18px 30px;
  box-shadow: 0 -12px 30px -28px rgba(31, 31, 31, 0.9);
}

.foot-brand a {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.foot-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--r-pill);
  font-size: 15.5px;
  color: var(--ink-62);
  font-weight: 700;
}

.foot-nav a:hover {
  text-decoration: none;
  background: var(--paper);
  color: var(--ink);
}

.foot-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink-62);
  font-weight: 700;
}

.foot-copy .dot {
  color: var(--ink-38);
}

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .toc li {
    animation: rise 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  }

  .toc li:nth-child(1) { animation-delay: 0.04s; }
  .toc li:nth-child(2) { animation-delay: 0.09s; }
  .toc li:nth-child(3) { animation-delay: 0.14s; }
  .toc li:nth-child(4) { animation-delay: 0.19s; }
  .toc li:nth-child(5) { animation-delay: 0.24s; }
  .toc li:nth-child(6) { animation-delay: 0.29s; }
  .toc li:nth-child(7) { animation-delay: 0.34s; }

  .anchors-list a {
    animation: rise 0.45s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  }

  .anchors-list li:nth-child(1) a { animation-delay: 0.02s; }
  .anchors-list li:nth-child(2) a { animation-delay: 0.06s; }
  .anchors-list li:nth-child(3) a { animation-delay: 0.1s; }
  .anchors-list li:nth-child(4) a { animation-delay: 0.14s; }
  .anchors-list li:nth-child(5) a { animation-delay: 0.18s; }
  .anchors-list li:nth-child(6) a { animation-delay: 0.22s; }
  .anchors-list li:nth-child(7) a { animation-delay: 0.26s; }
}

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

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 254px;
    gap: 26px;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 26px 16px 56px;
    gap: 26px;
  }

  .side {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .content > section {
    padding: 20px 16px 16px;
    scroll-margin-top: 84px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .rail {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px 12px;
    gap: 6px;
  }

  .brand {
    order: -1;
    justify-self: center;
    font-size: 18px;
  }

  .rail-side {
    justify-content: center;
    gap: 0;
  }

  .rail-side a {
    padding: 8px 9px;
    font-size: 15.5px;
  }

  .hero {
    min-height: 56vh;
  }

  .hero-in {
    padding: 56px 18px 30px;
  }

  .hero-contact {
    top: 12px;
    right: 12px;
    left: auto;
  }

  .foot {
    padding: 18px 12px 26px;
    gap: 6px 12px;
  }

  .foot-copy {
    flex-basis: 100%;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .rail-side a {
    font-size: 15px;
    padding: 8px 8px;
  }
}

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