:root {
  --mint: #b4fde1;
  --blue: #add8e6;
  --ink: #172620;
  --ink-soft: #33544a;
  --ink-mute: #4a6b60;
  --paper: #f3fffa;
  --edge: rgba(23, 38, 32, 0.16);
  --edge-strong: rgba(23, 38, 32, 0.26);
  --shadow-lg: 6px 8px 22px rgba(23, 38, 32, 0.16);
  --shadow-sm: 3px 4px 12px rgba(23, 38, 32, 0.12);
  --inner: inset -3px -3px 9px rgba(23, 38, 32, 0.09), inset 3px 3px 10px rgba(255, 255, 255, 0.9);
  --font: 'Roboto', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(23, 38, 32, 0.11) 1px, transparent 0),
    linear-gradient(155deg, #e9fdf5 0%, #f4fbff 46%, #ecfff7 100%);
  background-size: 15px 15px, 100% 100%;
  background-attachment: fixed, fixed;
}

a {
  color: #10573f;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
  border-radius: 12px;
}

/* 顶部细条 */
.topline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px 0 250px;
  background: linear-gradient(90deg, var(--mint) 0%, #d3fbf0 45%, var(--blue) 100%);
  border-bottom: 3px solid var(--edge);
  box-shadow: 0 4px 14px rgba(23, 38, 32, 0.12);
}

.topline p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* 左侧竖排导航 */
.rail {
  position: fixed;
  top: 60px;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  width: 216px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #e8fdf4 100%);
  border: 3px solid var(--edge);
  border-radius: 24px;
  box-shadow: var(--shadow-lg), var(--inner);
}

.mark {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 17px;
  border: 3px solid var(--edge);
  background: linear-gradient(160deg, var(--mint), var(--blue));
  box-shadow: var(--shadow-sm), var(--inner);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease-out;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.mark:hover {
  transform: translateY(-3px) rotate(-4deg);
}

.rail nav {
  min-width: 0;
}

.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 15px;
  border: 2px solid rgba(23, 38, 32, 0.12);
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 2px 3px 8px rgba(23, 38, 32, 0.08), inset 0 0 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease-out, background 0.2s ease-out, box-shadow 0.2s ease-out;
}

.rail a:hover {
  transform: translateY(-2px);
  background: linear-gradient(160deg, var(--mint), #e6fdf9);
  box-shadow: 4px 6px 14px rgba(23, 38, 32, 0.16), var(--inner);
}

/* 主体 */
main {
  margin-left: 244px;
  margin-top: 60px;
  padding: 24px 24px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
  max-width: 1440px;
}

.wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 首屏 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 70vh;
  overflow: hidden;
  border: 4px solid var(--edge-strong);
  border-radius: 28px;
  background: linear-gradient(150deg, var(--mint) 0%, #cdf6ec 40%, var(--blue) 100%);
  box-shadow: var(--shadow-lg), var(--inner);
}

.hero-media {
  position: absolute;
  inset: 0;
}

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

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top right, rgba(23, 38, 32, 0.82) 0%, rgba(23, 38, 32, 0.42) 52%, rgba(23, 38, 32, 0.1) 100%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(20px, 5vw, 58px);
  text-align: right;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 58px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.42);
  animation: rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* 正文外壳 */
.body {
  padding: clamp(16px, 2.6vw, 30px);
  border: 3px solid var(--edge);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf8 100%);
  box-shadow: var(--shadow-lg), var(--inner);
}

.prose {
  min-width: 0;
}

.prose section {
  margin: 0 0 20px;
  padding: 22px;
  border-radius: 10px;
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #ffffff 0%, #effdf7 100%);
  box-shadow: 3px 5px 14px rgba(23, 38, 32, 0.1), inset -2px -2px 8px rgba(23, 38, 32, 0.05), inset 2px 2px 8px #ffffff;
  scroll-margin-top: 76px;
  animation: rise 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.prose section:nth-child(1) { animation-delay: 0.02s; }
.prose section:nth-child(2) { animation-delay: 0.06s; }
.prose section:nth-child(3) { animation-delay: 0.1s; }
.prose section:nth-child(4) { animation-delay: 0.14s; }
.prose section:nth-child(5) { animation-delay: 0.18s; }
.prose section:nth-child(6) { animation-delay: 0.22s; }
.prose section:nth-child(7) { animation-delay: 0.26s; }
.prose section:nth-child(8) { animation-delay: 0.3s; }

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

.prose h2 {
  margin: 0 0 0.55em;
  font-size: clamp(23px, 2.5vw, 31px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.prose h3 {
  margin: 1.2em 0 0.5em;
  font-size: 20px;
  line-height: 1.4;
}

.prose h2 + p,
.prose h2 + .subtitle {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1em;
}

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

.prose li {
  margin: 0.35em 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 3px solid rgba(23, 38, 32, 0.1);
}

.prose blockquote {
  margin: 1em 0;
  padding: 14px 18px;
  border-left: 6px solid var(--blue);
  border-radius: 10px;
  background: #f3fbff;
  color: var(--ink-soft);
}

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

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

.prose th {
  background: #e8fdf4;
}

/* 右侧栏 */
.side {
  position: sticky;
  top: 76px;
  padding: 20px;
  border: 3px solid var(--edge);
  border-radius: 24px;
  background: linear-gradient(180deg, #eaf7ff 0%, #f2fffa 100%);
  box-shadow: var(--shadow-lg), var(--inner);
}

.side h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.side .subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 13px;
  border: 2px solid rgba(23, 38, 32, 0.12);
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 0.2s ease-out, background 0.2s ease-out;
}

.side a:hover {
  transform: translateX(-3px);
  background: linear-gradient(160deg, var(--mint), #ffffff);
}

/* 页脚 */
footer {
  margin-left: 244px;
  padding: 26px 24px 56px;
  max-width: 1440px;
  text-align: center;
}

footer .cta {
  margin: 0 0 22px;
}

footer .cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 34px;
  border: 3px solid var(--edge-strong);
  border-radius: 20px;
  background: linear-gradient(160deg, var(--mint) 0%, var(--blue) 100%);
  box-shadow: var(--shadow-lg), var(--inner);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease-out;
}

footer .cta a:hover {
  transform: translateY(-3px);
}

footer p {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ink-soft);
}

footer small {
  display: block;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-mute);
}

/* 回到顶部 */
.totop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  padding: 13px 16px;
  border: 3px solid var(--edge-strong);
  border-radius: 18px;
  background: linear-gradient(160deg, #ffffff 0%, #c9fbe9 100%);
  box-shadow: var(--shadow-sm), var(--inner);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.totop.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 16px;
  }
  .topline {
    position: static;
    justify-content: center;
    padding: 10px 14px;
    min-height: 44px;
  }
  .rail {
    position: static;
    width: auto;
    margin: 12px 12px 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 20px;
  }
  .rail nav {
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .rail ul {
    flex-direction: row;
    gap: 8px;
  }
  .rail a {
    white-space: nowrap;
  }
  main {
    margin-left: 0;
    margin-top: 0;
    padding: 12px;
    gap: 18px;
  }
  .hero {
    min-height: 62vh;
    border-radius: 22px;
  }
  .hero-copy {
    text-align: left;
    padding: 22px;
  }
  .prose section {
    padding: 18px;
    scroll-margin-top: 12px;
  }
  footer {
    margin-left: 0;
    padding: 22px 14px 70px;
  }
  .totop {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-copy h1,
  .prose section {
    animation: none;
  }
  .mark,
  .rail a,
  .side a,
  .totop,
  footer .cta a {
    transition: none;
  }
}

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