@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rail: 244px;
  --pad: 16px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  padding: 80px var(--pad) 120px;
  overflow-x: clip;
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: 'Bebas Neue', 'Source Sans 3', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  line-height: 1.06;
  margin: 0;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

img, svg, video, iframe { max-width: 100%; height: auto; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-size: 16px;
}
.skip:focus { left: 0; }

/* 侧栏 / 顶部栏 */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 8px 12px;
  max-width: 100%;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
}
.brand-img { display: block; }

.rail-nav { flex: 1 1 auto; min-width: 0; max-width: 100%; }

.rail-nav ol {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.rail-nav li { flex: none; }

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.rail-nav a:hover { background: var(--ink); color: var(--paper); }
.rail-nav a:hover .mk { background: var(--paper); }

.mk {
  display: block;
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}
.rail-nav li:nth-child(3n+2) .mk { border-radius: 50%; }
.rail-nav li:nth-child(3n+3) .mk { transform: rotate(45deg); }

/* 右侧主按钮 */
.cta {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 28px;
  font-size: 16px;
  letter-spacing: 0.08em;
  transition: transform 0.22s ease;
}
.cta:hover { transform: translateX(-4px); }

main { display: block; min-width: 0; max-width: 100%; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

/* 首屏 */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  padding-top: 10px;
  min-width: 0;
}

.hero-txt { text-align: right; min-width: 0; }

.hero h1 {
  font-size: clamp(2.9rem, 12vw, 6rem);
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}

.lede {
  margin: 0 0 8px auto;
  max-width: 46ch;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.band {
  display: block;
  height: 16px;
  background: var(--ink);
  margin: 30px 0 26px;
  transform: skewY(-2.5deg);
}

.hero-fig {
  margin: auto 0 0;
  border-radius: 28px;
  overflow: hidden;
  max-width: 100%;
}
.hero-img { display: block; width: 100%; max-width: 100%; object-fit: cover; }

/* 正文 */
.prose-sec { display: block; min-width: 0; max-width: 100%; }

.prose {
  max-width: 820px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose > * { max-width: 100%; }

.prose article {
  margin: 0 0 clamp(2.5rem, 7vw, 4.5rem);
  scroll-margin-top: 96px;
  min-width: 0;
}
.prose article + article {
  border-top: 1px solid var(--ink);
  padding-top: clamp(1.6rem, 4vw, 2.6rem);
}

.prose h2 {
  font-size: clamp(1.65rem, 6vw, 2.4rem);
  margin: 0 0 0.9rem;
}
.prose h3 {
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
}
.prose p { margin: 0 0 1.1rem; max-width: 72ch; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose strong { font-weight: 700; }
.prose img { border-radius: 28px; display: block; margin: 1.5rem 0; max-width: 100%; }
.prose figure { margin: 1.5rem 0; max-width: 100%; }
.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 6px solid var(--ink);
  font-size: 1.06rem;
}
.prose a { border-bottom: 2px solid var(--ink); overflow-wrap: anywhere; }
.prose a:hover { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.prose time { font-size: 16px; letter-spacing: 0.06em; }

.prose pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.2rem;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.prose pre code { overflow-wrap: normal; word-break: normal; }

hr {
  border: 0;
  border-top: 3px solid currentColor;
  margin: 0 0 1.3rem;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
  margin: 0 0 1.2rem;
}
.prose th, .prose td {
  border: 1px solid var(--ink);
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

/* 右栏 */
.side {
  background: var(--ink);
  color: var(--paper);
  border-radius: 28px;
  padding: 26px 20px;
  margin-top: 40px;
  font-size: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.side h2 { font-size: 1.2rem; letter-spacing: 0.08em; margin: 0 0 0.75rem; }
.side hr { border-top: 2px solid var(--paper); margin: 0 0 0.9rem; }
.side ol { list-style: none; margin: 0; padding: 0; }
.side li a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid var(--paper);
  transition: padding-left 0.22s ease;
}
.side li:last-child a { border-bottom: 0; }
.side li a:hover { padding-left: 8px; }
.side a:focus-visible { outline-color: var(--paper); }

/* 页脚 */
footer {
  border-top: 3px solid var(--ink);
  margin-top: 64px;
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  font-size: 16px;
  min-width: 0;
  max-width: 100%;
}

.f-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.f-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 2px solid var(--ink); flex: none; }
.f-brand { font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; }

.f-nav { min-width: 0; max-width: 100%; }
.f-nav ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
}
.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
  overflow-wrap: anywhere;
}
.f-nav a:hover { border-bottom-color: var(--ink); }

.f-copy { margin-left: auto; letter-spacing: 0.04em; overflow-wrap: anywhere; }

/* 桌面：左侧固定竖排导航 */
@media (min-width: 960px) {
  body { padding: 0 96px 0 calc(var(--rail) + 48px); }

  .rail {
    right: auto;
    bottom: 0;
    width: var(--rail);
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    gap: 34px;
    border-bottom: 0;
    border-right: 2px solid var(--ink);
    padding: 34px 24px;
    overflow-y: auto;
  }

  .rail-nav { width: 100%; }
  .rail-nav ol { flex-direction: column; overflow: visible; gap: 0; }
  .rail-nav a { width: 100%; padding: 13px 0; border-bottom: 1px solid var(--ink); transition: padding-left 0.2s ease, color 0.2s ease; }
  .rail-nav a:hover { background: none; color: var(--ink); padding-left: 8px; }
  .rail-nav li:last-child a { border-bottom: 0; }

  .cta {
    right: 26px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    padding: 22px 12px;
    min-height: 0;
    letter-spacing: 0.2em;
  }
  .cta:hover { transform: translateY(-50%) translateX(-4px); }

  .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 248px;
    column-gap: 56px;
    align-items: start;
  }
  .hero { grid-column: 1; grid-row: 1; }
  .prose-sec { grid-column: 1; grid-row: 2; }
  .side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 36px; margin-top: 0; }

  .prose article { scroll-margin-top: 36px; }
  article[id] { scroll-margin-top: 36px; }

  .hero h1 { font-size: clamp(4rem, 7.5vw, 6.6rem); }
  .lede { font-size: 18px; }
}

@media (min-width: 1280px) {
  .hero h1 { font-size: 6.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  .rail-nav li { animation: rise 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .rail-nav li:nth-child(1) { animation-delay: 0.02s; }
  .rail-nav li:nth-child(2) { animation-delay: 0.06s; }
  .rail-nav li:nth-child(3) { animation-delay: 0.1s; }
  .rail-nav li:nth-child(4) { animation-delay: 0.14s; }
  .rail-nav li:nth-child(5) { animation-delay: 0.18s; }
  .rail-nav li:nth-child(6) { animation-delay: 0.22s; }
  .rail-nav li:nth-child(7) { animation-delay: 0.26s; }
  .hero-txt { animation: rise 0.5s ease both; }
  .band { animation: rise 0.55s 0.06s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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