@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --sand: #efe7db;
  --sand-2: #e4d8c5;
  --sand-3: #d4c4a8;
  --clay: #c0714a;
  --clay-d: #a35a37;
  --ink: #172623;
  --moss: #3d5a4b;
  --teal: #5cc6b0;
  --line: rgba(23, 38, 35, 0.18);
  --line-soft: rgba(23, 38, 35, 0.1);
  --serif: "Source Serif 4", "Songti SC", Georgia, serif;
  --display: "Playfair Display", "Songti SC", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.78;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; }

a { color: inherit; text-decoration-color: var(--clay); text-underline-offset: 3px; }

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

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 26px;
}

/* 顶部品牌行 */
.top {
  border-bottom: 2px solid var(--ink);
  padding: 20px 0 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* 双栏骨架：菜单在左 */
.layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0 46px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 0;
  padding: 30px 26px 40px 0;
  border-right: 1px solid var(--line-soft);
  max-height: 100vh;
  overflow: auto;
}

.rail__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 22px;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--moss);
  line-height: 1.6;
}

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

.rail__nav a {
  display: block;
  padding: 10px 12px;
  font-size: 17px;
  line-height: 1.5;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color 0.25s ease-out, border-color 0.25s ease-out, color 0.25s ease-out;
}

.rail__nav a:hover,
.rail__nav a.on {
  background: var(--sand-2);
  border-left-color: var(--clay);
  color: var(--clay-d);
}

.rail__nav li.is-group > a::after {
  content: "＋";
  float: right;
  font-size: 13px;
  color: var(--moss);
}

.rail__nav .sub {
  display: none;
  padding-left: 14px;
  margin: 2px 0 6px;
}

.rail__nav .sub a {
  font-size: 16px;
  color: var(--moss);
  padding: 8px 12px;
}

.rail__nav li.is-group:hover .sub,
.rail__nav li.is-group:focus-within .sub {
  display: block;
}

.totop {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 14px;
  font-size: 15px;
  text-decoration: none;
  background: var(--ink);
  color: var(--sand);
  transition: background-color 0.25s ease-out;
}

.totop:hover { background: var(--clay-d); }

/* 主区 */
main { min-width: 0; padding-bottom: 26px; }

main article { display: block; }

main article > section {
  border-top: 1px solid var(--line);
  padding: 48px 0 10px;
  scroll-margin-top: 16px;
}

main article > section:last-child { padding-bottom: 20px; }

main article h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 33px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
}

main article h2::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  background: var(--clay);
  margin-bottom: 16px;
}

main section h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.35;
  margin: 30px 0 12px;
}

main section p {
  margin: 0 0 18px;
  max-width: 62ch;
  line-height: 1.85;
}

main section ul,
main section ol {
  margin: 0 0 20px;
  padding-left: 1.25em;
  max-width: 60ch;
}

main section li { margin-bottom: 8px; }

main section li::marker { color: var(--clay); }

main section strong { font-weight: 600; }

main section img {
  display: block;
  height: auto;
  margin: 24px 0;
  background: var(--sand-2);
}

main section blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--sand-2);
  border-left: 5px solid var(--moss);
}

main section blockquote p { margin: 0 0 10px; }
main section blockquote p:last-child { margin: 0; }

main section hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 30px 0;
}

main section table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 16px;
}

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

main section th { background: var(--sand-2); font-weight: 600; }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--sand);
  min-height: 45vh;
  display: grid;
  place-items: center;
  padding: 52px 22px 58px;
  border-top: 0;
  scroll-margin-top: 0;
}

.hero__body {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 34ch;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

.badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 13px;
  background: var(--clay);
  color: #fdf7f1;
  font-size: 14px;
  letter-spacing: 0.24em;
  line-height: 1.6;
  max-width: none;
}

.hero .shot {
  position: absolute;
  z-index: 1;
  width: 30%;
  max-width: 236px;
  height: auto;
  margin: 0;
  opacity: 0.5;
  border: 5px solid var(--sand-3);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.35);
  filter: sepia(0.32) contrast(1.05);
}

.hero .shot--a {
  left: -5%;
  bottom: -12%;
  transform: rotate(-6deg);
}

.hero .shot--b {
  right: -6%;
  top: -10%;
  transform: rotate(4deg);
}

/* 页脚 */
.foot {
  border-top: 2px solid var(--ink);
  margin-top: 40px;
  padding: 34px 0 44px;
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 20px 30px;
  align-items: end;
}

.foot__brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.foot__links {
  margin: 0;
  max-width: none;
}

.foot__links a {
  display: inline-block;
  padding: 10px 14px 10px 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--moss);
  text-decoration: none;
  transition: color 0.22s ease-out;
}

.foot__links a:hover { color: var(--clay-d); text-decoration: underline; }

.foot__copy {
  font-size: 14px;
  line-height: 1.7;
  color: var(--moss);
  text-align: right;
}

/* 滚动显现 */
.js main section > div {
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js main section > div:not(.in) {
  opacity: 0;
  transform: translateY(16px);
}

/* 移动端 */
@media (max-width: 780px) {
  body { font-size: 17px; }

  .wrap { padding: 0 18px; }

  .top { padding: 14px 0 12px; }

  .brand__name { font-size: 24px; }

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

  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0 14px;
  }

  .rail__title { font-size: 17px; margin-bottom: 2px; }

  .subtitle { margin-bottom: 12px; font-size: 13px; letter-spacing: 0.16em; }

  .rail__nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .rail__nav li { flex: 0 0 auto; }

  .rail__nav a {
    border: 1px solid var(--line);
    background: var(--sand-2);
    padding: 11px 14px;
    min-height: 44px;
    font-size: 16px;
    display: flex;
    align-items: center;
  }

  .rail__nav li.is-group > a::after { float: none; margin-left: 6px; }

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

  .rail__nav .sub a { min-height: 42px; font-size: 15px; }

  .totop { margin-top: 14px; padding: 11px 16px; min-height: 44px; display: inline-flex; align-items: center; }

  .hero { min-height: 45vh; padding: 44px 16px 48px; }

  .hero .shot { width: 34%; opacity: 0.36; border-width: 4px; }

  .hero .shot--a { left: -14%; bottom: -14%; }
  .hero .shot--b { right: -14%; top: -12%; }

  main section > div { padding: 34px 0 6px; }

  main section p { line-height: 1.8; }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 26px 0 34px;
  }

  .foot__copy { text-align: left; font-size: 14px; }
}

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

  .js main section > div,
  .js main section > div:not(.in) {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .rail__nav a,
  .totop,
  .foot__links a {
    transition: none;
  }
}

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