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

:root {
  --ink: #172623;
  --sand: #d4c4a8;
  --mint: #5cc6b0;
  --terra: #c07a58;
  --olive: #6b7b3c;
  --paper: #f5ecdf;
  --paper2: #eee1cf;
  --line: rgba(23, 38, 35, 0.16);
  --hd: 64px;
  --r: 18px;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --display: 'Bebas Neue', 'Source Sans 3', Impact, system-ui, sans-serif;
}

*,
*::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: 400 17px/1.72 var(--sans);
  overflow-x: hidden;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(23, 38, 35, 0.07) 1px, transparent 1px);
  background-size: 4px 4px;
}

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

a { color: #256f63; }

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

main { position: relative; z-index: 1; }

/* 顶栏 */
.hd {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--hd);
  padding: 8px 18px;
  background: rgba(245, 236, 223, 0.95);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px 5px 13px 5px;
  background: var(--ink);
  color: var(--mint);
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.04em;
}

.bname {
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 1.02rem;
}

/* 折叠菜单 */
.sw { position: relative; }

.sw > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 20px 20px 6px 20px;
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  list-style: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.sw > summary::-webkit-details-marker { display: none; }
.sw > summary:hover { background: rgba(92, 198, 176, 0.24); }

.bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.bars::before,
.bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.bars::before { top: -5px; }
.bars::after { top: 5px; }

.sw > menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 228px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--paper2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 20px 44px rgba(23, 38, 35, 0.16);
}

.sw > menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
}

.sw > menu a:hover { background: rgba(92, 198, 176, 0.26); }

@media (min-width: 960px) {
  .sw > summary { display: none; }
  .sw > menu {
    position: static;
    display: flex !important;
    gap: 2px;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .sw > menu a {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 99px;
    font-size: 0.92rem;
    white-space: nowrap;
  }
}

/* 锚点条 */
.jump {
  position: sticky;
  top: var(--hd);
  z-index: 20;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: linear-gradient(90deg, rgba(212, 196, 168, 0.92), rgba(92, 198, 176, 0.28));
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

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

.jump ul {
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 0;
  padding: 6px 14px;
  list-style: none;
}

.jump a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 99px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.jump a:hover { background: rgba(23, 38, 35, 0.1); }

/* 首屏 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100svh - var(--hd) * 2);
  padding: calc(var(--hd) + 74px) 20px 70px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(158deg, #16241f, #33483d 58%, #6b7b3c);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 46px), 0 100%);
}

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

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(20deg, rgba(23, 38, 35, 0.9), rgba(23, 38, 35, 0.08) 68%);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-txt {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  text-align: right;
}

.hero-txt h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 8.4vw, 5.4rem);
  line-height: 1.06;
  letter-spacing: 0.02em;
  color: #f8f1e4;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
}

@media (min-width: 820px) {
  .hero-media {
    width: 63%;
    left: auto;
    clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
  }
  .hero-media::after {
    background: linear-gradient(28deg, rgba(23, 38, 35, 0.82), rgba(23, 38, 35, 0.05) 72%);
  }
  .hero { padding-right: clamp(20px, 6vw, 96px); }
}

/* 主体两栏 */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 20px 84px;
}

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 284px;
    gap: 54px;
    padding-top: 74px;
  }
}

/* 正文 */
.prose {
  min-width: 0;
  counter-reset: sec;
  font-size: 1.02rem;
}

.prose > article {
  position: relative;
  margin-top: 46px;
  padding-top: 46px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--hd) + 72px);
}

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

.prose > article::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  color: var(--terra);
}

.prose > article::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 62px;
  height: 3px;
  border-radius: 3px;
  background: var(--mint);
}

.prose h2 {
  margin: 0 0 0.55em;
  font-size: clamp(1.42rem, 3.2vw, 2rem);
  line-height: 1.34;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.prose h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.18rem;
  line-height: 1.45;
  font-weight: 700;
  color: #24443b;
}

.prose h4 {
  margin: 1.4em 0 0.4em;
  font-size: 1.04rem;
}

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

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

.prose li { margin: 0.4em 0; }

.prose li::marker { color: var(--terra); }

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

.prose strong { font-weight: 700; }

.prose figure {
  margin: 26px 0;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper2);
  box-shadow: 0 16px 36px rgba(23, 38, 35, 0.12);
}

.prose figure img { width: 100%; }

.prose figcaption {
  padding: 10px 14px;
  font-size: 0.86rem;
  color: #4d5f57;
}

.prose blockquote {
  margin: 26px 0;
  padding: 15px 20px;
  border-left: 4px solid var(--mint);
  border-radius: 0 16px 16px 0;
  background: rgba(92, 198, 176, 0.13);
}

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

.prose table {
  width: 100%;
  margin: 0 0 1.3em;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

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

.prose > aside,
.prose > article > aside {
  margin: 26px 0;
  padding: 16px 18px;
  border-radius: 6px 20px 6px 20px;
  background: rgba(212, 196, 168, 0.4);
  font-size: 0.96rem;
}

.prose > figure,
.prose > article > figure { margin: 26px 0; }

/* 侧栏 */
.rail {
  align-self: start;
  grid-row: 1;
  padding: 20px 20px 24px;
  border: 1px solid var(--line);
  border-radius: 24px 8px 24px 8px;
  background: var(--paper2);
  box-shadow: 0 16px 38px rgba(23, 38, 35, 0.1);
}

@media (min-width: 900px) {
  .rail {
    grid-column: 2;
    position: sticky;
    top: calc(var(--hd) + 62px);
  }
}

.rail h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.72rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
}

.rail .subtitle {
  margin: 5px 0 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--terra);
  font-size: 0.93rem;
  letter-spacing: 0.05em;
  color: #4c5d55;
}

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

.rail a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.rail a:hover {
  color: #1f7365;
  transform: translateX(3px);
}

.rail .num {
  font-family: var(--display);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  color: var(--terra);
}

/* 页脚 */
.ft {
  position: relative;
  z-index: 1;
  padding: 58px 20px 34px;
  border-top: 6px solid var(--mint);
  background: var(--ink);
  color: var(--sand);
  text-align: center;
}

.ft-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto 30px;
  text-align: left;
}

@media (min-width: 760px) {
  .ft-cols {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 28px;
    align-items: start;
  }
}

.ft-word {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0.02em;
  color: var(--mint);
}

.ft-col { display: block; }

.ft-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(212, 196, 168, 0.2);
  color: var(--sand);
  text-decoration: none;
  font-size: 0.94rem;
  transition: color 0.2s ease;
}

.ft-col a:hover { color: var(--mint); }

.ft small {
  display: block;
  font-size: 0.84rem;
  letter-spacing: 0.07em;
  color: rgba(212, 196, 168, 0.78);
}

/* 回到顶部 */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 99px;
  background: var(--ink);
  color: var(--mint);
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  box-shadow: 0 12px 28px rgba(23, 38, 35, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.totop.on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* 滚动显现 */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.22, 0.9, 0.3, 1), transform 0.75s cubic-bezier(0.22, 0.9, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .rail a,
  .totop { transition: none; }
}

/* 小屏微调 */
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .hero { padding-bottom: 58px; }
  .hero-txt h1 { letter-spacing: 0.01em; }
  .wrap { padding-top: 44px; }
  .bname { font-size: 0.96rem; letter-spacing: 0.06em; }
  .ft { padding-top: 46px; }
}

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