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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --ink-2: #3c3c3c;
  --ink-3: #6d6d6d;
  --line: #e3e3e3;
  --r: 10px;
  --e1: 0 1px 2px rgba(31, 31, 31, .07), 0 1px 1px rgba(31, 31, 31, .04);
  --e2: 0 4px 12px rgba(31, 31, 31, .08), 0 2px 4px rgba(31, 31, 31, .05);
  --e3: 0 14px 30px rgba(31, 31, 31, .11), 0 5px 10px rgba(31, 31, 31, .06);
  --e4: 0 28px 60px rgba(31, 31, 31, .16), 0 10px 20px rgba(31, 31, 31, .09);
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: 'Baloo 2', 'Comic Neue', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: .01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 460px at 8% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(520px 420px at 96% 6%, #e9e9e9 0%, rgba(233, 233, 233, 0) 72%),
    linear-gradient(180deg, #ffffff 0%, #f5f5f5 45%, #f2f2f2 100%);
}

img { max-width: 100%; }

a { color: var(--ink); }

:focus-visible {
  outline: 3px solid #8c8c8c;
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e1);
}

.barTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
}

.brandImg {
  display: block;
  height: 26px;
  width: auto;
  border-radius: 6px;
  box-shadow: var(--e1);
}

.brandMark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.burger {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--e2);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.burger:hover { transform: translateY(-1px); box-shadow: var(--e3); }
.burger:active { transform: translateY(0); box-shadow: var(--e1); }

.strip {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }

.anchors {
  display: flex;
  gap: 6px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px 9px;
}

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  white-space: nowrap;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  box-shadow: var(--e1);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.anchors a:hover,
.anchors a:focus-visible {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* ---------- 全屏遮罩菜单 ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(31, 31, 31, .58);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  visibility: hidden;
  opacity: 0;
  transition: opacity .28s ease, visibility .28s ease;
}

.veil.open { visibility: visible; opacity: 1; }

.veilNav {
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 92px 20px 40px;
  overflow-y: auto;
}

.veilNav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: item;
}

.veilNav li {
  counter-increment: item;
  margin-bottom: 10px;
}

.veilNav li a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--e3);
  opacity: 0;
  transform: translateY(16px);
  transition: transform .35s ease, opacity .35s ease, background .2s ease, color .2s ease;
}

.veilNav li a::before {
  content: counter(item, decimal-leading-zero);
  font-family: 'Comic Neue', monospace;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--ink-3);
}

.veilNav li a:hover {
  background: var(--ink);
  color: #fff;
  transform: translateX(4px);
}

.veil.open .veilNav li a { opacity: 1; transform: none; }
.veil.open .veilNav li:nth-child(1) a { transition-delay: .04s; }
.veil.open .veilNav li:nth-child(2) a { transition-delay: .08s; }
.veil.open .veilNav li:nth-child(3) a { transition-delay: .12s; }
.veil.open .veilNav li:nth-child(4) a { transition-delay: .16s; }
.veil.open .veilNav li:nth-child(5) a { transition-delay: .20s; }
.veil.open .veilNav li:nth-child(6) a { transition-delay: .24s; }
.veil.open .veilNav li:nth-child(7) a { transition-delay: .28s; }

/* ---------- 主体骨架 ---------- */
main {
  position: relative;
  z-index: 1;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-areas:
    "title title"
    "hero  hero"
    "prose side";
  gap: 26px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 16px 12px;
}

.boardTitle {
  grid-area: title;
  margin: 0;
  max-width: 24ch;
  font-size: clamp(27px, 4.6vw, 48px);
  line-height: 1.24;
  letter-spacing: -.012em;
  font-weight: 700;
  z-index: 3;
}

