@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --ink: #171f26;
  --ink-2: #3c4b57;
  --ink-3: #5d6d7a;
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --bg-a: #e9f1f9;
  --bg-b: #f8ecf1;
  --glass: rgba(255, 255, 255, 0.58);
  --edge: rgba(255, 255, 255, 0.72);
  --r: 14px;
  --sh: -6px -6px 14px rgba(255, 255, 255, 0.92), 6px 6px 16px rgba(23, 31, 38, 0.13);
  --sh-sm: -3px -3px 8px rgba(255, 255, 255, 0.9), 3px 3px 8px rgba(23, 31, 38, 0.11);
  --sh-in: inset -4px -4px 10px rgba(255, 255, 255, 0.85), inset 4px 4px 10px rgba(23, 31, 38, 0.1);
  --mono: 'Share Tech Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace;
  --body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: linear-gradient(155deg, var(--bg-a) 0%, #eef2f8 46%, var(--bg-b) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  text-underline-offset: 3px;
}

a { color: #1d4b6a; }

:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 3px;
}

/* ---------- 顶部细条 ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: linear-gradient(90deg, #d5e8f7 0%, #f7e4ec 100%);
  box-shadow: 0 3px 10px rgba(23, 31, 38, 0.1);
}

.bar-t {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.34em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 左侧固定竖排导航 ---------- */
.rail {
  position: fixed;
  top: 34px;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 216px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 26px;
  overflow-y: auto;
  background: linear-gradient(180deg, #e4eff9 0%, #f7eaf0 100%);
  box-shadow: 7px 0 18px rgba(23, 31, 38, 0.08);
}

.brand {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: linear-gradient(145deg, #dcebf8, var(--blue));
  box-shadow: var(--sh-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.brand:active { transform: scale(0.96); box-shadow: var(--sh-in); }
.brand .mark { width: 26px; height: 26px; object-fit: contain; display: block; }
.brand-glyph { font-family: var(--mono); font-size: 20px; line-height: 1; }

.nav { min-width: 0; }

.nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav li {
  animation: rise 480ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.nav li:nth-child(1) { animation-delay: 40ms; }
.nav li:nth-child(2) { animation-delay: 90ms; }
.nav li:nth-child(3) { animation-delay: 140ms; }
.nav li:nth-child(4) { animation-delay: 190ms; }
.nav li:nth-child(5) { animation-delay: 240ms; }
.nav li:nth-child(6) { animation-delay: 290ms; }
.nav li:nth-child(7) { animation-delay: 340ms; }

.nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  transition: background 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav a:hover {
  background: linear-gradient(145deg, #faedf3, var(--pink));
  box-shadow: var(--sh-sm);
  color: var(--ink);
}

.nav a:active { transform: scale(0.98); }

.nav a[aria-current='true'] {
  background: linear-gradient(145deg, #e7f1fa, var(--blue));
  box-shadow: var(--sh-in);
  color: var(--ink);
}

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

/* ---------- 主体 ---------- */
main {
  margin-left: 216px;
  padding-top: 34px;
  display: block;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  align-items: center;
  padding: 38px 40px 32px;
  background: linear-gradient(118deg, #dcecf9 0%, #f2e6ef 62%, #f7e7ee 100%);
  box-shadow: inset 0 -10px 24px rgba(255, 255, 255, 0.55);
}

.hero-bg {
  position: absolute;
  right: 1%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(96px, 17vw, 210px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.66);
  pointer-events: none;
  user-select: none;
}

.hero-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 900px;
}

.hero-txt { min-width: 0; }

.hero-txt h1 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(26px, 3.3vw, 40px);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.hero-lead {
  margin: 0;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.8;
}

.hero-ico {
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: linear-gradient(145deg, #fdf5f8, var(--pink));
  box-shadow: var(--sh);
}

.hero-ico svg { width: 28px; height: 28px; color: var(--ink); }

/* ---------- 双栏 ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 40px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 32px;
  align-items: start;
}

.main-col { min-width: 0; }

section { display: block; }

section > article {
  position: relative;
  margin: 0 0 22px;
  padding: 26px 26px 20px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--blue);
  border-radius: 0;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 26px rgba(23, 31, 38, 0.07);
  scroll-margin-top: 56px;
  overflow-wrap: break-word;
}

section > article:nth-child(even) { border-left-color: var(--pink); }

section > article:target {
  border-left-color: var(--ink);
  box-shadow: 0 12px 26px rgba(23, 31, 38, 0.14);
}

small {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

section h2 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.45;
}

section h3 {
  margin: 22px 0 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.5;
}

section p { margin: 0 0 14px; line-height: 1.85; color: #202d37; }
section p:last-child { margin-bottom: 0; }

section ul, section ol { margin: 0 0 14px; padding-left: 1.3em; line-height: 1.85; }
section li { margin: 0.35em 0; }

section blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: var(--r);
  background: linear-gradient(145deg, #f2f8fd, #e6f1fa);
  box-shadow: var(--sh-in);
  color: var(--ink-2);
}

section img { max-width: 100%; height: auto; border-radius: var(--r); }
section code { font-family: var(--mono); font-size: 0.95em; }
section pre {
  margin: 0 0 14px;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: var(--r);
  background: #dfeaf4;
  box-shadow: var(--sh-in);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
}
section pre code { font-size: inherit; }

section table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 16px; }
section th, section td { padding: 9px 10px; border-bottom: 1px solid rgba(23, 31, 38, 0.12); text-align: left; }

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 54px;
  padding: 18px;
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--sh);
}

.side h2 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.4;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.side-list li { animation: rise 460ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.side-list li:nth-child(1) { animation-delay: 60ms; }
.side-list li:nth-child(2) { animation-delay: 105ms; }
.side-list li:nth-child(3) { animation-delay: 150ms; }
.side-list li:nth-child(4) { animation-delay: 195ms; }
.side-list li:nth-child(5) { animation-delay: 240ms; }
.side-list li:nth-child(6) { animation-delay: 285ms; }
.side-list li:nth-child(7) { animation-delay: 330ms; }

.side-list a {
  display: block;
  min-height: 40px;
  padding: 9px 10px;
  border-left: 2px solid transparent;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.side-list a:hover {
  background: rgba(200, 224, 244, 0.6);
  border-left-color: var(--ink);
  color: var(--ink);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-left: 216px;
  padding: 24px 40px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 30px;
  background: linear-gradient(90deg, #e2eef8 0%, #f7eaf0 100%);
  box-shadow: inset 0 6px 14px rgba(255, 255, 255, 0.7);
}

.foot dl {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

.foot dt {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.foot dd { margin: 0; }

.foot dd a {
  display: inline-block;
  padding: 9px 3px;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}

.foot dd a:hover { text-decoration: underline; }

.totop {
  display: inline-block;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fdf5f8, var(--pink));
  box-shadow: var(--sh-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}

.totop:active { transform: scale(0.98); box-shadow: var(--sh-in); }

.copy {
  margin: 0 0 0 auto;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .bar { position: static; height: 32px; padding: 0 16px; }
  .bar-t { font-size: 12px; letter-spacing: 0.24em; }

  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(23, 31, 38, 0.09);
  }

  .brand { width: 44px; height: 44px; }

  .nav { flex: 1; min-width: 0; overflow-x: auto; }

  .nav ol { flex-direction: row; gap: 6px; padding-bottom: 2px; }

  .nav a { white-space: nowrap; min-height: 40px; padding: 9px 11px; }

  main { margin-left: 0; padding-top: 0; }

  .hero { min-height: 40vh; padding: 22px 18px 24px; }
  .hero-row { gap: 14px; }
  .hero-ico { width: 48px; height: 48px; }
  .hero-ico svg { width: 22px; height: 22px; }
  .hero-txt h1 { font-size: clamp(24px, 7vw, 30px); }
  .hero-lead { font-size: 16px; }

  .wrap { grid-template-columns: 1fr; gap: 22px; padding: 22px 16px 8px; }

  .side { position: static; }

  section > article { padding: 20px 16px 16px; }

  .foot { margin-left: 0; padding: 20px 16px 28px; }
  .copy { margin: 6px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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