@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

:root {
  --mint: #b4fde1;
  --sky: #add8e6;
  --ink: #172620;
  --deep: #0f5c44;
  --paper: rgba(255, 255, 255, 0.72);
  --serif: "Noto Serif TC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans TC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --clay: 5px 5px 12px rgba(23, 38, 32, 0.18), inset -3px -3px 9px rgba(23, 38, 32, 0.08), inset 3px 3px 9px rgba(255, 255, 255, 0.85);
  --railw: 288px;
}

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

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

body {
  margin: 0;
  padding-left: var(--railw);
  background: linear-gradient(160deg, #f4fdf9 0%, #e8f5fb 58%, #f0fbf5 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  overflow-x: hidden;
  overflow-x: clip;
}

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

/* ---------- 左侧竖排栏 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--railw);
  padding: 0 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(180deg, #d7fbee 0%, #dff1fb 70%, #e9fbf3 100%);
  border-right: 4px solid var(--ink);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 60;
}

.rail-top {
  margin: 0 -20px;
  padding: 12px 6px;
  background: var(--ink);
  color: var(--mint);
  font-size: 15px;
  letter-spacing: 0.26em;
  text-align: center;
  line-height: 1.4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 20px;
  max-width: 100%;
  text-decoration: none;
  color: var(--ink);
}

.brand-dot {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 32% 28%, #f3fffa, var(--mint) 56%, #74e3bd);
  box-shadow: var(--clay);
}

.brand-dot.small {
  width: 38px;
  height: 38px;
}

.brand-pic,
.foot-pic {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  box-shadow: var(--clay);
}

.foot-pic {
  width: 38px;
  height: 38px;
  box-shadow: none;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding-bottom: 8px;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.rail-link:hover,
.rail-link:focus-visible {
  background: #ffffff;
  transform: translateX(4px);
}

.rail-link:active {
  transform: scale(0.97);
}

.ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--ink);
  opacity: 0.55;
}

.i1 {
  border-radius: 50%;
  background: var(--deep);
  opacity: 0.85;
}

.i2 {
  border-radius: 3px;
  background: #6fc9e0;
  opacity: 0.95;
  transform: rotate(45deg);
}

.i3 {
  border-radius: 50% 50% 4px 50%;
  background: #4fc59c;
  opacity: 0.95;
}

/* ---------- 主体 ---------- */
main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 44px) 60px;
  overflow-x: clip;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: 64px 0 96px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  clip-path: polygon(0 46%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.26;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero-lede {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  line-height: 1.85;
  color: #2b4a3e;
}

.hero-fig {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(150deg, #cbf9e8, #cfe9f8);
  box-shadow: var(--clay);
  overflow: hidden;
  will-change: transform;
}

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

.hero-blob {
  width: 58%;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 52% 46% 54% 48%;
  background: radial-gradient(circle at 34% 28%, #f4fffa, var(--mint) 58%, #7ee5c3);
  box-shadow: var(--clay);
  animation: bob 6.4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

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

.paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding-top: 26px;
}

.prose {
  min-width: 0;
  max-width: 100%;
}

.prose div {
  padding: 34px 0;
  scroll-margin-top: 116px;
  border-bottom: 3px dotted rgba(23, 38, 32, 0.18);
}

.prose div:last-child {
  border-bottom: 0;
  padding-bottom: 10px;
}

.prose h2 {
  margin: 4px 0 16px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.6vw, 1.92rem);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.prose h3 {
  margin: 24px 0 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.5;
}

.prose h2 span,
.side-t span,
.foot-h span {
  padding: 0 0.12em;
  border-radius: 4px;
  box-shadow: inset 0 -0.42em var(--mint);
}

.prose p {
  margin: 0 0 15px;
  overflow-wrap: break-word;
}

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

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

.prose li {
  margin: 7px 0;
}

.prose figure {
  margin: 20px 0;
  max-width: 100%;
}

.prose img {
  max-width: 100%;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--clay);
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 6px solid var(--mint);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.66);
}

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

.prose th,
.prose td {
  padding: 9px 10px;
  border-bottom: 2px solid rgba(23, 38, 32, 0.16);
  text-align: left;
  overflow-wrap: break-word;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #dcf8ee;
  overflow-wrap: break-word;
}

.side {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding: 18px 16px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--clay);
  backdrop-filter: blur(4px);
}

.side-t {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

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

.side-list a {
  display: block;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 4px;
  background: rgba(180, 253, 225, 0.5);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 0.18s ease-out, transform 0.18s ease-out;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: var(--mint);
  transform: translateX(3px);
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1140px;
  margin: 0 auto;
  padding: 34px clamp(16px, 3vw, 44px) 44px;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 22px;
  padding: 26px 24px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(150deg, #d6fbef, #dceffa);
  box-shadow: var(--clay);
}

.foot-nav {
  display: contents;
}

.foot-cols dl {
  margin: 0;
  min-width: 0;
}

.foot-cols dt {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 600;
}

.foot-cols dd {
  margin: 0;
}

.foot-cols a {
  display: inline-block;
  min-height: 40px;
  padding: 8px 0;
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot-cols a:hover,
.foot-cols a:focus-visible {
  border-bottom-color: var(--ink);
}

.foot-h {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.5;
}

.foot-logo {
  padding-top: 10px;
}

.foot-copy {
  margin: 20px 0 0;
  text-align: center;
  font-size: 15px;
  color: #31564a;
}

.foot-copy a {
  display: inline-block;
  min-height: 40px;
  padding: 6px 10px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 入场动效 ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
}

.js-reveal .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease-out, transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- 移动端 ---------- */
@media (max-width: 1023px) {
  body {
    padding-left: 0;
  }

  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding: 10px 12px 8px;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
    overflow: visible;
    background: linear-gradient(180deg, #dcfcef, #e4f3fb);
  }

  .rail-top {
    display: none;
  }

  .brand {
    margin-top: 0;
  }

  .rail-nav {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .rail-link {
    flex: 0 0 auto;
    padding: 10px 13px;
    max-width: 88vw;
  }

  .rail-link:hover,
  .rail-link:focus-visible {
    transform: none;
  }

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

  .hero::after {
    height: 46px;
    clip-path: polygon(0 52%, 100% 8%, 100% 100%, 0 100%);
  }

  .hero h1 {
    font-size: clamp(1.85rem, 7.6vw, 2.5rem);
  }

  .hero-lede {
    font-size: 1rem;
    max-width: none;
  }

  .hero-fig {
    aspect-ratio: 16 / 11;
  }

  .paper {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 16px;
  }

  .prose div {
    scroll-margin-top: 150px;
  }

  .side {
    position: static;
    order: 2;
  }

  .foot-cols {
    grid-template-columns: 1fr 1fr;
    padding: 22px 18px;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .foot-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-name {
    font-size: 17px;
  }
}

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

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

  .hero-blob {
    animation: none;
  }

  * {
    animation-duration: 0.001ms;
    transition-duration: 0.001ms;
  }
}

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