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

:root {
  --void: #0B0F14;
  --void-2: #10171F;
  --coral: #FF3D57;
  --ink: #E8EDF2;
  --dim: rgba(232, 237, 242, 0.64);
  --line: rgba(232, 237, 242, 0.16);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

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

a {
  color: var(--ink);
  text-decoration: none;
}

p {
  margin: 0 0 18px;
}

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

article[id] {
  scroll-margin-top: 92px;
}

/* ---------- 顶栏 ---------- */
.dock {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 78px 8px 20px;
  background: var(--void);
  border-bottom: 2px solid var(--line);
}

.brand {
  position: relative;
  z-index: 70;
  justify-self: center;
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: color 0.18s ease;
}

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

.rail-nav p {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  gap: 2px;
}

.rail-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 15px;
  color: var(--dim);
  border-radius: 2px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

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

.nav-l p {
  justify-content: flex-end;
}

.nav-r p {
  justify-content: flex-start;
}

/* ---------- 汉堡 ---------- */
.burger {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 2px;
  background: var(--coral);
  color: var(--void);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.burger:hover {
  background: var(--ink);
}

.burger-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.burger-bars::before,
.burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s ease;
}

.burger-bars::before {
  top: -6px;
}

.burger-bars::after {
  top: 6px;
}

body.nav-open .burger-bars {
  background: transparent;
}

body.nav-open .burger-bars::before {
  transform: translateY(6px) rotate(45deg);
}

body.nav-open .burger-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 全屏菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: center;
  padding: 96px 26px 140px;
  background: var(--void);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.drawer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: var(--coral);
  clip-path: polygon(0 100%, 100% 8%, 100% 100%);
  pointer-events: none;
}

.drawer-nav {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.drawer-nav p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.drawer-nav a {
  display: block;
  padding: 8px 0;
  font-size: clamp(24px, 6.4vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--line);
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.drawer-nav a:hover {
  color: var(--coral);
  padding-left: 12px;
}

body.nav-open .drawer {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 20px 108px;
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 58px;
  background: var(--coral);
  clip-path: polygon(0 100%, 100% 12%, 100% 100%);
}

.hero-txt::before {
  content: "";
  display: block;
  width: 58px;
  height: 6px;
  margin-bottom: 24px;
  background: var(--coral);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 5.8vw, 66px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 46ch;
  margin: 0 0 28px;
  font-size: 18px;
  color: var(--dim);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--void);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color 0.18s ease;
}

.cta:hover {
  background: var(--coral);
  color: var(--void);
}

.hero-fig {
  margin: 0;
  border: 2px solid var(--line);
  border-left: 8px solid var(--coral);
  border-radius: 4px;
  overflow: hidden;
}

.hero-fig img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* ---------- 正文骨架 ---------- */
.body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 20px 84px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 88px;
}

.rail small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--coral);
}

.rail h2 {
  margin: 6px 0 14px;
  padding-bottom: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--line);
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list a {
  display: block;
  padding: 9px 0;
  font-size: 15px;
  color: var(--dim);
  border-bottom: 1px dashed var(--line);
  transition: color 0.18s ease;
}

.rail-list a:hover {
  color: var(--coral);
}

/* ---------- 正文内容 ---------- */
.prose {
  min-width: 0;
}

.prose > article {
  position: relative;
  margin: 0 0 44px;
  padding: 0 0 40px;
  border-bottom: 2px solid var(--line);
}

.prose > article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.prose > article:nth-of-type(even) {
  background: var(--void-2);
  padding: 24px 20px 32px;
  border-radius: 4px;
  border-bottom-color: transparent;
}

.prose small {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--coral);
}

.prose h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 12px;
  background: var(--coral);
  vertical-align: baseline;
}

.prose > article:target h2 {
  color: var(--coral);
}

.prose h3 {
  margin: 30px 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.prose p {
  margin: 0 0 18px;
  color: rgba(232, 237, 242, 0.87);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 0 0 8px;
}

.prose li::marker {
  color: var(--coral);
}

.prose strong {
  color: #ffffff;
}

.prose a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 6px solid var(--coral);
  background: rgba(255, 61, 87, 0.07);
}

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

.prose table {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--void-2);
}

.prose figure {
  margin: 0 0 18px;
}

.prose img {
  margin: 0 0 18px;
  border: 2px solid var(--line);
  border-radius: 4px;
}

.prose hr {
  height: 0;
  margin: 28px 0;
  border: 0;
  border-top: 2px solid var(--line);
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px 30px;
  border-top: 2px solid var(--line);
}

.foot p {
  margin: 0;
  font-size: clamp(30px, 8.6vw, 88px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  word-break: break-word;
}

.foot small {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--dim);
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  background: var(--void-2);
  border: 2px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.totop:hover {
  color: var(--coral);
  border-color: var(--coral);
}

/* ---------- 出现动画 ---------- */
html.reveal .hero,
html.reveal .prose > article,
html.reveal .foot {
  opacity: 0;
  transform: translateY(16px);
}

html.reveal .on {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

  html.reveal .hero,
  html.reveal .prose > article,
  html.reveal .foot {
    opacity: 1;
    transform: none;
  }

  .drawer,
  .drawer-nav a,
  .rail-nav a,
  .cta,
  .burger {
    transition: none;
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .dock {
    padding-right: 74px;
  }

  .rail-nav {
    display: none;
  }

  .drawer-nav {
    max-width: 100%;
  }
}

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

  .dock {
    min-height: 60px;
    padding: 8px 74px 8px 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
    padding: 32px 18px 84px;
  }

  .hero::after {
    left: 0;
    right: 0;
    height: 44px;
  }

  .hero h1 {
    font-size: clamp(30px, 8.4vw, 44px);
  }

  .lede {
    font-size: 16px;
    margin-bottom: 22px;
  }

  .hero-fig img {
    aspect-ratio: 3 / 2;
  }

  .body {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 34px 18px 60px;
  }

  .rail {
    position: static;
    padding: 14px 16px 6px;
    border: 2px solid var(--line);
    border-radius: 4px;
  }

  .rail-list {
    columns: 2;
    column-gap: 14px;
  }

  .rail-list a {
    padding: 11px 0;
    break-inside: avoid;
  }

  .prose > article:nth-of-type(even) {
    padding: 20px 14px 26px;
  }

  .foot {
    padding: 28px 18px 26px;
  }
}

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