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

:root {
  --ink: #000000;
  --paper: #f2f2f2;
  --card: #ffffff;
  --gap: 1rem;
  --r: 28px;
  --pad: clamp(16px, 4vw, 48px);
  --font-body: 'Josefin Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Helvetica, Arial, sans-serif;
  --font-display: 'Cinzel', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Georgia, serif;
}

* { 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(--font-body);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.shell { display: block; }

/* ---------- 顶部：品牌居左 + 胶囊导航 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px var(--pad) 12px;
  background: rgba(242, 242, 242, 0.94);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 2.2vw, 21px);
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
}

.mark { width: auto; height: 26px; }

.pill-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  justify-content: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: var(--card);
  transform: translateY(-2px);
}

/* ---------- 十二栏主栅格 ---------- */
.stage {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--pad) 8px;
}

/* ---------- 首屏：纯文字超大标题 ---------- */
.hero {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  padding: 128px 0 44px;
  scroll-margin-top: 132px;
}

.badge {
  position: absolute;
  top: 124px;
  right: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 16px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  animation: drift 7s ease-in-out infinite;
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 8.2vw, 6.8rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.rule {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: clamp(18px, 3vw, 34px) 0 14px;
  width: 100%;
  opacity: 1;
}

.jump {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 16px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.jump:hover { transform: translateY(-3px); }

/* ---------- 正文 ---------- */
.prose {
  grid-column: 1 / span 8;
  display: grid;
  gap: var(--gap);
  min-width: 0;
  padding: 4px 0 60px;
}

.prose > div {
  background: var(--card);
  border-radius: var(--r);
  padding: clamp(20px, 3vw, 40px);
  scroll-margin-top: 132px;
}

.prose > div:nth-child(even) {
  background: var(--ink);
  color: var(--card);
}

.prose > div:nth-child(even) a { color: var(--card); }

.prose h2 {
  margin: 0 0 0.2em;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.02em;
}

.prose h3 {
  margin: 1.5em 0 0.35em;
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 1.35;
}

hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.38;
  margin: 0.55em 0 1.1em;
}

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

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

.prose li { margin: 0.4em 0; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover { text-decoration-thickness: 2px; }

.prose blockquote {
  margin: 1.2em 0;
  padding: 0 0 0 1.1em;
  border-left: 2px solid currentColor;
  font-style: normal;
  opacity: 0.92;
}

.prose strong { font-weight: 600; }

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

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid currentColor;
}

.prose img { border-radius: 18px; margin: 1em 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

/* ---------- 右侧目录 ---------- */
.rail {
  grid-column: 9 / -1;
  position: sticky;
  top: 132px;
  align-self: start;
  padding: 24px 18px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--card);
}

.rail h2 {
  margin: 0 0 0.25em;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.rail hr { border-top-color: var(--card); opacity: 0.45; }

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

.rail-list li {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.rail-list li:nth-child(1) { animation-delay: 0.05s; }
.rail-list li:nth-child(2) { animation-delay: 0.11s; }
.rail-list li:nth-child(3) { animation-delay: 0.17s; }
.rail-list li:nth-child(4) { animation-delay: 0.23s; }
.rail-list li:nth-child(5) { animation-delay: 0.29s; }
.rail-list li:nth-child(6) { animation-delay: 0.35s; }
.rail-list li:nth-child(7) { animation-delay: 0.41s; }

.rail-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--card);
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rail-link:hover {
  background: var(--card);
  color: var(--ink);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.to-top:hover { transform: translateY(-3px); }

/* ---------- 页脚单行 ---------- */
.foot { padding: 6px var(--pad) 44px; }

.foot-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 18px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.copy {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-align: center;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: flex-end;
}

.foot-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
}

.foot-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

@keyframes rise { to { opacity: 1; transform: none; } }

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  .masthead {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .pill-nav p { justify-content: flex-end; }
}

@media (max-width: 899px) {
  .hero,
  .prose,
  .rail { grid-column: 1 / -1; }

  .hero {
    min-height: 88svh;
    padding-top: 104px;
  }

  .badge { top: 104px; }

  .rail {
    position: static;
    margin-bottom: 56px;
  }

  .foot-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .copy { text-align: left; }
  .foot-nav { justify-content: flex-start; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero h1 { font-size: clamp(1.95rem, 10.5vw, 3rem); }
  .badge { padding: 0 16px; letter-spacing: 0.24em; }
  .prose > div { border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .rail-list li {
    opacity: 1;
    transform: none;
  }
}

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