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

:root {
  --ink: #172623;
  --sand: #d4c4a8;
  --jade: #5cc6b0;
  --paper: #f4ece0;
  --clay: #c67b5c;
  --rail: 236px;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  font: 400 17px/1.72 Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(23, 38, 35, 0.085) 1px, transparent 1.2px),
    linear-gradient(160deg, #f8f1e6 0%, #efe5d6 58%, #e6d9c5 100%);
  background-size: 22px 22px, 100% 100%;
  background-attachment: fixed;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: #1b7d6c;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- 顶部细条 ---------- */

.strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px clamp(16px, 3vw, 32px);
  background: rgba(212, 196, 168, 0.8);
  border-bottom: 1px solid rgba(23, 38, 35, 0.16);
  letter-spacing: 0.2em;
  position: relative;
  z-index: 12;
  transition: box-shadow 0.4s ease-out;
}

.strip.stuck {
  box-shadow: 0 10px 24px -18px rgba(23, 38, 35, 0.9);
}

.strip-mark {
  font-weight: 600;
}

.strip-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(23, 38, 35, 0.35), rgba(23, 38, 35, 0));
}

.strip-up {
  text-decoration: none;
  color: #33443e;
  letter-spacing: 0.06em;
  padding: 8px 2px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.strip-up:hover {
  color: #101c19;
}

/* ---------- 左侧固定竖排 ---------- */

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 30px;
  overflow-y: auto;
  z-index: 20;
  color: var(--sand);
  background: linear-gradient(180deg, #1c2d29 0%, #14211e 62%, #0f1a17 100%);
  box-shadow: inset -1px 0 0 rgba(212, 196, 168, 0.18);
}

.rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(92deg, rgba(212, 196, 168, 0.055) 0 1px, transparent 1px 8px);
}

.logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(212, 196, 168, 0.22);
  color: #f4ece0;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--jade);
  flex: none;
}

.rail nav {
  position: relative;
  z-index: 1;
  flex: 1;
}

.rail nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: railnav;
}

.rail nav li {
  counter-increment: railnav;
}

.rail nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 8px;
  font-size: 16px;
  line-height: 1.45;
  color: #cbbda4;
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 196, 168, 0.12);
  transition: color 0.28s ease-out, padding-left 0.28s ease-out, background 0.28s ease-out;
}

.rail nav a::before {
  content: counter(railnav, decimal-leading-zero);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(92, 198, 176, 0.7);
  flex: none;
  transition: color 0.28s ease-out;
}

.rail nav a:hover,
.rail nav a:focus-visible {
  color: #f7f1e6;
  background: rgba(92, 198, 176, 0.12);
  padding-left: 14px;
}

.rail nav a:hover::before,
.rail nav a:focus-visible::before {
  color: var(--jade);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  border-bottom: 1px solid rgba(23, 38, 35, 0.15);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 76% 24%, rgba(92, 198, 176, 0.24), transparent 56%);
}

.hero-media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #cbb99d 0%, #97ada1 55%, #5d7a71 100%);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(23, 38, 35, 0.18), rgba(23, 38, 35, 0));
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  filter: saturate(0.92);
  transition: opacity 1.1s ease-out;
}

.hero-photo.on {
  opacity: 1;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  text-align: right;
  padding: clamp(44px, 7vw, 92px) clamp(24px, 4vw, 62px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4.6vw, 4.2rem);
  line-height: 1.06;
  padding-right: clamp(14px, 2vw, 26px);
  border-right: 4px solid var(--jade);
  text-wrap: balance;
}

.hero-desc {
  margin: 0;
  max-width: 40ch;
  color: #3d4d47;
}

