@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --mint: #b4fde1;
  --blue: #add8e6;
  --ink: #172620;
  --paper: #f6fffb;
  --card: #ffffff;
  --mint-d: #6fe0bd;
  --blue-d: #86bfd8;
  --line: 3px solid var(--ink);
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --sh-1: inset -3px -3px 8px rgba(23, 38, 32, 0.10), 6px 8px 0 rgba(23, 38, 32, 0.18);
  --sh-2: inset -2px -2px 6px rgba(23, 38, 32, 0.10), 3px 4px 0 rgba(23, 38, 32, 0.16);
  --top: 68px;
  --f-head: 'Calistoga', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --f-body: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -8%, rgba(180, 253, 225, 0.95), transparent 46%),
    radial-gradient(circle at 90% 2%, rgba(173, 216, 230, 0.9), transparent 42%),
    radial-gradient(rgba(23, 38, 32, 0.13) 1.4px, transparent 1.5px) 0 0 / 24px 24px,
    linear-gradient(180deg, #f8fffc, #eaf7ff 72%, #f7fffb);
  background-attachment: fixed;
}

img {
  max-width: 100%;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--top);
  padding: 8px clamp(12px, 3vw, 28px);
  background: rgba(246, 255, 251, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 5px 14px 5px 6px;
  border: var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--sh-2);
  color: var(--ink);
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(140deg, var(--mint), var(--blue));
  font-family: var(--f-head);
  font-size: 15px;
  line-height: 1;
}

.bname {
  font-family: var(--f-head);
  font-size: 17px;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}

.menu {
  margin-left: auto;
}

.dd {
  position: relative;
}

.dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
  border: var(--line);
  border-radius: 999px;
  background: linear-gradient(150deg, var(--blue), #ffffff);
  box-shadow: var(--sh-2);
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: transform 0.2s ease-out;
}

.dd-btn::-webkit-details-marker {
  display: none;
}

.dd-btn:active {
  transform: translate(2px, 2px);
}

.bars {
  width: 16px;
  height: 11px;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.dd-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(86vw, 320px);
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 4px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.dd[open] > .dd-panel {
  display: flex;
}

.mn-grp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mn-grp + .mn-grp {
  padding-top: 8px;
  border-top: 2px dashed rgba(23, 38, 32, 0.3);
}

.mn-a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 12px;
  background: #f2fffa;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.mn-a:hover {
  background: var(--mint);
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: var(--line);
  border-radius: 999px;
  background: linear-gradient(150deg, var(--mint), #ffffff);
  box-shadow: var(--sh-2);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s ease-out;
}

.contact:active {
  transform: translate(2px, 2px);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 56px);
  min-height: calc(100vh - var(--top));
  min-height: calc(100svh - var(--top));
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 56px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.85), transparent 42%),
    radial-gradient(circle at 20% 82%, rgba(180, 253, 225, 0.8), transparent 48%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  max-width: min(660px, 56ch);
}

.hero-h1 {
  margin: 0 0 16px;
  font-family: var(--f-head);
  font-size: clamp(34px, 7.4vw, 66px);
  line-height: 1.26;
  letter-spacing: -0.012em;
  word-break: break-word;
}

