@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

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

:root {
  --ink: #1f1f1f;
  --ink-soft: #4d4d4d;
  --ink-mute: #7a7a7a;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: rgba(31, 31, 31, .14);
  --line-soft: rgba(31, 31, 31, .07);
  --e1: 0 1px 2px rgba(31, 31, 31, .06), 0 2px 6px rgba(31, 31, 31, .05);
  --e2: 0 4px 12px rgba(31, 31, 31, .07), 0 12px 28px rgba(31, 31, 31, .06);
  --e3: 0 12px 26px rgba(31, 31, 31, .09), 0 28px 64px rgba(31, 31, 31, .08);
  --e4: 0 20px 48px rgba(31, 31, 31, .13), 0 46px 100px rgba(31, 31, 31, .11);
  --r: 18px;
  --serif: 'Crimson Pro', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--mist);
  background-image:
    radial-gradient(120% 90% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #f7f7f7 0%, #f1f1f1 100%);
  background-attachment: fixed;
}

/* ---------- 背景光斑层 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg span {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.bg span:nth-child(1) {
  width: 48vw;
  height: 48vw;
  left: -12vw;
  top: -10vw;
  background: radial-gradient(circle at 32% 32%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%);
}
.bg span:nth-child(2) {
  width: 62vw;
  height: 62vw;
  right: -18vw;
  top: 24vh;
  background: radial-gradient(circle, rgba(31, 31, 31, .075), rgba(31, 31, 31, 0) 68%);
}
.bg span:nth-child(3) {
  width: 42vw;
  height: 42vw;
  left: 22vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%);
}

/* ---------- 跳转链接 ---------- */
.skip {
  position: absolute;
  top: -70px;
  left: 14px;
  z-index: 95;
  padding: 10px 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: var(--e3);
  transition: top .2s ease;
}
.skip:focus { top: 12px; }

/* ---------- 页头：品牌行 + 菜单行 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--e1);
  transition: box-shadow .25s ease, background .25s ease;
}
.masthead.is-stuck {
  box-shadow: var(--e3);
  background: rgba(255, 255, 255, .88);
}

.brandbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 32px) 2px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
}
.brand svg,
.brand img {
  width: 26px;
  height: 26px;
  display: block;
}
.brand:hover .brand__text {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.navbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(10px, 3.4vw, 26px) 8px;
}
.navbar ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.navbar a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.navbar a::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1);
}
.navbar a:hover,
.navbar a:focus-visible {
  color: var(--ink);
  background: rgba(31, 31, 31, .055);
  transform: translateY(-1px);
}
.navbar a:hover::after,
.navbar a:focus-visible::after { transform: scaleX(1); }

/* ---------- 主体网格 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(14px, 3.4vw, 32px) 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 26px;
  align-items: start;
}

/* ---------- 正文玻璃层 ---------- */
.paper {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: var(--r);
  box-shadow: var(--e3);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  min-height: 45vh;
  align-items: stretch;
}
.hero--solo { grid-template-columns: minmax(0, 1fr); }
.hero__media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #ececec 0%, #ffffff 55%, #e6e6e6 100%);
}
.hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  text-align: right;
  padding: clamp(24px, 4vw, 46px) clamp(20px, 4vw, 52px);
}
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.16;
  letter-spacing: -.01em;
}
.hero__desc {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- 正文流 ---------- */
.paper div {
  padding: clamp(26px, 4vw, 46px) clamp(20px, 4vw, 52px);
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 152px;
}
.paper div > * { max-width: 66ch; }

.paper p,
.paper ul,
.paper ol,
.paper blockquote,
.paper figure,
.paper table,
.paper pre {
  margin: 0 0 1.05em;
}
.paper p:last-child,
.paper ul:last-child,
.paper ol:last-child { margin-bottom: 0; }

.paper small {
  display: block;
  margin-bottom: 4px;
  font-size: .875rem;
  letter-spacing: .16em;
  color: var(--ink-mute);
}
.paper small + h2,
.paper small + h3 { margin-top: 0; }

.paper h2 {
  margin: 0 0 .5em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.7vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -.005em;
}
.paper h3 {
  margin: 1.1em 0 .45em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.4;
}
.paper ul,
.paper ol { padding-left: 1.3em; }
.paper li { margin-bottom: .4em; }

.paper a {
  color: var(--ink);
  text-decoration-color: rgba(31, 31, 31, .38);
  text-underline-offset: 3px;
}
.paper a:hover { text-decoration-color: var(--ink); }

.paper blockquote {
  padding: 6px 0 6px 18px;
  border-left: 2px solid var(--ink);
  color: var(--ink-soft);
}

.paper img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--e1);
}

.paper hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6em 0;
}

.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.paper th,
.paper td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.paper strong { font-weight: 700; }

/* ---------- 右侧目录 ---------- */
.rail {
  position: sticky;
  top: 150px;
  z-index: 2;
  padding: 18px 18px 20px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: var(--r);
  box-shadow: var(--e2);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.rail__k {
  display: block;
  font-size: .875rem;
  letter-spacing: .18em;
  color: var(--ink-mute);
  margin-bottom: 2px;
}
.rail__h {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.rail__list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.rail__list a:hover,
.rail__list a:focus-visible {
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--e1);
  transform: translateX(2px);
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 26px;
  padding: 20px clamp(16px, 4vw, 40px) 26px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--e2);
}
.foot__brand a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  text-decoration: none;
}
.foot__brand a:hover { text-decoration: underline; text-underline-offset: 5px; }

.foot__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.foot__nav a,
.foot__note a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.foot__nav a:hover,
.foot__note a:hover {
  color: var(--ink);
  background: rgba(31, 31, 31, .06);
}
.foot__copy {
  flex: 1;
  min-width: 140px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- 焦点 ---------- */
a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translate3d(0, 14px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  .brand,
  .navbar li,
  .hero,
  .paper,
  .rail,
  .foot {
    animation: rise .55s cubic-bezier(.22, .68, .32, 1) backwards;
  }
  .navbar li { animation-delay: calc(.055s * var(--i, 0)); }
  .hero { animation-delay: .14s; }
  .paper { animation-delay: .2s; }
  .rail { animation-delay: .28s; }
  .foot { animation-delay: .34s; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 880px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 48px;
  }
  .rail {
    position: static;
    order: 2;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .hero--solo { grid-template-columns: minmax(0, 1fr); }
  .hero__media { height: 150px; }
  .hero__copy { padding-top: 22px; padding-bottom: 26px; }
  .hero__desc { max-width: 40ch; }
  .paper div { scroll-margin-top: 168px; }
  .foot { gap: 4px 16px; }
  .foot__copy { flex-basis: 100%; text-align: left; }
}

@media (max-width: 460px) {
  .navbar a { padding: 0 8px; font-size: .95rem; }
  .rail__list { grid-template-columns: 1fr; }
  .hero__title { font-size: 1.75rem; }
}

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

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