:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2330;
  --border: #30363d;
  --accent: #2f81f7;
  --accent-2: #58a6ff;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

img { max-width: 100%; display: block; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.navbar-logo img {
  height: 32px;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}

.search-form {
  flex: 1;
  min-width: 200px;
  display: flex;
}

.search-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.search-form input:focus {
  border-color: var(--accent);
}

.search-form button {
  display: none;
}

.navbar-links {
  display: flex;
  gap: 14px;
  font-size: 14px;
}

.navbar-links a {
  color: var(--text-muted);
  font-weight: 500;
}

.navbar-links a:hover {
  color: var(--accent-2);
  text-decoration: none;
}

/* Layout */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .layout.with-sidebar {
    grid-template-columns: 1fr 260px;
  }
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
}

.device-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.device-card a { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }

.device-card .thumb {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  padding: 10px;
}

.device-card .thumb img {
  max-height: 120px;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

.device-card .info {
  padding: 10px 12px;
  flex: 1;
}

.device-card .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
  line-height: 1.35;
}

.device-card .meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Sidebar */
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  align-self: start;
}

.sidebar h3 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.sidebar a {
  font-size: 14px;
  color: var(--text);
  display: block;
  padding: 4px 0;
}

.sidebar a:hover { color: var(--accent-2); text-decoration: none; }

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-2); }

/* Device detail */
.device-hero {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.device-hero .photo {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-hero .photo img {
  max-height: 220px;
  width: auto;
}

.device-hero .meta { flex: 1; min-width: 220px; }

.device-hero .meta a.brand-link {
  font-size: 13px;
  color: var(--accent-2);
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.spec-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: #1c2330;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.spec-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.spec-table th, .spec-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.spec-table th {
  width: 150px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 28px 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  text-decoration: none;
}

.pagination .disabled {
  color: var(--text-muted);
  opacity: .5;
}

.pagination .current {
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a { color: var(--accent-2); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted);
}
