/* ============================================================
   SUBPAGE — additional shared bits (header / nav / footer)
   Mirrors the styles used on index.html so sub-pages render
   with the same chrome. Variables here assume style.css is
   loaded first (it is, via <link rel="stylesheet">).
   ============================================================ */

/* ----- header / nav / brand ---------------------------------- */
.header-fixed {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.header-fixed.is-scrolled {
  /* fully opaque so anchored h2 doesn't bleed through under fixed header */
  background: #ffffff;
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 24px 40px -28px rgba(24,30,37,.12);
}
.header-fixed .header-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-link-plain {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  position: relative;
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.nav-link-plain:hover { color: var(--ink); }
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.header-cta:hover {
  background: var(--coral);
  border-color: var(--coral);
  transform: translateY(-1px);
}

/* ----- footer (sub-page variant) ----------------------------- */
.footer-bot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6B7280;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.footer-status { color: #9DA5B0; }

/* subpage brand uses full logo (mark + wordmark) - override the 24x24 default */
.brand-mark {
  width: 132px;
  height: 32px;
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }

@media (max-width: 760px) {
  .header-fixed .header-inner { gap: 16px; padding: 0 24px; }
  .header-fixed { height: 64px; }
  .nav, .header-right { display: none; }
}

/* ============================================================
   SUBPAGE — shared sub-page styles
   Centered magazine layout: content lives in a 1240px column
   that is itself centered within the viewport.
   ============================================================ */
.sub-hero {
  padding: calc(var(--header-h) + 72px) 60px 40px;
  background: var(--paper);
}
.sub-hero .container,
.sub-body > .container { display: contents; }

.sub-hero .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  margin-bottom: 22px;
  letter-spacing: 0.04em;
}
.sub-hero .crumb a { color: var(--ink-3); }
.sub-hero .crumb a:hover { color: var(--ink); }

.sub-hero h1 {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin: 0 0 18px;
  max-width: 1080px;
}
.sub-hero h1 em {
  font-style: normal;
  background-image: var(--g-coral);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub-hero .sub-lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 820px;
  margin: 0 0 16px;
}

.sub-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 60px 96px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: start;
}
.sub-nav {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.sub-nav h6 {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(24,30,37,.5);
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 10px;
}
.sub-nav a {
  padding: 6px 0;
  color: var(--ink-4);
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
  transition: color .15s, border-color .15s;
}
.sub-nav a:hover { color: var(--ink); }
.sub-nav a.active { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

.sub-content { min-width: 0; max-width: 760px; }
.sub-content h2 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  padding-top: 28px;
  /* anchor offset so #router etc. land below the fixed header, not behind it */
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.sub-content h2:first-child { padding-top: 0; }
.sub-content h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--ink);
}
.sub-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.sub-content p code, .sub-content li code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.sub-content ul { margin: 0 0 18px 0; padding-left: 22px; list-style: disc; }
.sub-content li { font-size: 15px; line-height: 1.7; color: var(--ink-3); margin-bottom: 6px; }
.sub-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.callout {
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
}
.callout b { color: var(--ink); font-weight: 600; }

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.kv .k { color: var(--ink-4); font-family: var(--font-mono); font-size: 12px; padding-top: 2px; }
.kv .v { color: var(--ink); }
.kv .v code { font-family: var(--font-mono); font-size: 13px; background: var(--paper-2); padding: 2px 6px; border-radius: 4px; }

.code-block {
  background: #0E1116;
  color: #C9CDD4;
  padding: 18px 20px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 12px 0 24px;
  box-shadow: 0 12px 30px -16px rgba(14,17,22,.4);
}
.code-block .c { color: #86909C; }
.code-block .k { color: #FF7AC6; }
.code-block .s { color: #A6E22E; }
.code-block .f { color: #38CDFF; }
.code-block .p { color: #22c55e; font-weight: 700; }

/* timeline (roadmap) */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 120px 32px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.tl-item:first-child { border-top: 1px solid var(--line); }
.tl-when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); padding-top: 2px; }
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); margin-top: 4px; position: relative;
}
.tl-item.done .tl-dot { background: #22c55e; }
.tl-item.plan .tl-dot { background: var(--ink-4); }
.tl-body h4 { font-size: 18px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.tl-body p { font-size: 14px; line-height: 1.6; color: var(--ink-3); margin: 0 0 6px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tl-tags span { font-size: 11px; padding: 3px 10px; background: var(--paper-2); border-radius: 32px; color: var(--ink-3); font-weight: 500; }

/* arch diagram */
.arch-stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 28px; }
.arch-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.arch-row h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.arch-row p { font-size: 13px; color: var(--ink-4); margin: 0; }
.arch-row.openx { background: linear-gradient(135deg, #F4F0FF, #ECE6FF); border-color: #D9CBFF; }
.arch-row.providers { background: linear-gradient(135deg, #E8F6FF, #DBF0FF); border-color: #B9DFFB; }
.arch-arrow { text-align: center; color: var(--ink-4); font-size: 14px; font-family: var(--font-mono); }


/* ====== Sub-page pager (上一节 / 下一节) ====== */
.sub-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  max-width: 760px;
}
.sub-pager__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
  min-width: 0;
}
.sub-pager__link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -18px rgba(14, 17, 22, .35);
}
.sub-pager__link:hover .sub-pager__arrow { transform: translateX(2px); }
.sub-pager__prev:hover .sub-pager__arrow { transform: translateX(-2px); }
.sub-pager__next { text-align: right; align-items: flex-end; }
.sub-pager__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.sub-pager__arrow {
  display: inline-block;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  font-family: var(--font-mono);
}
.sub-pager__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.sub-pager__hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 768px) {
  .sub-pager { grid-template-columns: 1fr; gap: 12px; margin-top: 40px; padding-top: 24px; }
  .sub-pager__next { text-align: left; align-items: flex-start; }
  .sub-pager__title { font-size: 17px; }
}
/* responsive */
@media (max-width: 1100px) {
  .sub-body { grid-template-columns: 1fr; gap: 24px; padding: 24px 32px 64px; }
  .sub-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .sub-nav h6 { width: 100%; }
  .sub-hero { padding-left: 32px; padding-right: 32px; padding-top: calc(var(--header-h) + 40px); }
  .sub-hero h1 { font-size: 52px; }
  .sub-hero .sub-lead { font-size: 17px; }
}
@media (max-width: 768px) {
  .sub-hero { padding-left: 24px; padding-right: 24px; padding-top: calc(64px + 24px); }
  .sub-hero h1 { font-size: 38px; }
  .sub-body { padding-left: 24px; padding-right: 24px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-dot { margin: 0; }
  .nav, .header-right { display: none; }
}
/* === Center sub-hero to align with sub-body === */
.sub-hero {
  max-width: 1240px !important;
  margin: 0 auto !important;
}
.sub-hero .crumb,
.sub-hero h1,
.sub-hero .sub-lead {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ====== Section pager (上一节 / 下一节, 段间) ====== */
.section-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.section-pager__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
  font-weight: 500;
}
.section-pager__link:hover {
  color: var(--ink);
  background: var(--paper-2);
  border-color: var(--line);
}
.section-pager__link:hover .section-pager__arrow { transform: translateX(2px); }
.section-pager__prev:hover .section-pager__arrow { transform: translateX(-2px); }
.section-pager__arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  display: inline-block;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
.section-pager__name {
  font-weight: 600;
  color: var(--ink);
}
.section-pager__next { margin-left: auto; }
.section-pager__placeholder {
  flex: 0 0 auto;
  width: 1px;
}
@media (max-width: 768px) {
  .section-pager { flex-wrap: wrap; }
  .section-pager__next { margin-left: 0; }
}




/* ============================================================
   SUBPAGE — hero kinetic stage (Canvas particle stream)
   Particles spawn at the bottom of the hero, drift upward,
   morph dot → triangle → char as they rise, and dissolve into
   the nav area. Mouse motion creates local ripples.
   ============================================================ */
.sub-hero { position: relative; }
.hero-stage {
  /* Kimi-style hero animation container */
  position: absolute;
  inset-inline: 0;
  top: -64px;
  bottom: -120px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  /* Mask: full visibility in the upper 60% of the wrapper, fading to transparent at the bottom */
  -webkit-mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%, rgba(0,0,0,1) 60%,
    rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%, rgba(0,0,0,1) 60%,
    rgba(0,0,0,0) 100%);
}
.hero-stage__canvas-mount {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 60vw;
  min-height: 700px;
  min-width: 100%;
}
.hero-stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .hero-stage__canvas { display: none; }
}
.hero-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-grid { display: none !important; }   /* legacy DOM grid kept off */

/* keep hero text above the stage */
.sub-hero .crumb,
.sub-hero h1,
.sub-hero .sub-lead {
  position: relative;
  z-index: 2;
}
.sub-hero h1::before,
.sub-hero .sub-lead::before {
  content: '';
  position: absolute;
  inset: -8px -16px;
  background: var(--paper);
  filter: blur(12px);
  z-index: -1;
  border-radius: 4px;
}
.sub-hero .crumb::before {
  content: '';
  position: absolute;
  inset: -4px -8px;
  background: var(--paper);
  filter: blur(8px);
  z-index: -1;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-stage canvas { display: none; }
}
/* subpage brand uses full logo (mark + wordmark) - override the 24x24 default */
.brand-mark {
  width: 132px;
  height: 32px;
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }

@media (max-width: 760px) {
  .header-fixed .header-inner { gap: 16px; padding: 0 24px; }
  .header-fixed { height: 64px; }
  .nav, .header-right { display: none; }
}

/* ============================================================
   SUBPAGE — shared sub-page styles
   Centered magazine layout: content lives in a 1240px column
   that is itself centered within the viewport.
   ============================================================ */
.sub-hero {
  padding: calc(var(--header-h) + 72px) 60px 40px;
  background: var(--paper);
}
.sub-hero .container,
.sub-body > .container { display: contents; }

.sub-hero .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  margin-bottom: 22px;
  letter-spacing: 0.04em;
}
.sub-hero .crumb a { color: var(--ink-3); }
.sub-hero .crumb a:hover { color: var(--ink); }

.sub-hero h1 {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin: 0 0 18px;
  max-width: 1080px;
}
.sub-hero h1 em {
  font-style: normal;
  background-image: var(--g-coral);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub-hero .sub-lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 820px;
  margin: 0 0 16px;
}

.sub-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 60px 96px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: start;
}
.sub-nav {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.sub-nav h6 {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(24,30,37,.5);
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 10px;
}
.sub-nav a {
  padding: 6px 0;
  color: var(--ink-4);
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
  transition: color .15s, border-color .15s;
}
.sub-nav a:hover { color: var(--ink); }
.sub-nav a.active { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

.sub-content { min-width: 0; max-width: 760px; }
.sub-content h2 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  padding-top: 28px;
}
.sub-content h2:first-child { padding-top: 0; }
.sub-content h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--ink);
}
.sub-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.sub-content p code, .sub-content li code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.sub-content ul { margin: 0 0 18px 0; padding-left: 22px; list-style: disc; }
.sub-content li { font-size: 15px; line-height: 1.7; color: var(--ink-3); margin-bottom: 6px; }
.sub-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.callout {
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
}
.callout b { color: var(--ink); font-weight: 600; }

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.kv .k { color: var(--ink-4); font-family: var(--font-mono); font-size: 12px; padding-top: 2px; }
.kv .v { color: var(--ink); }
.kv .v code { font-family: var(--font-mono); font-size: 13px; background: var(--paper-2); padding: 2px 6px; border-radius: 4px; }

