:root {
  color-scheme: dark;

  --bg: #070f22;
  --card: rgb(12 24 52 / 88%);
  --line: rgb(173 200 255 / 22%);
  --text: #eef4ff;
  --muted: #afc1e0;
  --gold: #f5c35a;
  --focus: #ffdb85;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 8% -8%, rgb(46 197 255 / 20%), transparent 36%), radial-gradient(circle at 95% 10%, rgb(255 109 77 / 16%), transparent 40%), linear-gradient(145deg, var(--bg), #0a1f48);
  font-family: MiSans, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(rgb(130 165 255 / 8%) 1px, transparent 1px), linear-gradient(90deg, rgb(130 165 255 / 8%) 1px, transparent 1px);
  background-size: 34px 34px;
}

[hidden] {
  display: none !important;
}

a {
  color: #ffe0a0;
  text-underline-offset: 3px;
}

button, input, select {
  font: inherit;
}

button, select {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.hero {
  padding: 38px 0 16px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
  background: linear-gradient(150deg, rgb(14 28 63 / 96%), rgb(9 20 46 / 90%));
  box-shadow: 0 16px 36px rgb(2 9 24 / 36%);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgb(245 195 90 / 20%), transparent 70%);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c7d5ed;
  font-size: 0.73rem;
  letter-spacing: 0.09em;
  flex-wrap: wrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgb(245 195 90 / 30%);
}

.edition {
  margin-left: auto;
  color: var(--gold);
  font-size: 0.72rem;
}

h1 {
  margin: 12px 0 0;
  font-size: clamp(1.9rem, 4.2vw, 2.65rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.title-dot {
  color: var(--gold);
  margin-left: 2px;
}

.sub {
  color: #ccdaef;
  margin: 11px 0 0;
  max-width: 76ch;
}

.chips, .page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  border: 1px solid rgb(176 201 255 / 26%);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.77rem;
  background: rgb(8 16 38 / 72%);
  color: #dce9ff;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffdd94, #f8be45);
  color: #1f3157;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
}

.page-nav a.nav-secondary {
  color: #ffe5b2;
  background: rgb(245 195 90 / 10%);
  border-color: rgb(245 195 90 / 38%);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 19px 17px;
  margin-bottom: 15px;
  background: var(--card);
  box-shadow: 0 12px 30px rgb(2 10 25 / 25%);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 13px;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

h3 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.section-note, .note {
  color: var(--muted);
  font-size: 0.81rem;
}

.note {
  margin: 9px 0 0;
  line-height: 1.7;
}

.kicker {
  display: block;
  color: #afc1df;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.unit-badge {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.75rem;
  color: #c8d9f7;
}

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

.stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 12px;
  background: linear-gradient(155deg, rgb(20 35 74 / 95%), rgb(10 21 47 / 90%));
}

.stat-label, .stat-detail {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.stat strong {
  display: block;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-weight: 750;
  line-height: 1.4;
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
}

.stat strong small {
  font-size: 0.7rem;
  font-weight: 500;
  color: #bfceeb;
}

.metric-fieldset {
  margin: 0 0 15px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.metric-fieldset legend {
  font-size: 0.81rem;
  margin-bottom: 8px;
  color: #d3e0f8;
}

.metric-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-switch label {
  position: relative;
  cursor: pointer;
  flex: 0 1 190px;
}

.metric-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.metric-switch span {
  display: block;
  padding: 10px 14px;
  background: #0c1934;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #c3d2ec;
  font-weight: 700;
}

.metric-switch small {
  margin-left: 6px;
  font-weight: 400;
  font-size: 0.75rem;
}

.metric-switch input:checked + span {
  border-color: var(--gold);
  background: rgb(245 195 90 / 13%);
  color: #ffe1a0;
}

.metric-switch input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.1fr 1.5fr;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > label {
  color: #d2e0fb;
  font-size: 0.79rem;
}

input:not([type="radio"], [type="checkbox"]), select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: #09162e;
  color: var(--text);
  border: 1px solid rgb(173 199 255 / 28%);
  border-radius: 10px;
  padding: 10px;
}

input::placeholder {
  color: #94a8cb;
}

.filter-actions {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 12px;
}

.filter-actions .note {
  margin: 0;
  max-width: 78ch;
}

.action-buttons, .fleet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-buttons {
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  border: 1px solid rgb(173 199 255 / 28%);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  background: #102247;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-primary {
  background: linear-gradient(180deg, #ffdd94, #f8be45);
  color: #1f3157;
  border-color: #f8be45;
}

.btn-soft {
  background: rgb(245 195 90 / 13%);
  border-color: rgb(245 195 90 / 45%);
  color: #ffe1a0;
}

.btn-ghost {
  background: #102143;
}

.status-line {
  color: #d7e6ff;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgb(7 15 34 / 45%);
  margin: 14px 0 12px;
}

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

.tier {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgb(8 17 37 / 60%);
}

.tier-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgb(23 40 78 / 62%);
  flex-wrap: wrap;
}

.tier-heading h3 {
  font-size: 0.85rem;
  color: #e0eaff;
}

.tier-heading span {
  color: #adbedc;
  font-size: 0.73rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
}

.gpu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgb(177 202 255 / 22%);
  border-radius: 10px;
  background: linear-gradient(150deg, rgb(22 40 80 / 90%), rgb(11 22 45 / 90%));
}

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  background: rgb(122 201 67 / 18%);
  color: #bde996;
  margin-bottom: 8px;
}

