:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --panel-2: #1f2540;
  --text: #e7e9f3;
  --muted: #9aa0b5;
  --accent: #6c8cff;
  --accent-2: #57e0b0;
  --danger: #ff6b6b;
  --border: #2a3050;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #0d1020, #0f1220 40%);
  color: var(--text);
  min-height: 100vh;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 18, 32, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { font-size: 20px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.search { flex: 1; display: flex; gap: 8px; }
.search input {
  flex: 1; padding: 10px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
}
.search button {
  padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #0b0e1a; font-weight: 600;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text); font-weight: 500; }
.badge {
  display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-2); color: #05231a; font-size: 12px; font-weight: 700; text-align: center;
}

/* Lab banner */
.lab-banner {
  background: rgba(255, 107, 107, 0.12);
  border-bottom: 1px solid rgba(255, 107, 107, 0.3);
  color: #ffd6d6; text-align: center; padding: 8px 16px; font-size: 14px;
}

/* Layout blocks */
main { padding-top: 26px; padding-bottom: 60px; }
.page-title { font-size: 26px; margin: 6px 0 18px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* Category chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 14px;
}
.chip.active { background: var(--accent); color: #0b0e1a; border-color: var(--accent); font-weight: 600; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card img { width: 100%; height: 160px; object-fit: cover; display: block; background: var(--panel-2); }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .name { font-weight: 600; }
.card .price { color: var(--accent-2); font-weight: 700; font-size: 18px; }
.card .tag {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--panel-2); color: var(--muted); padding: 2px 8px; border-radius: 6px; margin-right: 6px;
}

/* Buttons */
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: #0b0e1a; font-weight: 600; font-size: 14px;
}
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: #2a0000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Product detail */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.detail img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.detail h1 { margin-top: 0; }

/* Panels / forms */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.panel.narrow { max-width: 440px; margin: 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Cart / tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.right { text-align: right; }

/* Notices */
.notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.notice.ok { background: rgba(87,224,176,.12); border: 1px solid rgba(87,224,176,.3); color: #b9f5e2; }
.notice.err { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.3); color: #ffd6d6; }

/* API explorer */
pre {
  background: #0a0d1a; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow: auto; font-size: 13px; color: #cfe0ff; max-height: 420px;
}
.explorer-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .search { order: 3; width: 100%; }
  .two-col { grid-template-columns: 1fr; }
}
