@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

:root {
  --cream: #f5e6c8;
  --paper: #fbf3e2;
  --caramel: #d4a574;
  --ink: #262117;
  --rust: #a4592f;
  --fade: #8a7657;
  --line: rgba(38, 33, 23, 0.26);
  --line-soft: rgba(38, 33, 23, 0.14);
  --radius: 28px;
  --bar: 68px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--cream);
  background-image:
    radial-gradient(60vw 40vh at 100% 0%, rgba(212, 165, 116, 0.28), transparent 60%),
    radial-gradient(50vw 40vh at 0% 100%, rgba(212, 165, 116, 0.2), transparent 62%);
  color: var(--ink);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, 'Songti SC', 'Noto Serif CJK SC', 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

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

a { color: var(--rust); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* ---------- 胶片质感层 ---------- */
.grain {
  position: fixed;
  inset: -10px;
  z-index: 5;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: grainShift 1.1s steps(3) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-3px, 2px); }
  66% { transform: translate(2px, -3px); }
  100% { transform: translate(0, 0); }
}

.leak {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.62;
  filter: blur(8px) saturate(1.15);
  background:
    radial-gradient(38vw 40vh at 10% -8%, rgba(255, 198, 128, 0.62), transparent 62%),
    radial-gradient(30vw 34vh at 98% 20%, rgba(255, 142, 92, 0.34), transparent 66%),
    radial-gradient(28vw 26vh at -8% 84%, rgba(255, 226, 172, 0.5), transparent 70%);
  animation: leakDrift 24s ease-in-out infinite alternate;
}

@keyframes leakDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}

.skip {
  position: absolute;
  left: 10px;
  top: -60px;
  z-index: 120;
  background: var(--ink);
  color: var(--cream);
  padding: 0.7em 1.1em;
  border-radius: 0 0 14px 14px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip:focus { top: 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bar);
  padding: 10px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(245, 230, 200, 0.97), rgba(245, 230, 200, 0.74));
  backdrop-filter: blur(7px);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: rgba(251, 243, 226, 0.7);
  transition: transform 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
.mark:hover { transform: rotate(-8deg) scale(1.06); }
.mark-img { width: 100%; height: 100%; object-fit: cover; }
.mark-glyph { font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }

.topbar-brand {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.94rem;
  letter-spacing: 0.22em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.94rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.cta:hover { transform: translateY(-2px); background: var(--rust); }

.burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.9em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.35s ease, color 0.35s ease;
}
.burger-bars {
  width: 18px;
  height: 10px;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  position: relative;
}
.burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1.5px solid currentColor;
}

body.menu-open { overflow: hidden; }
body.menu-open .topbar {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}
body.menu-open .topbar-brand { color: var(--cream); }
body.menu-open .mark { border-color: var(--caramel); color: var(--caramel); background: transparent; }
body.menu-open .burger { border-color: var(--caramel); color: var(--caramel); }
body.menu-open .cta { background: var(--cream); color: var(--ink); }

/* ---------- 全屏遮罩菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  padding: calc(var(--bar) + 24px) clamp(20px, 6vw, 72px) clamp(26px, 6vw, 56px);
  background: var(--ink);
  color: var(--cream);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-102%) skewY(-1.4deg);
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.4s ease, visibility 0.55s;
  overflow-y: auto;
}
body.menu-open .drawer {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) skewY(0);
}

.drawer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: mz;
}
.drawer-nav li {
  counter-increment: mz;
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  border-bottom: 1px solid rgba(245, 230, 200, 0.16);
}
.drawer-nav li::before {
  content: counter(mz, decimal-leading-zero);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--caramel);
  opacity: 0.8;
}
.drawer-nav a {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0.35em 0;
  color: var(--cream);
  text-decoration: none;
  font-size: clamp(1.3rem, 4.6vw, 2rem);
  line-height: 1.3;
  letter-spacing: 0.06em;
  transition: color 0.3s ease, padding-left 0.3s ease;
}
.drawer-nav a:hover { color: var(--caramel); padding-left: 0.4em; }

.drawer-foot {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  color: var(--caramel);
  opacity: 0.75;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--bar) + 34px) clamp(16px, 5vw, 76px) clamp(48px, 7vw, 96px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -14%;
  height: 44%;
  z-index: -1;
  background: linear-gradient(100deg, rgba(212, 165, 116, 0.85), rgba(212, 165, 116, 0.18));
  transform: skewY(-6deg);
}

.polaroid {
  position: relative;
  margin: 0;
  max-width: 420px;
  justify-self: center;
  padding: 14px 14px 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  min-height: 220px;
  transform: rotate(-1.8deg);
  animation: polaroidSettle 0.9s ease-out both;
}
@keyframes polaroidSettle {
  from { transform: rotate(-4deg) translateY(14px); opacity: 0; }
  to { transform: rotate(-1.8deg) translateY(0); opacity: 1; }
}
.polaroid:hover { animation: polaroidShake 0.6s ease-in-out; }
@keyframes polaroidShake {
  0%, 100% { transform: rotate(-1.8deg); }
  35% { transform: rotate(1deg); }
  70% { transform: rotate(-2.6deg); }
}

.tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 100px;
  height: 26px;
  margin-left: -50px;
  transform: rotate(-3deg);
  background: rgba(212, 165, 116, 0.6);
  border: 1px dashed rgba(38, 33, 23, 0.3);
  border-radius: 2px;
}

.hero-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  filter: sepia(0.32) saturate(0.82) contrast(1.04);
}

.hero-copy { text-align: center; }

.hero-copy h1 {
  margin: 0 0 0.35em;
  font-size: clamp(2rem, 5.2vw, 3.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.03em;
  text-wrap: balance;
}

.hero-lead {
  margin: 0 auto 1.6em;
  max-width: 34ch;
  font-size: 1.02rem;
  line-height: 1.8;
  color: #4a3f2e;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1.6em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.14em;
  font-size: 0.98rem;
  transition: transform 0.3s ease, background 0.3s ease;
}
.hero-cta:hover { transform: translateY(-3px); background: var(--rust); }

/* ---------- 正文骨架 ---------- */
.wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  align-items: start;
  gap: clamp(20px, 4vw, 54px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 76px) clamp(16px, 4vw, 40px) clamp(20px, 4vw, 40px);
}

