/* ==========================================================================
   山医奶站 · styles
   无外部依赖：字体走系统栈，图标全是内联 SVG / 文本
   ========================================================================== */

:root {
  --ink: #241f16;
  --ink-2: #5b5344;
  --ink-3: #8a8070;
  --cream: #fff9ea;
  --paper: #fffdf6;
  --yellow: #ffd23f;
  --yellow-2: #ffc21a;
  --seal: #c0392b;
  --line: rgba(36, 31, 22, 0.16);

  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun",
    Georgia, serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;

  --page: 1120px;
  --pad: clamp(18px, 4vw, 24px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(36, 31, 22, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -11px -11px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  top: -70px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip:focus {
  top: 0;
}

/* ---------- 站头 ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
}

.masthead-doc {
  max-width: 780px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  font-size: 15px;
}

.brand img {
  width: 34px;
  height: 34px;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
}

.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background: rgba(36, 31, 22, 0.07);
  color: var(--ink);
}

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(44px, 7vw, 84px) var(--pad) clamp(36px, 5vw, 56px);
  isolation: isolate;
}

.hero::before {
  content: "奶";
  position: absolute;
  right: 2%;
  top: -6%;
  z-index: -1;
  font-family: var(--font-display);
  font-size: clamp(220px, 34vw, 460px);
  line-height: 1;
  color: rgba(36, 31, 22, 0.045);
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-2);
}

h1 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 7.4vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.outline {
  display: block;
  -webkit-text-stroke: 2.5px var(--ink);
  color: transparent;
}

@supports not (-webkit-text-stroke: 1px black) {
  .outline {
    color: var(--ink);
  }
}

.aka {
  margin: 18px 0 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.lede {
  margin: 16px 0 0;
  max-width: 37em;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.85;
  color: #322c22;
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: clamp(24px, 4vw, 34px);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
  background: #fff;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-go {
  padding: 15px 24px 15px 28px;
  background: var(--yellow);
  font-size: 22px;
  letter-spacing: 0.05em;
}

.btn-go span {
  padding-left: 12px;
  border-left: 1px solid rgba(36, 31, 22, 0.28);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.btn-go:hover {
  background: var(--yellow-2);
}

/* ---------- 数据条 ---------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  margin: 30px 0 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px dashed var(--line);
}

.stats b {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stats span {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* ---------- 印章 ---------- */

.hero-art {
  display: grid;
  justify-items: end;
  gap: 16px;
}

.seal-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--yellow);
  box-shadow: 10px 10px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seal-card:hover {
  transform: translate(-2px, -2px) rotate(-0.6deg);
  box-shadow: 13px 13px 0 var(--ink);
}

.seal-card:active {
  transform: translate(4px, 4px);
  box-shadow: 6px 6px 0 var(--ink);
}

.seal-ring {
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(36, 31, 22, 0.42);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}

.seal-card img {
  position: relative;
  z-index: 1;
  width: 58%;
  filter: drop-shadow(0 5px 0 rgba(36, 31, 22, 0.12));
  transition: transform 0.3s ease;
}

.seal-card:hover img {
  transform: rotate(-4deg) scale(1.04);
}

.seal-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border: 1.5px solid rgba(36, 31, 22, 0.55);
  border-radius: 999px;
  background: rgba(255, 250, 234, 0.92);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  white-space: nowrap;
  color: rgba(36, 31, 22, 0.7);
}

.art-note {
  width: 100%;
  max-width: 330px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-2);
  text-align: right;
  word-break: break-all;
}

/* ---------- 区块 ---------- */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(46px, 7vw, 82px) var(--pad) 0;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.num {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  transform: translateY(-3px);
}

.sec-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.sec-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nowrap {
  white-space: nowrap;
}

.cards {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.three {
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 620px) {
  .two {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 22px 22px 24px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
}

.card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.3;
}

.card-tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: #322c22;
}

/* ---------- 奶力交卷 ---------- */

.game {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 3vw, 32px);
  margin-top: 24px;
  padding: clamp(22px, 3.4vw, 34px);
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--yellow);
}

.game-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.6vw, 28px);
}

.game p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.85;
}

.fine {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.fine a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-panel {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: start;
  padding-left: clamp(0px, 2vw, 26px);
  border-left: 2px dashed var(--line);
}

.btn-submit {
  padding: 16px 30px;
  background: var(--yellow);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.milk-out {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff3c4;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 2.6em;
}

/* ---------- 协议 / 政策页 ---------- */

.prose {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 68px) var(--pad) 0;
}

.prose h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.15;
}

.prose-meta {
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.prose h2 {
  margin: 34px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.4;
}

.prose p,
.prose li {
  font-size: 15px;
  line-height: 1.9;
  color: #322c22;
}

.prose ul {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding-left: 1.2em;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff3c4;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose-back {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 60vh;
  padding: 48px var(--pad);
  text-align: center;
}

.lost h1 {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: clamp(72px, 15vw, 140px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lost-text {
  margin: 6px 0 18px;
  font-size: 15px;
  color: var(--ink-2);
}

.lost .cta-row {
  justify-content: center;
}

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

.footer {
  margin-top: clamp(60px, 9vw, 96px);
  padding: 40px var(--pad) 56px;
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: #f4ecd8;
}

.footer-inner {
  display: grid;
  gap: 14px;
  max-width: var(--page);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13px;
}

.footer-links a {
  color: #ffe89a;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 232, 154, 0.3);
  transition: border-color 0.15s ease;
}

.footer-links a:hover {
  border-bottom-color: #ffe89a;
}

.footer-line {
  margin: 0;
  font-size: 12.5px;
  color: #cfc4a9;
}

.footer-line.dim {
  color: #93896f;
}

.footer-line.credit {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #9a907a;
}

.footer :focus-visible {
  outline-color: var(--yellow);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  max-width: calc(100vw - 40px);
  padding: 12px 20px;
  border: 2px solid #ffe89a;
  border-radius: 999px;
  background: var(--ink);
  color: #ffe89a;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 盖章彩蛋 ---------- */

.burst {
  position: absolute;
  z-index: 2;
  font-size: 20px;
  animation: float-up 900ms ease-out forwards;
  pointer-events: none;
}

.burst.b1 { left: 14%; top: 46%; }
.burst.b2 { left: 28%; top: 66%; }
.burst.b3 { left: 42%; top: 40%; }
.burst.b4 { left: 56%; top: 62%; }
.burst.b5 { left: 70%; top: 44%; }
.burst.b6 { left: 82%; top: 64%; }

@keyframes float-up {
  from {
    opacity: 1;
    transform: translateY(0) scale(0.8) rotate(0deg);
  }
  to {
    opacity: 0;
    transform: translateY(-46px) scale(1.35) rotate(12deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 20px;
  }

  .hero-art {
    justify-items: start;
    order: 2;
  }

  .art-note {
    text-align: left;
  }

  .seal-card {
    max-width: 280px;
  }

  .game {
    grid-template-columns: 1fr;
  }

  .game-panel {
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 2px dashed var(--line);
  }
}

@media (max-width: 520px) {
  .cta-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .btn-go {
    flex: 1 1 100%;
    justify-content: center;
  }

  .stats {
    gap: 10px 24px;
  }
}

/* ---------- 动效偏好 ---------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