.badge.amd {
  background: rgb(255 109 77 / 20%);
  color: #ffd0c7;
}

.gpu-card h3 {
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

.gpu-meta {
  margin: 4px 0 0;
  color: #afc1df;
  font-size: 0.72rem;
}

.compute-value {
  font-size: 1.7rem;
  line-height: 1.3;
  color: #ffe0a0;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 3px;
}

.compute-value small {
  font-size: 0.65rem;
  color: #b8c8e3;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 4px;
}

.spec-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.spec-pills span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1731;
  padding: 2px 6px;
  color: #cbd9ef;
  font-size: 0.67rem;
}

.gpu-card .btn {
  width: 100%;
  margin-top: auto;
  min-height: 36px;
  padding: 6px;
  font-size: 0.75rem;
}

.table-note {
  margin-bottom: 12px;
}

.table-scroll {
  overflow: auto;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.spec-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 11px 10px;
  color: #dceaff;
  background: #15254b;
}

.spec-table td {
  padding: 10px;
  border-top: 1px solid rgb(177 202 255 / 14%);
  color: #cfddf5;
}

.spec-table tbody th {
  position: static;
  background: transparent;
  border-top: 1px solid rgb(177 202 255 / 14%);
  font-weight: 600;
}

.spec-table tbody tr:hover {
  background: rgb(29 52 100 / 35%);
}

.model-sub {
  display: block;
  color: #a5badc;
  font-size: 0.69rem;
  font-weight: 400;
}