/* ---------- 正文区 ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(24px, 3vw, 54px);
  padding: clamp(38px, 5vw, 70px) clamp(18px, 3vw, 48px) clamp(46px, 6vw, 84px);
}

section {
  min-width: 0;
  max-width: 72ch;
}

section > div {
  padding: 34px 0 8px;
  border-top: 1px dashed rgba(23, 38, 35, 0.22);
  scroll-margin-top: 18px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 0.84, 0.24, 1), transform 0.8s cubic-bezier(0.16, 0.84, 0.24, 1);
}

section > div:first-child {
  border-top: 0;
  padding-top: 0;
}

section > div.in {
  opacity: 1;
  transform: none;
}

section h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  line-height: 1.28;
}

section h2 + hr {
  margin: 0 0 20px;
  height: 0;
  border: 0;
  border-top: 3px solid var(--jade);
  width: 76px;
}

section h3 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
  line-height: 1.4;
}

section p {
  margin: 0 0 16px;
}

section ul,
section ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

section li {
  margin-bottom: 8px;
}

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

section strong {
  font-weight: 600;
}

section img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 22px 0;
}

section figure,
section blockquote {
  margin: 26px 0;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(23, 38, 35, 0.12);
  border-bottom: 3px solid var(--jade);
  border-radius: 10px;
  box-shadow: 0 12px 28px -22px rgba(23, 38, 35, 0.95);
}

section figure img {
  margin: 0 0 10px;
}

section figcaption {
  font-size: 16px;
  color: #4c5c55;
}

section blockquote {
  border-left: 3px solid var(--clay);
  color: #33443e;
}

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

section code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(23, 38, 35, 0.08);
  font-size: 0.95em;
}

/* ---------- 右侧页内导航 ---------- */

.toc {
  position: sticky;
  top: 22px;
  align-self: start;
  min-width: 0;
}

.toc h2 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.24em;
  color: #3d4d47;
}

.toc hr {
  margin: 0 0 14px;
  border: 0;
  border-top: 2px solid var(--jade);
  width: 44px;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid rgba(23, 38, 35, 0.2);
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-left: -1px;
  padding: 6px 0 6px 12px;
  font-size: 16px;
  line-height: 1.45;
  color: #43544d;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.25s ease-out, border-color 0.25s ease-out;
}

.toc a:hover,
.toc a:focus-visible {
  color: #12312a;
  border-left-color: var(--jade);
}

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

.foot {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 58px) clamp(18px, 3vw, 48px) 24px;
  color: var(--sand);
  background: linear-gradient(180deg, #1c2d29 0%, #101c19 100%);
}

.foot::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(212, 196, 168, 0.05) 0 1px, transparent 1px 9px);
}

.foot-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 42px);
}

.foot dl {
  margin: 0;
  min-width: 0;
}

.foot dt {
  margin-bottom: 10px;
  letter-spacing: 0.22em;
  color: #9ab0a6;
}

.foot dd {
  margin: 0;
  color: #e3d9c7;
  line-height: 1.7;
}

.foot dd a {
  color: #d3cbb9;
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

.foot dd a:hover,
.foot dd a:focus-visible {
  color: #ffffff;
  border-bottom-color: var(--jade);
}

.foot-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.foot-mark {
  position: relative;
  margin: clamp(22px, 4vw, 40px) 0 clamp(10px, 2vw, 18px);
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: rgba(212, 196, 168, 0.17);
  white-space: nowrap;
}

.foot-base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 196, 168, 0.22);
}

.foot-up {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 2px;
  color: #d3cbb9;
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

.foot-up:hover,
.foot-up:focus-visible {
  color: #ffffff;
  border-bottom-color: var(--jade);
}

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-bottom: 78px;
  }

  .rail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 64px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 1px 0 rgba(212, 196, 168, 0.22);
  }

  .rail::after {
    display: none;
  }

  .logo {
    flex: none;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 17px;
  }

  .logo-dot {
    display: none;
  }

  .rail nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }

  .rail nav ul {
    flex-direction: row;
  }

  .rail nav a {
    min-height: 44px;
    padding: 0 11px;
    white-space: nowrap;
    border-bottom: 0;
  }

  .rail nav a::before {
    display: none;
  }

  .rail nav a:hover,
  .rail nav a:focus-visible {
    padding-left: 11px;
  }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: -1;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    padding: 30px 18px 24px;
  }

  .hero h1 {
    padding-right: 0;
    padding-left: 15px;
    border-right: 0;
    border-left: 4px solid var(--jade);
  }

  .hero-media {
    height: 232px;
  }

  main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 28px 18px 46px;
  }

  section {
    max-width: none;
  }

  .toc {
    position: static;
  }

  .toc ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    gap: 0 12px;
  }

  .toc a {
    border-left: 0;
    border-bottom: 1px solid rgba(23, 38, 35, 0.16);
    margin-left: 0;
    padding-left: 0;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .foot-mark {
    white-space: normal;
    word-break: break-all;
  }
}

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

  section > div {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-photo {
    transition: none;
  }
}

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