/* ---------- CSS Variables ---------- */
:root {
  --bg-deep: #0A0E27;
  --bg-card: #0F1535;
  --bg-table: #141A3E;
  --accent: #00FF87;
  --accent-alt: #FF6B35;
  --accent-data: #6F8BFF;
  --paper: #F4F1EA;
  --ink: #1A1A2E;
  --text: #C7C9D9;
  --text-dim: rgba(199, 201, 217, 0.72);
  --warn: #9B2C2C;
  --font-display: "Rajdhani", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --container: 1280px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.36s;
  --header-height: 80px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

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

ul, ol {
  list-style: none;
}

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

a:hover {
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

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

::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

#main-content {
  scroll-margin-top: calc(var(--header-height) + 24px);
  min-height: 60vh;
  position: relative;
  z-index: 1;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease);
  box-shadow: 0 4px 20px rgba(0, 255, 135, 0.35);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--bg-deep);
}

/* ---------- Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 45%, var(--accent-alt) 100%);
  z-index: 2500;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.6);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(10, 14, 39, 0.92) 0%, rgba(10, 14, 39, 0.55) 70%, rgba(10, 14, 39, 0) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  background: rgba(15, 21, 53, 0.78);
  border: 1px solid rgba(0, 255, 135, 0.16);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 255, 135, 0.1);
  pointer-events: auto;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.header-inner::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.65;
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #00cc6e 100%);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 18% 100%, 0 82%);
  transition: transform 0.3s var(--ease);
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.25);
}

.brand:hover .brand-symbol {
  transform: rotate(-6deg) scale(1.05);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-alt);
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- Nav Toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(0, 255, 135, 0.08);
  border: 1px solid rgba(0, 255, 135, 0.24);
  border-radius: 14px;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: rgba(0, 255, 135, 0.16);
  border-color: rgba(0, 255, 135, 0.4);
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.15);
}

.nav-toggle[data-open] {
  background: rgba(0, 255, 135, 0.14);
}

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

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

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

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

/* ---------- Primary Nav ---------- */
.primary-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s, background 0.22s, box-shadow 0.22s;
  position: relative;
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(0, 255, 135, 0.07);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: rgba(0, 255, 135, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 135, 0.22);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background 0.2s, color 0.2s;
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 4px 24px rgba(0, 255, 135, 0.25);
}

.btn--primary:hover {
  background: #3dffa0;
  box-shadow: 0 6px 30px rgba(0, 255, 135, 0.4);
  color: var(--bg-deep);
}

.btn--accent {
  background: var(--accent-alt);
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 107, 53, 0.25);
}

.btn--accent:hover {
  background: #ff7d4d;
  box-shadow: 0 6px 30px rgba(255, 107, 53, 0.4);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(0, 255, 135, 0.4);
  color: var(--accent);
  clip-path: none;
  border-radius: var(--radius-pill);
}

.btn--ghost:hover {
  background: rgba(0, 255, 135, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 135, 0.15);
  color: var(--accent);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 13px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.tag--green {
  background: rgba(0, 255, 135, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 135, 0.28);
}

.tag--orange {
  background: rgba(255, 107, 53, 0.1);
  color: var(--accent-alt);
  border: 1px solid rgba(255, 107, 53, 0.28);
}

/* ---------- Eyebrow & Section Title ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(111, 139, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 28px;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.card:hover {
  border-color: rgba(0, 255, 135, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.card__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.card__text {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 0;
}

.card--orange::after {
  background: var(--accent-alt);
}

.card--orange:hover {
  border-color: rgba(255, 107, 53, 0.25);
}

/* ---------- Data Stats ---------- */
.data-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.data-value {
  font-family: var(--font-mono);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.data-value--orange {
  color: var(--accent-alt);
}

.data-value--blue {
  color: var(--accent-data);
}

.data-label {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

.breadcrumb-item a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: rgba(199, 201, 217, 0.35);
  font-family: var(--font-mono);
  font-size: 13px;
}

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

/* ---------- Image Frame ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.img-frame:hover img {
  transform: scale(1.03);
}

.img-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.16) 0%, transparent 42%, rgba(255, 107, 53, 0.12) 100%);
  z-index: 1;
  pointer-events: none;
}

.img-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  z-index: 2;
  pointer-events: none;
}

.img-frame--cut {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  border-radius: 0;
}

/* ---------- Data Flow Decoration ---------- */
.data-flow {
  position: relative;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-data), var(--accent-alt));
  border-radius: 2px;
  overflow: hidden;
  margin: 24px 0;
}

.data-flow::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  animation: flowSweep 3s ease-in-out infinite;
}

@keyframes flowSweep {
  0% { left: -30%; }
  100% { left: 110%; }
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid rgba(0, 255, 135, 0.1);
  position: relative;
  margin-top: 80px;
  overflow: hidden;
}

.site-footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 30%, var(--accent-alt) 70%, var(--accent-alt) 100%);
  opacity: 0.65;
  z-index: 1;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 24px 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 56px;
  margin-bottom: 48px;
}

/* Footer Brand / Intro */
.footer-brand {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 8px;
  position: relative;
}

.footer-brand::before {
  content: "斗";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 15px;
  font-weight: 700;
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 18% 100%, 0 82%);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.footer-trust {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 340px;
}

/* Footer Nav */
.footer-heading {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

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

/* Footer Contact */
.footer-email,
.footer-phone,
.footer-address {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 6px;
  position: relative;
  padding-left: 22px;
}

.footer-email::before,
.footer-phone::before,
.footer-address::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.6;
}

.footer-email::after,
.footer-phone::after,
.footer-address::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.8;
}

.footer-contact-link {
  margin-top: 16px;
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(199, 201, 217, 0.1);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}

.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.8;
  letter-spacing: 0.03em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 68px;
  }

  .site-header {
    padding: 12px 16px;
  }

  .header-inner {
    border-radius: 18px;
    padding: 8px 8px 8px 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(15, 21, 53, 0.98);
    border: 1px solid rgba(0, 255, 135, 0.2);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
    z-index: 100;
  }

  .primary-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }

  .nav-list {
    flex-direction: column;
    gap: 2px;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    white-space: normal;
  }

  .nav-link[aria-current="page"] {
    background: rgba(0, 255, 135, 0.1);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(0, 255, 135, 0.18);
  }

  .nav-link[aria-current="page"]::after {
    display: none;
  }

  .brand-text {
    font-size: 20px;
  }

  .brand-symbol {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .brand-version {
    display: none;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-inner {
    padding: 48px 24px 24px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 8px 12px;
  }

  .header-inner {
    padding: 6px 6px 6px 12px;
    gap: 10px;
  }

  .brand-text {
    font-size: 18px;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .container {
    padding: 0 16px;
  }
}

/* ---------- Reduced Motion ---------- */
@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;
  }

  ::selection {
    background: var(--accent);
    color: var(--bg-deep);
  }

  .data-flow::after {
    animation: none;
  }

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

  .skip-link {
    transition: none;
  }

  .header-inner,
  .card,
  .btn,
  .img-frame img {
    transition: none;
  }
}
