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

:root {
  --bg: #0A1128;
  --bg-card: #101B3A;
  --bg-elevated: #16224A;
  --border: #1C2B5E;
  --border-strong: #29408A;
  --accent: #FF6B35;
  --accent-soft: rgba(255, 107, 53, 0.12);
  --accent2: #00E5FF;
  --accent2-soft: rgba(0, 229, 255, 0.1);
  --text: #E8EDF7;
  --text-muted: #8892B0;
  --warning: #FFD166;
  --success: #4ADE80;
  --error: #F87171;
  --font-headline: "DIN Condensed", "Impact", "Arial Narrow", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --container: 1280px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 72px;
  --space-7: 96px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent2);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

ul, ol {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
  border-radius: 2px;
}

[hidden] {
  display: none !important;
}

.hide-visually {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#main-content {
  min-height: 60vh;
  outline: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding: var(--space-6) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.skip-link {
  position: fixed;
  top: -80px;
  left: var(--space-2);
  z-index: 1200;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-2);
  text-decoration: none;
  color: #fff;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 1100;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
  transition: width 0.1s linear;
}

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

.ticker-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-meta {
  flex-shrink: 0;
  color: var(--accent2);
  font-size: 11px;
  letter-spacing: 0.15em;
  border-left: 1px solid var(--border);
  padding-left: var(--space-2);
}

.masthead {
  position: relative;
  padding: var(--space-5) var(--space-3) var(--space-4);
  text-align: center;
  overflow: hidden;
}

.masthead::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  margin: var(--space-4) auto 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.masthead-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}

.masthead-note {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  text-transform: uppercase;
  user-select: none;
}

.masthead-note-left {
  left: 20px;
}

.masthead-note-right {
  right: 20px;
}

.masthead-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--accent2);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.masthead-brand {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  font-family: var(--font-headline);
  font-size: clamp(44px, 9vw, 88px);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.masthead-brand:hover {
  text-decoration: none;
  color: #fff;
}

.brand-main {
  color: #fff;
}

.brand-sub {
  color: var(--accent);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.15em 0.4em 0.1em;
  line-height: 1.2;
}

.masthead-tagline {
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

.tagline-dot {
  color: var(--accent);
}

.main-nav {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.nav-list {
  display: flex;
  justify-content: center;
  align-items: stretch;
  max-width: var(--container);
  margin: 0 auto;
  counter-reset: nav-index;
}

.nav-list li {
  counter-increment: nav-index;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-list a::before {
  content: "0" counter(nav-index);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--accent2);
  opacity: 0.7;
  transform: translateY(-1px);
}

.nav-list a:hover {
  color: var(--accent2);
  background: var(--accent2-soft);
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

.site-footer {
  background: var(--bg-card);
  border-top: 2px solid var(--border-strong);
  margin-top: var(--space-7);
}

.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3) var(--space-5);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr;
  gap: var(--space-5);
}

.footer-brand-name {
  font-family: var(--font-headline);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.footer-brand-name span {
  color: var(--accent);
}

.footer-brand-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent2);
  margin-top: 6px;
}

.footer-about {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: 1.7;
  max-width: 340px;
}

.footer-col-title {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  color: var(--text-muted);
  font-size: 14px;
  display: inline-block;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-list a:hover {
  color: var(--accent);
  padding-left: 6px;
  text-decoration: none;
}

.footer-contact .footer-list li,
.footer-col:last-child .footer-list li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.footer-col:last-child .footer-list li::before {
  content: ">";
  font-family: var(--font-mono);
  color: var(--accent2);
  font-size: 12px;
  flex-shrink: 0;
}

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
}

.footer-copy {
  font-weight: 500;
}

.footer-icp {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.footer-trust {
  flex-basis: 100%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  opacity: 0.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.15);
}

.btn-primary:hover {
  background: #FF8A5C;
  color: #fff;
  box-shadow: 0 0 32px rgba(255, 107, 53, 0.3);
}

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

.btn-ghost:hover {
  background: var(--accent2-soft);
  color: var(--accent2);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 17px;
  font-weight: 700;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
  line-height: 1.25;
}

.card-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.section-index {
  font-family: var(--font-headline);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.section-head h2 {
  font-family: var(--font-headline);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.section-note {
  margin-left: auto;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  letter-spacing: 0.05em;
}

.tag-accent {
  color: var(--accent);
  border-color: rgba(255, 107, 53, 0.5);
  background: var(--accent-soft);
}

.tag-success {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.5);
}

.tag-warning {
  color: var(--warning);
  border-color: rgba(255, 209, 102, 0.5);
}

.tag-error {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.5);
}

.tag-cyan {
  color: var(--accent2);
  border-color: rgba(0, 229, 255, 0.5);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: var(--success);
}

.status-dot.is-warning {
  background: var(--warning);
}

.status-dot.is-error {
  background: var(--error);
}

.status-dot.is-accent {
  background: var(--accent);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent2);
}

.breadcrumb-sep {
  color: var(--border-strong);
  margin: 0 4px;
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
}

.timeline {
  position: relative;
  padding-left: 32px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--space-4);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent2);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--accent2-soft);
}

.tab-btn.is-active,
.tab-btn[aria-selected="true"] {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
  background: var(--accent2-soft);
}

[data-tab-panel] {
  display: block;
}

[data-tab-panel][hidden] {
  display: none;
}

.fig {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.fig-wide {
  aspect-ratio: 21 / 9;
}

.fig-square {
  aspect-ratio: 1 / 1;
}

.fig > img,
.fig > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vertical-note {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1024px) {
  .masthead-note {
    display: none;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border-top: 1px solid var(--border);
    background: var(--bg);
  }

  .main-nav[data-open] .nav-list {
    display: flex;
  }

  .nav-list a {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    justify-content: flex-start;
  }

  .nav-list a::before {
    content: "0" counter(nav-index) " /";
    margin-right: 8px;
  }

  .nav-list a:hover {
    border-left-color: var(--accent2);
  }

  .nav-list a[aria-current="page"] {
    border-left-color: var(--accent);
    border-bottom-color: var(--border);
    background: var(--accent-soft);
  }

  .main-nav[data-open] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .main-nav[data-open] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .main-nav[data-open] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .ticker-meta {
    display: none;
  }

  .masthead {
    padding: var(--space-4) var(--space-2) var(--space-3);
  }

  .masthead-tagline {
    flex-direction: column;
    gap: 4px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-col:last-child {
    grid-column: auto;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
