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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --muted: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Nav */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.nav-sub {
  color: var(--muted);
  font-size: 0.85rem;
}
.nav-link {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--accent-hover); text-decoration: none; }

/* Main */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-hover), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-amazon { background: var(--orange); color: #000; border-color: var(--orange); font-weight: 600; }
.btn-amazon:hover { background: #d97706; border-color: #d97706; }

/* Alerts */
.alert {
  max-width: 500px;
  margin: 1.5rem auto;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.alert-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.alert-ok { border-color: var(--green); }
.alert-error { border-color: var(--red); color: var(--red); }
.ts { font-size: 0.8rem; color: var(--muted); margin-left: 0.5rem; text-align: center; }

/* Searching */
.searching {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  text-align: left;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.info-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  text-align: center;
}
.info-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Results */
.results-page { padding-top: 1rem; }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.filter-group select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  cursor: pointer;
  min-width: 110px;
}
.filter-group select:focus {
  border-color: var(--accent);
  outline: none;
}
.filter-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Architecture badge */
.arch-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.arch-x86 {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}
.arch-arm {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.arch-risc-v {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.arch-cell, .ram-cell {
  text-align: center;
  font-size: 0.82rem;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.results-header h2 { font-size: 1.5rem; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.results-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
}
thead {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
th {
  text-align: center;
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
td {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: middle;
}
tr:hover td { background: rgba(255,255,255,0.02); }
.title-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.title-cell span {
  max-width: 100%;
  word-wrap: break-word;
}
.thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.price-cell {
  font-weight: 700;
  color: var(--green);
  font-size: 1.05rem;
  white-space: nowrap;
}
td:first-child {
  color: var(--muted);
  font-size: 0.8rem;
  width: 40px;
}
.arch-cell, .ram-cell, .price-cell, td:last-child { white-space: nowrap; }
.title-cell { max-width: 100%; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.about h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.about p {
  max-width: 660px;
  margin-bottom: 1rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 700px) {
  .hero h1 { font-size: 2rem; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .title-cell span { max-width: 250px; }
  th, td { padding: 0.6rem 0.5rem; font-size: 0.82rem; }
}
