:root {
  --ink: #172623;
  --ink-soft: #3a4a45;
  --teal: #5cc6b0;
  --sand: #d4c4a8;
  --clay: #c67b5c;
  --olive: #6b7b3c;
  --bg: #f4ece0;
  --paper: #fbf6ee;
  --line: rgba(23, 38, 35, 0.16);
  --shadow: 0 1px 2px rgba(23, 38, 35, 0.06), 0 20px 38px -26px rgba(23, 38, 35, 0.55);
  --f-display: "Calistoga", "Iowan Old Style", Georgia, "Songti SC", serif;
  --f-body: "Inter", system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --dock-h: 66px;
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 70% at 100% 0%, rgba(212, 196, 168, 0.55), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(107, 123, 60, 0.14), transparent 62%);
  color: var(--ink);
  font: 400 17px/1.72 var(--f-body);
  letter-spacing: 0.006em;
  padding-bottom: calc(var(--dock-h) + 26px);
  overflow-x: hidden;
}

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

img {
  border-radius: 0;
}

/* 顶部图像区 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 45vh;
  padding: clamp(22px, 4vw, 40px) clamp(18px, 5vw, 64px) clamp(48px, 7vw, 76px);
  overflow: hidden;
  text-align: right;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 46px));
  background: linear-gradient(148deg, #ecdfcc 0%, #d9c9b1 52%, #bfae92 100%);
  color: #fdf8f1;
}

.hero-art {
  position: absolute;
  inset: -10% 0;
  z-index: 0;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  will-change: transform;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(104deg, rgba(23, 38, 35, 0.62), rgba(23, 38, 35, 0.16) 52%, rgba(23, 38, 35, 0.72));
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: min(680px, 94%);
  margin-left: auto;
}

.hero-title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.95rem, 6.2vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(23, 38, 35, 0.35);
}

.hero-desc {
  margin: 14px 0 0 auto;
  max-width: 34ch;
  font-size: 17px;
  line-height: 1.65;
  color: rgba(253, 248, 241, 0.92);
}

.band {
  height: 9px;
  background: linear-gradient(90deg, var(--clay), var(--teal) 48%, var(--olive));
}

/* 主体：正文右 + 侧栏左上的网格 */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(20px, 3vw, 42px);
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) clamp(16px, 4vw, 32px) 0;
}

.content {
  min-width: 0;
}

.content > section {
  margin: 0 0 clamp(18px, 3vw, 28px);
  padding: clamp(20px, 3vw, 34px);
  background: var(--paper);
  border-left: 5px solid var(--teal);
  box-shadow: var(--shadow);
  scroll-margin-top: 22px;
  scroll-margin-bottom: calc(var(--dock-h) + 26px);
  transition: box-shadow 0.35s ease-out, transform 0.35s ease-out;
}

.content > section:nth-of-type(3n + 2) {
  border-left-color: var(--clay);
}

.content > section:nth-of-type(3n + 3) {
  border-left-color: var(--olive);
}

.content > section:hover {
  box-shadow: 0 2px 4px rgba(23, 38, 35, 0.07), 0 26px 46px -28px rgba(23, 38, 35, 0.6);
  transform: translateY(-2px);
}

.content h2,
.content h3 {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

.content h2 {
  font-size: clamp(23px, 3vw, 29px);
  margin: 0 0 0.62em;
}

.content h3 {
  font-size: clamp(19px, 2.2vw, 22px);
  margin: 1.5em 0 0.5em;
}

.content h2 > span,
.content h3 > span {
  background-image: linear-gradient(transparent 66%, rgba(92, 198, 176, 0.42) 66%);
  padding-bottom: 2px;
}

.content p {
  margin: 0 0 1.05em;
  color: var(--ink-soft);
}

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

.content a {
  color: #2c6f61;
  text-decoration: underline;
  text-decoration-color: rgba(92, 198, 176, 0.75);
  text-underline-offset: 3px;
}

.content a:hover {
  color: var(--ink);
  text-decoration-color: var(--clay);
}

.content ul,
.content ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.content li {
  margin-bottom: 0.45em;
  color: var(--ink-soft);
}

.content li::marker {
  color: var(--clay);
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 22px 0;
  box-shadow: var(--shadow);
}

.content blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--sand);
  background: rgba(212, 196, 168, 0.24);
  color: var(--ink-soft);
}

.content strong {
  color: var(--ink);
}

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

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

/* 侧栏 */
.rail {
  position: sticky;
  top: 24px;
  padding: 18px 18px 22px;
  background: var(--paper);
  border-top: 5px solid var(--clay);
  box-shadow: var(--shadow);
}

.rail-head,
.foot-head {
  margin: 0 0 12px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.rail-head > span,
.foot-head > span {
  border-bottom: 2px solid var(--teal);
  padding-bottom: 4px;
}

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

.rail-list li {
  counter-increment: rail;
}

.rail-list a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.25s ease-out, padding-left 0.25s ease-out;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--f-num);
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.04em;
}

.rail-list a:hover {
  color: #2c6f61;
  padding-left: 6px;
}

.to-top {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.25s ease-out, color 0.25s ease-out, border-color 0.25s ease-out;
}

.to-top:hover {
  background: var(--teal);
  border-color: transparent;
  color: #10201c;
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 1140px;
  margin: clamp(30px, 5vw, 60px) auto 0;
  padding: clamp(24px, 4vw, 38px) clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--line);
}

.foot section {
  min-width: 0;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot ul a {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 16px;
  text-decoration: none;
}

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

.foot-copy {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--f-display);
  font-size: 17px;
  line-height: 1.2;
}

.brand-img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.foot-logo {
  color: var(--ink);
}

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px clamp(14px, 4vw, 30px);
  background: rgba(23, 38, 35, 0.95);
  border-top: 3px solid var(--teal);
  backdrop-filter: blur(8px);
}

.dock-brand {
  color: #f6efe3;
}

.dock-brand:hover {
  color: var(--teal);
}

.dock-toggle {
  min-width: 76px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(212, 196, 168, 0.55);
  background: transparent;
  color: #f6efe3;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.25s ease-out, color 0.25s ease-out;
}

.dock-toggle:hover,
.dock-toggle[aria-expanded="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #10201c;
}

.dock-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 14px clamp(14px, 4vw, 30px) 16px;
  list-style: none;
  background: #f7f0e4;
  border-top: 3px solid var(--clay);
  box-shadow: 0 -18px 34px -22px rgba(23, 38, 35, 0.75);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.28s ease-out, transform 0.28s ease-out, visibility 0.28s;
}

.dock[data-open="true"] .dock-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dock-menu li {
  list-style: none;
  min-width: 0;
}

.dock-menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-left: 3px solid var(--teal);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.2s ease-out, border-color 0.2s ease-out;
}

.dock-menu a:hover {
  background: #eef4ef;
  border-left-color: var(--clay);
}

@media (min-width: 780px) {
  .dock-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .hero {
    min-height: 46vh;
    padding-bottom: clamp(44px, 9vw, 62px);
    text-align: left;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-desc {
    margin-left: 0;
    max-width: 100%;
    font-size: 16px;
  }

  .dock-menu {
    grid-template-columns: minmax(0, 1fr);
    max-height: 62vh;
    overflow-y: auto;
  }
}

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

  .content > div,
  .rail-list a,
  .to-top,
  .dock-toggle,
  .dock-menu,
  .dock-menu a {
    transition: none;
  }

  .hero-photo {
    transform: none;
  }
}

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