:root {
  --paper: #f5e6c8;
  --paper-2: #ecd9b3;
  --tan: #d4a574;
  --ink: #262117;
  --rust: #8a4b23;
  --line: rgba(38, 33, 23, 0.28);
  --hard: 2px solid var(--ink);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Cabin", "Songti SC", "Noto Serif SC", "SimSun", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
}

/* 胶片颗粒 + 漏光 */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(42% 32% at 10% 6%, rgba(232, 178, 110, 0.6), transparent 70%),
    radial-gradient(36% 26% at 90% 84%, rgba(138, 75, 35, 0.36), transparent 72%),
    radial-gradient(48% 38% at 72% 12%, rgba(255, 244, 219, 0.55), transparent 74%);
  mix-blend-mode: multiply;
  animation: leak 22s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 95;
  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='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* 顶部 */
.masthead {
  position: relative;
  z-index: 60;
  background: var(--paper);
  border-bottom: var(--hard);
}

.mast-row {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem clamp(0.6rem, 3vw, 1.4rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
}

.brand {
  font-family: "Amatic SC", "Songti SC", serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  padding: 0.2rem 0.35rem;
}

.brand:hover {
  color: var(--rust);
}

.mast-menu {
  position: relative;
  justify-self: start;
}

.mast-menu--end {
  justify-self: end;
}

.mast-menu summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: var(--hard);
  font-size: 1rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  list-style: none;
  background: transparent;
  color: var(--ink);
  user-select: none;
}

.mast-menu summary::-webkit-details-marker {
  display: none;
}

.mast-menu summary::after {
  content: "＋";
  font-size: 0.85rem;
  line-height: 1;
}

.mast-menu[open] summary {
  background: var(--ink);
  color: var(--paper);
}

.mast-menu[open] summary::after {
  content: "－";
}

.mast-menu menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 12rem;
  z-index: 70;
  background: var(--paper-2);
  border: var(--hard);
  padding: 0.35rem;
  box-shadow: 6px 6px 0 rgba(38, 33, 23, 0.18);
}

.mast-menu--end menu {
  left: auto;
  right: 0;
}

.mast-menu menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

.mast-menu menu li:last-child a {
  border-bottom: 0;
}

.mast-menu menu a:hover {
  background: var(--tan);
}

/* 粘性锚点条 */
.rail {
  position: sticky;
  top: 0;
  z-index: 55;
  background: var(--ink);
  border-bottom: 3px solid var(--tan);
}

.rail-track {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem clamp(0.4rem, 3vw, 1rem);
}

.rail-nav {
  display: flex;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  white-space: nowrap;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease;
}

.rail-nav a:hover {
  background: var(--tan);
  color: var(--ink);
}

.rail-cta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font-size: 1rem;
  color: var(--tan);
  text-decoration: none;
  border: 1px solid var(--tan);
  transition: background 0.18s ease, color 0.18s ease;
}

.rail-cta:hover {
  background: var(--tan);
  color: var(--ink);
}

/* 首屏 */
.hero {
  position: relative;
  min-height: calc(100svh - 7.6rem);
  display: grid;
  align-items: end;
  justify-items: end;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 68% 22%, #eed4a7 0%, var(--tan) 46%, #7a4423 100%);
}

.hero img,
.hero .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.42) contrast(1.06) saturate(0.82);
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(202deg, rgba(38, 33, 23, 0.12) 0%, rgba(38, 33, 23, 0.52) 54%, rgba(38, 33, 23, 0.88) 100%);
}

.ghost {
  position: absolute;
  left: -1.5vw;
  bottom: 0.4rem;
  z-index: 1;
  font-family: "Amatic SC", "Songti SC", serif;
  font-weight: 700;
  font-size: clamp(5rem, 25vw, 17rem);
  line-height: 0.78;
  letter-spacing: 0.02em;
  color: rgba(245, 230, 200, 0.2);
  white-space: nowrap;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  padding: clamp(1.4rem, 5vw, 3.2rem);
  padding-bottom: clamp(2.2rem, 6vw, 3.6rem);
  text-align: right;
  color: var(--paper);
  animation: vhs 7s steps(2, end) infinite;
}

