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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --ink-2: rgba(31, 31, 31, .64);
  --ink-3: rgba(31, 31, 31, .42);
  --line: rgba(31, 31, 31, .1);
  --line-2: rgba(31, 31, 31, .16);
  --glass: rgba(255, 255, 255, .68);
  --glass-2: rgba(255, 255, 255, .86);
  --r: 28px;
  --e1: 0 1px 2px rgba(31, 31, 31, .05), 0 6px 14px rgba(31, 31, 31, .05);
  --e2: 0 2px 8px rgba(31, 31, 31, .06), 0 16px 34px rgba(31, 31, 31, .08);
  --e3: 0 6px 20px rgba(31, 31, 31, .08), 0 28px 64px rgba(31, 31, 31, .11);
  --e4: 0 12px 34px rgba(31, 31, 31, .1), 0 48px 110px rgba(31, 31, 31, .15);
  --head: 168px;
}

* { box-sizing: border-box; }

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

html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--mist);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -10% -10% -10% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 46vh at 10% -8%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(46vw 40vh at 96% 6%, #ffffff 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(64vw 58vh at 62% 104%, #ffffff 0%, rgba(255, 255, 255, 0) 64%);
}

a { color: inherit; }

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

p { margin: 0 0 1em; }

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

/* ---------- 顶部 ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8), var(--e1);
}

.topline {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(31, 31, 31, .05), rgba(31, 31, 31, 0) 70%);
}

.topline p {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 32px);
  height: 42px;
  display: flex;
  align-items: center;
  font-size: 16px;
  letter-spacing: .01em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(10px, 3vw, 28px);
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav--l { flex: 1 1 0; min-width: 0; }
.nav--r { flex: 0 0 auto; }
.bar__r {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.nav p {
  margin: 0;
  display: flex;
  gap: 2px;
}

.nav--l p { justify-content: flex-end; }

.navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}

.navlink:hover { background: var(--paper); color: var(--ink); box-shadow: var(--e1); }
.navlink.is-on { background: var(--ink); color: var(--paper); }

.brand {
  flex: 0 0 auto;
  font-family: Calistoga, "Songti SC", Georgia, serif;
  font-size: 22px;
  letter-spacing: .01em;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--e2);
  border: 1px solid rgba(255, 255, 255, .9);
  white-space: nowrap;
}

.burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--glass-2);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--e1);
}

.burger__bar {
  width: 14px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  display: none;
}

.burger__txt {
  min-width: 2.2em;
  text-align: center;
}

.chips {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chips nav p {
  margin: 0;
  padding: 8px clamp(10px, 3vw, 28px);
  display: flex;
  gap: 8px;
  width: max-content;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}

.chip:hover { background: var(--paper); color: var(--ink); transform: translateY(-1px); box-shadow: var(--e1); }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 全屏菜单 ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(20px, 6vw, 56px);
  background: rgba(245, 245, 245, .9);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s;
}

.sheet.is-open { opacity: 1; visibility: visible; }

.sheet__close {
  position: absolute;
  top: 18px;
  right: clamp(20px, 6vw, 56px);
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  box-shadow: var(--e2);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.sheet__nav p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.sheetlink {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 6px 20px;
  border-radius: 20px;
  text-decoration: none;
  font-size: clamp(18px, 4.6vw, 22px);
  font-weight: 500;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--e2);
  transform: translateY(10px);
  opacity: 0;
  transition: transform .34s ease, opacity .34s ease;
}

.sheet.is-open .sheetlink { transform: none; opacity: 1; }
.sheet.is-open .sheetlink:nth-child(1) { transition-delay: .03s; }
.sheet.is-open .sheetlink:nth-child(2) { transition-delay: .06s; }
.sheet.is-open .sheetlink:nth-child(3) { transition-delay: .09s; }
.sheet.is-open .sheetlink:nth-child(4) { transition-delay: .12s; }
.sheet.is-open .sheetlink:nth-child(5) { transition-delay: .15s; }
.sheet.is-open .sheetlink:nth-child(6) { transition-delay: .18s; }
.sheet.is-open .sheetlink:nth-child(7) { transition-delay: .21s; }

/* ---------- 版面 ---------- */

