/* RACE DESK — 数字商贸对抗分析台 */
:root {
  --bg: #061014;
  --bg-elev: #0b1a1f;
  --bg-panel: #0f2229;
  --line: rgba(62, 207, 175, 0.18);
  --line-strong: rgba(62, 207, 175, 0.42);
  --ink: #d7e8e1;
  --muted: #7f9a93;
  --faint: #4f6660;
  --signal: #3ecfaf;
  --signal-dim: #1f7a68;
  --route: #ff6b35;
  --warn: #f0b429;
  --danger: #e25555;
  --ok: #4ade80;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --font-ui: "Sora", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 2px;
  --max: 1120px;
  --nav-w: 220px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--signal-dim) var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(62, 207, 175, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(255, 107, 53, 0.1), transparent 50%),
    linear-gradient(180deg, #061014 0%, #08161b 40%, #061014 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #7aead2;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--bg-panel);
  padding: 8px 12px;
}

/* —— Top bar —— */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(6, 16, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
  background: rgba(6, 16, 20, 0.92);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.brand-mark span {
  color: var(--route);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  width: min(240px, 36vw);
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, width 0.25s var(--ease);
}

.search-wrap input:focus {
  border-color: var(--line-strong);
  width: min(300px, 48vw);
}

.search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--signal);
  border-radius: var(--radius);
  background: transparent;
  color: var(--signal);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.btn:hover {
  background: var(--signal);
  color: #061014;
  text-decoration: none;
}

.btn-solid {
  background: var(--signal);
  color: #061014;
}

.btn-solid:hover {
  background: #7aead2;
  color: #061014;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
}

/* —— Hero —— */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  padding: 100px clamp(16px, 4vw, 48px) 56px;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-canvas svg {
  width: 100%;
  height: 100%;
}

.route-line {
  fill: none;
  stroke: var(--route);
  stroke-width: 1.6;
  stroke-dasharray: 8 10;
  opacity: 0.55;
  animation: dash-move 28s linear infinite;
}

.route-line.secondary {
  stroke: var(--signal);
  opacity: 0.35;
  animation-duration: 36s;
  animation-direction: reverse;
}

@keyframes dash-move {
  to {
    stroke-dashoffset: -400;
  }
}

.node {
  fill: var(--bg);
  stroke: var(--signal);
  stroke-width: 2;
}

.node.hot {
  stroke: var(--route);
  animation: pulse-node 2.8s ease-in-out infinite;
}

@keyframes pulse-node {
  0%,
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.55));
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 18px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--route);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.15s forwards;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: rise 1s var(--ease) 0.28s forwards;
}

.hero h1 em {
  font-style: normal;
  color: var(--signal);
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 34em;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--muted);
  opacity: 0;
  animation: rise 1s var(--ease) 0.45s forwards;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  opacity: 0;
  animation: rise 1s var(--ease) 0.6s forwards;
}

.hero-meta {
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  bottom: 56px;
  z-index: 2;
  display: grid;
  gap: 10px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  opacity: 0;
  animation: rise 1s var(--ease) 0.75s forwards;
}

.hero-meta strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Layout —— */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 28px) 80px;
}

.side-nav {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding: 28px 12px 28px 0;
  border-right: 1px solid var(--line);
}

.side-nav h2 {
  margin: 0 0 14px;
  padding-left: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav a {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--ink);
  border-left-color: var(--signal);
  background: rgba(62, 207, 175, 0.06);
}

.content {
  min-width: 0;
  padding: 28px 0 28px clamp(18px, 3vw, 40px);
}

section.block {
  margin-bottom: 72px;
  scroll-margin-top: 88px;
}

.block-head {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.block-head .idx {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--route);
  letter-spacing: 0.08em;
}

.block-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.block-head p {
  margin: 10px 0 0;
  max-width: 42em;
  color: var(--muted);
}

/* —— Content atoms —— */
.lede {
  font-size: 1.08rem;
  color: var(--ink);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  padding: 18px 18px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.panel p,
.panel li {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel ul {
  margin: 0;
  padding-left: 1.1em;
}

.panel .tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--signal);
}

.tag.warn {
  border-color: rgba(240, 180, 41, 0.45);
  color: var(--warn);
}

.tag.danger {
  border-color: rgba(226, 85, 85, 0.45);
  color: var(--danger);
}

.tag.route {
  border-color: rgba(255, 107, 53, 0.45);
  color: var(--route);
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.chain span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
}

.chain i {
  color: var(--route);
  font-style: normal;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

td strong {
  color: var(--ink);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

tr.hl td {
  background: rgba(62, 207, 175, 0.07);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.callout {
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--signal);
  background: rgba(62, 207, 175, 0.07);
}

.callout.warn {
  border-left-color: var(--warn);
  background: rgba(240, 180, 41, 0.08);
}

.callout.danger {
  border-left-color: var(--danger);
  background: rgba(226, 85, 85, 0.08);
}

.callout.route {
  border-left-color: var(--route);
  background: rgba(255, 107, 53, 0.08);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  padding: 16px 16px 16px 58px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--route);
}

.steps li strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  color: var(--ink);
}

.steps li span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* filters / schools */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover,
.chip.on {
  border-color: var(--signal);
  color: var(--signal);
  background: rgba(62, 207, 175, 0.08);
}

.school[hidden] {
  display: none !important;
}

.quote-grid {
  display: grid;
  gap: 12px;
}

.quote {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 34, 41, 0.95), rgba(11, 26, 31, 0.6));
}

.quote .who {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--signal);
}

.quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
}

.timeline {
  position: relative;
  margin: 8px 0 0;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
}

.timeline article {
  position: relative;
  margin-bottom: 22px;
  padding-left: 8px;
}

.timeline article::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--route);
}

.timeline h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: var(--font-display);
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

.stat .value {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--ink);
}

.stat .value.good {
  color: var(--ok);
}

.stat .value.bad {
  color: var(--danger);
}

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

.checklist li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist .mark {
  font-family: var(--font-mono);
  color: var(--signal);
}

.checklist .mark.no {
  color: var(--danger);
}

.checklist .mark.wait {
  color: var(--warn);
}

.footer {
  position: relative;
  z-index: 2;
  margin-top: 40px;
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.82rem;
}

.footer .inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.hit {
  background: rgba(240, 180, 41, 0.28);
  color: inherit;
  border-radius: 2px;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    padding-bottom: 40px;
  }

  .side-nav {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 45;
    padding: 20px;
    background: rgba(6, 16, 20, 0.97);
    border-right: 1px solid var(--line);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
  }

  .side-nav.open {
    transform: none;
  }

  .content {
    padding-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .grid-2,
  .grid-3,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    position: static;
    margin-top: 40px;
    text-align: left;
  }

  .search-wrap {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand-sub {
    display: none;
  }

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
