:root {
  --bg: #111415;
  --bg-soft: #171b1d;
  --bg-deep: #09090b;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-panel-2: rgba(40, 42, 44, 0.42);
  --bg-glass: rgba(20, 20, 25, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #e1e2e4;
  --text-soft: #ccc3d9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --purple: #7b39fc;
  --purple-soft: #d0bcff;
  --purple-glow: rgba(123, 57, 252, 0.4);
  --gold: #facc15;
  --success: #10b981;
  --danger: #ffb4ab;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.2);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-panel: 0 8px 16px rgba(0, 0, 0, 0.37);
  --shadow-large: 0 16px 40px rgba(0, 0, 0, 0.4);
  --font-body: "WenQuanYi Zen Hei", "Microsoft YaHei", "PingFang SC",
    "Noto Sans SC", sans-serif;
  --font-display: "Be Vietnam Pro", "Public Sans", "Segoe UI", sans-serif;
  --page-max: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  background: #0c0f10 !important;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar { width: 0; }

body.site-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #0c0f10 !important;
  color: var(--text-primary);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
}

body > *:not(.site-shell):not(.pf-shell):not(.modal-overlay):not(script):not(style):not(link):not(noscript) {
  display: none !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow: hidden;
  transition: opacity 0.38s ease, transform 0.38s ease, filter 0.38s ease;
}

.site-shell:not(.is-ready) {
  opacity: 0;
}

.site-shell.is-leaving {
  opacity: 0;
  transform: scale(0.98);
  filter: blur(4px);
}

.site-shell.with-white-frame {
  margin: 18px 24px;
  min-height: calc(100vh - 36px);
  box-shadow: var(--shadow-panel);
}

.ambient-orb {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(70px);
}

.page-wrap,
.topbar-inner,
.footer-inner {
  width: min(var(--page-max), 100%);
  margin: 0 auto;
}

.page-wrap {
  position: relative;
  padding-inline: 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}

.topbar.simple {
  position: relative;
}

.topbar-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
}

.topbar-compact .topbar-inner {
  min-height: 64px;
}

.brand-mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -1.2px;
  color: #fff;
  text-decoration: none;
}

.brand-mark.small {
  font-size: 20px;
  line-height: 28px;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: 28px;
}

.nav-actions {
  gap: 16px;
}

.nav-link {
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
}

.nav-link.active {
  color: var(--purple-soft);
  border-bottom: 2px solid var(--purple);
  padding-bottom: 6px;
}

.button,
.ghost-button,
.outline-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease, border-color 0.18s ease;
  font-family: var(--font-body);
}

.button:hover,
.ghost-button:hover,
.outline-button:hover,
.pill-button:hover {
  transform: translateY(-1px);
}

.button {
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 14px rgba(123, 57, 252, 0.32);
}

.button.round {
  border-radius: 999px;
}

.button.light {
  background: #fff;
  color: var(--purple);
}

.ghost-button {
  padding: 10px 16px;
  color: var(--text-muted);
  background: transparent;
}

.outline-button {
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.outline-button.round {
  border-radius: 999px;
}

.pill-button {
  padding: 7px 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  color: var(--text-soft);
  font-size: 12px;
}

.panel,
.glass-card,
.dark-card,
.metric-card,
.step-card,
.feature-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.glass-card,
.step-card,
.feature-card,
.table-card {
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
}

.dark-card,
.metric-card {
  background: var(--bg-panel-2);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 100px);
  line-height: 0.96;
  font-weight: 700;
}

.page-title.zh {
  font-family: var(--font-body);
  font-weight: 500;
}

.page-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: #020617;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 32px;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.warn {
  background: rgba(255, 180, 171, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 180, 171, 0.2);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.table th {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.table td {
  color: var(--text-secondary);
}

.sidebar-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: rgba(2, 6, 23, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  padding: 24px 0;
}

.sidebar-head,
.sidebar-foot {
  padding: 0 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}

.sidebar-link.active {
  color: var(--purple);
  border-left: 4px solid var(--purple);
  background: linear-gradient(
    90deg,
    rgba(123, 57, 252, 0.2) 0%,
    rgba(123, 57, 252, 0) 100%
  );
  padding-left: 28px;
}

.sidebar-sep {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 16px;
  padding-top: 16px;
}

.field,
.select {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  padding: 0 14px;
  font-family: var(--font-body);
}

.tabs {
  display: flex;
  gap: 12px;
}

.tab-button {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--purple);
  background: rgba(123, 57, 252, 0.1);
  color: var(--text-secondary);
}

.qr-box {
  background: rgba(12, 15, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 18, 0.76);
  backdrop-filter: blur(12px);
}

.modal-shell {
  position: relative;
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(18, 22, 24, 0.96) 0%, rgba(10, 12, 18, 0.98) 100%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.modal-shell.compact {
  width: min(460px, 100%);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .site-shell.with-white-frame {
    margin: 0;
    min-height: 100vh;
  }

  .topbar-inner,
  .page-wrap,
  .footer-inner {
    padding-inline: 20px;
  }

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

  .sidebar-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar-inner {
    min-height: 72px;
    padding-block: 12px;
  }

  .nav-links,
  .nav-actions .ghost-button {
    display: none;
  }

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

  .mobile-drawer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 6, 23, 0.94);
  }

.mobile-drawer a {
    color: var(--text-soft);
    text-decoration: none;
    padding: 12px 0;
  }

  .mobile-drawer a.active {
    color: var(--purple-soft);
  }
}

.ui-reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ui-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
  .page-wrap {
    padding-inline: 16px;
  }

  .page-subtitle {
    font-size: 15px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 16px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-shell {
    max-height: calc(100vh - 24px);
    border-radius: 20px;
  }
}