.hero h1 {
  margin: 0;
  font-family: "Amatic SC", "Songti SC", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 7.6vw, 4.8rem);
  line-height: 1.06;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.hero-lead {
  margin: 0.9rem 0 0 auto;
  max-width: 32rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #f4e4c6;
}

/* 主体 */
.page-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.4rem) clamp(1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.side {
  position: sticky;
  top: 4.6rem;
  border: var(--hard);
  background: var(--paper-2);
  padding: 0.9rem 0.85rem 0.6rem;
}

.side h2 {
  margin: 0;
  font-family: "Amatic SC", "Songti SC", serif;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  line-height: 1.2;
}

.side hr {
  margin: 0.55rem 0 0.7rem;
  height: 3px;
  width: 2.4rem;
  background: var(--rust);
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.45rem 0;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

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

.side-list a:hover {
  color: var(--rust);
  padding-left: 0.25rem;
}

.body {
  min-width: 0;
}

.body section {
  padding: clamp(1.8rem, 5vw, 3.2rem) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5.2rem;
}

.body section:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.body h2 {
  margin: 0;
  font-family: "Amatic SC", "Songti SC", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.body h2 + hr {
  height: 3px;
  width: 4.2rem;
  background: var(--tan);
  margin: 0.9rem 0 1.3rem;
}

.body h3 {
  margin: 2rem 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.body p {
  margin: 0 0 1.05rem;
  max-width: 66ch;
}

.body ul,
.body ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  max-width: 62ch;
}

.body li {
  margin-bottom: 0.5rem;
}

.body blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--tan);
  background: var(--paper-2);
  max-width: 62ch;
}

.body img {
  height: auto;
  border: 7px solid #fdf6e6;
  box-shadow: 0 0 0 2px var(--ink);
  margin: 0.6rem 0 1.2rem;
}

.body a:hover {
  background: var(--tan);
  color: var(--ink);
}

.body strong {
  background: linear-gradient(transparent 62%, var(--tan) 62%);
}

/* 页脚 */
.site-foot {
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem 2.4rem;
  padding: clamp(2.2rem, 6vw, 3.2rem) max(1rem, calc((100% - 1180px) / 2)) 1.3rem;
}

.foot-brand {
  margin: 0;
  font-family: "Amatic SC", "Songti SC", serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.09em;
  line-height: 1.1;
  color: var(--tan);
}

.foot-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  justify-content: flex-end;
  align-content: start;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.1rem;
  font-size: 1rem;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 230, 200, 0.3);
}

.foot-links a:hover {
  color: var(--tan);
  border-bottom-color: var(--tan);
}

.site-foot small {
  grid-column: 1 / -1;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(245, 230, 200, 0.22);
  font-size: 1rem;
  color: rgba(245, 230, 200, 0.66);
}

/* 动效 */
@keyframes leak {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2%, 1.5%, 0) scale(1.06);
  }
}

@keyframes vhs {
  0%,
  100% {
    transform: translateX(0) skewX(0deg);
  }
  48% {
    transform: translateX(1px) skewX(0.16deg);
  }
  52% {
    transform: translateX(-1px) skewX(-0.12deg);
  }
}

@media (max-width: 860px) {
  .page-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
  }

  .site-foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-links {
    justify-content: flex-start;
  }

  .hero-copy {
    max-width: none;
    padding-bottom: 2rem;
  }
}

@media (max-width: 420px) {
  .mast-menu summary {
    padding: 0.55rem 0.6rem;
    letter-spacing: 0.06em;
  }

  .rail-nav a {
    padding: 0.5rem 0.65rem;
  }
}

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

  body::before,
  .hero-copy {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

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