/* PF site — palette from web_V1.0.0 (slate + primary blue) */
@property --bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #f8fafc;
}
@property --bg-soft {
  syntax: "<color>";
  inherits: true;
  initial-value: #f1f5f9;
}
@property --surface {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --ink {
  syntax: "<color>";
  inherits: true;
  initial-value: #0f172a;
}
@property --text {
  syntax: "<color>";
  inherits: true;
  initial-value: #1e293b;
}
@property --muted {
  syntax: "<color>";
  inherits: true;
  initial-value: #64748b;
}
@property --line {
  syntax: "<color>";
  inherits: true;
  initial-value: #e2e8f0;
}
@property --topbar-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 255, 255, 0.96);
}
@property --card {
  syntax: "<color>";
  inherits: true;
  initial-value: #f8fafc;
}
@property --card-line {
  syntax: "<color>";
  inherits: true;
  initial-value: #f1f5f9;
}

:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --card: #f8fafc;
  --card-line: #f1f5f9;
  --theme-ease: 0.75s cubic-bezier(0.4, 0, 0.2, 1);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cyan: #0ea5e9;
  --green: #16a34a;
  --orange: #ea580c;
  --code-bg: #1e1e1e;
  --code-bar: #2d2d2d;
  --code-border: #333333;
  --code-fg: #d4d4d4;
  --code-kw: #569cd6;
  --code-type: #4ec9b0;
  --code-fn: #dcdcaa;
  --code-num: #b5cea8;
  --code-str: #ce9178;
  --code-com: #6a9955;
  --code-var: #9cdcfe;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --page-max: min(96rem, calc(100vw - 2.5rem));
  --page-pad: clamp(1.25rem, 3vw, 2.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .pin-dot { animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
  transition:
    --bg var(--theme-ease),
    --bg-soft var(--theme-ease),
    --surface var(--theme-ease),
    --ink var(--theme-ease),
    --text var(--theme-ease),
    --muted var(--theme-ease),
    --line var(--theme-ease),
    --topbar-bg var(--theme-ease),
    --card var(--theme-ease),
    --card-line var(--theme-ease),
    background-color var(--theme-ease),
    color var(--theme-ease);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--primary);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav ?? solid, no backdrop-blur */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  transition:
    box-shadow 0.25s ease,
    border-color var(--theme-ease),
    background-color var(--theme-ease),
    color var(--theme-ease);
}
.topbar.scrolled {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-bottom-color: transparent;
}

.topbar-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 0.9rem var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.leo {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  text-decoration: none;
}
.leo:hover { color: var(--primary); text-decoration: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}
.brand:hover { text-decoration: none; color: var(--primary); }

.chip-ico {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--primary); }

.btn-nav {
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.btn-nav:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-nav { transition: background 0.15s, transform 0.15s; }

@media (max-width: 980px) {
  .nav { display: none; }
  .leo { display: none; }
}

/* Hero — full-bleed shell, wide content */
.hero-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  transition: background-color var(--theme-ease), color var(--theme-ease);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 7.5rem var(--page-pad) 4.5rem;
}

