:root {
  --ink: #172623;
  --ink-soft: rgba(23, 38, 35, .68);
  --mint: #5cc6b0;
  --mint-deep: #2f6f63;
  --sand: #d4c4a8;
  --clay: #c67b5c;
  --paper: #f4eee3;
  --paper-2: #e8dcc7;
  --line: rgba(23, 38, 35, .16);
  --line-soft: rgba(23, 38, 35, .09);
  --radius: 28px;
}

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

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

body {
  margin: 0;
  padding: 0 0 104px;
  overflow-x: hidden;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(180deg, #f7f1e6 0%, #ece0cb 46%, #e2d3ba 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

img,
svg { max-width: 100%; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  border: 1px solid rgba(92, 198, 176, .34);
  border-radius: 24px;
  box-shadow: 0 14px 30px -22px rgba(23, 38, 35, .9);
}

.dock ol {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dock ol::-webkit-scrollbar { display: none; }

.dock-left { justify-content: flex-start; }
.dock-right { justify-content: flex-end; }

.dock-mid {
  overflow: visible;
  min-width: 0;
}

.dock a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 9px;
  border-radius: 14px;
  color: var(--sand);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color .25s ease-out, background-color .25s ease-out;
}

.dock a:hover,
.dock a:focus-visible {
  color: #0d1a17;
  background: var(--mint);
  outline: none;
}

.dock .ico {
  width: 9px;
  height: 9px;
  flex: none;
  color: currentColor;
}

.dock-brand {
  color: var(--mint) !important;
  font-weight: 600;
  letter-spacing: .14em;
  padding: 8px 10px !important;
}

.dock-brand:hover,
.dock-brand:focus-visible {
  color: #0d1a17 !important;
  background: transparent !important;
}

.dock-search form {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 3px 2px 12px;
  border: 1px solid rgba(212, 196, 168, .32);
  border-radius: 999px;
}

.dock-search input {
  width: 92px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sand);
  font: inherit;
  font-size: .95rem;
}

.dock-search input::placeholder { color: rgba(212, 196, 168, .62); }
.dock-search input:focus { outline: none; }

.dock-search button {
  width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #0d1a17;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 首屏 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(18px, 4vh, 42px);
  min-height: 100svh;
  padding: clamp(64px, 11vh, 120px) 0 22px;
  text-align: right;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  min-width: 0;
}

.hero h1 {
  max-width: 24ch;
  font-size: clamp(2rem, 6.4vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.02em;
  overflow-wrap: break-word;
  word-break: break-word;
}

.lede {
  max-width: 46ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.hero-media {
  position: relative;
  width: 100%;
  max-height: 42vh;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(140deg, #d3c3a8, #b9a184 58%, #96b3a8);
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transform-origin: 50% 30%;
}

.hero-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(140deg, #d3c3a8, #b9a184 58%, #96b3a8);
}

/* ---------- 内容区 ---------- */
.content {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(38px, 7vh, 70px) 0 34px;
  text-align: left;
}

.rail {
  position: sticky;
  top: 18px;
  min-width: 0;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .28));
}

.rail small,
.prose small {
  display: block;
  margin-bottom: 7px;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--mint-deep);
}

.rail-title {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
}

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

.rail li + li { border-top: 1px solid var(--line-soft); }

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 2px;
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
  transition: color .2s ease-out, padding-left .2s ease-out;
}

.rail a:hover,
.rail a:focus-visible {
  color: var(--mint-deep);
  padding-left: 6px;
  outline: none;
}

.prose {
  min-width: 0;
  padding: clamp(20px, 3.4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .34));
  overflow-wrap: break-word;
}

.prose > * { scroll-margin-top: 24px; }

.prose section {
  padding-block: clamp(20px, 3vw, 34px);
  border-top: 1px dashed var(--line);
}

.prose section:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose section:last-child { padding-bottom: 0; }

.prose h2 {
  margin-bottom: .6em;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -.01em;
}

small + h2 { margin-top: 0; }

.prose h3 {
  margin: 1.5em 0 .5em;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}

.prose p {
  margin-bottom: 1em;
  font-size: 1.0625rem;
  line-height: 1.85;
  color: rgba(23, 38, 35, .87);
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
  line-height: 1.85;
}

.prose li { margin-bottom: .4em; }

.prose a {
  color: var(--mint-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong { font-weight: 600; }

.prose blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--mint);
  color: var(--ink-soft);
}

.prose img {
  display: block;
  margin: 1.2em 0;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
}

.prose pre {
  margin: 1.2em 0;
  padding: 14px 16px;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(23, 38, 35, .06);
  font-size: .95rem;
  line-height: 1.7;
}

.prose code { overflow-wrap: break-word; }

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .95rem;
}

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

.prose iframe,
.prose video {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
}

.foot-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink);
  text-decoration: none;
}

.foot-nav { min-width: 0; }

.foot-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { color: var(--mint-deep); outline: none; }

.sub form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 2px 2px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
}

.sub input {
  width: 130px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.sub input:focus { outline: none; }

.sub button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #0d1a17;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
}

.foot-meta {
  margin-left: auto;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* ---------- 揭示动效 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.19, .9, .22, 1), transform .7s cubic-bezier(.19, .9, .22, 1);
}

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

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .content { grid-template-columns: minmax(0, 1fr); }

  .rail {
    position: static;
    padding: 16px;
  }

  .rail-title { margin-bottom: 10px; }

  .rail-nav ol {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .rail-nav ol::-webkit-scrollbar { display: none; }

  .rail li + li { border-top: 0; }

  .rail a {
    padding: 8px 14px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  body { padding-bottom: 96px; }
  .wrap { padding: 0 16px; }

  .dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .dock a {
    padding: 8px 7px;
    gap: 5px;
  }

  .dock-brand { padding: 8px 6px !important; letter-spacing: .08em; }
  .dock-search { display: none; }

  .hero {
    min-height: 94svh;
    padding-top: 60px;
  }

  .hero-media { max-height: 36vh; aspect-ratio: 4 / 3; }

  .foot { gap: 6px 16px; }
  .foot-meta { margin-left: 0; }

  .sub form { max-width: 100%; }
  .sub input { width: 100%; min-width: 0; flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .dock { left: 6px; right: 6px; }

  .dock a { padding: 8px 6px; }

  .dock .ico {
    width: 7px;
    height: 7px;
  }

  .dock-brand { font-size: .98rem !important; letter-spacing: .04em !important; }

  .hero h1 { font-size: clamp(1.75rem, 8vw, 2.4rem); }
}

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

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

  .hero-media img { transform: none; }
}

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