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

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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --grey: #4a4a4a;
  --faint: #8a8780;
  --line: #d9d6ce;
  --serif: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.03) 0 1px, transparent 1px 4px),
    radial-gradient(rgba(26, 26, 26, 0.055) 1px, transparent 1px);
  background-size: auto, 8px 8px;
  color: var(--grey);
  font: 400 17px/1.78 var(--sans);
}

img { max-width: 100%; }
a { color: var(--ink); }

/* ---------- 页头：品牌独占一行 + 胶囊菜单行 ---------- */

.masthead {
  padding: 14px clamp(14px, 4vw, 40px) 0;
  border-bottom: 2px solid var(--ink);
  background: rgba(250, 250, 248, 0.86);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  filter: grayscale(1);
  transform: rotate(-3deg);
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding-bottom: 3px;
  border-bottom: 4px double var(--ink);
}

.finder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(26, 26, 26, 0.12);
  transform: rotate(0.5deg);
}

.finder-q {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  min-height: 40px;
  width: clamp(88px, 17vw, 150px);
  outline: none;
  padding: 0;
}

.finder-q::placeholder { color: var(--faint); }

.finder-go {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  min-height: 40px;
  padding: 0 15px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.finder-go:hover { background: var(--grey); border-color: var(--grey); }

.menuroll {
  overflow-x: auto;
  padding: 10px 0 14px;
  scrollbar-width: thin;
}

.menu-list {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: max-content;
}

.menu-item a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 17px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.3;
}

.menu-item:nth-child(odd) a { transform: rotate(-0.8deg); }
.menu-item:nth-child(even) a { transform: rotate(0.7deg); }
.menu-item a:hover { background: var(--ink); color: var(--paper); }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  height: 70vh;
  min-height: 380px;
  max-height: 680px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: #e7e4dc;
}

.hero-media { position: absolute; inset: 0; }

.hero-media--blank {
  background:
    repeating-linear-gradient(45deg, rgba(26, 26, 26, 0.06) 0 2px, transparent 2px 9px),
    #ece9e1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.4) contrast(1.06);
}

.hero-img:not(:first-child) {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: herofade 21s linear infinite;
}

.hero-img:nth-child(2) { animation-delay: 0s; }
.hero-img:nth-child(3) { animation-delay: 7s; }
.hero-img:nth-child(4) { animation-delay: 14s; }

@keyframes herofade {
  0% { opacity: 0; }
  6% { opacity: 1; }
  27% { opacity: 1; }
  34% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(250, 250, 248, 0.1) 0%, rgba(250, 250, 248, 0.7) 52%, rgba(250, 250, 248, 0.94) 100%);
}

.hero-ghost {
  position: absolute;
  left: -2vw;
  right: 0;
  bottom: -1.6vw;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(58px, 16vw, 210px);
  line-height: 0.82;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: rgba(26, 26, 26, 0.085);
  pointer-events: none;
  will-change: transform;
}

.hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 0 clamp(16px, 6vw, 72px);
}

.hero-h1 {
  position: relative;
  margin: 0;
  max-width: 16em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(29px, 5.2vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(250, 250, 248, 0.85);
}

.hero-h1::after {
  content: "";
  display: block;
  width: 76px;
  height: 5px;
  margin: 16px 0 0 auto;
  border-radius: 4px;
  background: var(--ink);
  transform: rotate(-1.4deg);
}

/* ---------- 主体：左栏目录 + 右侧正文 ---------- */

.spread {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(14px, 4vw, 40px) 68px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: start;
}

.rail {
  position: sticky;
  top: 16px;
  padding: 16px 14px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  border-bottom-width: 6px;
  background: rgba(250, 250, 248, 0.94);
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.1);
  transform: rotate(-0.6deg);
}

.rail-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
  color: var(--ink);
}

.rail hr {
  margin: 10px 0 12px;
  border: 0;
  border-top: 1.5px dashed var(--faint);
}

.rail-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 18px 18px 0;
  color: var(--grey);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
}

.rail-nav a:hover,
.rail-nav a.is-on {
  color: var(--ink);
  border-left-color: var(--ink);
  background: rgba(26, 26, 26, 0.055);
}

.sheet { min-width: 0; }

.sheet div[id] { scroll-margin-top: 24px; }

.sheet div {
  padding: clamp(18px, 3vw, 32px) 0;
  border-bottom: 1.5px dashed var(--line);
}

.sheet div:last-child { border-bottom: 0; }

.sheet h2 {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.3;
  color: var(--ink);
}

.sheet h2::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 11px;
  background: var(--ink);
  transform: rotate(-7deg);
  vertical-align: 2px;
}

.sheet h3 {
  margin: 26px 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.35;
  color: var(--ink);
}

.sheet hr {
  border: 0;
  border-top: 2px dashed rgba(26, 26, 26, 0.4);
  margin: 6px 0 18px;
  transform: rotate(-0.2deg);
}

.sheet p { margin: 0 0 1.05em; }

.sheet ul,
.sheet ol { margin: 0 0 1.1em; padding-left: 24px; }

.sheet li { margin-bottom: 8px; }

.sheet li::marker { color: var(--ink); }

.sheet a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.sheet strong,
.sheet b { color: var(--ink); }

.sheet img {
  display: block;
  height: auto;
  margin: 16px 0;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  filter: grayscale(0.2) contrast(1.03);
}

.sheet figure { margin: 20px 0; }

.sheet figcaption {
  font-size: 16px;
  color: var(--faint);
  margin-top: 6px;
}

.sheet blockquote {
  margin: 22px 0;
  padding: 16px 20px 20px;
  border: 1.5px solid var(--ink);
  border-bottom-width: 6px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-family: var(--serif);
}

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

.sheet table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 16px;
}

.sheet th,
.sheet td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
}

.sheet th {
  background: rgba(26, 26, 26, 0.05);
  color: var(--ink);
}

/* ---------- 页脚 ---------- */

.colophon {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 1fr;
  gap: 14px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px clamp(14px, 4vw, 40px) 44px;
  border-top: 2px solid var(--ink);
  font-size: 16px;
  text-align: center;
}

.colophon p { margin: 0; }

.f-1 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  text-align: left;
}

.f-2 { color: var(--grey); }

.f-3 { color: var(--ink); }

.f-4 {
  font-size: 16px;
  color: var(--faint);
  text-align: right;
  word-break: break-all;
}

/* ---------- 回到顶部 ---------- */

.totop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(26, 26, 26, 0.16);
  transform: rotate(-1deg);
}

.totop.is-show { display: inline-flex; }

/* ---------- 断点 ---------- */

@media (max-width: 900px) {
  .spread {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .rail {
    position: static;
    transform: none;
    padding: 14px 12px 16px;
  }

  .rail-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .rail-nav a { border-radius: 18px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  .finder { flex: 1 1 100%; transform: none; }
  .finder-q { width: auto; flex: 1 1 auto; }

  .hero {
    height: auto;
    min-height: 58vh;
    padding: 0;
  }

  .hero-copy { padding: 0 18px; }
  .hero-ghost { font-size: 21vw; bottom: 0; }
  .hero-h1 { font-size: clamp(26px, 8vw, 38px); }

  .rail-nav ul { grid-template-columns: minmax(0, 1fr); }

  .colophon {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    text-align: left;
  }

  .f-3 { text-align: right; }
  .f-4 { text-align: right; }
}

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

  .hero-img:not(:first-child) {
    animation: none;
    opacity: 0;
  }

  .hero-ghost { transform: none !important; }
}

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