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

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

:root {
  --paper: #f5e6c8;
  --paper2: #efdcb9;
  --caramel: #d4a574;
  --caramel2: #a97642;
  --ink: #262117;
  --ink2: #574a35;
  --rail: #262117;
  --railink: #f2e5cb;
  --line: rgba(38, 33, 23, 0.22);
  --pad: clamp(18px, 4.4vw, 52px);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(58% 38% at 94% 3%, rgba(212, 165, 116, 0.5), transparent 70%),
    radial-gradient(46% 32% at 2% 97%, rgba(212, 165, 116, 0.3), transparent 72%);
  animation: leak 19s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.14;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

@keyframes leak {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
  filter: sepia(0.1) saturate(0.94) contrast(1.02);
}

/* ---------- 左侧导轨：品牌行 + 搜索行 + 菜单 ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px 20px;
  background: var(--rail);
  color: var(--railink);
  border-right: 1px solid rgba(0, 0, 0, 0.45);
  overflow-y: auto;
}

.rail-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.brand-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--caramel);
  border-radius: 3px;
  background: linear-gradient(135deg, var(--caramel) 0 42%, transparent 42% 100%);
  object-fit: cover;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.search { position: relative; }

.search input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--railink);
  background: rgba(245, 230, 200, 0.07);
  border: 1px solid rgba(245, 230, 200, 0.3);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder { color: rgba(245, 230, 200, 0.55); }

.search input:focus {
  outline: none;
  border-color: var(--caramel);
  background: rgba(245, 230, 200, 0.14);
}

.search-ico {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -7px;
  border: 1.5px solid var(--caramel);
  border-radius: 50%;
  pointer-events: none;
}

.search-ico::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: var(--caramel);
  transform: rotate(45deg);
}

.menu { flex: 1 1 auto; }

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
  color: rgba(242, 229, 203, 0.8);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 4px;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.menu a::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--caramel);
  opacity: 0.55;
  transform: rotate(45deg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu li:nth-child(3n+2) a::before { border-radius: 50%; transform: none; }
.menu li:nth-child(3n) a::before { transform: rotate(0); }

.menu a:hover,
.menu a:focus-visible {
  color: #fff8ea;
  background: rgba(245, 230, 200, 0.1);
  border-left-color: var(--caramel);
}

.menu a:hover::before { opacity: 1; transform: rotate(45deg) scale(1.35); }

.rail-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-top: 12px;
  font-size: 15px;
  color: rgba(242, 229, 203, 0.68);
  text-decoration: none;
  border-top: 1px solid rgba(245, 230, 200, 0.18);
}

.rail-back:hover { color: #fff8ea; }

/* ---------- 主列 ---------- */

main { min-width: 0; }

article > section { scroll-margin-top: 26px; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--pad);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper2), var(--paper));
}

.hero-band {
  position: absolute;
  left: -14%;
  top: 46%;
  width: 128%;
  height: 24%;
  background: linear-gradient(90deg, rgba(212, 165, 116, 0.95), rgba(212, 165, 116, 0.28) 64%, transparent 100%);
  transform: rotate(-6deg) skewX(-5deg);
  animation: track 8s ease-in-out infinite alternate;
}

@keyframes track {
  from { transform: rotate(-6deg) skewX(-5deg) translateY(0); }
  to { transform: rotate(-6deg) skewX(-5deg) translateY(-9px) scaleY(1.06); }
}

.hero-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(38, 33, 23, 0.28) 0 22px, transparent 22px 40px);
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: min(100%, 15em);
  text-align: right;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8.4vw, 6.6rem);
  line-height: 1.03;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.intro {
  display: grid;
  gap: 10px;
  max-width: 74ch;
  padding: clamp(38px, 7vw, 78px) var(--pad);
  border-bottom: 1px solid var(--line);
}

.intro h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink2);
}

/* ---------- 正文块 ---------- */

article > section:not(.hero):not(.intro) {
  max-width: 80ch;
  padding: clamp(32px, 5vw, 62px) var(--pad);
  border-bottom: 1px solid var(--line);
}

article > section:last-of-type { border-bottom: 0; }

article h2 {
  margin: 0 0 0.55em;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
}

article h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: 14px;
  background: var(--caramel);
  transform: skewX(-26deg);
}

div h3 {
  margin: 1.7em 0 0.45em;
  font-size: 1.14rem;
  line-height: 1.4;
}

div p { margin: 0 0 1.05em; }
div ul, div ol { margin: 0 0 1.1em; padding-left: 1.2em; }
div li { margin: 0.32em 0; }

div a {
  color: #7b4a1a;
  text-decoration: underline;
  text-decoration-color: var(--caramel);
  text-underline-offset: 3px;
}

div a:hover { text-decoration-color: var(--caramel2); }

div blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--caramel);
  color: var(--ink2);
}

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

div table { width: 100%; border-collapse: collapse; font-size: 16px; }
div th, div td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
div th { background: rgba(212, 165, 116, 0.22); }

.hit { outline: 2px solid var(--caramel2); outline-offset: 6px; border-radius: 4px; }

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

footer {
  background: var(--ink);
  color: var(--paper);
  filter: sepia(0.1) saturate(0.94) contrast(1.02);
}

footer article { padding: clamp(32px, 6vw, 58px) var(--pad); }

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid rgba(245, 230, 200, 0.2);
}

.cta-brand {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.cta-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  font-size: 16px;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--caramel);
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease;
}

.cta-back:hover { background: var(--caramel); color: var(--ink); }

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 15px;
}

.copy { margin: 0; color: rgba(245, 230, 200, 0.66); }

.foot-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 0;
  padding: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: rgba(245, 230, 200, 0.8);
  text-decoration: none;
}

.foot-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 滚动显现 ---------- */

.reveal { transition: opacity 0.7s ease, transform 0.7s ease; }
.rv .reveal:not(.in) { opacity: 0; transform: translateY(20px); }

.nohit .search input { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---------- 窄屏 ---------- */

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

  .rail {
    height: auto;
    gap: 10px;
    padding: 10px 16px 8px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  }

  .rail-top { flex-direction: row; align-items: center; gap: 12px; }
  .brand { min-height: 40px; }
  .brand-name { font-size: 16px; }
  .search { flex: 1 1 auto; min-width: 0; }
  .search input { height: 40px; }

  .menu { overflow-x: auto; }
  .menu ul { flex-direction: row; gap: 4px; padding-bottom: 2px; }

  .menu a {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 15px;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
  }

  .menu a:hover, .menu a:focus-visible { border-left-color: transparent; border-bottom-color: var(--caramel); }
  .rail-back { display: none; }

  .hero {
    min-height: 60vh;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 42px var(--pad) 38px;
  }

  .hero-text { text-align: left; }
  .hero-band { top: 56%; height: 20%; }
  .hero-ghost { top: 26%; }

  h1 { font-size: clamp(2.1rem, 9.4vw, 3.3rem); }

  div > article { scroll-margin-top: 128px; }
  div > article:not(.hero):not(.intro) { padding-top: 34px; padding-bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-band, body::before { animation: none; }
  .reveal { transition: none; }
  .rv .reveal:not(.in) { opacity: 1; transform: none; }
}

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