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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: #d8d8d8;
  --soft: #f2f2f2;
  --mute: #565656;
  --rail: 246px;
  --r: 18px;
  --pad: clamp(20px, 5vw, 64px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Poppins, system-ui, -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: Righteous, Poppins, system-ui, "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

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

a { color: var(--ink); }

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

/* ---------- 左侧固定竖排导航 ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 20px 22px;
  overflow-y: auto;
  z-index: 50;
}

.rail :focus-visible { outline-color: var(--paper); }

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

.brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  border-radius: 50%;
  font-family: Righteous, Poppins, sans-serif;
  font-size: 17px;
  line-height: 1;
  object-fit: cover;
}

.brand-txt {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.rail-h {
  font-size: 13px;
  letter-spacing: 0.24em;
  font-weight: 500;
  color: #8b8b8b;
  margin: 8px 0 0;
  font-family: Poppins, system-ui, sans-serif;
}

.rail-h > span { display: inline-block; }

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rail-a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 12px 2px;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  border-bottom: 1px solid #232323;
  transition: color 0.2s ease, padding-left 0.25s ease;
}

.rail-a .ico {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  transform: rotate(45deg);
  transition: background 0.25s ease, transform 0.35s ease;
}

.rail-a:hover,
.rail-a:focus-visible { padding-left: 8px; }
.rail-a:hover .ico,
.rail-a:focus-visible .ico,
.rail-a[aria-current="true"] .ico {
  background: var(--paper);
  transform: rotate(0deg) scale(1.15);
}
.rail-a[aria-current="true"] { font-weight: 600; }

.rail-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 11px 16px;
  border: 2px solid var(--paper);
  border-radius: var(--r);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.25s ease, color 0.25s ease;
}

.rail-cta:hover,
.rail-cta:focus-visible { background: var(--paper); color: var(--ink); }

/* ---------- 版面 ---------- */

.page { margin-left: var(--rail); }

.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 54px var(--pad) 44px clamp(64px, 17%, 220px);
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}

.hero-slash {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(40px, 13%, 170px);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 52% 100%, 0 100%);
}

.hero-in {
  position: relative;
  text-align: right;
  max-width: 24ch;
}

.hero-h {
  font-size: clamp(2.5rem, 8.2vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  word-break: break-word;
}

.hero-lede {
  margin: 20px 0 0 auto;
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--mute);
  text-align: right;
}

main { padding: 0 var(--pad); }

.flow {
  max-width: 1080px;
  margin: 0 auto;
  padding: 6px 0 72px;
}

.flow > section {
  padding: 54px 0 18px;
  scroll-margin-top: 30px;
  break-inside: avoid;
}

.flow > section + section { border-top: 2px solid var(--ink); }

.flow > section:first-child { padding-top: 44px; }

.flow h2 {
  font-size: clamp(1.65rem, 4.2vw, 2.8rem);
  margin: 0 0 0.6em;
}

.flow h3 {
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  margin: 1.7em 0 0.45em;
}

.flow h2 > span,
.flow h3 > span { display: inline-block; }

.flow h2 > span {
  padding-bottom: 0.12em;
  border-bottom: 6px solid var(--ink);
}

.flow p { margin: 0 0 1.15em; }

.flow > section:first-child > p:first-of-type::first-letter {
  float: left;
  font-family: Righteous, Poppins, serif;
  font-weight: 700;
  font-size: 3.5em;
  line-height: 0.78;
  padding: 0.06em 0.12em 0 0;
}

.flow a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.flow a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.flow ul,
.flow ol { margin: 0 0 1.2em; padding-left: 1.35em; }

.flow li { margin: 0.35em 0; break-inside: avoid; }

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

.flow blockquote {
  margin: 1.6em 0;
  padding: 22px 24px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  background: var(--paper);
  font-size: 1.1em;
  line-height: 1.5;
  font-weight: 500;
}

.flow blockquote::before {
  content: "\201C";
  display: block;
  font-family: Righteous, Poppins, serif;
  font-size: 2.2em;
  line-height: 0.6;
  margin-bottom: 0.2em;
}

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

.flow figure { margin: 1.6em 0; break-inside: avoid; }

.flow figure img {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--r);
}

.flow figcaption {
  margin-top: 0.6em;
  font-size: 16px;
  color: var(--mute);
  line-height: 1.5;
}

.flow table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 16px;
}

.flow th,
.flow td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.flow th { border-bottom: 2px solid var(--ink); font-weight: 700; }

.flow pre {
  overflow-x: auto;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  font-size: 15px;
}

.flow code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

@media (min-width: 1024px) {
  .flow > section {
    column-count: 2;
    column-gap: clamp(28px, 4vw, 56px);
    column-rule: 1px solid var(--line);
  }
  .flow h2,
  .flow h3 { column-span: all; }
  .flow > section:first-child > p:first-of-type { margin-top: 0; }
}

/* ---------- 大 CTA 块 ---------- */

.cta {
  background: var(--ink);
  color: var(--paper);
  margin-top: 8px;
}

.cta-a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(34px, 6vw, 70px) var(--pad);
  color: var(--paper);
  text-decoration: none;
}

.cta-h {
  font-size: clamp(2rem, 6.6vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.cta-h > span { display: inline-block; transition: transform 0.35s ease; }

.cta-a:hover .cta-h > span,
.cta-a:focus-visible .cta-h > span { transform: translateX(12px); }

.cta-go {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1;
  flex: 0 0 auto;
}

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

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 20px var(--pad) 26px;
  border-top: 2px solid var(--ink);
  font-size: 16px;
}

.f-a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.f-logo {
  font-weight: 600;
  text-decoration: none;
  padding: 10px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.f-copy { color: var(--mute); }

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

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
}

.f-nav a:hover,
.f-nav a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

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

.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  min-height: 44px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.totop.on { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- 滚动出现 ---------- */

.js .flow > section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .flow > section.in { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  .rail {
    position: sticky;
    inset: auto;
    top: 0;
    left: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

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

  .brand { flex: 0 0 auto; padding: 6px 0; min-height: 40px; }
  .rail-h { display: none; }
  .rail-nav { flex: 0 0 auto; }

  .rail-nav ul { flex-direction: row; gap: 2px; }

  .rail-a {
    border-bottom: 0;
    min-height: 44px;
    padding: 12px 10px;
    white-space: nowrap;
  }

  .rail-a:hover,
  .rail-a:focus-visible { padding-left: 10px; }

  .rail-cta {
    margin: 0 0 0 auto;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
  }

  .page { margin-left: 0; }

  .hero { padding-top: 40px; padding-bottom: 34px; }

  .hero-in { max-width: none; }

  .hero-lede { max-width: 46ch; }

  .flow > section { scroll-margin-top: 78px; }
}

@media (max-width: 560px) {
  .brand-txt { display: none; }
  .hero { padding-left: clamp(64px, 20%, 96px); }
  footer { flex-direction: row; }
  .f-nav ul { gap: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .flow > section { opacity: 1; transform: none; transition: none; }
  .totop { transition: none; }
  .rail-a .ico,
  .cta-h > span { transition: none; }
}

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