.page { position: relative; z-index: 1; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(18px, 3.6vw, 40px) clamp(12px, 3.4vw, 32px) 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  position: relative;
  perspective: 1200px;
  padding-bottom: 14px;
}

.hero__body {
  position: relative;
  z-index: 3;
  min-height: min(64vh, 560px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(26px, 5vw, 64px);
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, .95);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .7) 62%, rgba(245, 245, 245, .82));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--e4);
  transform-style: preserve-3d;
  text-align: left;
  overflow: hidden;
}

.hero__body::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -18px;
  height: 22px;
  background: linear-gradient(90deg, var(--ink) 0%, rgba(31, 31, 31, .16) 46%, rgba(31, 31, 31, 0) 100%);
  transform: skewY(-1.6deg);
  border-radius: 4px;
  opacity: .85;
}

.hero__mark {
  position: absolute;
  top: clamp(16px, 3vw, 30px);
  right: clamp(16px, 3vw, 30px);
  z-index: 2;
  width: clamp(56px, 9vw, 96px);
  height: clamp(56px, 9vw, 96px);
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 24px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: var(--e3);
  transform: translateZ(70px) rotate(-4deg);
  animation: bob 5.4s ease-in-out infinite;
}

.hero__img { width: 100%; height: 100%; object-fit: contain; }

@keyframes bob {
  0%, 100% { transform: translateZ(70px) rotate(-4deg) translateY(0); }
  50% { transform: translateZ(70px) rotate(-2deg) translateY(-8px); }
}

.hero__title {
  margin: 0;
  font-family: Calistoga, "Songti SC", Georgia, serif;
  font-weight: 400;
  font-size: clamp(31px, 6.2vw, 60px);
  line-height: 1.14;
  letter-spacing: -.01em;
  max-width: 20em;
}

.hero__lead {
  margin: 0;
  max-width: 34em;
  font-size: clamp(16px, 1.9vw, 18px);
  color: var(--ink-2);
  line-height: 1.7;
}

.rotor {
  position: relative;
  margin-top: 10px;
  width: min(100%, 400px);
  height: 54px;
}

.rotor a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 22px;
  height: 54px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  box-shadow: var(--e2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  animation: cycle 21s linear infinite;
  animation-delay: calc(var(--i) * 3s);
}

@keyframes cycle {
  0% { opacity: 0; transform: translateY(12px) scale(.95); }
  2% { opacity: 1; transform: none; }
  12% { opacity: 1; transform: none; }
  14.3% { opacity: 0; transform: translateY(-12px) scale(.95); }
  100% { opacity: 0; transform: translateY(-12px) scale(.95); }
}

/* ---------- 正文 ---------- */

.content {
  position: relative;
  z-index: 1;
  display: block;
}

.content > article {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(16px, 2.6vw, 30px);
  padding: clamp(22px, 3.8vw, 46px);
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, .95);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--e2);
  scroll-margin-top: calc(var(--head) + 8px);
  animation: rise .6s cubic-bezier(.2, .7, .3, 1) both;
}

.content > article:nth-child(2n) {
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(245, 245, 245, .72));
  box-shadow: var(--e3);
  margin-left: clamp(0px, 1.4vw, 18px);
}

.content > article:nth-child(1) { animation-delay: .02s; }
.content > article:nth-child(2) { animation-delay: .06s; }
.content > article:nth-child(3) { animation-delay: .1s; }
.content > article:nth-child(4) { animation-delay: .14s; }
.content > article:nth-child(5) { animation-delay: .18s; }
.content > article:nth-child(6) { animation-delay: .22s; }
.content > article:nth-child(7) { animation-delay: .26s; }
.content > article:nth-child(n+8) { animation-delay: .3s; }

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

.content h2 {
  margin: 0 0 .5em;
  font-family: Calistoga, "Songti SC", Georgia, serif;
  font-weight: 400;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.28;
  letter-spacing: .004em;
  padding-bottom: .5em;
  border-bottom: 1px solid var(--line);
}