.code-block {
  background: #0E1116;
  color: #C9CDD4;
  padding: 18px 20px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 12px 0 24px;
  box-shadow: 0 12px 30px -16px rgba(14,17,22,.4);
}
.code-block .c { color: #86909C; }
.code-block .k { color: #FF7AC6; }
.code-block .s { color: #A6E22E; }
.code-block .f { color: #38CDFF; }
.code-block .p { color: #22c55e; font-weight: 700; }

/* timeline (roadmap) */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 120px 32px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.tl-item:first-child { border-top: 1px solid var(--line); }
.tl-when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); padding-top: 2px; }
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); margin-top: 4px; position: relative;
}
.tl-item.done .tl-dot { background: #22c55e; }
.tl-item.plan .tl-dot { background: var(--ink-4); }
.tl-body h4 { font-size: 18px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.tl-body p { font-size: 14px; line-height: 1.6; color: var(--ink-3); margin: 0 0 6px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tl-tags span { font-size: 11px; padding: 3px 10px; background: var(--paper-2); border-radius: 32px; color: var(--ink-3); font-weight: 500; }

/* arch diagram */
.arch-stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 28px; }
.arch-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.arch-row h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.arch-row p { font-size: 13px; color: var(--ink-4); margin: 0; }
.arch-row.openx { background: linear-gradient(135deg, #F4F0FF, #ECE6FF); border-color: #D9CBFF; }
.arch-row.providers { background: linear-gradient(135deg, #E8F6FF, #DBF0FF); border-color: #B9DFFB; }
.arch-arrow { text-align: center; color: var(--ink-4); font-size: 14px; font-family: var(--font-mono); }


/* ====== Sub-page pager (上一节 / 下一节) ====== */
.sub-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  max-width: 760px;
}
.sub-pager__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
  min-width: 0;
}
.sub-pager__link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -18px rgba(14, 17, 22, .35);
}
.sub-pager__link:hover .sub-pager__arrow { transform: translateX(2px); }
.sub-pager__prev:hover .sub-pager__arrow { transform: translateX(-2px); }
.sub-pager__next { text-align: right; align-items: flex-end; }
.sub-pager__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.sub-pager__arrow {
  display: inline-block;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  font-family: var(--font-mono);
}
.sub-pager__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.sub-pager__hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 768px) {
  .sub-pager { grid-template-columns: 1fr; gap: 12px; margin-top: 40px; padding-top: 24px; }
  .sub-pager__next { text-align: left; align-items: flex-start; }
  .sub-pager__title { font-size: 17px; }
}
/* responsive */
@media (max-width: 1100px) {
  .sub-body { grid-template-columns: 1fr; gap: 24px; padding: 24px 32px 64px; }
  .sub-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .sub-nav h6 { width: 100%; }
  .sub-hero { padding-left: 32px; padding-right: 32px; padding-top: calc(var(--header-h) + 40px); }
  .sub-hero h1 { font-size: 52px; }
  .sub-hero .sub-lead { font-size: 17px; }
}
@media (max-width: 768px) {
  .sub-hero { padding-left: 24px; padding-right: 24px; padding-top: calc(64px + 24px); }
  .sub-hero h1 { font-size: 38px; }
  .sub-body { padding-left: 24px; padding-right: 24px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-dot { margin: 0; }
  .nav, .header-right { display: none; }
}
/* === Center sub-hero to align with sub-body === */
.sub-hero {
  max-width: 1240px !important;
  margin: 0 auto !important;
}
.sub-hero .crumb,
.sub-hero h1,
.sub-hero .sub-lead {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ====== Section pager (上一节 / 下一节, 段间) ====== */
.section-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.section-pager__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
  font-weight: 500;
}
.section-pager__link:hover {
  color: var(--ink);
  background: var(--paper-2);
  border-color: var(--line);
}
.section-pager__link:hover .section-pager__arrow { transform: translateX(2px); }
.section-pager__prev:hover .section-pager__arrow { transform: translateX(-2px); }
.section-pager__arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  display: inline-block;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
.section-pager__name {
  font-weight: 600;
  color: var(--ink);
}
.section-pager__next { margin-left: auto; }
.section-pager__placeholder {
  flex: 0 0 auto;
  width: 1px;
}
@media (max-width: 768px) {
  .section-pager { flex-wrap: wrap; }
  .section-pager__next { margin-left: 0; }
}


/* ============================================================
   SUBPAGE — hero kinetic stage
   Kimi-style dot grid that morphs into triangles / brackets /
   letters from left to right. Subtle mouse parallax + glow.
   ============================================================ */
.sub-hero { position: relative; }

}


/* ============================================================
   SUBPAGE — mobile menu (hamburger + drawer)
   ============================================================ */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 11px 10px;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: #fff;
  padding: 8px 24px 24px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px -28px rgba(24,30,37,.18);
}
.nav-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-drawer__link {
  display: block;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.nav-drawer__link:last-of-type { border-bottom: 0; }
.nav-drawer__cta {
  margin-top: 16px;
  text-align: center;
  background: var(--ink);
  color: #fff;
  padding: 14px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-drawer__cta:hover { background: var(--coral); }
body.is-locked { overflow: hidden; }

/* ============================================================
   SUBPAGE — mobile breakpoints (≤760px)
   ============================================================ */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  /* shrink logo + balance header */
  .header-fixed { height: 56px; }
  .header-fixed .header-inner { gap: 12px; padding: 0 16px; }
  .brand-mark { width: 96px; height: 24px; }

  /* hero stage: bigger cells, lower density, less aggressive fade */
  .hero-stage {
    --cell: 26px;
    opacity: .55;
    mask-image: linear-gradient(to right,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%,
      rgba(0,0,0,.45) 70%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to right,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%,
      rgba(0,0,0,.45) 70%, rgba(0,0,0,0) 100%);
  }
  .hero-cell { font-size: 8px; }

  /* sub-hero typography & spacing */
  .sub-hero {
    padding: calc(56px + 28px) 20px 28px;
  }
  .sub-hero .crumb {
    font-size: 11px;
    margin-bottom: 16px;
    gap: 6px;
  }
  .sub-hero h1 {
    font-size: 30px;
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin: 0 0 14px;
  }
  .sub-hero .sub-lead {
    font-size: 15px;
    line-height: 1.6;
    max-width: 100%;
  }

  /* sub-body tighter */
  .sub-body {
    padding: 24px 16px 60px;
    gap: 20px;
  }
  .sub-content h2 { font-size: 26px; }
  .sub-content h3 { font-size: 18px; }
  .sub-content p  { font-size: 14.5px; line-height: 1.7; }
  .sub-content li { font-size: 14.5px; line-height: 1.7; }

  /* section-pager — full-width buttons, easier to tap */
  .section-pager {
    margin-top: 32px;
    padding-top: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .section-pager__link {
    justify-content: space-between;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-height: 48px;
    font-size: 14px;
  }
  .section-pager__next { margin-left: 0; }

  /* sub-pager — already single column; just tighten */
  .sub-pager {
    margin-top: 36px;
    padding-top: 24px;
  }
  .sub-pager__link {
    padding: 16px 18px;
  }
  .sub-pager__title { font-size: 18px; }
  .sub-pager__hint  { font-size: 11.5px; }

  /* timeline cards — already stacked, tighten gap */
  .tl-item {
    grid-template-columns: 90px 16px 1fr;
    gap: 12px;
    padding: 18px 0;
  }
  .tl-body h4 { font-size: 16px; }
  .tl-body p  { font-size: 13.5px; }

  /* arch stack — narrower padding */
  .arch-row { padding: 14px 16px; }
  .arch-row h4 { font-size: 14px; }

  /* footer */
  .footer-bot {
    flex-direction: column;
    gap: 6px;
    padding: 22px 16px;
    text-align: center;
  }
}

/* very narrow phones (≤360px) */
@media (max-width: 360px) {
  .brand-mark { width: 84px; height: 22px; }
  .sub-hero h1 { font-size: 26px; }
  .hero-stage { --cell: 22px; }
}

/* ============================================================
   SUBPAGE — tablet tweaks (761-1024px)
   ============================================================ */
@media (min-width: 761px) and (max-width: 1024px) {
  .sub-body { padding: 28px 32px 72px; gap: 56px; grid-template-columns: 200px 1fr; }
  .sub-hero h1 { font-size: 56px; }
  .sub-hero .sub-lead { font-size: 17px; }
  .brand-mark { width: 116px; height: 28px; }
  .hero-stage { --cell: 22px; opacity: .8; }
}
/* ============================================================
   DESKTOP PAGE — screenshot, action grid, capability cards
   ============================================================ */
.hero-cta-row {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  margin-bottom: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button--dark {
  background: var(--ink);
  color: #fff;
}
.button--dark:hover {
  background: var(--coral);
  border-color: var(--coral);
}
.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.button--ghost:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}
.button--small {
  padding: 8px 14px;
  font-size: 13px;
}

.desktop-shot {
  margin: 40px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -36px rgba(24,30,37,.25);
  background: #1a1d22;
}
.desktop-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.desktop-shot figcaption {
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  background: #0f1217;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* four quick actions */
.action-grid {
  margin: 32px 0 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.action-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
  color: var(--ink);
}
.action-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -20px rgba(24,30,37,.25);
}
.action-card__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.action-card__title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.action-card__hint {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* capability grid */
.cap-grid {
  margin: 28px 0 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.cap-card {
  padding: 22px 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.cap-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.cap-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-3);
}

/* misc helpers */
.hint {
  font-size: 13px;
  color: var(--ink-4);
  margin-top: 16px;
}

/* toc sidebar */
.sub-body__toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
}
.toc-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.sub-body__toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.sub-body__toc li a {
  font-size: 13px;
  color: var(--ink-3);
  transition: color .2s var(--ease);
}
.sub-body__toc li a:hover { color: var(--ink); }

/* main article (companion to .sub-body__toc) */
.sub-body:has(.sub-body__toc) {
  grid-template-columns: 1fr 220px;
}
.sub-body__main {
  min-width: 0;
}
.sub-body__main h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 64px 0 16px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.sub-body__main h2:first-of-type { margin-top: 0; }
.sub-body__main p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.sub-body__main ul {
  padding-left: 20px;
  margin-bottom: 16px;
}
.sub-body__main li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.sub-body__main code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

@media (max-width: 760px) {
  .action-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .hero-cta-row { width: 100%; }
  .hero-cta-row .button { flex: 1; min-width: 0; }
}