@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --paper: #fdfbf7;
  --panel: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e0e0e0;
  --muted: #5c5a57;
  --serif: 'Cormorant', 'Songti SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
  --sans: 'Montserrat', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --radius: 18px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: .01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .42;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.32'/></svg>");
  background-size: 160px 160px;
}

img { max-width: 100%; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1rem;
  z-index: 20;
  text-decoration: none;
}

.skip:focus { left: .5rem; top: .5rem; }

/* 页头 */
.site-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: .6rem 1.1rem;
}

.head-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .8rem;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 0;
  padding: 0;
}

.menu-left { justify-content: flex-end; }

.head-right {
  display: flex;
  align-items: center;
  gap: .3rem;
  justify-content: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .85rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}

.pill:hover,
.pill[aria-current] {
  background: var(--ink);
  color: var(--paper);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: .06em;
  text-decoration: none;
  white-space: nowrap;
}

.cta:hover { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-decoration: none;
  white-space: nowrap;
}

.brand .mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: grayscale(1);
}

/* 粘性锚点条 */
.anchorbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: .3rem;
  padding: .45rem 1.1rem;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

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

.anchorbar .pill { min-height: 40px; border-color: var(--line); }

/* 首屏 */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--panel);
  isolation: isolate;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-media .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  opacity: 0;
}

.hero-media .hero-img.is-on { opacity: 1; }

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--paper);
  opacity: .68;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 6rem 1.4rem;
  text-align: right;
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  letter-spacing: .38em;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: .03em;
}

.hero-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  z-index: 3;
  background: var(--ink);
  transform: skewY(-1.4deg);
  transform-origin: left bottom;
}

/* 正文骨架 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 5.5rem;
}

.reader {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* 左侧栏 */
.rail {
  position: sticky;
  top: 4.5rem;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.3rem 1.1rem;
}

.rail-head {
  margin: 0 0 .8rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .16em;
}

.rail-head > span {
  display: inline-block;
  border-bottom: 2px solid var(--ink);
  padding-bottom: .1rem;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-list a {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  min-height: 40px;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.35;
}

.rail-list li:last-child a { border-bottom: 0; }

.rail-n {
  font-size: .9rem;
  letter-spacing: .1em;
  color: var(--muted);
}

.rail-list a:hover .rail-t { border-bottom: 1px solid var(--ink); }

/* 正文 */
.prose {
  max-width: 74ch;
  min-width: 0;
}

.prose > article {
  border-top: 1px solid var(--line);
  padding-top: 2.4rem;
  margin-top: 2.8rem;
}

.prose > article:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.prose h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: .01em;
}

.prose h2 > span { display: inline-block; }

.prose h3 {
  margin: 2rem 0 .8rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.3;
}

.prose h3 > span { display: inline-block; }

.prose p { margin: 0 0 1.15rem; }

.prose ul,
.prose ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }

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

.prose a {
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
}

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

.prose blockquote {
  margin: 1.5rem 0;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.prose figure { margin: 1.6rem 0; }

.prose figcaption {
  margin-top: .5rem;
  font-size: .95rem;
  color: var(--muted);
}

.prose img { border-radius: var(--radius); height: auto; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 1rem;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: .6rem .7rem;
  text-align: left;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--panel);
  border-radius: var(--radius);
}

/* 页脚 */
.site-foot {
  border-top: 1px solid var(--ink);
  background: var(--panel);
  padding: 2.6rem 1.4rem 1.4rem;
}

.foot-cols {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.site-foot dl { margin: 0; }

.foot-nav dl { display: grid; }

.site-foot dt {
  font-size: 1rem;
  color: var(--ink);
}

.foot-meta dt,
.foot-key dt {
  font-size: .95rem;
  letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: .35rem;
}

.site-foot dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

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

.foot-bar {
  max-width: 1180px;
  margin: 2.2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-bar p {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .1em;
  color: var(--muted);
}

/* 滚动显现 */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].in { opacity: 1; }

/* 分区锚点偏移 */
article[id] { scroll-margin-top: 6rem; }

@media (max-width: 1000px) {
  .head-inner { grid-template-columns: 1fr auto 1fr; gap: .5rem; }
  .brand { font-size: 1.2rem; }
  .pill, .cta { font-size: .95rem; padding: .3rem .7rem; }
}

@media (max-width: 860px) {
  .head-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .3rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .head-inner::-webkit-scrollbar { display: none; }

  .menu,
  .head-right { display: contents; }

  .brand {
    order: -1;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--paper);
    padding-right: .55rem;
    border-right: 1px solid var(--line);
    font-size: 1.15rem;
  }

  .pill, .cta { font-size: 1rem; padding: .35rem .8rem; min-height: 44px; }
  .anchorbar { position: static; }

  .hero-inner { text-align: left; padding: 4.5rem 1.2rem; }
  .wrap { padding: 3rem 1.2rem 4rem; }

  .reader { grid-template-columns: minmax(0, 1fr); gap: 2rem; }

  .rail { position: static; order: -1; }

  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }

  article[id] { scroll-margin-top: 1rem; }
}

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

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