.content h3 {
  margin: 1.4em 0 .4em;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.content p.subtitle,
.content .subtitle,
.content .subhead,
.content .desc,
.content .lead {
  margin: -.2em 0 1.1em;
  color: var(--ink-2);
  font-size: 16px;
}

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

.content ul,
.content ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.content li { margin-bottom: .5em; }

.content a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  transition: border-color .2s, background .2s;
}

.content a:hover { border-color: var(--ink); background: rgba(31, 31, 31, .06); }

.content blockquote {
  margin: 0 0 1.1em;
  padding: 14px 20px;
  border-left: 3px solid var(--ink);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--e1);
  color: var(--ink-2);
}

.content strong { color: var(--ink); font-weight: 600; }

.content time {
  display: inline-block;
  font-size: 16px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1em;
  font-size: 16px;
  background: rgba(255, 255, 255, .78);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--e1);
}

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

.content th { background: rgba(31, 31, 31, .05); font-weight: 600; }

.content figure { margin: 0 0 1.1em; }
.content figcaption { font-size: 16px; color: var(--ink-3); margin-top: .5em; }

.content img { border-radius: 20px; box-shadow: var(--e2); }

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

.side {
  position: relative;
  z-index: 4;
  margin-top: clamp(0px, 2vw, 28px);
}

.side__card {
  position: sticky;
  top: calc(var(--head) + 10px);
  padding: 22px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, .95);
  background: var(--glass-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e3);
  transform: translateY(-14px);
}

.side__card h2 {
  margin: 0 0 .25em;
  font-family: Calistoga, "Songti SC", Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
}

.side__card .subtitle {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.5;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.side__list li { counter-increment: side; }

.sidelink {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .2s, color .2s;
}

.sidelink::before {
  content: counter(side, decimal-leading-zero);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.sidelink:hover { background: var(--paper); color: var(--ink); }
.sidelink.is-on { background: var(--ink); color: var(--paper); box-shadow: var(--e1); }
.sidelink.is-on::before { color: rgba(255, 255, 255, .6); }

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

.foot {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: clamp(40px, 7vw, 76px) auto 0;
  padding: 26px clamp(14px, 4vw, 32px) 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.foot__c { margin: 0; color: var(--ink-2); }

.foot__l {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 16px;
}

.foot__l a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .2s, color .2s;
}

.foot__l a:hover { background: var(--paper); color: var(--ink); box-shadow: var(--e1); }

.foot__h {
  text-align: right;
  color: var(--ink-3);
  font-size: 16px;
  overflow-wrap: anywhere;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 1000px) {
  .wrap { grid-template-columns: minmax(0, 1fr) 254px; }
  .nav--l .navlink:nth-child(3) { display: none; }
  .brand { font-size: 20px; }
}

@media (max-width: 820px) {
  :root { --head: 120px; }
  .nav--l, .nav--r { display: none; }
  .bar { justify-content: space-between; gap: 8px; }
  .bar__r { flex: 0 0 auto; }
  .burger__bar { display: block; }
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero__body { min-height: 58vh; }
  .hero__mark { width: 54px; height: 54px; border-radius: 18px; }
  .hero__body::after { height: 16px; bottom: -12px; }
  .side { order: 3; margin-top: 6px; }
  .side__card { position: static; transform: none; }
  .content > article:nth-child(2n) { margin-left: 0; }
  .foot { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .foot__h { text-align: center; }
  .foot__l { justify-content: center; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .hero__body { padding: 24px 20px; }
  .hero__mark { position: static; transform: none; margin-bottom: 6px; animation: none; }
  .rotor { width: 100%; }
  .sidelink { font-size: 16px; }
  .content > article { padding: 20px 16px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__mark { animation: none; }
  .rotor a { animation: none; opacity: 1; position: static; }
  .rotor { height: auto; display: flex; flex-direction: column; gap: 6px; }
  .content > article { animation: none; }
  .sheetlink { transition: none; }
}

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