.hero-circuit {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  width: 100%;
  background-image:
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(37, 99, 235, 0.12), transparent 60%),
    linear-gradient(rgba(148, 163, 184, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  overflow: hidden;
  transition: opacity var(--theme-ease);
}

.hero-circuit .trace {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  opacity: 0.35;
  width: 40%;
  border-radius: 2px;
}
.hero-circuit .t1 { top: 28%; left: -10%; }
.hero-circuit .t2 { top: 58%; right: -15%; width: 45%; }
.hero-circuit .t3 { top: 78%; left: 20%; width: 35%; background: linear-gradient(90deg, transparent, #0ea5e9, transparent); }

.hero-circuit .hex {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(37, 99, 235, 0.28);
  pointer-events: none;
  user-select: none;
}
.hero-circuit .h1 { top: 18%; left: 8%; }
.hero-circuit .h2 { top: 42%; right: 12%; }
.hero-circuit .h3 { bottom: 22%; left: 18%; }
.hero-circuit .h4 { top: 30%; right: 28%; color: rgba(14, 165, 233, 0.28); }

.hero-circuit .node {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  opacity: 0.35;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.hero-circuit .n-a { top: 35%; left: 48%; }
.hero-circuit .n-b { top: 62%; left: 72%; background: #0ea5e9; }
.hero-circuit .n-c { top: 48%; left: 22%; }

.hero-in {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-in.delay-2 { animation-delay: 0.16s; }

@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

.pill {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color var(--theme-ease), color var(--theme-ease);
}

.brand-hero {
  margin: 0 0 0.35rem;
  font-size: clamp(2.6rem, 7.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.grad {
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 34rem;
}

.lede strong { color: var(--primary); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
}
.btn.primary:hover {
  background: #1e293b;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: #cbd5e1;
}
.btn.ghost:hover {
  background: var(--bg-soft);
  text-decoration: none;
  border-color: var(--primary);
  color: var(--primary);
}

.btn { transition: background var(--theme-ease), color var(--theme-ease), border-color var(--theme-ease), transform 0.15s, box-shadow 0.15s; }

.hero-panel { justify-self: stretch; }

.die {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease,
    background-color var(--theme-ease),
    border-color var(--theme-ease),
    color var(--theme-ease);
}
.die.hero-preview:hover {
  box-shadow: 0 22px 48px rgba(37, 99, 235, 0.14);
  transform: translateY(-3px);
}

.die-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--theme-ease), color var(--theme-ease), border-color var(--theme-ease);
}

.die-title {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.live i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.die-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  position: relative;
  transition: background-color var(--theme-ease);
}

.die-code-wrap {
  border-top: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  transition: border-color var(--theme-ease), background var(--theme-ease);
}

.die-code-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.die-code-label {
  color: var(--primary);
  font-weight: 600;
}

.die-code-hint {
  color: #94a3b8;
}

.die-code {
  margin: 0;
  padding: 0.55rem 1rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  tab-size: 4;
  background: transparent;
  color: #1e293b;
  border: none;
}

.die-code .k { color: #1d4ed8; font-weight: 600; }
.die-code .t { color: #0891b2; }
.die-code .f { color: #c2410c; }
.die-code .n { color: #15803d; }
.die-code .c { color: #64748b; font-style: italic; }

@media (prefers-reduced-motion: no-preference) {
  .pin-dot { animation: blink 2.6s ease-in-out infinite; }
  .pin-dot.d2 { animation-delay: 0.8s; }
  .live i { animation: blink 1.6s ease-in-out infinite; }
  .signal {
    stroke-dasharray: 8 10;
    animation: dash 2.4s linear infinite;
  }
  .signal.d2 { animation-direction: reverse; animation-duration: 3s; }
  .bit-hop { animation: bitHop 2.8s ease-in-out infinite; }
  .bit-hop.d2 { animation-delay: 1.1s; animation-direction: reverse; }
  .hero-circuit .t1 { animation: drift 14s linear infinite; }
  .hero-circuit .t2 { animation: drift 18s linear infinite reverse; }
  .hero-circuit .t3 { animation: drift 16s linear infinite; }
  .hero-circuit .hex { animation: hexFloat 7s ease-in-out infinite; }
  .hero-circuit .h2 { animation-delay: 1.2s; }
  .hero-circuit .h3 { animation-delay: 2.1s; }
  .hero-circuit .h4 { animation-delay: 0.6s; }
  .hero-circuit .node { animation: nodeBlink 2.4s ease-in-out infinite; }
  .hero-circuit .n-b { animation-delay: 0.7s; }
  .hero-circuit .n-c { animation-delay: 1.4s; }
  .grad {
    background-size: 200% auto;
    animation: shimmer 6s ease-in-out infinite;
  }
  .feat-ico svg { animation: iconFloat 3.2s ease-in-out infinite; }
  .feat:nth-child(2) .feat-ico svg { animation-delay: 0.4s; }
  .feat:nth-child(3) .feat-ico svg { animation-delay: 0.8s; }
  .feat:nth-child(4) .feat-ico svg { animation-delay: 1.2s; }
  .step-n { animation: stepGlow 3s ease-in-out infinite; }
  .pill { animation: pillPulse 3.5s ease-in-out infinite; }
  .die-code-wrap {
    position: relative;
    overflow: hidden;
  }
  .die-code-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 28%;
    top: -40%;
    background: linear-gradient(180deg, transparent, rgba(37, 99, 235, 0.06), transparent);
    animation: codeScan 4.5s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes dash {
  to { stroke-dashoffset: -36; }
}
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(18%); }
}
@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes stepGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12); }
}
@keyframes pillPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12); }
}
@keyframes hexFloat {
  0%, 100% { transform: translateY(0); opacity: 0.25; }
  50% { transform: translateY(-8px); opacity: 0.45; }
}
@keyframes nodeBlink {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.25); }
}
@keyframes bitHop {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes codeScan {
  0% { top: -40%; }
  100% { top: 110%; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 6rem;
  }
  .hero-panel { order: -1; }
}

/* Blocks — full-bleed backgrounds, wide content */
.block {
  padding: 4.5rem var(--page-pad);
  background: var(--surface);
  border-top: 1px solid var(--line);
  width: 100%;
  transition: background-color var(--theme-ease), color var(--theme-ease), border-color var(--theme-ease);
}

.block.soft { background: var(--bg); }

.block.dark {
  background: #0f172a;
  color: #e2e8f0;
  border-top: none;
}

.block.dark h2,
.block.dark h3 { color: #fff; }

.block.dark .arch-lead,
.block.dark .arch-steps p { color: #94a3b8; }

.block.dark code { color: #93c5fd; }

.arch-section {
  border-top: 1px solid var(--line);
}

/* —— 整页日/夜：看架构区时 body.arch-night（变量过渡，去浅色也平滑） —— */
body.arch-night {
  --bg: #0f172a;
  --bg-soft: #0b1220;
  --surface: #111827;
  --ink: #f8fafc;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #1e293b;
  --topbar-bg: rgba(15, 23, 42, 0.96);
  --card: #111827;
  --card-line: #1e293b;
  background: var(--bg);
  color: var(--text);
}

body.arch-night .topbar .nav a:hover {
  color: #93c5fd;
}

body.arch-night .chip-ico {
  color: #93c5fd;
  transition: color var(--theme-ease);
}

body.arch-night .hero-circuit {
  opacity: 0.35;
}

body.arch-night .pill {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

body.arch-night .btn.ghost {
  color: #e2e8f0;
  border-color: #334155;
}
body.arch-night .btn.ghost:hover {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.12);
}

body.arch-night .die {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

body.arch-night .die-code-wrap {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  border-top-color: #1e293b;
}

body.arch-night .die-code .k { color: #569cd6; }
body.arch-night .die-code .t { color: #4ec9b0; }
body.arch-night .die-code .f { color: #dcdcaa; }
body.arch-night .die-code .n { color: #b5cea8; }
body.arch-night .die-code .c { color: #6a9955; }

body.arch-night .feat:hover {
  border-color: #2563eb;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.15);
}

body.arch-night .feat-ico.blue,
body.arch-night .cap-ico.blue { background: rgba(37, 99, 235, 0.22); color: #93c5fd; }
body.arch-night .feat-ico.green,
body.arch-night .cap-ico.green { background: rgba(22, 163, 74, 0.2); color: #86efac; }
body.arch-night .feat-ico.cyan,
body.arch-night .cap-ico.cyan { background: rgba(14, 165, 233, 0.2); color: #67e8f9; }
body.arch-night .feat-ico.orange,
body.arch-night .cap-ico.orange { background: rgba(234, 88, 12, 0.2); color: #fdba74; }

body.arch-night .flow-track,
body.arch-night .rail {
  box-shadow: none;
}

body.arch-night .flow-step.is-active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
}

body.arch-night .flow-detail {
  border-color: #1e3a8a;
  background: linear-gradient(135deg, #111827, #0f172a);
}

body.arch-night .flow-detail-label,
body.arch-night .flow-num,
body.arch-night .date {
  color: #93c5fd;
}

body.arch-night .flow-ico {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

body.arch-night .rail article:hover {
  background: var(--bg);
}

body.arch-night .step-ico {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
}

body.arch-night .arch-steps li:nth-child(2) .step-ico {
  color: #67e8f9;
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.35);
}
body.arch-night .arch-steps li:nth-child(3) .step-ico {
  color: #86efac;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(34, 197, 94, 0.3);
}
body.arch-night .arch-steps li:nth-child(4) .step-ico {
  color: #fdba74;
  background: rgba(234, 88, 12, 0.18);
  border-color: rgba(249, 115, 22, 0.35);
}

body.arch-night .timeline {
  border-left-color: #334155;
}
body.arch-night .timeline > li::before {
  background: var(--bg);
  border-color: #64748b;
  transition: background-color var(--theme-ease), border-color var(--theme-ease);
}
body.arch-night .timeline > li.current::before {
  border-color: #3b82f6;
  background: #3b82f6;
}

body.arch-night .qr-card {
  box-shadow: none;
}

body.arch-night .linkish {
  color: #93c5fd;
}

body.arch-night .modal-panel {
  background: var(--surface);
  color: var(--text);
}
body.arch-night .modal-panel h3 {
  color: var(--ink);
}
body.arch-night .modal-body {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .block,
  .hero-shell,
  .topbar,
  .feat,
  .die,
  .flow-track,
  .flow-step,
  .qr-card,
  .pill {
    transition: none !important;
  }
}

.step-ico {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #dbeafe;
  border: 1px solid #93c5fd;
  transition: background-color var(--theme-ease), color var(--theme-ease), border-color var(--theme-ease);
}

.step-ico svg {
  width: 1.2rem;
  height: 1.2rem;
}

.cap-ico {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  margin-bottom: 0.75rem;
}
.cap-ico svg {
  width: 1.2rem;
  height: 1.2rem;
}
.cap-ico.blue { background: #dbeafe; color: var(--primary); }
.cap-ico.cyan { background: #e0f2fe; color: var(--cyan); }
.cap-ico.green { background: #dcfce7; color: var(--green); }
.cap-ico.orange { background: #ffedd5; color: var(--orange); }

@media (prefers-reduced-motion: no-preference) {
  .cap-ico svg { animation: iconFloat 3.2s ease-in-out infinite; }
  .rail article:nth-child(2) .cap-ico svg { animation-delay: 0.4s; }
  .rail article:nth-child(3) .cap-ico svg { animation-delay: 0.8s; }
  .rail article:nth-child(4) .cap-ico svg { animation-delay: 1.2s; }
  .step-ico { animation: stepGlow 3s ease-in-out infinite; }
  .arch-steps li:nth-child(2) .step-ico { animation-delay: 0.4s; }
  .arch-steps li:nth-child(3) .step-ico { animation-delay: 0.8s; }
  .arch-steps li:nth-child(4) .step-ico { animation-delay: 1.2s; }
}

.block-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

.block-inner.wide { max-width: var(--page-max); }
.block-inner.narrow { max-width: min(44rem, var(--page-max)); }

.center-head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.center-head.left { text-align: left; }

.center-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 1.9rem);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.center-head p {
  margin: 0 auto;
  max-width: 38rem;
  color: var(--muted);
}

.center-head.left p { margin-left: 0; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
}

.feat {
  padding: 1.35rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color var(--theme-ease),
    background-color var(--theme-ease),
    color var(--theme-ease);
}
.feat:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.1);
  border-color: #bfdbfe;
}

.feat h3 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  color: var(--ink);
}

.feat p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.feat-ico {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  margin-bottom: 0.9rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color var(--theme-ease),
    color var(--theme-ease);
}

.feat-ico svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feat:hover .feat-ico {
  transform: scale(1.08);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.feat-ico.blue { background: #dbeafe; color: var(--primary); }
.feat-ico.green { background: #dcfce7; color: var(--green); }
.feat-ico.cyan { background: #e0f2fe; color: var(--cyan); }
.feat-ico.orange { background: #ffedd5; color: var(--orange); }

/* —— 使用流程动画图 —— */
.flow {
  margin-top: 0.5rem;
}

.flow-track {
  list-style: none;
  margin: 0;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
  transition:
    background-color var(--theme-ease),
    border-color var(--theme-ease),
    box-shadow var(--theme-ease);
}

.flow-step {
  flex: 1 1 8.5rem;
  min-width: 8.5rem;
  max-width: 11rem;
  margin: 0 auto;
  padding: 1.1rem 0.85rem 1.2rem;
  text-align: center;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  background: var(--bg);
  position: relative;
  transition:
    border-color var(--theme-ease),
    background var(--theme-ease),
    transform 0.25s,
    box-shadow 0.25s;
  cursor: default;
}

.flow-step.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
}

.flow-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.55rem;
}

.flow-ico {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.65rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: #dbeafe;
  color: var(--primary);
  transition: background-color var(--theme-ease), color var(--theme-ease);
}

.flow-ico svg {
  width: 1.2rem;
  height: 1.2rem;
}

.flow-step.is-active .flow-ico {
  background: var(--primary);
  color: #fff;
}

.flow-step h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.flow-step p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.flow-arrow {
  flex: 0 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  align-self: center;
}

.flow-arrow span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: linear-gradient(90deg, #bfdbfe, #2563eb, #bfdbfe);
  background-size: 200% 100%;
  position: relative;
  border-radius: 2px;
}

.flow-arrow span::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--primary);
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: no-preference) {
  .flow.is-running .flow-arrow span {
    animation: flowDash 1.2s linear infinite;
  }
  .flow-step.is-active .flow-ico {
    animation: iconFloat 1.8s ease-in-out infinite;
  }
}

@keyframes flowDash {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.flow-detail {
  margin-top: 1.35rem;
  padding: 1.35rem 1.5rem;
  border-radius: 0.9rem;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #fff);
  min-height: 5.5rem;
  transition: background var(--theme-ease), border-color var(--theme-ease), color var(--theme-ease);
}

.flow-detail-label {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.flow-detail-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.flow-detail-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 48rem;
}

@media (max-width: 900px) {
  .flow-track {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-step {
    max-width: none;
    width: 100%;
  }
  .flow-arrow {
    height: 1.5rem;
    transform: rotate(90deg);
  }
}

/* Architecture */
.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .arch-grid { grid-template-columns: 1fr; }
}

.arch-grid > div > h2 {
  margin: 0 0 1rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.arch-lead {
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.arch-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.arch-steps li {
  display: flex;
  gap: 1rem;
}

.step-n {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.arch-steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.arch-steps p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.code-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.code-win {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #334155;
  background: #1e1e1e;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  color: #d4d4d4;
  /* 固定 VS Code Dark+，不受日/夜主题变量影响 */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.code-win-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  background: #2d2d2d;
  border-bottom: 1px solid #000;
  color: #94a3b8;
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}
.dot.r { background: #ef4444; }
.dot.y { background: #eab308; }
.dot.g { background: #22c55e; }
.dot.dim { background: #3e3e3e; }

.fname {
  margin-left: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #94a3b8;
}

.code-pane {
  margin: 0;
  padding: 1.15rem 1.25rem 1.3rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  tab-size: 4;
  color: #d4d4d4;
  text-align: left;
  background: #1e1e1e;
}

/* 覆盖全局 code { color: primary }，保持编辑器前景色 */
.code-pane code {
  font-size: inherit;
  color: inherit;
  background: transparent;
}

.code-pane .k { color: #569cd6; font-weight: 600; }
.code-pane .t { color: #4ec9b0; }
.code-pane .f { color: #dcdcaa; }
.code-pane .n { color: #b5cea8; }
.code-pane .c { color: #6a9955; font-style: italic; }
.code-pane .s { color: #ce9178; }
.code-pane .v { color: #9cdcfe; }

/* 日夜主题不得改写架构区代码窗（固定 Dark+） */
body.arch-night .code-win {
  background: #1e1e1e;
  border-color: #334155;
  color: #d4d4d4;
}
body.arch-night .code-win-bar {
  background: #2d2d2d;
  border-bottom-color: #000;
}
body.arch-night .code-pane,
body.arch-night .code-pane code {
  background: #1e1e1e;
  color: #d4d4d4;
}
body.arch-night .fname {
  color: #94a3b8;
}
body.arch-night .code-pane .k { color: #569cd6; }
body.arch-night .code-pane .t { color: #4ec9b0; }
body.arch-night .code-pane .f { color: #dcdcaa; }
body.arch-night .code-pane .n { color: #b5cea8; }
body.arch-night .code-pane .c { color: #6a9955; }
body.arch-night .code-pane .s { color: #ce9178; }
body.arch-night .code-pane .v { color: #9cdcfe; }

/* 新能力：可读正文字体层级 */
#whats-new .capability-head h2,
#whats-new .center-head h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

#whats-new .center-head p {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: #475569;
  max-width: 34rem;
}

.rail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  transition:
    background-color var(--theme-ease),
    border-color var(--theme-ease),
    box-shadow var(--theme-ease);
}

@media (max-width: 640px) {
  .rail { grid-template-columns: 1fr; }
}

.rail article {
  padding: 1.5rem 1.4rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

.rail article:hover {
  background: var(--bg);
}

.rail article:nth-child(2n) { border-right: none; }

.rail h3,
#whats-new .rail h3 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.rail p,
#whats-new .rail p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.65;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.timeline > li {
  position: relative;
  padding: 0 0 1.75rem 1.35rem;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid #94a3b8;
}

.code-stack .code-win:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
}

.timeline > li.current::before {
  border-color: var(--primary);
  background: var(--primary);
  animation: blink 1.8s ease-in-out infinite;
}

.t-meta {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.ver {
  font-weight: 700;
  color: var(--ink);
}

.date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--primary);
}

.timeline h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  color: var(--ink);
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Donate */
.donate-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.qr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  cursor: zoom-in;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color var(--theme-ease),
    border-color var(--theme-ease),
    color var(--theme-ease);
}
.qr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.qr-card img {
  width: 12rem;
  height: 12rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--bg-soft);
}

.qr-label {
  font-weight: 700;
  font-size: 0.95rem;
}
.qr-label.weixin { color: var(--green); }
.qr-label.alipay { color: #3b82f6; }

.donate-note {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
}

.site-foot {
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem var(--page-pad);
  border-top: 1px solid #1e293b;
  width: 100%;
}

.foot-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.foot-inner strong {
  color: #fff;
  font-size: 1.1rem;
}

.foot-inner p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.875rem;
  align-items: center;
}

.foot-links a,
.linkish {
  color: #93c5fd;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.linkish:hover { text-decoration: underline; color: #bfdbfe; }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--d, 0) * 70ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.modal-panel {
  animation: modalIn 0.28s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-in,
  .modal-panel,
  .grad,
  .signal,
  .hero-circuit .trace,
  .live i,
  .feat-ico svg,
  .step-n,
  .step-ico,
  .cap-ico svg,
  .pill,
  .flow-arrow span,
  .hero-circuit .hex,
  .hero-circuit .node,
  .bit-hop,
  .die-code-wrap::after { animation: none !important; }
  .hero-in { opacity: 1; transform: none; }
}

/* Lightbox / modal */
.lightbox,
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.lightbox {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.82);
  padding: 1.5rem;
}
.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(90vw, 26rem);
  max-height: 80vh;
  background: #fff;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #64748b;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal[hidden] { display: none !important; }
.modal:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 32rem);
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-panel h3 {
  margin: 0 0 1rem;
  color: var(--ink);
}

.modal-body {
  max-height: 14rem;
  overflow-y: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-body ol {
  padding-left: 1.2rem;
}

.modal-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.modal-actions .btn {
  font-size: 0.875rem;
  padding: 0.55rem 1rem;
}

.modal-actions .btn.primary {
  background: var(--primary);
}
.modal-actions .btn.primary:hover {
  background: var(--primary-dark);
}
