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

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

:root {
  --ink: #172623;
  --ink-2: #33463f;
  --ink-3: #5b6b64;
  --pri: #5cc6b0;
  --sand: #d4c4a8;
  --terra: #c67b5c;
  --olive: #6b7b3c;
  --paper: #f7f2e9;
  --card: #fffaf2;
  --line: rgba(23, 38, 35, 0.14);
  --serif: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 420px at 10% -6%, rgba(212, 196, 168, 0.5), transparent 66%),
    radial-gradient(900px 400px at 94% 2%, rgba(92, 198, 176, 0.26), transparent 70%);
  background-repeat: no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.13;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23g)'/></svg>");
  background-size: 140px 140px;
}

img { max-width: 100%; }

a { color: #2b7d6d; }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}

/* ---------- 顶部 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 242, 233, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  max-width: 1240px;
  margin: 0 auto;
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  overflow: hidden;
}

.mark-glyph {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.find {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  margin: 0;
}

.find-in {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.find-in::placeholder { color: #8b9a94; }

.burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}

.burger[aria-expanded="true"] {
  background: var(--ink);
  color: var(--paper);
}

.rail {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rail-in {
  display: flex;
  gap: 6px;
  padding: 5px 16px;
  width: max-content;
  min-width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.rail a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  font-size: 16px;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
}

.rail a:hover,
.rail a.is-on {
  color: var(--ink);
  background: rgba(92, 198, 176, 0.22);
  border-color: rgba(92, 198, 176, 0.6);
}

.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.drawer.open { display: block; }

.drawer-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 16px 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.grp-t {
  margin: 0 0 6px;
  padding-left: 12px;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--olive);
}

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

.grp a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 12px;
}

.grp a:hover { background: rgba(212, 196, 168, 0.45); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  padding: 34px 18px 52px;
  max-width: 1240px;
  margin: 0 auto;
}

.hero-band {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -44px;
  height: 92px;
  z-index: 0;
  transform: skewY(-2.5deg);
  background: linear-gradient(90deg, rgba(92, 198, 176, 0.5), rgba(212, 196, 168, 0.55));
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-tag {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.34em;
  color: var(--olive);
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
}

.hero-sub {
  margin: 0 0 24px;
  max-width: 48ch;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  font-size: 16px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
}

.hero-cta:hover { background: #23403a; }

.hero-fig {
  position: relative;
  z-index: 2;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 28px 28px 28px 6px;
  background: linear-gradient(155deg, var(--sand), #efe4cf 58%, rgba(92, 198, 176, 0.75));
  box-shadow: 0 26px 52px -34px rgba(23, 38, 35, 0.8);
}

.hero-fig--blank {
  background-image:
    radial-gradient(320px 220px at 24% 18%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(155deg, var(--sand), #efe4cf 58%, rgba(92, 198, 176, 0.75));
}

.hero-fig img {
  display: block;
  width: 100%;
  height: 112%;
  margin-top: -6%;
  object-fit: cover;
  will-change: transform;
}

/* ---------- 正文栏 ---------- */
.wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 18px 64px;
}

.col { min-width: 0; }

.prose > div {
  margin: 0 0 22px;
  padding: 26px 20px 28px;
  background: var(--card);
  border-bottom: 3px solid rgba(92, 198, 176, 0.8);
  border-radius: 28px 28px 28px 8px;
  box-shadow: 0 20px 42px -36px rgba(23, 38, 35, 0.9);
  scroll-margin-top: 140px;
}

.prose > div:nth-of-type(even) {
  border-radius: 8px 28px 28px 28px;
  border-bottom-color: rgba(198, 123, 92, 0.65);
}

.prose > div:last-child { margin-bottom: 0; }

.prose h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.32;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--olive);
}

.prose p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.35em;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
}

.prose li { margin: 0 0 8px; }

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

.prose img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border-radius: 20px;
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  color: var(--ink);
  background: rgba(212, 196, 168, 0.24);
  border-left: 4px solid var(--sand);
  border-radius: 0 18px 18px 0;
}

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

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

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

.prose th { color: var(--ink); font-weight: 600; }

.prose hr {
  height: 0;
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 1px 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: rgba(212, 196, 168, 0.42);
  border-radius: 6px;
}

.prose h2 + hr { margin: -6px 0 18px; }

/* ---------- 侧栏 ---------- */
.side {
  padding: 22px 20px 26px;
  background: rgba(212, 196, 168, 0.3);
  border-radius: 28px 28px 8px 28px;
}

.side-h {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.rule {
  height: 0;
  margin: 0 0 14px;
  border: 0;
  border-top: 1px solid var(--line);
}

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

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px 0 12px;
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.side-nav a:hover,
.side-nav a.is-on {
  color: var(--ink);
  border-left-color: var(--pri);
  background: rgba(255, 250, 242, 0.7);
}

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  padding: 44px 20px 0;
  color: #e7e0d2;
  background: var(--ink);
}

.foot .mark {
  background: var(--sand);
  color: var(--ink);
}

.f-name {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: #fdf7ed;
}

.f-h {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--sand);
}

.foot .rule { border-top-color: rgba(231, 224, 210, 0.25); }

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

.foot a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  color: #e7e0d2;
  text-decoration: none;
}

.foot a:hover { color: var(--pri); }

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.sub input {
  flex: 1 1 120px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fdf7ed;
  border: 1px solid transparent;
  border-radius: 999px;
}

.sub button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--pri);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.f-base {
  grid-column: 1 / -1;
  padding: 18px 0 28px;
  text-align: center;
  font-size: 16px;
  color: rgba(231, 224, 210, 0.72);
  border-top: 1px solid rgba(231, 224, 210, 0.2);
}

.f-base p { margin: 0; }

/* ---------- 动效 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.prose > div.in { animation: rise 0.55s ease-out both; }

.prose > div:nth-of-type(2).in { animation-delay: 0.05s; }
.prose > div:nth-of-type(3).in { animation-delay: 0.1s; }
.prose > div:nth-of-type(4).in { animation-delay: 0.14s; }
.prose > div:nth-of-type(5).in { animation-delay: 0.18s; }
.prose > div:nth-of-type(6).in { animation-delay: 0.22s; }
.prose > div:nth-of-type(7).in { animation-delay: 0.26s; }

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  .top-bar { padding: 10px 24px; }

  .find { flex: 0 1 220px; margin-left: auto; }

  .drawer {
    position: absolute;
    top: 100%;
    right: max(24px, calc(50% - 620px));
    width: 600px;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 30px 60px -40px rgba(23, 38, 35, 0.85);
    overflow: hidden;
  }

  .drawer-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 18px;
  }

  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 44px;
    min-height: 70vh;
    padding: 56px 24px 76px;
  }

  .hero-fig {
    aspect-ratio: auto;
    height: min(56vh, 440px);
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 40px;
    align-items: start;
    padding: 8px 24px 80px;
  }

  .side { position: sticky; top: 132px; }

  .prose > div { padding: 34px 34px 36px; scroll-margin-top: 150px; }

  .foot {
    grid-template-columns: repeat(4, 1fr);
    gap: 36px;
    padding: 54px max(24px, calc((100% - 1192px) / 2)) 0;
  }
}

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

  .prose > div.in { animation-duration: 0.001ms; }

  .hero-fig img { transform: none !important; }
}

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