.check-label {
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.check-label input {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
}

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

.source-link {
  font-size: 0.73rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.compare-card {
  padding: 14px;
  background: #0c1934;
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 0;
}

.compare-card h3 {
  min-height: 3em;
  overflow-wrap: anywhere;
}

.compare-card dl {
  margin: 11px 0;
}

.compare-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.compare-card dt {
  color: var(--muted);
}

.compare-card dd {
  margin: 0;
  color: #f5dfb0;
}

.compare-card .btn {
  width: 100%;
}

.fleet-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  align-items: end;
  gap: 10px;
}

.fleet-list {
  margin: 14px 0;
}

.empty-state {
  padding: 27px 16px;
  text-align: center;
  background: rgb(7 15 34 / 40%);
  border: 1px dashed rgb(173 200 255 / 30%);
  border-radius: 11px;
  color: #d8e5fa;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.81rem;
}

.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px 150px auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.fleet-row strong {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.fleet-row .row-total {
  font-variant-numeric: tabular-nums;
  color: #ffe0a0;
  font-size: 0.85rem;
  text-align: right;
}

.fleet-totals strong {
  font-size: 1.5rem;
}

.fleet-actions {
  margin-top: 14px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.guide-card {
  padding: 15px;
  background: rgb(11 21 45 / 78%);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.guide-number {
  display: block;
  color: #f5c35a;
  font-size: 0.75rem;
  margin-bottom: 9px;
}

.guide-card p, details p {
  color: #bfcfec;
  font-size: 0.81rem;
  line-height: 1.8;
  margin: 8px 0 0;
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #0c1934;
  margin-top: 8px;
}

summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: #dce9ff;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.source-list a {
  font-size: 0.8rem;
}

.source-list p {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 4px 0 0;
}

.page-footer {
  text-align: center;
  color: #a9bddf;
  font-size: 0.76rem;
  padding: 10px 0 24px;
}

.page-footer p {
  margin: 4px 0;
}

.scope-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.scope-nav button {
  padding: 13px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1833;
  color: #d9e5fa;
  min-width: 0;
  min-height: 76px;
}

.scope-nav button[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgb(245 195 90 / 12%);
  color: #ffe0a0;
}

.scope-nav strong {
  display: block;
  font-size: 0.9rem;
}

.scope-nav small {
  display: block;
  margin-top: 5px;
  font-size: 0.69rem;
  color: #afc1df;
}

.scope-nav strong span {
  margin-left: 4px;
  font-size: 0.76rem;
  color: #c4d3ed;
}

.family-search {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 14px;
}

.family-search > span {
  font-size: 0.73rem;
  color: var(--muted);
  margin-right: 4px;
}

.family-search button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  min-height: 36px;
  background: #0a1730;
  color: #dbe6f8;
  font-size: 0.74rem;
}

.family-search button:hover {
  border-color: var(--gold);
  color: #ffe0a0;
}

.compute-cell {
  color: #ffe0a0;
  font-weight: 700;
}

.spec-unverified .compute-cell {
  color: #b6c6e1;
  font-weight: 400;
}

.card-view .board {
  margin-top: 15px;
}

@media (max-width: 850px) {
  .scope-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.skip-link {
  position: fixed;
  top: -70px;
  left: 12px;
  z-index: 2000;
  padding: 10px 14px;
  background: white;
  color: #102754;
  border-radius: 9px;
}

.skip-link:focus {
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .cards, .compare-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 20px;
  }

  .hero-card {
    padding: 22px 16px;
  }

  .panel {
    padding: 16px 13px;
  }

  .stats, .cards, .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .metric-switch label {
    flex: 1;
  }

  .metric-switch span {
    padding: 9px;
    text-align: center;
  }

  .metric-switch small {
    display: block;
    margin: 0;
    font-size: 0.65rem;
  }

  .guide-grid, .source-list {
    grid-template-columns: 1fr;
  }

  .fleet-form {
    grid-template-columns: minmax(0, 1fr) 110px;
  }

  .fleet-form .btn {
    grid-column: 1 / -1;
  }

  .fleet-row {
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 8px;
  }

  .fleet-row .row-total {
    text-align: left;
  }

  .stat strong {
    font-size: 1.45rem;
  }

  .edition {
    font-size: 0.63rem;
  }
}

@media (max-width: 380px) {
  .wrap {
    width: calc(100% - 20px);
  }

  .hero-card {
    padding: 20px 13px;
  }

  .hero-card h1 {
    font-size: 1.85rem;
  }

  .eyebrow {
    font-size: 0.65rem;
  }

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

  .stat-label {
    font-size: 0.7rem;
  }

  .stat {
    padding: 11px 9px;
  }

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

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