@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --mint: #b4fde1;
  --sky: #add8e6;
  --ink: #172620;
  --cream: #f2fffa;
  --head: 124px;
  --font-head: "Lexend Mega", "Public Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Public Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --clay: inset -4px -4px 10px rgba(23, 38, 32, .18), inset 4px 4px 12px rgba(255, 255, 255, .72), 0 10px 0 -3px rgba(23, 38, 32, .5), 0 18px 30px rgba(0, 0, 0, .32);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  color: #eafff7;
  background-color: var(--ink);
  background-image:
    radial-gradient(680px 480px at 8% 4%, rgba(180, 253, 225, .17), transparent 62%),
    radial-gradient(560px 420px at 96% 26%, rgba(173, 216, 230, .16), transparent 64%),
    radial-gradient(720px 520px at 40% 92%, rgba(180, 253, 225, .10), transparent 68%);
  background-attachment: fixed;
  overflow-x: hidden;
}

menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

a { color: inherit; }

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

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -14px;
  padding: 10px 14px 0;
  background: var(--ink);
  border-bottom: 4px solid rgba(180, 253, 225, .3);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .42);
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: linear-gradient(150deg, #ddfff2, var(--mint) 58%, #8fdcbf);
  box-shadow: inset -3px -3px 8px rgba(23, 38, 32, .3), inset 3px 3px 8px rgba(255, 255, 255, .8), 0 4px 0 rgba(180, 253, 225, .4);
}

.mark-ball {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  transform: translateY(-1px);
}

.finder {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 300px;
  display: flex;
  align-items: center;
  border: 3px solid rgba(180, 253, 225, .45);
  border-radius: 999px;
  background: rgba(234, 255, 247, .08);
  overflow: hidden;
}

.finder-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #eafff7;
  font-family: inherit;
  font-size: 16px;
}

.finder-in::placeholder { color: rgba(234, 255, 247, .6); }

.finder-go {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 13px;
  border: 0;
  border-left: 3px solid rgba(180, 253, 225, .45);
  background: var(--mint);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.drawer {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.drawer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 15px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(150deg, #ddfff2, var(--mint));
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset -3px -3px 7px rgba(23, 38, 32, .22), 0 4px 0 rgba(180, 253, 225, .45);
  transition: transform .2s ease-out, background .2s ease-out;
}

.drawer-btn:active { transform: translateY(3px); }
.drawer[open] .drawer-btn { background: var(--sky); }

.burger {
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink);
}

.drawer-list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(310px, calc(100vw - 30px));
  padding: 12px;
  display: grid;
  gap: 9px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: #eafff7;
  box-shadow: inset -4px -4px 10px rgba(23, 38, 32, .14), 0 16px 30px rgba(0, 0, 0, .5);
  z-index: 60;
}

.dr-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(150deg, #f4fffb, var(--mint));
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: inset -2px -2px 6px rgba(23, 38, 32, .14);
  transition: transform .2s ease-out;
}

.dr-link:active { transform: translateY(2px); }

.ic {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(23, 38, 32, .4);
  border-radius: 8px;
  background: rgba(23, 38, 32, .1);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* ---------- 粘性锚点条 ---------- */

.rails {
  margin-top: 8px;
  padding-bottom: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.rails::-webkit-scrollbar { height: 0; }

.rails-list {
  display: flex;
  gap: 8px;
  width: max-content;
  padding: 2px 2px 3px;
}

.rl-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border: 3px solid rgba(180, 253, 225, .42);
  border-radius: 999px;
  background: rgba(180, 253, 225, .12);
  color: var(--mint);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s ease-out, color .2s ease-out;
}

.rl-link:hover,
.rl-link:focus-visible {
  background: var(--mint);
  color: var(--ink);
}

.rails .ic {
  border-color: rgba(180, 253, 225, .55);
  background: rgba(180, 253, 225, .22);
  color: var(--mint);
}

.rl-link:hover .ic,
.rl-link:focus-visible .ic {
  border-color: rgba(23, 38, 32, .4);
  background: rgba(23, 38, 32, .12);
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  margin: 16px 0 30px;
  padding: 22px 0 26px;
  min-height: 62svh;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 30px 30px 62px 62px;
  background: linear-gradient(155deg, #d5f7ec, var(--sky) 58%, #7fb9a1);
  box-shadow: inset -6px -6px 16px rgba(23, 38, 32, .2), 0 14px 32px rgba(0, 0, 0, .38);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -1;
}

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

.hero-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 38, 32, .38) 0%, rgba(23, 38, 32, .06) 42%, rgba(23, 38, 32, .48) 100%);
}

