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

:root {
  --ink: #2B1B2E;
  --ink-soft: rgba(43, 27, 46, 0.72);
  --amber: #E8894A;
  --amber-deep: #A9531F;
  --cream: #FBF1E4;
  --paper: #FFFCF7;
  --sy: 0px;
  --max: 74rem;
  --font-body: 'Quicksand', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-hand: 'Caveat', "PingFang SC", "Microsoft YaHei", cursive, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ---------- 视差层 ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.6;
  will-change: transform;
}

.scene i:nth-child(1) {
  width: 46vmax;
  height: 46vmax;
  left: -16vmax;
  top: -12vmax;
  background: radial-gradient(circle at 40% 40%, rgba(232, 137, 74, 0.55), rgba(232, 137, 74, 0) 68%);
  transform: translate3d(0, calc(var(--sy) * -0.16), 0);
}

.scene i:nth-child(2) {
  width: 38vmax;
  height: 38vmax;
  right: -13vmax;
  top: 24vh;
  background: radial-gradient(circle, rgba(43, 27, 46, 0.28), rgba(43, 27, 46, 0) 70%);
  transform: translate3d(0, calc(var(--sy) * 0.1), 0);
}

.scene i:nth-child(3) {
  width: 30vmax;
  height: 30vmax;
  left: 18vw;
  bottom: -12vmax;
  background: radial-gradient(circle, rgba(232, 137, 74, 0.42), rgba(232, 137, 74, 0) 70%);
  transform: translate3d(0, calc(var(--sy) * -0.26), 0);
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(251, 241, 228, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(43, 27, 46, 0.12);
}

.brand {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.62rem;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
  background: rgba(232, 137, 74, 0.24);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
  overflow: hidden;
  background: linear-gradient(155deg, #2B1B2E 0%, #4A2B3A 60%, #6B3B33 100%);
  perspective: 1px;
}

.hero-bg {
  position: absolute;
  inset: -6% 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translate3d(0, calc(var(--sy) * 0.14), 0) scale(1.06);
  will-change: transform;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(43, 27, 46, 0.9) 0%, rgba(43, 27, 46, 0.55) 55%, rgba(43, 27, 46, 0.2) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.15rem 2.4rem;
  color: var(--cream);
}

.hero h1 {
  margin: 0 0 0.7rem;
  max-width: 40rem;
  font-size: clamp(1.95rem, 6.2vw, 3.5rem);
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-desc {
  margin: 0;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(251, 241, 228, 0.84);
}

/* ---------- 主体骨架 ---------- */
main {
  position: relative;
  z-index: 2;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.2rem 1.1rem 3.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* ---------- 左侧栏 ---------- */
.side {
  align-self: start;
  padding: 0.2rem 0 0;
}

.side h2 {
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.side h2 span {
  display: inline-block;
  padding-bottom: 0.18rem;
  border-bottom: 2px solid var(--amber);
}

.side ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: side;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.side li { counter-increment: side; }

.side a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.15rem 0.72rem;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(43, 27, 46, 0.16);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.7);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.side a::before {
  content: counter(side, decimal-leading-zero);
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--amber-deep);
}

.side a:hover,
.side a:focus-visible {
  background: var(--amber);
  border-color: var(--amber);
  transform: translateX(2px);
}

/* ---------- 正文 ---------- */
.content { min-width: 0; }

.prose { font-size: 1.02rem; }

.prose > * { min-width: 0; }

.prose div {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.15rem;
  background: var(--paper);
  border: 1px solid rgba(43, 27, 46, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 48px -34px rgba(43, 27, 46, 0.55);
  scroll-margin-top: 5.2rem;
}

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

.prose h2,
.prose h3 {
  margin: 0.2rem 0 0.85rem;
  line-height: 1.38;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.prose h2 { font-size: clamp(1.28rem, 3.8vw, 1.72rem); }

.prose h2 span,
.prose h3 span {
  display: inline;
  box-shadow: inset 0 -0.34em 0 rgba(232, 137, 74, 0.32);
}

.prose h3 { font-size: clamp(1.1rem, 3vw, 1.28rem); }

.prose p { margin: 0 0 1rem; }

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

.prose a {
  color: var(--amber-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--ink); }

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.prose li { margin: 0 0 0.4rem; }

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.4rem 0 1rem;
  border-radius: 14px;
  box-shadow: 0 18px 34px -26px rgba(43, 27, 46, 0.6);
}

.prose blockquote {
  margin: 0 0 1rem;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid var(--amber);
  color: var(--ink-soft);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(43, 27, 46, 0.14);
  text-align: left;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(43, 27, 46, 0.08);
  font-size: 0.94em;
}

/* ---------- 滚动显影 ---------- */
.js .rv {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

.js .rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.72s ease, transform 0.72s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  padding: 2.4rem 1.1rem 2rem;
  background: var(--ink);
  color: var(--cream);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem 1.1rem;
  max-width: var(--max);
  margin: 0 auto 1.9rem;
}

.foot-nav dl {
  margin: 0;
  min-width: 0;
}

.foot-nav dt,
.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.1rem 0;
  font-size: 16px;
  line-height: 1.45;
  color: rgba(251, 241, 228, 0.76);
  text-decoration: none;
  transition: color 0.2s ease;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { color: var(--amber); }

.foot-brand {
  margin: 0 0 0.4rem;
  font-family: var(--font-hand);
  font-size: clamp(2.7rem, 13vw, 6.4rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--amber);
  letter-spacing: 0.02em;
}

.foot-copy {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(251, 241, 228, 0.58);
}

/* ---------- 断点 ---------- */
@media (min-width: 700px) {
  .hero-inner { padding: 3.6rem 1.6rem 3rem; }
  .prose div { padding: 2rem 1.9rem; }
  .foot-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .top { padding: 0.4rem 1.2rem; gap: 0.9rem; }

  .wrap {
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 2.6rem;
    padding: 3.4rem 1.6rem 4.2rem;
  }

  .side {
    position: sticky;
    top: 4.8rem;
    padding-top: 0.35rem;
    border-right: 1px solid rgba(43, 27, 46, 0.12);
    padding-right: 1.1rem;
  }

  .side ol {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.32rem;
  }

  .side a { border-color: transparent; background: transparent; }

  .foot-nav { gap: 1rem 2rem; }
}

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

  .scene i,
  .hero-bg img { transform: none; }

  .js .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .side a,
  .nav a,
  .foot-nav a { transition: none; }
}

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