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

:root {
  --g: #87ff71;
  --y: #ffce5c;
  --ink: #192617;
  --paper: #f5f2e6;
  --card: #fffdf6;
  --serif: 'Lora', Georgia, 'Songti SC', 'STSong', serif;
  --sans: 'Raleway', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(25, 38, 23, .14) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

/* 顶部细条 */
.ann { background: var(--ink); color: var(--g); }

.ann p {
  margin: 0;
  padding: 7px clamp(16px, 4vw, 40px);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
}

/* 顶栏 */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px clamp(14px, 4vw, 40px);
  background: var(--y);
  border-bottom: 4px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
}

.brand-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: var(--g);
  border: 2px solid var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.brand:hover .brand-dot { transform: rotate(0deg) scale(1.15); }

.burger {
  min-height: 46px;
  padding: 11px 20px;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--g);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.burger:hover { background: #243522; }

/* 布局 */
.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  transition: grid-template-columns .3s ease;
}

.side {
  position: sticky;
  top: 72px;
  min-height: calc(100vh - 72px);
  padding: 24px 18px 40px;
  background: var(--y);
  background-image: repeating-linear-gradient(-45deg, rgba(25, 38, 23, .07) 0 10px, transparent 10px 20px);
  border-right: 4px solid var(--ink);
  transition: transform .3s ease, opacity .3s ease;
}

.side h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .28em;
}

hr {
  margin: 10px 0 16px;
  border: 0;
  border-top: 3px dashed var(--ink);
}

.side nav ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.side nav a:hover,
.side nav a:focus-visible {
  background: var(--g);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

main {
  min-width: 0;
  padding-right: clamp(0px, 2vw, 26px);
}

/* 头图 */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100svh - 6.4rem);
  padding: clamp(46px, 9vw, 96px) clamp(18px, 5vw, 64px) 0;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
  border-bottom: 5px solid var(--g);
}

.hero::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 6%;
  left: -8%;
  width: min(46vw, 260px);
  aspect-ratio: 1;
  background: var(--y);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(-12deg);
  opacity: .92;
  animation: bob 9s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  right: 4%;
  bottom: 20%;
  width: min(38vw, 200px);
  aspect-ratio: 1;
  background: var(--g);
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: .26;
  animation: pul 7s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-10px); }
}

@keyframes pul {
  0%, 100% { transform: scale(1); opacity: .2; }
  50% { transform: scale(1.12); opacity: .34; }
}

.hero-ghost {
  position: absolute;
  z-index: 0;
  top: 8%;
  right: -.06em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3.2rem, 15vw, 11rem);
  line-height: .9;
  color: var(--g);
  opacity: .14;
  white-space: nowrap;
  pointer-events: none;
}

.hero-txt {
  position: relative;
  z-index: 2;
  margin-top: auto;
  text-align: right;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 7vw, 4.4rem);
  line-height: 1.08;
  color: var(--g);
  letter-spacing: .01em;
}

.hero-lead {
  max-width: 44ch;
  margin: 16px 0 clamp(26px, 6vw, 58px) auto;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--paper);
  opacity: .88;
}

.hero-figure {
  position: relative;
  z-index: 2;
  margin: clamp(24px, 5vw, 48px) calc(-1 * clamp(18px, 5vw, 64px)) 0;
  border-top: 5px solid var(--y);
}

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

/* 正文 */
.doc > article:not(.hero) {
  margin: clamp(22px, 4vw, 40px) clamp(14px, 4vw, 44px);
  padding: clamp(22px, 4vw, 44px);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 7px 7px 0 var(--y);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}

.doc > article.in { opacity: 1; transform: none; }

.doc article[id] { scroll-margin-top: 96px; }

.doc h2 {
  margin: 0 0 .2em;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  line-height: 1.25;
}

.doc h2 + hr { margin: .7em 0 1.1em; }

.doc h3 {
  position: relative;
  margin: 1.5em 0 .45em;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 1.13rem;
  font-weight: 700;
  line-height: 1.4;
}

.doc h3::before {
  content: '';
  position: absolute;
  top: .5em;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--y);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
}

.doc p { max-width: 74ch; margin: 0 0 1.05em; }

.doc a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--y);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.doc a:hover { background: var(--g); }

.doc ul,
.doc ol {
  max-width: 74ch;
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}

.doc li { margin: .4em 0; }

.doc blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  background: var(--y);
  border-left: 7px solid var(--ink);
  border-radius: 4px;
}

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

.doc table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: .95rem;
}

.doc th,
.doc td {
  padding: 9px 11px;
  text-align: left;
  border: 2px solid var(--ink);
}

.doc th { background: var(--g); }

.doc img { border: 3px solid var(--ink); border-radius: 4px; }

.doc code {
  padding: 2px 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .92em;
  background: rgba(25, 38, 23, .09);
  border-radius: 3px;
}

/* 订阅块 */
.cta {
  padding: clamp(26px, 5vw, 44px) clamp(18px, 5vw, 64px);
  background: var(--g);
  border-top: 4px solid var(--ink);
}

.cta h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
}

.cta hr { max-width: 340px; margin: .7em 0 1.1em; }

.cta-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 460px;
}

.cta-form input {
  flex: 1 1 190px;
  min-height: 50px;
  padding: 11px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 4px;
}

.cta-form button {
  min-height: 50px;
  padding: 12px 24px;
  font: inherit;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--g);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: clamp(28px, 5vw, 44px) clamp(18px, 5vw, 64px) 22px;
  color: var(--paper);
  background: var(--ink);
  border-top: 5px solid var(--g);
}

.foot p {
  margin: 0 0 8px;
  font-size: .92rem;
  line-height: 1.6;
  color: rgba(245, 242, 230, .86);
}

.foot p:first-child {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--g);
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px;
  font-size: .92rem;
  line-height: 1.35;
  color: var(--g);
  text-decoration: none;
}

.foot a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.foot small {
  grid-column: 1 / -1;
  display: block;
  margin-top: 6px;
  padding-top: 14px;
  font-size: .82rem;
  color: rgba(245, 242, 230, .7);
  text-align: center;
  border-top: 2px dashed rgba(135, 255, 113, .45);
}

.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--y);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

/* 桌面收起 */
@media (min-width: 761px) {
  body.nav-off .layout { grid-template-columns: 0 minmax(0, 1fr); }
  body.nav-off .side {
    overflow: hidden;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
  }
}

/* 移动端 */
@media (max-width: 760px) {
  body.menu-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(25, 38, 23, .55);
  }

  .layout { grid-template-columns: 1fr; }

  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(84vw, 320px);
    min-height: 0;
    overflow: auto;
    box-shadow: 8px 0 0 rgba(25, 38, 23, .2);
    transform: translateX(-105%);
    opacity: 1;
  }

  body.menu-open .side { transform: none; }

  main { padding-right: 0; }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .hero-ghost { top: 4%; font-size: 3.4rem; }

  .doc > article:not(.hero) { margin: 22px 14px; box-shadow: 5px 5px 0 var(--y); }

  .doc table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

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

  .doc > article:not(.hero) { opacity: 1; transform: none; }
}

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