.ledger { min-width: 0; }

.kicker {
  display: block;
  margin-bottom: 0.5em;
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--rust);
}

.ledger-title,
.side-title {
  margin: 0 0 0.9em;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.ledger-title {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  padding-bottom: 0.55em;
  border-bottom: 2px solid var(--ink);
}
.side-title { font-size: 1.1rem; }

.prose {
  max-width: 70ch;
  font-size: 1.04rem;
  line-height: 1.88;
  overflow-wrap: break-word;
  filter: saturate(0.96);
}

.prose article {
  padding: clamp(18px, 3vw, 32px) 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: calc(var(--bar) + 24px);
}
.prose article:first-child { border-top: 0; padding-top: 0; }

.prose article.reveal { opacity: 0; transform: translateY(12px); }
.prose article.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.prose h2 {
  margin: 0.2em 0 0.7em;
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.03em;
}
.prose h3 {
  margin: 1.4em 0 0.5em;
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.4;
  color: #3b3125;
}
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.prose li { margin-bottom: 0.4em; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }

.prose blockquote {
  margin: 1.3em 0;
  padding: 0.8em 1.1em;
  border-left: 3px solid var(--caramel);
  border-radius: 0 16px 16px 0;
  background: rgba(212, 165, 116, 0.16);
  color: #4a3f2e;
  font-size: 0.98rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose img {
  border-radius: 16px;
  border: 1px solid var(--line);
  filter: sepia(0.2) saturate(0.9);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.94rem;
}
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 0.5em 0.65em;
  text-align: left;
  vertical-align: top;
}
.prose th { background: rgba(212, 165, 116, 0.24); font-weight: 600; }

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

.prose strong { font-weight: 700; }

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: calc(var(--bar) + 20px);
  padding: 20px 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 243, 226, 0.7);
}
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.96rem;
  transition: color 0.3s ease, padding-left 0.3s ease;
}
.side-nav a:hover { color: var(--rust); padding-left: 0.45em; }
.side-nav li:last-child a { border-bottom: 0; }

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 26px;
  margin-top: clamp(30px, 6vw, 74px);
  padding: clamp(22px, 4vw, 38px) clamp(16px, 4vw, 40px);
  border-top: 2px solid var(--caramel);
  background: var(--ink);
  color: var(--cream);
}

.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot .mark { border-color: rgba(245, 230, 200, 0.7); color: var(--cream); background: transparent; }
.foot-name { margin: 0; font-size: 0.95rem; letter-spacing: 0.22em; }

.foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}
.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 2px;
  color: rgba(245, 230, 200, 0.82);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}
.foot-nav a:hover { color: var(--caramel); }

.foot-legal {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.84rem;
}
.foot-copy { margin: 0; color: rgba(245, 230, 200, 0.62); letter-spacing: 0.06em; }
.foot-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--caramel);
  text-decoration: none;
}
.foot-top:hover { text-decoration: underline; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: 2; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding-top: calc(var(--bar) + 40px);
    text-align: center;
  }
  .hero::before { height: 34%; bottom: -10%; }
  .hero-copy { order: 1; }
  .polaroid { order: 2; max-width: 320px; margin: 26px auto 0; }
  .hero-lead { max-width: 40ch; }
}

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .topbar-brand { display: none; }
  .topbar { gap: 10px; }
  .foot { flex-direction: column; align-items: flex-start; }
  .foot-legal { width: 100%; justify-content: space-between; }
  .prose { max-width: 100%; }
  .polaroid { max-width: 260px; padding: 11px 11px 38px; }
  .drawer-nav a { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .leak, .polaroid { animation: none !important; }
  .prose article.reveal { opacity: 1; transform: none; }
  .drawer { transition: none; }
  * { transition-duration: 0.01ms !important; }
}

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