@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');

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

:root {
  --sky: #c8e0f4;
  --pink: #f5e0e8;
  --ink: #171f26;
  --mute: #4f5d6a;
  --bg: #e9f1f8;
  --face: #edf4fa;
  --r: 18px;
  --sh-out: -6px -6px 16px #ffffff, 6px 6px 18px rgba(23, 31, 38, .13);
  --sh-out-sm: -3px -3px 8px #ffffff, 3px 3px 10px rgba(23, 31, 38, .13);
  --sh-in: inset -4px -4px 10px #ffffff, inset 4px 4px 10px rgba(23, 31, 38, .12);
  --font-h: 'Calistoga', 'Songti SC', Georgia, serif;
  --font-b: 'Inter', -apple-system, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: 100px;
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(165deg, #eff5fb 0%, #e9f1f8 46%, #f7eef2 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-h);
  font-weight: 400;
  letter-spacing: -.005em;
  line-height: 1.14;
  margin: 0 0 .55em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: #1d4b6d; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #0f2f47; }

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

:focus-visible { outline: 2px solid #6e96b8; outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 56px 8px 8px;
  border-radius: 22px;
  background: linear-gradient(145deg, #eff5fb, #e2ebf3);
  box-shadow: -6px -6px 16px #ffffff, 6px 8px 20px rgba(23, 31, 38, .2);
}

.dock-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 14px;
  font-family: var(--font-h);
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(145deg, #f8eef2, #e9f1f8);
  box-shadow: var(--sh-out-sm);
}
.dock-brand img { display: block; border-radius: 8px; }

.dock-burger {
  position: absolute;
  right: 5px; top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(145deg, #f8eef2, #e9f1f8);
  box-shadow: var(--sh-out-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}
.dock-burger:active { box-shadow: var(--sh-in); transform: translateY(-50%) scale(.97); }

.dock-nav { display: none; flex: 1; gap: 10px; align-items: center; padding: 0 130px; }
.dock-nav p { display: flex; margin: 0; gap: 2px; }
.dock-nav p:first-child { justify-content: flex-end; }
.dock-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow .15s ease;
}
.dock-nav a:hover { box-shadow: var(--sh-out-sm); color: var(--ink); }
.dock-nav a:active { box-shadow: var(--sh-in); }

@media (min-width: 1080px) {
  .dock { padding: 8px; }
  .dock-nav { display: flex; }
}

/* ---------- 全屏菜单 ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 76px 20px 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  background-image: linear-gradient(160deg, #eff5fb, #f8eef2 92%);
  transition: opacity .2s ease, visibility .2s ease;
}
.menu.is-open { opacity: 1; visibility: visible; }

.menu-head {
  position: absolute;
  top: 26px; left: 24px;
  margin: 0;
  font-family: var(--font-h);
  font-size: 1.1rem;
}

.menu-close {
  position: absolute;
  top: 18px; right: 18px;
  min-width: 56px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(145deg, #f8eef2, #e9f1f8);
  box-shadow: var(--sh-out-sm);
}
.menu-close:active { box-shadow: var(--sh-in); }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.menu-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 16px;
  font-family: var(--font-h);
  font-size: 1.1rem;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  background: linear-gradient(145deg, #f5fafe, #e4edf6);
  box-shadow: var(--sh-out);
  transition: box-shadow .15s ease, transform .15s ease;
}
.menu-grid a:active { box-shadow: var(--sh-in); transform: scale(.98); }

/* ---------- 主体栅格 ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 44px) clamp(14px, 4vw, 32px) 36px;
}

section { min-width: 0; grid-row: 1; }

@media (min-width: 1020px) {
  main { grid-template-columns: minmax(0, 1fr) 268px; gap: 34px; }
  .rail { grid-column: 2; grid-row: 1; }
  section { grid-column: 1; }
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  min-height: 45vh;
  padding: 18px 0 34px;
}

.badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .08em;
  color: #2b3a46;
  background: linear-gradient(145deg, #fbeff3, #e6eff8);
  box-shadow: -4px -4px 10px #ffffff, 4px 4px 12px rgba(23, 31, 38, .12);
  transform: rotate(-2deg);
}

.hero h1 {
  font-size: clamp(2.15rem, 7.6vw, 4.6rem);
  line-height: 1.05;
  margin: 0 0 .4em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 38ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--mute);
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(-2deg); }
}
.badge { animation: bob 7s ease-in-out infinite; }

/* ---------- 正文区块 ---------- */
section > article:not(.hero),
.join {
  background: linear-gradient(145deg, #f7fbfe, #e7eff7);
  border-radius: var(--r);
  padding: clamp(18px, 3.4vw, 32px);
  box-shadow: var(--sh-out);
  scroll-margin-top: 24px;
}

section > article:not(.hero) { margin-bottom: 24px; }

section > article > :first-child { margin-top: 0; }
section > article > :last-child { margin-bottom: 0; }

section h2 { font-size: clamp(1.45rem, 3.1vw, 2.05rem); margin-bottom: .45em; }
section h3 { font-size: clamp(1.15rem, 2.3vw, 1.45rem); margin-top: 1.4em; }
section h4 { font-size: 1.05rem; margin-top: 1.3em; letter-spacing: .02em; }

section ul, section ol { padding-left: 1.25em; margin: 0 0 1em; }
section li { margin-bottom: .45em; }
section li::marker { color: #7e9bb3; }

section blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-radius: 14px;
  color: #2c3a45;
  background: #e8f0f8;
  box-shadow: var(--sh-in);
}
section blockquote p:last-child { margin-bottom: 0; }

section code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: .9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e6eef6;
}
section pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: #e6eef6;
  box-shadow: var(--sh-in);
}
section pre code { padding: 0; background: none; }

section table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: .96rem;
}
section th, section td { padding: 10px 12px; text-align: left; vertical-align: top; }
section thead th { background: #e4edf6; }
section tbody tr:nth-child(even) { background: #eef5fb; }
section table, section th, section td { border-radius: 10px; }

section img { border-radius: 14px; display: block; margin: 1.2em 0; }
section figure { margin: 1.2em 0; }
section figcaption { font-size: .9rem; color: var(--mute); margin-top: .5em; }

section hr { border: 0; height: 1px; background: #dbe6f0; margin: 1.6em 0; }

/* ---------- 目录侧栏 ---------- */
.rail {
  padding: 20px;
  border-radius: var(--r);
  background: linear-gradient(145deg, #e6eef7, #f7fbfe);
  box-shadow: var(--sh-in);
}
@media (min-width: 1020px) {
  .rail { position: sticky; top: 24px; align-self: start; }
}

.rail h2 { font-size: 1.12rem; margin-bottom: .25em; }
.rail .subtitle {
  margin: 0 0 14px;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--mute);
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 1020px) {
  .rail ol { grid-template-columns: minmax(0, 1fr); }
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15.5px;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, #f6fbff, #e6eef6);
  box-shadow: var(--sh-out-sm);
  transition: box-shadow .15s ease;
}
.rail a:active { box-shadow: var(--sh-in); }

/* ---------- 订阅块 ---------- */
.join { grid-column: 1 / -1; }

.join h2 { font-size: clamp(1.3rem, 2.8vw, 1.75rem); margin-bottom: .6em; }

.join-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.join-form label { flex: 0 0 100%; font-size: .92rem; color: var(--mute); }

.join-form input {
  flex: 1 1 220px;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #e7eff7;
  box-shadow: var(--sh-in);
}
.join-form input::placeholder { color: #7c8b98; }

.join-form button {
  min-height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  color: #16232d;
  cursor: pointer;
  background: linear-gradient(145deg, #d7e9f8, #b6d2ea);
  box-shadow: var(--sh-out-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.join-form button:hover { box-shadow: -4px -4px 12px #ffffff, 4px 4px 14px rgba(23, 31, 38, .18); }
.join-form button:active { transform: scale(.97); box-shadow: var(--sh-in); }

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 28px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px clamp(14px, 4vw, 32px) 40px;
  font-size: .95rem;
  color: var(--mute);
}
@media (min-width: 700px) {
  footer { grid-template-columns: 1.1fr 1.4fr; }
}

footer p { margin: 0; }

.fb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-h);
  font-size: 1.02rem;
  color: var(--ink);
}
.fb-brand img { display: block; border-radius: 8px; }

.fb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
}
.fb-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #22313d;
  text-decoration: none;
  border-bottom: 1px solid rgba(23, 31, 38, .14);
}
.fb-links a:hover { border-bottom-color: rgba(23, 31, 38, .45); }

footer small {
  grid-column: 1 / -1;
  font-size: .84rem;
  color: #6b7885;
  letter-spacing: .02em;
}

/* ---------- 入场 ---------- */
.js section > article,
.js .join {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.js section > article.in,
.js .join.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge { animation: none; }
  .js section > article,
  .js .join { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

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