.hero-sub {
  max-width: 46ch;
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.75;
  color: #2c4c40;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(150deg, var(--mint), var(--blue));
  box-shadow: var(--sh-1);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.cta:active {
  transform: translate(2px, 3px);
}

.hero-art {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(140px, 23vw, 296px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #ffffff, var(--mint));
  box-shadow: var(--sh-1);
  transform: rotate(-3deg);
}

.hero-art:empty {
  display: none;
}

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

/* ---------- 主体骨架 ---------- */
main {
  padding: 0 clamp(12px, 3vw, 32px) clamp(44px, 7vw, 84px);
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 1220px;
  margin: 0 auto;
}

.body-col {
  min-width: 0;
}

/* ---------- 侧栏 ---------- */
.side {
  padding: 16px;
  border: 4px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.side-h2 {
  margin: 0 0 10px;
  font-family: var(--f-head);
  font-size: 20px;
  line-height: 1.4;
}

.rule,
.prose hr {
  height: 0;
  margin: 0 0 14px;
  border: 0;
  border-top: 4px dashed rgba(23, 38, 32, 0.35);
}

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

.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 2.5px solid var(--ink);
  border-bottom-width: 6px;
  border-bottom-color: var(--mint-d);
  border-radius: 16px;
  background: #f5fffb;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease-out, border-bottom-color 0.18s ease-out;
}

.toc a:hover {
  transform: translateY(-2px);
  border-bottom-color: var(--blue-d);
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: var(--sh-2);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 正文 ---------- */
.prose {
  max-width: 78ch;
  padding: clamp(18px, 3.4vw, 44px);
  border: 4px solid var(--ink);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--sh-1);
}

.prose section {
  padding: clamp(22px, 4vw, 48px) 0;
  scroll-margin-top: calc(var(--top) + 24px);
}

.prose section:first-child {
  padding-top: 0;
}

.prose section + section {
  border-top: 4px dotted rgba(23, 38, 32, 0.22);
}

.prose h2 {
  margin: 0 0 12px;
  font-family: var(--f-head);
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h2 + hr {
  margin-bottom: 18px;
}

.prose h3 {
  margin: 26px 0 10px;
  font-family: var(--f-head);
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.38;
}

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

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

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

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0.35em 0;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--sh-2);
}

.prose figure {
  margin: 20px 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: #3d5a4e;
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 8px solid var(--blue);
  border-radius: 0 20px 20px 0;
  background: #f4fbff;
}

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

.prose table {
  display: block;
  width: 100%;
  margin: 18px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border: 2.5px solid var(--ink);
  text-align: left;
}

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

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--mint);
  font-family: var(--f-mono);
  font-size: 0.92em;
}

.prose pre {
  padding: 16px;
  overflow-x: auto;
  border-radius: 18px;
  background: var(--ink);
  color: #eafff5;
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.prose strong {
  font-weight: 700;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 26px;
  padding: clamp(20px, 4vw, 40px) clamp(14px, 3vw, 36px);
  border-top: 4px solid var(--ink);
  background: var(--ink);
  color: #e9fff7;
}

.foot-brand {
  font-family: var(--f-head);
  font-size: clamp(28px, 5.2vw, 56px);
  line-height: 1.14;
  color: var(--mint);
  letter-spacing: -0.02em;
}

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
}

.foot-nav dt,
.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid rgba(233, 255, 247, 0.35);
  border-radius: 999px;
  color: #e9fff7;
  font-size: 16px;
  text-decoration: none;
}

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

.foot-legal p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.85;
}

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  :root {
    --top: 78px;
  }

  .dd-btn {
    display: none;
  }

  .dd-panel,
  .dd:not([open]) > .dd-panel {
    display: flex !important;
    position: static;
    width: auto;
    flex-direction: row;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .mn-grp {
    flex-direction: row;
    gap: 4px;
  }

  .mn-grp + .mn-grp {
    padding-top: 0;
    padding-left: 12px;
    border-top: 0;
    border-left: 2px dashed rgba(23, 38, 32, 0.3);
  }

  .wrap {
    grid-template-columns: 268px minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
  }

  .side {
    position: sticky;
    top: calc(var(--top) + 18px);
  }
}

@media (max-width: 899px) {
  .side {
    padding: 12px;
  }

  .toc {
    flex-direction: row;
    gap: 8px;
    padding-bottom: 6px;
    overflow-x: auto;
  }

  .toc a {
    white-space: nowrap;
  }
}

@media (max-width: 639px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-height: 0;
    padding-top: 26px;
    padding-bottom: 34px;
  }

  .hero-art {
    width: 130px;
    order: -1;
  }

  .bname {
    font-size: 16px;
  }
}

/* ---------- 动效 ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(16px);
}

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

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .rv {
    opacity: 1;
    transform: none;
  }
}

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