:root {
  --cream: #f5e6c8;
  --cream-2: #efdcb8;
  --paper: #fbf2dd;
  --tan: #d4a574;
  --tan-deep: #b07f4a;
  --ink: #262117;
  --ink-soft: #55452f;
  --line: rgba(38, 33, 23, 0.18);
  --glass: rgba(251, 242, 221, 0.6);
  --shadow: 0 10px 26px rgba(38, 33, 23, 0.16);
  --r: 4px;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  font-family: "Roboto", system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(58rem 34rem at 112% -12%, rgba(212, 165, 116, 0.45), transparent 62%),
    radial-gradient(44rem 30rem at -18% 26%, rgba(255, 244, 214, 0.8), transparent 58%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  background-attachment: fixed;
}

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

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

/* ---------- 胶片颗粒与漏光 ---------- */
.grain {
  position: fixed;
  inset: -10%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  animation: grainShift 1.1s steps(3) infinite;
}

@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(-1.5%, 1%, 0); }
  66% { transform: translate3d(1%, -1.5%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.leak {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 209, 142, 0.55) 50%, transparent 63%);
  mix-blend-mode: screen;
  opacity: 0.75;
  animation: leakDrift 16s ease-in-out infinite alternate;
}

@keyframes leakDrift {
  0% { transform: translateX(-6%) scaleY(1); opacity: 0.45; }
  100% { transform: translateX(6%) scaleY(1.08); opacity: 0.8; }
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ---------- 跳转 ---------- */
.skip {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 70;
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip:focus {
  top: 0.7rem;
}

/* ---------- 页头 ---------- */
.top {
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem) 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 74rem;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(38, 33, 23, 0.4);
  box-shadow: inset 0 0 0 3px rgba(251, 242, 221, 0.55), 0 3px 8px rgba(38, 33, 23, 0.18);
  background: linear-gradient(155deg, var(--tan), var(--tan-deep));
  color: #2a2014;
  font-weight: 700;
  font-size: 1.1rem;
  object-fit: cover;
}

.brand-name {
  font-weight: 500;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cta:hover,
.cta:focus-visible {
  background: var(--tan);
  border-color: var(--tan-deep);
  color: var(--ink);
}

/* ---------- 粘性胶囊导航 ---------- */
.pills {
  position: sticky;
  top: 0;
  z-index: 40;
  max-width: 74rem;
  margin: 0.7rem auto 0;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}

.pills ol {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pills ol::-webkit-scrollbar {
  display: none;
}

.pills a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.pills a:hover,
.pills a:focus-visible,
.pills a[aria-current="true"] {
  background: var(--ink);
  color: var(--cream);
}

/* ---------- 主区 ---------- */
main {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 2.5rem;
}

section.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  gap: 1.1rem;
  align-items: center;
  padding: 0.9rem 0 0.4rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5.2vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.012em;
  font-weight: 700;
  max-width: 20ch;
  animation: vhsTrack 9s steps(1, end) infinite;
}

@keyframes vhsTrack {
  0%, 90%, 100% { transform: none; text-shadow: none; }
  92% { transform: skewX(-1.3deg); text-shadow: 2px 0 rgba(212, 165, 116, 0.75), -2px 0 rgba(38, 33, 23, 0.28); }
  94% { transform: skewX(0.9deg); text-shadow: -2px 0 rgba(212, 165, 116, 0.7), 2px 0 rgba(38, 33, 23, 0.24); }
  96% { transform: none; }
}

.collage {
  position: relative;
  margin: 0;
  min-height: 13rem;
  aspect-ratio: 5 / 4;
}

.collage .polaroid {
  position: absolute;
  margin: 0;
  width: 72%;
  padding: 0;
  background: var(--paper);
  border: 8px solid var(--paper);
  border-bottom-width: 26px;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.collage .polaroid:nth-child(1) {
  top: 0;
  left: 0;
  transform: rotate(-3.2deg);
  z-index: 2;
  animation: polaroidSway 7s ease-in-out infinite alternate;
}

.collage .polaroid:nth-child(2) {
  bottom: 0;
  right: 0;
  width: 56%;
  transform: rotate(3.6deg);
  z-index: 1;
  animation: polaroidSway 9s ease-in-out infinite alternate-reverse;
}

@keyframes polaroidSway {
  0% { transform: rotate(-3.2deg) translateY(0); }
  100% { transform: rotate(-1.4deg) translateY(-6px); }
}

.collage .shot {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: sepia(0.32) contrast(1.06) saturate(0.82);
}

/* ---------- 侧栏 ---------- */
.side {
  align-self: start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.side-h {
  margin: 0 0 0.3rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.side hr {
  margin: 0 0 0.6rem;
}

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

.side-list li + li {
  border-top: 1px dashed var(--line);
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.25rem 0;
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
}

.side-list a::before {
  counter-increment: sideNo;
  content: counter(sideNo, decimal-leading-zero);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--tan-deep);
}

.side-list a:hover {
  color: var(--tan-deep);
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.65rem 0 0.85rem;
}

/* ---------- 正文区块 ---------- */
section.page > article {
  scroll-margin-top: 7rem;
  padding: 1.15rem 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

section.page > .hero {
  padding: 0.9rem 0 0.4rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

section.page h2 {
  margin: 0.1rem 0 0.35rem;
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.008em;
}

section.page h3 {
  margin: 1.3rem 0 0.3rem;
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink-soft);
}

section.page p {
  margin: 0.55rem 0;
  max-width: 68ch;
}

section.page ul,
section.page ol {
  margin: 0.6rem 0;
  padding-left: 1.25rem;
}

section.page li {
  margin: 0.3rem 0;
}

section.page li::marker {
  color: var(--tan-deep);
}

section.page a {
  color: #6d4a20;
  text-decoration: underline;
  text-decoration-color: var(--tan);
  text-underline-offset: 3px;
}

section.page a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

section.page blockquote {
  margin: 1rem 0;
  padding: 0.65rem 0.95rem;
  border-left: 4px solid var(--tan);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(212, 165, 116, 0.18);
}

section.page blockquote p {
  margin: 0.25rem 0;
}

section.page img {
  display: block;
  margin: 0.9rem 0;
  border: 6px solid var(--paper);
  border-bottom-width: 18px;
  border-radius: 2px;
  box-shadow: var(--shadow);
  filter: sepia(0.3) contrast(1.05) saturate(0.85);
}

section.page table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

section.page th,
section.page td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

section.page th {
  background: rgba(212, 165, 116, 0.34);
  font-weight: 700;
}

section.page dl {
  margin: 0.8rem 0;
}

section.page dt {
  font-weight: 700;
  color: var(--ink-soft);
}

section.page dd {
  margin: 0.15rem 0 0.6rem;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 1.5rem;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 1.4rem;
  border-top: 2px solid rgba(38, 33, 23, 0.28);
  background: linear-gradient(180deg, rgba(38, 33, 23, 0.02), rgba(38, 33, 23, 0.09));
}

.fcols {
  display: grid;
  gap: 1.4rem;
  max-width: 74rem;
  margin: 0 auto;
}

.fcols dt {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.fcols dd {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.fcols a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.fcols a:hover {
  border-bottom-color: var(--tan-deep);
}

.fbase {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  max-width: 74rem;
  margin: 1.4rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.copy {
  margin: 0;
  color: var(--ink-soft);
}

.flinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin: 0;
}

.flinks a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
}

.flinks a:hover {
  text-decoration: underline;
}

/* ---------- 滚动浮现 ---------- */
.js-on section.page > article {
  opacity: 0;
  transform: translateY(16px);
}

.js-on section.page > article.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 55ms);
}

/* ---------- 断点 ---------- */
@media (max-width: 599px) {
  .brand-name {
    display: none;
  }
}

@media (min-width: 700px) {
  .fcols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  section.page {
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: 2.4rem;
  }

  section.page > article {
    grid-column: 2;
  }

  section.page > .hero {
    grid-column: 1 / -1;
  }

  section.page > .side {
    grid-column: 1;
    grid-row: 2 / span 40;
    position: sticky;
    top: 5.4rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.2rem;
    min-height: 45vh;
    padding: 1.1rem 0 0.6rem;
  }

  .collage {
    aspect-ratio: auto;
    min-height: 16rem;
    height: 45vh;
    max-height: 26rem;
  }
}

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

  .grain,
  .leak,
  .hero h1,
  .collage .polaroid {
    animation: none;
  }

  .js-on section.page > article {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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