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

:root {
  --paper: #fdfbf7;
  --wash: #f5f5f5;
  --ink: #1a1a1a;
  --soft: #4c4c4c;
  --line: #e0e0e0;
  --line2: #cfc9bf;
  --glass: rgba(255, 255, 255, 0.62);
  --r: 18px;
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

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

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

a:hover {
  background: var(--wash);
}

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

code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0.02em;
}

/* 页头：品牌独占一行，菜单为第二行胶囊组 */
.masthead {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0;
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

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

.contact {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--soft);
  font-size: 15px;
}

.navrow {
  padding: 12px 0 14px;
}

.drawer > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  list-style: none;
}

.drawer > summary::-webkit-details-marker {
  display: none;
}

.drawer > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
}

.drawer[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}

.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 16px;
  text-decoration: none;
}

.chips a:hover,
.chips a:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* 主栅格：正文在左，aside 固定在右侧 */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 48px;
  align-items: start;
}

.doc {
  min-width: 0;
  counter-reset: sec;
}

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 70vh;
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line);
}

.backdrop {
  position: absolute;
  top: 4px;
  left: -8px;
  z-index: 0;
  color: #eae5db;
  font-size: clamp(54px, 15vw, 168px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.055em;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 21ch;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.lead {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  max-width: 50ch;
  color: var(--soft);
  font-size: 17px;
}

.herofigure {
  position: relative;
  z-index: 1;
  margin: 28px 0 0;
}

.herofigure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* 正文分节 */
.doc > div {
  position: relative;
  padding: 46px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: sec;
  scroll-margin-top: 22px;
}

.doc > div::before {
  content: "0" counter(sec);
  position: absolute;
  top: 48px;
  right: 0;
  color: var(--line2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.doc div h2 {
  margin: 0 0 16px;
  max-width: 24ch;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.doc div h3 {
  margin: 28px 0 10px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.doc div p {
  margin: 0 0 16px;
  max-width: 66ch;
}

.doc div ul,
.doc div ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
  max-width: 66ch;
}

.doc div li {
  margin: 0 0 8px;
}

.doc div figure {
  margin: 22px 0;
}

.doc div img {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.doc div blockquote {
  margin: 22px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--ink);
  color: var(--soft);
}

.doc div table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

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

/* 侧栏 */
.rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
}

.railbox {
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.railbox h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

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

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 16px;
  text-decoration: none;
}

.toc a:hover {
  background: #fff;
  text-decoration: underline;
}

.railhost {
  margin: 0 0 10px;
}

.railhost code {
  font-size: 15px;
}

.top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
}

/* 页脚：单行极简 */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px 44px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
}

.foot p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.foot small {
  color: var(--soft);
  font-size: 15px;
}

/* 动效：瞬时、无模糊 */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .lead,
  .herofigure {
    animation: rise 0.28s ease-out both;
  }

  .lead {
    animation-delay: 0.04s;
  }

  .herofigure {
    animation-delay: 0.08s;
  }

  .doc > div {
    animation: rise 0.26s ease-out both;
  }

  .doc > div:nth-child(2) { animation-delay: 0.02s; }
  .doc > div:nth-child(3) { animation-delay: 0.04s; }
  .doc > div:nth-child(4) { animation-delay: 0.06s; }
  .doc > div:nth-child(5) { animation-delay: 0.08s; }
  .doc > div:nth-child(6) { animation-delay: 0.1s; }
  .doc > div:nth-child(7) { animation-delay: 0.12s; }
  .doc > div:nth-child(8) { animation-delay: 0.14s; }
  .doc > div:nth-child(9) { animation-delay: 0.16s; }

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

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .rail {
    position: static;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 17px;
  }

  .masthead {
    padding: 14px 16px 0;
  }

  .wrap {
    padding: 4px 16px 48px;
  }

  .hero {
    min-height: 0;
    padding-top: 62px;
  }

  .backdrop {
    top: 8px;
    font-size: clamp(46px, 21vw, 92px);
  }

  .chips a {
    padding: 9px 13px;
    font-size: 16px;
  }

  .doc > div {
    padding: 34px 0;
  }

  .doc > div::before {
    top: 36px;
  }

  .foot {
    padding: 18px 16px 36px;
  }
}

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