.hero-h1 {
  position: relative;
  margin: 0 18px;
  padding: 14px 20px;
  max-width: 92%;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(160deg, #f4fffb, var(--mint) 70%);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.75rem, 6.4vw, 3.3rem);
  line-height: 1.16;
  letter-spacing: -.015em;
  transform: rotate(-1.4deg);
  box-shadow: inset -4px -4px 10px rgba(23, 38, 32, .16), inset 4px 4px 10px rgba(255, 255, 255, .8), 0 12px 0 -4px rgba(23, 38, 32, .45);
  animation: pop .62s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(18px) scale(.955) rotate(-1.4deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(-1.4deg); }
}

/* ---------- 版面 ---------- */

.stage {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
  padding-top: 4px;
}

.content { min-width: 0; }

.content > section {
  position: relative;
  margin: 0 0 28px;
  padding: 26px 20px 36px;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: linear-gradient(155deg, #e6fff6, var(--mint) 52%, #a4efd6);
  color: var(--ink);
  box-shadow: var(--clay);
  scroll-margin-top: calc(var(--head) + 14px);
  overflow-wrap: break-word;
}

.content > section:nth-of-type(even) {
  background: linear-gradient(155deg, #ecf9ff, var(--sky) 54%, #bfe4f4);
}

.content > section::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 14px;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ink), rgba(23, 38, 32, .12));
  opacity: .55;
}

.content > section > *:first-child { margin-top: 0; }
.content > section > *:last-child { margin-bottom: 0; }

.content h2 {
  margin: 0 0 .75rem;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.35rem, 4.8vw, 1.95rem);
  line-height: 1.28;
  letter-spacing: -.01em;
}

.content h3 {
  margin: 1.5rem 0 .45rem;
  font-size: 1.14rem;
  line-height: 1.4;
}

.content p { margin: 0 0 1rem; }

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

.content li { margin: .35rem 0; }

.content a {
  color: #0a3f31;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.content strong { font-weight: 800; }

.content blockquote {
  margin: 1.1rem 0;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset -3px -3px 8px rgba(23, 38, 32, .1);
}

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

.content figure {
  margin: 1.1rem 0;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, .5);
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.1rem 0;
  border-collapse: collapse;
  font-size: 16px;
}

.content th,
.content td {
  padding: 9px 11px;
  border: 2px solid rgba(23, 38, 32, .34);
  text-align: left;
  vertical-align: top;
}

.content th { background: rgba(23, 38, 32, .1); }

.content code {
  padding: .08em .34em;
  border-radius: 6px;
  background: rgba(23, 38, 32, .12);
  font-size: .95em;
}

/* ---------- 侧栏 ---------- */

.side {
  min-width: 0;
  padding: 18px 16px 20px;
  border: 4px solid var(--ink);
  border-radius: 26px;
  background: linear-gradient(160deg, #f6fffb, #cbf6e5 78%);
  color: var(--ink);
  box-shadow: inset -4px -4px 10px rgba(23, 38, 32, .14), 0 10px 0 -3px rgba(23, 38, 32, .45), 0 16px 24px rgba(0, 0, 0, .3);
}

.side-h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.3;
}

.subtitle {
  margin: .12rem 0 1rem;
  font-size: 16px;
  line-height: 1.5;
  opacity: .72;
}

.side-list {
  display: grid;
  gap: 8px;
}

.sd-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 11px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  background: linear-gradient(150deg, #ffffff, #d5fbee);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: inset -2px -2px 6px rgba(23, 38, 32, .13);
  transition: transform .2s ease-out, background .2s ease-out;
}

.sd-link:hover,
.sd-link:focus-visible {
  background: var(--sky);
  transform: translateX(3px);
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--mint);
  text-decoration: none;
  font-weight: 800;
  transition: transform .2s ease-out;
}

.totop:active { transform: translateY(3px); }

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 46px;
  padding: 28px 0 36px;
  border-top: 4px solid rgba(180, 253, 225, .32);
}

.foot-brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.5rem, 15vw, 5.6rem);
  line-height: .96;
  letter-spacing: -.035em;
  text-align: center;
  color: var(--mint);
  text-shadow: 0 6px 0 rgba(180, 253, 225, .18);
  overflow-wrap: break-word;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 18px;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  color: #eafff7;
  text-decoration: none;
  font-size: 16px;
}

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

.foot-copy {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 16px;
  opacity: .68;
}

/* ---------- 动效 ---------- */

.has-js .content > section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease-out, transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

.has-js .content > section.on {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */

@media (min-width: 640px) {
  .content > section { padding: 30px 28px 42px; }
  .content > section::after { left: 28px; right: 28px; }
  .hero-h1 { margin: 0 26px; padding: 18px 24px; }
}

@media (min-width: 920px) {
  .shell { padding: 0 22px; }
  .topbar { margin: 0 -22px; padding: 12px 22px 0; }
  .stage {
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
    gap: 30px;
  }
  .side {
    position: sticky;
    top: calc(var(--head) + 12px);
  }
  .hero {
    min-height: calc(100svh - 152px);
    padding: 34px 0;
  }
  .hero-h1 { margin: 0 38px; }
  .rails { overflow-x: visible; }
  .rails-list { flex-wrap: wrap; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

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