@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  --ink: #172623;
  --ink-soft: #3d4c46;
  --ink-mute: #6d7a73;
  --mint: #5cc6b0;
  --mint-deep: #2f9c88;
  --sand: #d4c4a8;
  --clay: #c67b5c;
  --paper: #f7f1e7;
  --card: rgba(255, 252, 247, 0.86);
  --line: rgba(23, 38, 35, 0.12);
  --radius: 10px;
  --shadow: 0 16px 32px -22px rgba(23, 38, 35, 0.55);
  --shadow-lift: 0 24px 44px -24px rgba(23, 38, 35, 0.5);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background-color: #f4ecdf;
  background-image:
    radial-gradient(1100px 560px at 6% -8%, #fdf4e7 0%, rgba(253, 244, 231, 0) 62%),
    radial-gradient(880px 520px at 102% 2%, rgba(92, 198, 176, 0.22), rgba(92, 198, 176, 0) 64%),
    linear-gradient(180deg, #f8f1e5 0%, #f0e4d3 52%, #e9dbc7 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- 顶部：品牌行 + 胶囊菜单 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 18px 12px;
  background: rgba(248, 242, 233, 0.9);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 26px -26px rgba(23, 38, 35, 0.9);
}

.brandrow {
  display: flex;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px 0 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: 999px;
}

.brand img {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.brand-name {
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-name::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 2px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--mint), var(--sand));
}

.pillnav {
  max-width: 1120px;
  margin: 0 auto;
}

.pillnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pillnav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 16px;
  border: 1px solid rgba(23, 38, 35, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.6);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.28s ease-out, color 0.28s ease-out,
    border-color 0.28s ease-out, transform 0.28s ease-out;
}

.pillnav a:hover,
.pillnav a:focus-visible {
  background: rgba(92, 198, 176, 0.22);
  border-color: rgba(92, 198, 176, 0.65);
  color: var(--ink);
  transform: translateY(-1px);
}

.pillnav a.is-active {
  background: var(--mint);
  border-color: var(--mint-deep);
  color: #0d211d;
  font-weight: 500;
}

/* ---------- 头图 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 46vh;
  padding: 54px 20px 66px;
  margin-bottom: 38px;
  border-radius: 0 0 46% 46% / 0 0 78px 78px;
  background: linear-gradient(158deg, #2f4038 0%, #172623 78%);
  color: #f7f1e7;
}

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

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    185deg,
    rgba(23, 38, 35, 0.42) 0%,
    rgba(23, 38, 35, 0.6) 55%,
    rgba(23, 38, 35, 0.78) 100%
  );
}

.hero-watermark {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  white-space: nowrap;
  font-size: clamp(3.6rem, 21vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: rgba(247, 241, 231, 0.16);
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 42ch;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5.4vw, 2.5rem);
  line-height: 1.32;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 18px rgba(10, 20, 17, 0.45);
}

/* ---------- 主体 ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 34px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 66px;
}

div {
  min-width: 0;
}

.prose {
  counter-reset: sec;
}

.prose > h2 {
  margin: 0 0 10px;
  font-size: clamp(1.32rem, 3.6vw, 1.86rem);
  line-height: 1.36;
  letter-spacing: -0.015em;
}

.subtitle {
  margin: 0 0 26px;
  padding-left: 14px;
  border-left: 3px solid var(--mint);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
  max-width: 58ch;
}

.prose > article {
  position: relative;
  counter-increment: sec;
  margin: 0 0 22px;
  padding: 26px 24px 28px;
  border: 1px solid rgba(23, 38, 35, 0.08);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 152px;
  transition: box-shadow 0.35s ease-out, transform 0.35s ease-out,
    border-color 0.35s ease-out;
}

.prose > article::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  top: 4px;
  right: 14px;
  font-size: clamp(2.5rem, 7.4vw, 3.7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  color: rgba(92, 198, 176, 0.26);
  pointer-events: none;
}

.prose > article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(92, 198, 176, 0.4);
}

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

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

.prose article h2 {
  margin: 0 0 6px;
  padding-right: 56px;
  font-size: clamp(1.22rem, 3.2vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.prose article h3 {
  margin: 24px 0 6px;
  font-size: 1.1rem;
  line-height: 1.5;
}

.prose article h2 + p,
.prose article h3 + p {
  color: var(--ink-soft);
}

.prose article p {
  margin: 0 0 14px;
}

.prose article ul,
.prose article ol {
  margin: 0 0 14px;
  padding-left: 1.25em;
}

.prose article li {
  margin: 0 0 7px;
}

.prose article li::marker {
  color: var(--mint-deep);
}

.prose a {
  color: #1c7a69;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.25s ease-out, background 0.25s ease-out;
}

.prose a:hover {
  color: var(--ink);
  background: rgba(92, 198, 176, 0.22);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.prose table {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

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

.prose th {
  background: rgba(212, 196, 168, 0.3);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
  padding: 0.1em 0.36em;
  border-radius: 4px;
  background: rgba(23, 38, 35, 0.08);
}

.prose hr {
  height: 1px;
  margin: 26px 0;
  border: 0;
  background: var(--line);
}

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

.rail {
  position: sticky;
  top: 156px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255, 252, 247, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.rail-title {
  margin: 0 0 10px;
  padding-left: 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
}

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

.rail-toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.26s ease-out, color 0.26s ease-out,
    border-color 0.26s ease-out;
}

.rail-toc a:hover,
.rail-toc a.is-active {
  background: rgba(92, 198, 176, 0.2);
  border-left-color: var(--mint-deep);
  color: var(--ink);
}

.totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #f4ecdf;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.26s ease-out, transform 0.26s ease-out;
}

.totop:hover {
  background: #24382f;
  transform: translateY(-1px);
}

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

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px 26px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 16px;
}

footer p {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

footer small {
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- 动效 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out,
    box-shadow 0.35s ease-out, border-color 0.35s ease-out;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 0 16px 52px;
  }

  .rail {
    position: static;
    order: 2;
  }

  .rail-toc {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .hero {
    min-height: 38vh;
    padding: 40px 18px 48px;
    border-radius: 0 0 50% 50% / 0 0 48px 48px;
    margin-bottom: 28px;
  }

  .prose > article {
    padding: 20px 18px 22px;
    scroll-margin-top: 190px;
  }

  .prose article h2 {
    padding-right: 44px;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 22px 16px 40px;
  }
}

@media (max-width: 480px) {
  .masthead {
    padding: 10px 14px;
  }

  .pillnav ul {
    gap: 6px;
  }

  .pillnav a {
    padding: 6px 12px;
    font-size: 16px;
  }

  .rail-toc {
    grid-template-columns: 1fr;
  }

  .hero-watermark {
    font-size: clamp(2.9rem, 24vw, 6rem);
  }
}

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