@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

:root {
  --neon: #87ff71;
  --sun: #ffce5c;
  --ink: #192617;
  --paper: #f6ffef;
  --moss: #3c5a37;
  --r: 10px;
  --dock-h: 132px;
}

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

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

body {
  margin: 0;
  padding: 0 0 calc(var(--dock-h) + env(safe-area-inset-bottom));
  background:
    radial-gradient(rgba(135, 255, 113, 0.6) 1.4px, transparent 1.6px) 0 0 / 22px 22px,
    var(--paper);
  color: var(--ink);
  font-family: "Crimson Text", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "EB Garamond", Georgia, "Songti SC", serif;
  font-weight: 700;
  line-height: 1.14;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--ink);
}

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

/* ---------- 背景几何 ---------- */
.deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.dec {
  position: absolute;
  display: block;
  will-change: transform;
}

.dec-a {
  width: 190px;
  height: 190px;
  background: var(--neon);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  top: 15vh;
  left: -78px;
  opacity: 0.75;
  transform: rotate(14deg);
}

.dec-b {
  width: 118px;
  height: 118px;
  border: 11px solid var(--sun);
  border-radius: 50%;
  top: 6vh;
  right: 4vw;
  opacity: 0.9;
  transform: rotate(-8deg);
}

.dec-c {
  width: 280px;
  height: 24px;
  border-radius: 20px;
  background: repeating-linear-gradient(90deg, var(--sun) 0 14px, transparent 14px 27px);
  bottom: 24vh;
  left: 5vw;
  opacity: 0.75;
  transform: rotate(-6deg);
}

.dec-d {
  width: 96px;
  height: 96px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  bottom: 15vh;
  right: -28px;
  opacity: 0.32;
  transform: rotate(22deg);
}

/* ---------- 顶部细条 ---------- */
.strip {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--sun);
  border-bottom: 3px solid var(--ink);
}

.strip-mark {
  flex: none;
  width: 15px;
  height: 15px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.strip-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 布局骨架 ---------- */
main {
  position: relative;
  z-index: 1;
}

.wrap {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 46px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- 左栏 ---------- */
.rail {
  position: sticky;
  top: 62px;
  padding: 26px 0 10px;
}

.rail-title {
  font-size: 1.65rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.35em;
}

.subtitle {
  margin: 0 0 1.2em;
  padding-left: 12px;
  border-left: 5px solid var(--neon);
  font-size: 16px;
  line-height: 1.65;
  color: var(--moss);
}

.rail-nav ol {
  counter-reset: rail;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1.5px dotted rgba(25, 38, 23, 0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}

.rail-nav a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 13px;
  color: var(--moss);
}

.rail-nav a:hover {
  background: var(--neon);
  transform: translateX(3px);
}

/* ---------- 主列 ---------- */
.col {
  min-width: 0;
  padding-top: 6px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 40%);
  gap: clamp(16px, 3vw, 34px);
  align-items: center;
  min-height: 70vh;
  padding: 22px 0 34px;
}

.hero-text {
  position: relative;
}

.hero-text::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -18px;
  width: 46px;
  height: 46px;
  background: var(--sun);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(-12deg);
  z-index: -1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.15rem, 6vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-art {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  background: var(--neon);
  overflow: hidden;
  transform: rotate(-1.6deg);
  box-shadow: 10px 10px 0 var(--sun);
}

.hero-art::after {
  content: "";
  position: absolute;
  left: -12%;
  bottom: -12%;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, var(--ink) 0 6px, transparent 6px 15px);
  opacity: 0.22;
  mix-blend-mode: multiply;
  pointer-events: none;
}

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

/* ---------- 正文 ---------- */
.prose {
  padding: 0 0 46px;
}

.prose > article {
  padding: 34px 0 6px;
  border-top: 3px dashed rgba(25, 38, 23, 0.26);
  scroll-margin-top: 74px;
}

.prose > article + article {
  margin-top: 12px;
}

.prose h2 {
  display: inline-block;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  background: var(--sun);
  padding: 3px 13px;
  margin: 0 0 0.55em;
  border-radius: 4px;
  transform: rotate(-0.7deg);
}

.prose h3 {
  font-size: 1.32rem;
  margin-top: 1.5em;
  padding-left: 12px;
  border-left: 6px solid var(--neon);
}

.prose p {
  max-width: 66ch;
}

.prose ul,
.prose ol {
  max-width: 66ch;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.35em 0;
}

.prose a {
  text-decoration: none;
  border-bottom: 2px solid var(--sun);
}

.prose a:hover {
  background: var(--neon);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: #e9ffdf;
  border-left: 7px solid var(--neon);
  border-radius: 0 var(--r) var(--r) 0;
}

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

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
}

.prose table {
  width: 100%;
  max-width: 66ch;
  margin: 1.3em 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 11px;
  text-align: left;
  border: 1.5px dotted rgba(25, 38, 23, 0.42);
}

.prose th {
  background: var(--neon);
}

.prose hr {
  border: 0;
  border-top: 3px dotted rgba(25, 38, 23, 0.4);
  margin: 2em 0;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 40px;
  padding: 16px 18px 20px;
  background: var(--sun);
  border-top: 4px solid var(--ink);
}

.foot-brand a {
  font-family: "EB Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.1;
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 2px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px dotted rgba(25, 38, 23, 0.5);
}

.foot-nav a:hover {
  background: var(--neon);
}

.foot-copy {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--neon);
}

.dock-brand {
  display: block;
  width: fit-content;
  padding: 2px 2px 7px;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.12rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--sun);
}

.dock-nav ol {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

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

.dock-nav li {
  scroll-snap-align: start;
}

.dock-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--paper);
  border: 1.5px dashed rgba(135, 255, 113, 0.65);
  border-radius: var(--r);
  transition: background 0.15s ease, color 0.15s ease;
}

.dock-nav a:hover {
  background: var(--neon);
  color: var(--ink);
  border-color: var(--ink);
}

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

  .rail {
    position: static;
    padding: 18px 0 6px;
  }

  .rail-title {
    font-size: 1.4rem;
    margin-bottom: 0.25em;
  }

  .subtitle {
    margin-bottom: 0.9em;
    font-size: 16px;
  }

  .rail-nav ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rail-nav a {
    padding: 0 11px;
    border: 1.5px solid rgba(25, 38, 23, 0.28);
    border-radius: var(--r);
    background: rgba(255, 255, 255, 0.6);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 16px 0 26px;
  }

  .hero-text::before {
    left: auto;
    right: 4px;
    top: -14px;
    width: 38px;
    height: 38px;
  }

  .hero-art {
    aspect-ratio: 16 / 10;
    transform: rotate(-1deg);
    box-shadow: 7px 7px 0 var(--sun);
  }

  .prose > article {
    scroll-margin-top: 66px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .foot-copy {
    align-self: flex-start;
  }
}

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

  .prose p {
    max-width: none;
  }

  .prose table {
    font-size: 15px;
  }
}

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

  .dec {
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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