:root {
  --bg: #070b16;
  --bg-soft: rgba(12, 19, 38, 0.86);
  --card: rgba(17, 24, 39, 0.72);
  --card-strong: rgba(12, 18, 32, 0.94);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(99, 102, 241, 0.32);
  --text: #e5eefb;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --accent-3: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 30px 80px rgba(2, 6, 23, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 22%),
    linear-gradient(180deg, #0a1020 0%, #060912 100%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(59, 130, 246, 0.18), transparent 20%),
    radial-gradient(circle at 80% 30%, rgba(168, 85, 247, 0.18), transparent 22%),
    radial-gradient(circle at 50% 75%, rgba(6, 182, 212, 0.14), transparent 24%);
  filter: blur(18px);
}

.topbar {
  width: min(1240px, calc(100vw - 32px));
  margin: 18px auto 0;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 14px;
  z-index: 10;
  border: 1px solid var(--border);
  background: rgba(7, 11, 22, 0.68);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.35);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #fff;
}

.page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 28px auto 60px;
  display: grid;
  gap: 30px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: stretch;
}

.hero-copy {
  padding: 24px 4px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d8b4fe;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.section-title-row h2 {
  margin: 14px 0 14px;
  font-size: clamp(2.4rem, 4vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.section-title-row h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  margin: 8px 0 0;
}

.hero p,
.faq-card p,
.muted-text,
.toolbar-note,
.selection-summary {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 28px 0 22px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.btn-primary,
.version-action {
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
}

.highlights {
  display: grid;
  gap: 10px;
}

.highlight-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.glass-card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--card), var(--card-strong));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-side {
  padding: 24px;
  display: flex;
  align-items: center;
}

.stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(8, 15, 29, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.stat-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.25;
  word-break: break-word;
}

.stat-card.wide {
  grid-column: 1 / -1;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.selection-summary {
  max-width: 420px;
  text-align: right;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.step {
  padding: 14px 16px;
  border-radius: 999px;
  text-align: center;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

.step.is-active,
.step.is-done {
  color: #fff;
  border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.26), rgba(6, 182, 212, 0.22));
}

.workspace-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar-card,
.control-card,
.list-card,
.versions-card,
.download-card,
.faq-card {
  padding: 22px;
}

.content-stack {
  display: grid;
  gap: 22px;
}

.card-header,
.versions-header,
.download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-header h3,
.download-card h3,
.faq-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(37, 99, 235, 0.28);
}

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

.brand-card,
.item-card,
.major-card {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text);
  text-align: left;
}

.brand-card:hover,
.item-card:hover,
.major-card:hover,
.version-action:hover {
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.3);
}

.brand-card.active,
.item-card.active,
.major-card.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(6, 182, 212, 0.16));
  border-color: rgba(99, 102, 241, 0.4);
}

.brand-card-name,
.item-card-name,
.major-card-name {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
}

.brand-card-meta,
.item-card-meta,
.major-card-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.search-box {
  flex: 1;
}

.search-box label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.search-box input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(5, 10, 20, 0.8);
  color: var(--text);
  border-radius: 14px;
  padding: 15px 16px;
  outline: none;
}

.search-box input:focus {
  border-color: rgba(56, 189, 248, 0.46);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

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

.item-list {
  display: grid;
  gap: 10px;
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.empty-list {
  min-height: 240px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(8, 15, 29, 0.38);
  padding: 20px;
}

.empty-state.small {
  min-height: 200px;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.versions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.versions-table thead {
  background: rgba(15, 23, 42, 0.92);
}

.versions-table th,
.versions-table td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  text-align: left;
  vertical-align: top;
}

.versions-table th {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 700;
}

.versions-table td {
  color: #d8e4f5;
  font-size: 0.94rem;
}

.version-meta-stack {
  display: grid;
  gap: 6px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 600;
}

.tag.success {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.22);
}

.tag.warning {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.22);
}

.version-action {
  padding: 10px 14px;
  font-size: 0.88rem;
}

.version-action.secondary {
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.download-section,
.faq-block,
.explorer-block {
  display: grid;
  gap: 20px;
}

.download-links {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.download-link-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(8, 15, 29, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.download-link-card strong {
  display: block;
  margin-bottom: 10px;
}

.download-link-card code {
  display: block;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.7;
  color: #c4e3ff;
}

.link-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.24);
  color: #dbeafe;
  cursor: pointer;
}

.challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(10px);
}

.challenge-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
}

.challenge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.challenge-header h3 {
  margin: 8px 0 0;
  font-size: 1.3rem;
}

.challenge-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.challenge-text {
  margin: 18px 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.challenge-expression {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(8, 15, 29, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.28);
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.challenge-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.challenge-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(5, 10, 20, 0.8);
  color: var(--text);
  border-radius: 14px;
  padding: 15px 16px;
  outline: none;
}

.challenge-input:focus {
  border-color: rgba(56, 189, 248, 0.46);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.challenge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

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

.hidden {
  display: none !important;
}

.loading-state {
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #e2e8f0;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .hero,
  .workspace-grid,
  .two-col-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .selection-summary {
    text-align: left;
    max-width: none;
  }

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

@media (max-width: 768px) {
  .topbar {
    padding: 14px 16px;
    width: calc(100vw - 20px);
  }

  .nav-links {
    display: none;
  }

  .page-shell {
    width: calc(100vw - 20px);
    margin-top: 18px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .toolbar,
  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

  .versions-table {
    min-width: 760px;
  }
}
