@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;500;600;700&family=Jost:wght@300;400;500;600;700&display=swap');

:root {
  --cream: #f5e6c8;
  --paper: #faf0da;
  --caramel: #d4a574;
  --ink: #262117;
  --muted: rgba(38, 33, 23, 0.64);
  --line: rgba(38, 33, 23, 0.24);
  --line-soft: rgba(38, 33, 23, 0.12);
  --serif: 'Bodoni Moda', 'Songti SC', 'Times New Roman', serif;
  --sans: 'Jost', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --dock-h: 96px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.78;
  padding-bottom: calc(var(--dock-h) + 26px);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.17;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
}

img { max-width: 100%; }
p { margin: 0 0 1.05em; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
a:hover { color: #8a5c2c; }

:focus-visible {
  outline: 2px solid #8a5c2c;
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.005em;
}
h3 { font-size: 1.22rem; margin: 1.6em 0 0.5em; }
h4 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }

/* ——— 底部胶囊导航 ——— */
.dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 18px));
  z-index: 60;
}

.dock-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(245, 230, 200, 0.92);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.dock-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
  padding: 8px 4px;
}

.dock-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  margin: 0;
  padding: 0 clamp(54px, 8vw, 110px);
  list-style: none;
}
.dock-menu li:nth-child(4) { margin-left: auto; }
.dock-menu li { display: flex; }

.dock-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.dock-menu a:hover,
.dock-menu a[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* ——— 首屏 ——— */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: clamp(22px, 4vw, 54px) clamp(18px, 5vw, 64px);
  background: linear-gradient(155deg, #e4cda4 0%, var(--cream) 48%, #eed7b2 100%);
}

.hero-art {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -2;
  overflow: hidden;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.34) contrast(1.06) saturate(0.78);
  will-change: transform;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 232, 186, 0.72), transparent 46%),
    radial-gradient(circle at 8% 88%, rgba(212, 165, 116, 0.62), transparent 52%);
  filter: blur(6px);
  animation: leak 12s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(262deg, rgba(38, 33, 23, 0.78), rgba(38, 33, 23, 0.24) 58%, rgba(38, 33, 23, 0.1));
}

.hero-copy {
  position: relative;
  max-width: 30ch;
  text-align: right;
  color: var(--cream);
  text-shadow: 0 1px 12px rgba(38, 33, 23, 0.35);
}

.hero-brand {
  margin: 0 0 0.5em;
  font-size: 16px;
  letter-spacing: 0.34em;
  color: var(--caramel);
}
.hero h1 {
  margin: 0 0 0.4em;
  font-size: clamp(1.9rem, 5.6vw, 3.4rem);
  line-height: 1.06;
  font-weight: 500;
}
.hero-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(245, 230, 200, 0.88);
}

.hero.vhs .hero-copy { animation: vhs 0.85s steps(5, end) 1 both; }

@keyframes leak {
  from { opacity: 0.55; transform: translate3d(-2%, 1%, 0) scale(1.02); }
  to { opacity: 0.95; transform: translate3d(2%, -1%, 0) scale(1.08); }
}
@keyframes vhs {
  0% { opacity: 0; transform: translate3d(0, 10px, 0) skewX(-2.5deg); }
  40% { opacity: 0.6; transform: translate3d(-6px, 4px, 0) skewX(1.6deg); }
  70% { opacity: 0.9; transform: translate3d(3px, 0, 0) skewX(-0.8deg); }
  100% { opacity: 1; transform: none; }
}

/* ——— 正文舞台 ——— */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 60px) clamp(18px, 4vw, 34px);
}

.content { min-width: 0; }

.content section {
  border-top: 1px solid var(--line);
  padding: clamp(24px, 3.6vw, 38px) 0;
  scroll-margin-top: 18px;
}
.content section:first-child { border-top: 0; padding-top: 0; }
.content section:last-child { padding-bottom: 0; }

.content small {
  display: block;
  margin-bottom: 0.35em;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--muted);
}

.content h2 {
  margin: 0 0 0.55em;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

.content ul,
.content ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.content li { margin-bottom: 0.35em; }

.content blockquote,
.content figure {
  margin: 1.4em 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
}
.content figure { padding: 12px 12px 16px; }
.content figure img {
  border-radius: 20px;
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.22) contrast(1.04) saturate(0.84);
  border: 1px solid var(--line-soft);
}
.content figcaption {
  margin-top: 0.65em;
  font-size: 16px;
  color: var(--muted);
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3em 0;
  display: block;
  overflow-x: auto;
  font-size: 16px;
}
.content th,
.content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}
.content th { background: var(--paper); font-weight: 500; }

.content code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.94em;
  background: var(--paper);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}
.content hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 2em 0;
}

/* ——— 右侧栏 ——— */
.side {
  position: sticky;
  top: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  padding: 20px 18px 12px;
}

.side small {
  display: block;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--muted);
}
.side h2 {
  margin: 0.15em 0 0.8em;
  font-size: 1.28rem;
}

.side ul { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.side li { counter-increment: toc; }
.side a {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  min-height: 40px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.45;
}
.side a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #a97b45;
  flex: none;
}
.side li:last-child a { border-bottom: 0; }

/* ——— 页脚 ——— */
.foot {
  margin-top: clamp(34px, 6vw, 70px);
  padding: clamp(34px, 5vw, 60px) clamp(18px, 4vw, 44px) 0;
  background: var(--ink);
  color: var(--cream);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(22px, 4vw, 48px);
}

.foot-brand { min-width: 0; }
.foot-word {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 7.5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--caramel);
  word-break: break-all;
}
.foot-desc {
  margin: 0.9em 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245, 230, 200, 0.76);
  max-width: 34ch;
}

.foot-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px;
}
.foot-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  font-size: 16px;
  color: rgba(245, 230, 200, 0.84);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 230, 200, 0.14);
}
.foot-links a:hover { color: var(--caramel); border-color: var(--caramel); }

.foot-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(20px, 3vw, 34px);
  padding: 14px 0 20px;
  border-top: 1px solid rgba(245, 230, 200, 0.2);
}
.foot-base p { margin: 0; font-size: 16px; letter-spacing: 0.1em; }
.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid rgba(245, 230, 200, 0.34);
  border-radius: 999px;
  font-size: 16px;
  color: var(--cream);
  text-decoration: none;
}
.to-top:hover { background: var(--caramel); border-color: var(--caramel); color: var(--ink); }

/* ——— 进场 ——— */
.js .content div {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .content div.in {
  opacity: 1;
  transform: none;
}

/* ——— 断点 ——— */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .side {
    position: static;
    order: -1;
    margin-bottom: 6px;
  }
}

@media (max-width: 860px) {
  :root { --dock-h: 196px; }
  body { padding-bottom: calc(var(--dock-h) + 24px); }
  .dock { bottom: 8px; width: calc(100% - 12px); }
  .dock-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 26px;
    padding: 9px 10px 11px;
    gap: 7px;
  }
  .dock-brand {
    position: static;
    transform: none;
    order: -1;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.16em;
    padding: 2px 0 4px;
  }
  .dock-menu {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    gap: 6px;
  }
  .dock-menu li:nth-child(4) { margin-left: 0; }
  .dock-menu a { padding: 9px 12px; }
}

@media (max-width: 720px) {
  .foot { grid-template-columns: 1fr; }
  .foot-links ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 46vh; }
  .hero-copy { max-width: 100%; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .content h2 { font-size: 1.5rem; }
  .foot-links ul { grid-template-columns: 1fr; }
}

@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;
  }
}

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