@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@700&display=swap');

:root {
  --cream: #f5e6c8;
  --cream-2: #efdbb5;
  --caramel: #d4a574;
  --ink: #262117;
  --ink-2: #463d30;
  --paper: #fff8e9;
  --line: rgba(38, 33, 23, 0.22);
  --head: 128px;
  --font: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(38, 33, 23, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

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

/* ---------- 胶片叠层 ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.55'/></svg>");
}

.leak {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 38% at 6% 10%, rgba(212, 165, 116, 0.6), transparent 72%),
    radial-gradient(38% 32% at 94% 76%, rgba(255, 142, 96, 0.32), transparent 70%),
    radial-gradient(32% 28% at 68% 4%, rgba(255, 219, 148, 0.55), transparent 72%);
  animation: leakdrift 20s ease-in-out infinite alternate;
}

@keyframes leakdrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-2%, 1.5%, 0) scale(1.06);
  }
}

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 46;
  background: rgba(245, 230, 200, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}

.bar-top {
  display: flex;
  align-items: center;
  padding: 10px 20px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.2rem, 4.4vw, 1.7rem);
  letter-spacing: -0.02em;
}

.brand-mark {
  background: var(--ink);
  color: var(--cream);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.72em;
  line-height: 1.6;
}

.bar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px 10px;
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--caramel);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  flex: none;
}

.burger-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.burger-bars i {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-open .burger-bars i:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-open .burger-bars i:nth-child(2) {
  opacity: 0;
}

.menu-open .burger-bars i:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.search {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 16px;
}

.search-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  flex: none;
}

/* ---------- 全屏菜单 ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  visibility: hidden;
  transform: translateY(-101%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.45s;
  overflow-y: auto;
  padding: calc(var(--head) + 18px) 20px 48px;
  background: var(--ink);
  color: var(--cream);
}

.menu.open {
  visibility: visible;
  transform: none;
}

.menu-tag {
  margin: 0 0 16px;
  font-family: var(--font);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--caramel);
  text-transform: uppercase;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.menu-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 0;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.25rem, 6vw, 2rem);
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(245, 230, 200, 0.18);
}

.menu-list a:hover {
  color: var(--caramel);
}

.menu-list .num {
  font-size: 0.68em;
  letter-spacing: 0.1em;
  color: var(--caramel);
  flex: none;
}

/* ---------- 主视觉 ---------- */
.main {
  position: relative;
  z-index: 2;
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--head));
  min-height: calc(100svh - var(--head));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 20px 64px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(38, 33, 23, 0.1) 0 1px, transparent 1px 4px);
  opacity: 0.5;
  animation: vhs 6s steps(2) infinite;
}

@keyframes vhs {
  0%,
  100% {
    transform: translateY(0) skewX(0);
  }
  50% {
    transform: translateY(-1px) skewX(0.35deg);
  }
}

.hero-h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0.08em 0.16em 0.14em;
  border-radius: 10px;
  background: var(--caramel);
  box-shadow: 12px 12px 0 var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(2rem, 9.5vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.stamp {
  position: absolute;
  right: 26px;
  bottom: 46px;
  z-index: 1;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px dashed var(--ink);
  opacity: 0.55;
  animation: spin 24s linear infinite;
}

.stamp::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--caramel);
}

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

/* ---------- 引导区 ---------- */
.lead {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 20px 0;
}

.lead-h2 {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.55rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 0.5em 0 0;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 1.02rem;
}

.polaroid {
  margin: 32px 0 0;
  padding: 14px 14px 18px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 18px 38px rgba(38, 33, 23, 0.16);
  transform: rotate(-1.1deg);
}

.polaroid:hover {
  animation: shake 0.55s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(-1.1deg) translateX(0);
  }
  30% {
    transform: rotate(0.6deg) translateX(-4px);
  }
  65% {
    transform: rotate(-1.6deg) translateX(4px);
  }
}

.pol-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  background: linear-gradient(120deg, #e7cda2, var(--caramel));
}

.pol-fallback {
  background:
    radial-gradient(58% 78% at 18% 22%, rgba(255, 231, 184, 0.9), transparent 70%),
    linear-gradient(120deg, var(--caramel), #a97f52);
}

/* ---------- 正文 + 侧栏 ---------- */
.shell {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 20px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 48px;
  align-items: start;
}

.prose {
  min-width: 0;
}

.prose section {
  padding: 34px 0;
  border-top: 2px dashed var(--line);
  scroll-margin-top: calc(var(--head) + 16px);
}

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

.prose h2 {
  margin: 0.2em 0 0.55em;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.prose h3 {
  margin: 1.7em 0 0.45em;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.16rem;
  line-height: 1.35;
}

.prose p {
  margin: 0 0 1em;
  line-height: 1.85;
}

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

.prose li {
  margin: 0.4em 0;
  line-height: 1.75;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.9em 1.15em;
  border-left: 8px solid var(--caramel);
  border-radius: 8px 24px 24px 8px;
  background: var(--cream-2);
}

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

.prose strong {
  background: linear-gradient(transparent 62%, var(--caramel) 0);
}

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

.prose img {
  margin: 1em 0;
  border-radius: 20px;
}

.prose figure {
  margin: 1.4em 0;
}

.prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 2px dashed var(--line);
}

.prose table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px dashed var(--line);
}

.prose th {
  font-family: var(--font);
  font-weight: 700;
}

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

.side-box {
  padding: 20px 18px;
  border-radius: 28px;
  background: var(--caramel);
}

.side-title {
  margin: 0 0 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: side;
}

.side-list li {
  counter-increment: side;
}

.side-list a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 40px;
  padding: 9px 0;
  text-decoration: none;
  font-size: 0.97rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(38, 33, 23, 0.18);
}

.side-list li:last-child a {
  border-bottom: 0;
}

.side-list a::before {
  content: counter(side, decimal-leading-zero);
  flex: none;
  padding-top: 0.2em;
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--ink-2);
}

.side-list a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  padding: 0 20px 30px;
}

.cta {
  max-width: 1120px;
  margin: 0 auto;
}

.cta-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 34px 26px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.cta-link::after {
  content: "↑";
  font-size: 0.85em;
}

.cta-link:hover {
  background: var(--caramel);
  color: var(--ink);
}

.foot-row {
  max-width: 1120px;
  margin: 22px auto 0;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 2px solid var(--ink);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--font);
  font-weight: 700;
  text-decoration: none;
}

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0;
}

.foot-nav dt {
  display: none;
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.94rem;
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--caramel);
}

.copy {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}

/* ---------- 滚动出现 ---------- */
html.anim .hero,
html.anim .lead,
html.anim .prose > section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.anim .is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-bottom: 60px;
  }

  .side {
    position: static;
  }

  .side-box {
    border-radius: 24px;
  }
}

@media (max-width: 560px) {
  :root {
    --head: 124px;
  }

  .foot-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cta-link {
    min-height: 84px;
    padding: 26px 20px;
  }

  .hero-h1 {
    box-shadow: 8px 8px 0 var(--ink);
  }

  .stamp {
    right: 16px;
    bottom: 28px;
    width: 72px;
    height: 72px;
  }

  .stamp::after {
    inset: 20px;
  }
}

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

  .leak,
  .hero::after,
  .stamp,
  .polaroid:hover {
    animation: none;
  }

  html.anim .hero,
  html.anim .lead,
  html.anim .prose > section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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