:root {
  --ink: #0E0E10;
  --red: #E8452C;
  --paper: #F5F1EA;
  --panel: #17171C;
  --line: rgba(245, 241, 234, 0.14);
  --dim: rgba(245, 241, 234, 0.66);
  --rail: 212px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { padding: 0; margin: 0; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 10px;
  top: -70px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: 4px;
  background: var(--red);
  color: var(--paper);
  font-weight: 700;
}
.skip:focus { top: 10px; }

/* 左侧竖排轨道 */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 18px;
  background: var(--ink);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--red);
  border-radius: 4px;
  flex: 0 0 auto;
}
.brand-mark {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--paper);
}
.brand img { width: 26px; height: 26px; }

.rail-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.rail-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-links a {
  display: block;
  padding: 11px 10px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  color: var(--dim);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.rail-links a:hover,
.rail-links a:focus-visible {
  color: var(--paper);
  background: var(--panel);
  border-left-color: var(--red);
}

.group { border-top: 1px solid var(--line); padding-top: 12px; }
.group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '+'; color: var(--red); font-weight: 800; }
.group[open] summary::after { content: '−'; }
.group ul { list-style: none; margin-top: 6px; }
.group ul + ul { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.group li a {
  display: block;
  padding: 10px 10px;
  min-height: 44px;
  font-size: 16px;
  color: var(--dim);
  border-radius: 4px;
}
.group li a:hover { color: var(--paper); background: var(--panel); }

.find { margin: 0; }
.find input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.find input::placeholder { color: rgba(245, 241, 234, 0.45); }
.find-none { margin-top: 8px; font-size: 16px; color: var(--red); }

/* 首屏 */
main { display: block; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  min-height: 52vh;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  will-change: transform;
}
.hero-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 52vh;
  font-size: clamp(4rem, 11vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--red);
}

.badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 14px;
  border-radius: 4px;
  background: var(--red);
  color: var(--paper);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-3deg);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 8vw 6vw;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.2rem, 5.4vw, 4.8rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  background: linear-gradient(96deg, var(--paper) 0 58%, var(--red) 58% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero h1 span {
  display: inline-block;
  animation: rise 0.78s cubic-bezier(0.16, 0.84, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 34ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.5em) rotate(3deg); }
  to { opacity: 1; transform: none; }
}

/* 正文区 */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(44px, 6vw, 88px) clamp(20px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: clamp(26px, 4vw, 60px);
  align-items: start;
}

.col { min-width: 0; }
.prose { max-width: 70ch; }

.prose > article {
  background: var(--panel);
  border-radius: 4px;
  padding: clamp(22px, 3vw, 40px);
  scroll-margin-top: 30px;
}
.prose > article + article { margin-top: 22px; }

.prose h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.prose h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  margin: 26px 0 8px;
}
.prose hr {
  border: 0;
  height: 4px;
  width: 72px;
  background: var(--red);
  margin: 0 0 20px;
}
.prose p { margin-bottom: 16px; font-size: 17px; line-height: 1.8; }
.prose ul,
.prose ol { padding-left: 1.2em; margin-bottom: 16px; }
.prose li { margin-bottom: 8px; line-height: 1.75; }
.prose a { color: var(--red); border-bottom: 1px solid rgba(232, 69, 44, 0.5); }
.prose a:hover { border-bottom-color: var(--red); }
.prose img { border-radius: 4px; margin: 18px 0; }
.prose strong { color: #ffffff; }

/* 右侧边栏 */
.side {
  position: sticky;
  top: 32px;
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.side h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.side hr {
  border: 0;
  height: 4px;
  width: 40px;
  background: var(--red);
  margin: 10px 0 14px;
}
.side ul { list-style: none; }
.side a {
  display: block;
  padding: 9px 0;
  min-height: 40px;
  font-size: 16px;
  color: var(--dim);
  border-bottom: 1px solid rgba(245, 241, 234, 0.08);
}
.side a:hover { color: var(--paper); }

/* 页脚 */
.foot {
  margin-top: 36px;
  padding: clamp(34px, 5vw, 60px) clamp(20px, 4vw, 56px) 26px;
  background: #0A0A0C;
  border-top: 1px solid var(--line);
}
.foot-cols {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.foot dl { margin: 0; }
.foot dt {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 8px;
}
.foot dd { margin: 0; }
.foot dd a {
  display: block;
  padding: 9px 0;
  min-height: 40px;
  font-size: 16px;
  color: var(--dim);
}
.foot dd a:hover { color: var(--paper); }

.foot-note {
  max-width: 1240px;
  margin: 30px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  color: var(--dim);
}
.foot-note a { display: inline-flex; align-items: center; min-height: 40px; }
.foot-note a:hover { color: var(--paper); }

/* 滚动显现 */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 0.84, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 span { animation: none; }
  .hero-img { transform: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 900px) {
  body { padding-left: 0; padding-top: 124px; }

  .rail {
    top: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-nav { order: 3; flex: 1 0 100%; overflow-x: auto; overflow-y: hidden; }
  .rail-links { flex-direction: row; gap: 4px; }
  .rail-links a {
    white-space: nowrap;
    padding: 10px 12px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 4px;
  }
  .rail-links a:hover,
  .rail-links a:focus-visible { border-left-color: transparent; border-bottom-color: var(--red); }

  .find { order: 2; margin-left: auto; flex: 1 1 110px; max-width: 176px; }
  .group { display: none; }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 12px;
  }
  .hero-copy { order: 1; align-items: flex-start; padding: 26px 20px 30px; }
  .hero h1 { font-size: clamp(2rem, 8.6vw, 3rem); }
  .hero-media { order: 2; min-height: 38vh; max-height: 46vh; }
  .hero-mark { min-height: 38vh; }

  .wrap { grid-template-columns: minmax(0, 1fr); padding: 34px 18px 48px; }
  .side { position: static; border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; }
  .prose > article { scroll-margin-top: 132px; padding: 22px 18px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .foot-cols { grid-template-columns: 1fr; }
  .prose { max-width: none; }
}

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