.hero {
  grid-area: hero;
  position: relative;
  margin: 0;
  min-height: 70vh;
  border-radius: 14px;
  overflow: hidden;
  z-index: 2;
  box-shadow: var(--e4);
  background:
    radial-gradient(420px 260px at 20% 10%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(145deg, #ffffff 0%, #ececec 55%, #dcdcdc 100%);
}

.hero img {
  position: absolute;
  inset: -8% 0 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 84px;
  z-index: 2;
  background: #1f1f1f;
  opacity: .9;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* ---------- 正文 ---------- */
.prose {
  grid-area: prose;
  min-width: 0;
}

.prose > article {
  position: relative;
  z-index: 1;
  margin: 0 0 26px;
  padding: 26px 22px;
  background: var(--paper);
  border-radius: var(--r);
  border-bottom: 4px solid var(--ink);
  box-shadow: var(--e2);
}

.prose > article:nth-child(even) {
  margin-left: 12px;
  z-index: 2;
  box-shadow: var(--e3);
}

.prose > article[id] { scroll-margin-top: 138px; }

.prose h2 {
  margin: 0 0 .3em;
  font-size: clamp(21px, 2.7vw, 28px);
  line-height: 1.36;
  letter-spacing: -.01em;
  font-weight: 700;
}

.prose h3 {
  margin: 1.4em 0 .4em;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
}

.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.prose p.subtitle,
.prose .subtitle {
  margin: -.1em 0 1em;
  color: var(--ink-3);
  font-size: 15px;
  letter-spacing: .04em;
}

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

.prose li { margin: .35em 0; }

.prose a {
  text-decoration: underline;
  text-decoration-color: #bcbcbc;
  text-underline-offset: 3px;
}

.prose a:hover { text-decoration-color: var(--ink); }

.prose img {
  display: block;
  height: auto;
  margin: 1.1em 0;
  border-radius: var(--r);
  box-shadow: var(--e1);
}

.prose blockquote {
  margin: 1.1em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--ink);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--mist);
  box-shadow: var(--e1);
}

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

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

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

.prose th { background: var(--mist); font-weight: 600; }

.prose code {
  font-family: 'Comic Neue', ui-monospace, monospace;
  font-size: .95em;
  padding: .1em .35em;
  border-radius: 6px;
  background: var(--mist);
}

/* ---------- 右侧栏 ---------- */
.side {
  grid-area: side;
  position: sticky;
  top: 130px;
  z-index: 3;
  padding: 20px 16px;
  background: var(--paper);
  border-radius: var(--r);
  border-bottom: 4px solid var(--ink);
  box-shadow: var(--e3);
}

.side h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: .01em;
}

.side p.subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--ink-3);
}

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

.side a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--mist);
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.side a:hover,
.side a:focus-visible {
  background: var(--ink);
  color: #fff;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 26px;
  align-items: start;
  max-width: 1180px;
  margin: 26px auto 0;
  padding: 26px 16px 18px;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 34px rgba(31, 31, 31, .07);
  border-top: 1px solid var(--line);
}

.footBrand .brand { padding-left: 0; }

.footNav dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  margin: 0;
}

.footNav dt { margin: 0; }

.footNav dd {
  margin: 0;
  font-size: 12px;
  letter-spacing: .14em;
  color: #a6a6a6;
}

.footNav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 4px;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.footNav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

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

.footForm input {
  flex: 1 1 150px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--mist);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  box-shadow: inset var(--e1);
}

.footForm button {
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--e2);
  transition: transform .18s ease, box-shadow .18s ease;
}

.footForm button:hover { transform: translateY(-1px); box-shadow: var(--e3); }

.copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 入场 ---------- */
.has-js .boardTitle,
.has-js .hero,
.has-js .prose > article,
.has-js .side {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .68, .24, 1);
}

.has-js .boardTitle.in,
.has-js .hero.in,
.has-js .prose > article.in,
.has-js .side.in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .board {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "hero"
      "prose"
      "side";
    gap: 20px;
    padding-top: 22px;
  }

  .hero { min-height: 54vh; }
  .side { position: relative; top: auto; }
  .prose > article:nth-child(even) { margin-left: 0; }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

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

  .board { padding: 18px 12px 8px; }
  .boardTitle { font-size: 26px; max-width: none; }
  .hero { min-height: 46vh; border-radius: 12px; }
  .hero::after { height: 56px; }
  .prose > article { padding: 20px 15px; }
  .prose > article[id] { scroll-margin-top: 148px; }
  .foot { margin-top: 18px; padding: 20px 12px 16px; }
  .footNav dl { grid-template-columns: auto minmax(0, 1fr); }
}

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

  .has-js .boardTitle,
  .has-js .hero,
  .has-js .prose > article,
  .has-js .side {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .veilNav li a { transition: none; opacity: 1; transform: none; }
  .burger,
  .footForm button { transition: none; }
}

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