/* ============ Base & theme variables ============ */
:root,
[data-theme="dark"] {
  --bg: #0a0e17;
  --bg-soft: #0f1522;
  --card: #121a2b;
  --card-hover: #16213a;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e8edf7;
  --text-dim: #9aa8c2;
  --text-faint: #64748b;
  --accent: #4d6bfe;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #4d6bfe 0%, #22d3ee 100%);
  --star: #fbbf24;
  --nav-bg: rgba(10, 14, 23, 0.82);
  --hero-title: linear-gradient(180deg, #ffffff 30%, #a5b4d4 100%);
  --hero-glow: radial-gradient(ellipse at center, rgba(77, 107, 254, 0.22) 0%, rgba(34, 211, 238, 0.08) 45%, transparent 70%);
  --code-bg: rgba(6, 9, 16, 0.9);
  --code-fg: #cbd5e1;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.35);
  --seg-active-bg: rgba(77, 107, 254, 0.2);
  --seg-active-fg: #b7c6ff;
  --icon-bg: rgba(77, 107, 254, 0.1);
  --icon-border: rgba(77, 107, 254, 0.22);
  --toast-bg: rgba(18, 26, 43, 0.95);
  --mark-bg: rgba(251, 191, 36, 0.25);
  --mark-fg: #fcd34d;
  --copy-fg: #93a8ff;
  --radius: 14px;
  --nav-h: 64px;
  font-size: 16px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #64748b;
  --accent: #3b5bfd;
  --accent-2: #0891b2;
  --accent-grad: linear-gradient(135deg, #4d6bfe 0%, #0ea5e9 100%);
  --star: #d97706;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --hero-title: linear-gradient(180deg, #0f172a 20%, #334155 100%);
  --hero-glow: radial-gradient(ellipse at center, rgba(77, 107, 254, 0.14) 0%, rgba(14, 165, 233, 0.08) 45%, transparent 70%);
  --code-bg: #0f172a;
  --code-fg: #cbd5e1;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.1);
  --seg-active-bg: rgba(77, 107, 254, 0.12);
  --seg-active-fg: #3b5bfd;
  --icon-bg: rgba(77, 107, 254, 0.08);
  --icon-border: rgba(77, 107, 254, 0.2);
  --toast-bg: rgba(255, 255, 255, 0.96);
  --mark-bg: rgba(245, 158, 11, 0.22);
  --mark-fg: #b45309;
  --copy-fg: #4d6bfe;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.hidden { display: none !important; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -56px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ Top navigation ============ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; letter-spacing: 0.3px; }
.brand-logo { font-size: 1.4rem; }
.brand-text b {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mainnav { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 16px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav-link.active { color: var(--text); background: rgba(77, 107, 254, 0.16); }

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  width: 240px;
  margin: 0;
  transition: border-color 0.18s ease;
}
.search-box:focus-within { border-color: var(--accent); }
.search-icon { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0 8px;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input[type="search"]::-webkit-search-decoration,
.search-box input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color 0.16s ease, background 0.16s ease;
}
.search-clear:hover { color: var(--text); background: rgba(148, 163, 184, 0.16); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  transition: all 0.18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn .icon-sun { display: block; }
.icon-btn .icon-moon { display: none; }
[data-theme="light"] .icon-btn .icon-sun { display: none; }
[data-theme="light"] .icon-btn .icon-moon { display: block; }

/* ============ Views ============ */
main { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }
.view { display: none; animation: fadeUp 0.35s ease; }
.view.active { display: block; }

.page-head { padding: 48px 0 20px; }
.page-head h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.3; margin: 0 0 8px; }
.page-head p { color: var(--text-dim); margin: 0; }

.page-not-found {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}
.page-not-found h1 { font-size: 1.8rem; font-weight: 800; margin: 0 0 12px; }
.page-not-found p { color: var(--text-dim); margin: 0 0 8px; }
.page-not-found a { color: var(--accent); font-weight: 600; }
.page-not-found a:hover { text-decoration: underline; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 24px 56px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 420px;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  position: relative;
  font-size: 0.82rem;
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.07);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-title {
  position: relative;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 1px;
  background: var(--hero-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  position: relative;
  color: var(--text-dim);
  font-size: 1.06rem;
  margin: 18px auto 28px;
  max-width: 620px;
}

.hero-filters { position: relative; text-align: left; }

.hero-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
}
.hero-search-row .filter-search { flex: 1; }
.search-submit {
  flex-shrink: 0;
  height: 42px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(77, 107, 254, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(77, 107, 254, 0.4);
}

.hero-stats {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 0.82rem; color: var(--text-faint); }
.stat-divider { width: 1px; height: 34px; background: var(--border); }

/* ============ Section head ============ */
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 64px 0 22px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.45rem; font-weight: 700; }
.section-note { color: var(--text-faint); font-size: 0.88rem; }
.section-more {
  margin-left: auto;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.section-more:hover { text-decoration: underline; }

/* ============ Card grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover { background: var(--card-hover); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: flex-start; gap: 13px; }
.card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  border-radius: 12px;
  overflow: hidden;
}
.card-icon img,
.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-title-wrap { flex: 1; min-width: 0; }
.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-repo {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: Consolas, monospace;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
  font-size: 0.75rem;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 2px 10px;
  border-radius: 999px;
}
.badge-link {
  cursor: pointer;
  transition: all 0.18s ease;
}
.badge-link:hover {
  background: rgba(34, 211, 238, 0.18);
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.card-stars { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--star); font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.card-updated { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; }

/* Staggered entrance for listing grids */
#view-models .grid > .card { animation: fadeUp 0.4s ease backwards; }
#view-models .grid > .card:nth-child(2) { animation-delay: 0.04s; }
#view-models .grid > .card:nth-child(3) { animation-delay: 0.08s; }
#view-models .grid > .card:nth-child(4) { animation-delay: 0.12s; }
#view-models .grid > .card:nth-child(5) { animation-delay: 0.16s; }
#view-models .grid > .card:nth-child(6) { animation-delay: 0.2s; }
#view-models .grid > .card:nth-child(n+7) { animation-delay: 0.24s; }

.article-card .article-name {
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Sort toolbar ============ */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sort-select {
  height: 42px;
  padding: 0 34px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa8c2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
}
.sort-select:hover, .sort-select:focus { border-color: var(--border-strong); outline: none; }

/* ============ Pagination ============ */
.list-pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 0 8px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.16s ease;
  cursor: pointer;
}
.page-btn:hover:not(.disabled) {
  color: var(--text);
  border-color: var(--accent);
  background: var(--card-hover);
}
.page-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(77, 107, 254, 0.3);
}
.page-btn.disabled { opacity: 0.35; cursor: default; }
.page-ellipsis { color: var(--text-faint); padding: 0 4px; font-size: 0.9rem; user-select: none; }
.page-info { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; white-space: nowrap; }

/* ============ Filter bar / chips ============ */
.search-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 200px;
  width: auto;
  height: 42px;
  border-radius: 12px;
}
.filter-bar .list-toolbar { margin-bottom: 0; }

.category-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 0 2px 14px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: thin;
}
.category-chips::-webkit-scrollbar { height: 6px; }
.category-chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.chip .count {
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.14);
  padding: 1px 8px;
  border-radius: 999px;
}
.chip.active .count { background: rgba(255, 255, 255, 0.22); }

/* ============ Detail pages ============ */
.detail-page { padding: 44px 0 70px; animation: fadeUp 0.3s ease; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  margin-bottom: 28px;
  transition: all 0.18s ease;
  text-decoration: none;
}
.detail-back:hover { color: var(--text); border-color: var(--border-strong); background: var(--card-hover); }

.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.detail-icon {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  border-radius: 18px;
  overflow: hidden;
}
.detail-header-info { flex: 1; min-width: 0; }
.detail-title { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 0; }
.detail-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.detail-meta .updated { font-size: 0.82rem; color: var(--text-faint); }

/* Quick stats under the detail title */
.detail-quick-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.quick-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.quick-stat svg { color: var(--star); flex-shrink: 0; }
.quick-stat b { color: var(--text); }
.quick-stat-open { color: #34d399; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }

/* Sticky section navigation inside detail pages */
.detail-toc {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  z-index: 10;
}
.detail-toc a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}
.detail-toc a:hover { color: var(--text); background: rgba(148, 163, 184, 0.1); }
.detail-toc a.active { color: var(--seg-active-fg); background: var(--seg-active-bg); }
.detail-section[id] { scroll-margin-top: calc(var(--nav-h) + 76px); }

/* Section head row inside detail sections */
.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-section-head .detail-section-title { margin-bottom: 0; }

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
.detail-main { min-width: 0; }
/* Safety net: nothing in the main column may overflow it, even if rendered
   markup escapes the .markdown-body wrapper (malformed model-card HTML). */
.detail-main img { max-width: 100%; height: auto; }
.detail-main pre { max-width: 100%; overflow-x: auto; }
.detail-main table { max-width: 100%; }
.detail-sidebar { position: sticky; top: calc(var(--nav-h) + 24px); }

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.sidebar-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.sidebar-card .github-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: Consolas, monospace;
  transition: color 0.18s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.sidebar-card .github-link:hover { color: var(--accent-2); border-color: var(--border-strong); }

/* Model Info card: Source button pinned to the card bottom, centered */
.sidebar-card .github-link.source-btn {
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin: 14px 0 0;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
}
.sidebar-card .github-link.source-btn:hover { color: var(--accent-2); }

.sidebar-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.sidebar-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sidebar-stat svg { color: var(--text-faint); flex-shrink: 0; }
.sidebar-stat b { color: var(--text); font-size: 0.92rem; }
.sidebar-stat span { font-size: 0.82rem; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }

/* Score visualization in sidebar */
.score-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.score-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.score-max { font-size: 0.85rem; color: var(--text-faint); }
.score-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}
.score-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Sidebar action buttons */
.sidebar-actions { display: flex; gap: 8px; }
.sidebar-actions .compare-btn {
  flex: 1;
  justify-content: center;
  padding: 9px 10px;
  min-width: 0;
}
button.compare-btn { font-family: inherit; }
.compare-btn.copied {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  gap: 10px;
}
.meta-label { color: var(--text-faint); }
.meta-value { color: var(--text-dim); font-family: Consolas, monospace; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-section { margin-bottom: 36px; }
.detail-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

.detail-desc,
.markdown-body {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.85;
}

.detail-desc p,
.markdown-body p { margin: 0 0 0.9em; }
.detail-desc p:last-child,
.markdown-body p:last-child { margin-bottom: 0; }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.4;
  margin: 1.35em 0 0.55em;
}
.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.2rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body h4,
.markdown-body h5 { font-size: 1rem; }

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body h4:first-child { margin-top: 0; }

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 0.9em;
  padding-left: 1.35em;
}
.markdown-body li { margin: 0.28em 0; }

.markdown-body pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 0.9em;
  font-size: 0.88rem;
  line-height: 1.65;
}

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--icon-bg);
  padding: 0.12em 0.38em;
  border-radius: 5px;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Pygments syntax highlighting (monokai palette on the dark code background) */
.codehilite .c,
.codehilite .ch,
.codehilite .cm,
.codehilite .cp,
.codehilite .cpf,
.codehilite .c1,
.codehilite .cs { color: #75715e; font-style: italic; }
.codehilite .k,
.codehilite .kc,
.codehilite .kd,
.codehilite .kp,
.codehilite .kr,
.codehilite .kt,
.codehilite .no { color: #66d9ef; }
.codehilite .kn,
.codehilite .o,
.codehilite .ow,
.codehilite .nt { color: #f92672; }
.codehilite .l,
.codehilite .m,
.codehilite .mb,
.codehilite .mf,
.codehilite .mh,
.codehilite .mi,
.codehilite .mo,
.codehilite .il,
.codehilite .se { color: #ae81ff; }
.codehilite .s,
.codehilite .ld,
.codehilite .sa,
.codehilite .sb,
.codehilite .sc,
.codehilite .dl,
.codehilite .sd,
.codehilite .s2,
.codehilite .sh,
.codehilite .si,
.codehilite .sx,
.codehilite .sr,
.codehilite .s1,
.codehilite .ss { color: #e6db74; }
.codehilite .na,
.codehilite .nc,
.codehilite .nd,
.codehilite .ne,
.codehilite .nf,
.codehilite .fm { color: #a6e22e; }
.codehilite .n,
.codehilite .nb,
.codehilite .bp,
.codehilite .ni,
.codehilite .nl,
.codehilite .nn,
.codehilite .nx,
.codehilite .py,
.codehilite .nv,
.codehilite .vc,
.codehilite .vg,
.codehilite .vi,
.codehilite .vm,
.codehilite .p,
.codehilite .esc,
.codehilite .g,
.codehilite .w { color: #f8f8f2; }
.codehilite .ge { font-style: italic; }
.codehilite .gs { font-weight: 700; }
.codehilite .gp { color: #f92672; font-weight: 700; }
.codehilite .gu { color: #75715e; }
.codehilite .gd { color: #f92672; }
.codehilite .gi { color: #a6e22e; }
.codehilite .go { color: #66d9ef; }
.codehilite .err { color: #f92672; }

.markdown-body blockquote {
  margin: 0 0 0.9em;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid var(--accent);
  color: var(--text-faint);
}

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

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.5em 0;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 0.9em;
  font-size: 0.9rem;
}
.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border-strong);
  padding: 8px 12px;
  text-align: left;
}
.markdown-body th { background: var(--icon-bg); color: var(--text); font-weight: 600; }

.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.3em 0; }
.markdown-body strong { color: var(--text); font-weight: 650; }

.markdown-body { overflow-x: auto; overflow-wrap: break-word; }
.markdown-body h6 {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 1.2em 0 0.5em;
}
.markdown-body details {
  margin: 0 0 0.9em;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.markdown-body summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.markdown-body video {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.5em 0;
}
.markdown-body dl { margin: 0 0 0.9em; }
.markdown-body dt { font-weight: 650; color: var(--text); margin-top: 0.5em; }
.markdown-body dd { margin: 0.15em 0 0.4em 1.2em; }
.markdown-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--icon-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.4em;
}
.markdown-body sub,
.markdown-body sup { font-size: 0.75em; }
.markdown-body table { display: block; overflow-x: auto; }
.hf-card > p:first-child img,
.hf-card > p:nth-child(-n+3) img {
  display: inline-block;
  width: auto;
  max-height: 28px;
  margin: 0 4px 6px 0;
  border-radius: 4px;
  vertical-align: middle;
}

/* ============ Install block ============ */
.install-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 36px;
}
.install-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.install-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 18px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.18s ease;
}
.install-tab:hover { color: var(--text); }
.install-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }

.install-panel { display: none; padding-top: 16px; }
.install-panel.active { display: block; animation: fadeUp 0.25s ease; }
.install-hint { font-size: 0.85rem; color: var(--text-faint); margin-bottom: 10px; }

.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 13px 15px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
}
.code-box code { flex: 1; color: var(--code-fg); overflow-x: auto; white-space: nowrap; }
.prompt-box { align-items: flex-start; }
.prompt-box code { white-space: pre-wrap; line-height: 1.7; }

.copy-btn {
  flex-shrink: 0;
  background: rgba(77, 107, 254, 0.14);
  border: 1px solid rgba(77, 107, 254, 0.35);
  color: var(--copy-fg);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 8px;
  transition: all 0.18s ease;
}
.copy-btn:hover { background: rgba(77, 107, 254, 0.28); color: #fff; }
.copy-btn.copied { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.4); color: #34d399; }

/* ============ Image carousel ============ */
.image-carousel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.carousel-stage { position: relative; }
.carousel-viewport { overflow: hidden; width: 100%; }
.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--code-bg);
}
.carousel-slide img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.carousel-btn:hover:not(:disabled) {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--accent);
}
.carousel-btn:disabled {
  color: var(--text-faint);
  background: color-mix(in srgb, var(--text-faint) 22%, var(--card));
  border-color: var(--border);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px 12px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.45;
  cursor: pointer;
  transition: width 0.22s ease, background 0.22s ease, opacity 0.22s ease;
}
.carousel-dot:hover { opacity: 0.8; }
.carousel-dot.active {
  width: 18px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 1;
}

/* ============ Info cards ============ */
.detail-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.info-card .detail-section-title { margin-bottom: 10px; }
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}
.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
}
.info-list .info-empty { color: var(--text-faint); padding-left: 0; }
.info-list .info-empty::before { display: none; }

/* ============ Tags ============ */
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tags .tag {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.detail-tags .tag:hover { color: var(--text); border-color: var(--accent); }
a.tag { cursor: pointer; }
a.tag:hover { background: var(--card-hover); }

/* ============ Article page ============ */
.article-page { max-width: 860px; margin: 0 auto; }
.article-header { margin-bottom: 30px; }
.article-header .detail-title { margin-bottom: 6px; }
.article-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 36px;
}
.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all 0.2s ease;
}
.article-nav-link:hover { border-color: var(--border-strong); background: var(--card-hover); transform: translateY(-2px); }
.article-nav-link.next { text-align: right; }
.article-nav-label { font-size: 0.78rem; color: var(--accent); font-weight: 600; }
.article-nav-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Empty state / Toast ============ */
.empty-state { text-align: center; padding: 80px 0; color: var(--text-dim); grid-column: 1 / -1; }
.empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.5; }
.empty-action { margin-top: 18px; }

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--toast-bg);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #34d399;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--border); padding: 40px 24px; }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 48px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-left { flex: 1; max-width: 560px; }
.footer-right { flex-shrink: 0; text-align: right; }
.footer-brand { font-size: 1.05rem; margin-bottom: 8px; color: var(--text); }
.footer-brand b {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-disclaimer { font-size: 0.78rem; color: var(--text-faint); margin: 8px 0 0; line-height: 1.5; }
.footer-links { font-size: 0.85rem; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.footer-link-row { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 14px; }
.footer-links a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { text-decoration: underline; }
.footer-copyright { font-size: 0.78rem; color: var(--text-faint); margin-top: 12px; }

/* ============ LLM Models ============ */
.card-params {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(77, 107, 254, 0.08);
  border: 1px solid rgba(77, 107, 254, 0.2);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.compare-btn:hover { background: rgba(77, 107, 254, 0.15); border-color: var(--accent); }

.sidebar-compare-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

/* Benchmark */
.benchmark-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.benchmark-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.benchmark-label {
  width: 120px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}
.benchmark-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.benchmark-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.benchmark-value {
  width: 48px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  flex-shrink: 0;
}

/* Pricing */
.pricing-table-wrap { overflow-x: auto; }
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.pricing-table th,
.pricing-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.pricing-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pricing-table td { color: var(--text); }
.pricing-unit { color: var(--text-faint); font-size: 0.78rem; white-space: nowrap; }

/* Compare page */
.model-selector {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.selector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 600;
  color: var(--text);
}
.selector-count { font-size: 0.85rem; color: var(--accent); }
.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.model-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.model-checkbox:hover { border-color: var(--border-strong); }
.model-checkbox.checked { border-color: var(--accent); background: rgba(77, 107, 254, 0.08); }
.model-checkbox input[type="checkbox"] { display: none; }
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.check-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }
.check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.check-name { font-weight: 600; line-height: 1.35; word-break: break-word; }
.check-company { font-size: 0.75rem; color: var(--text-faint); }
.selector-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.selector-hint { font-size: 0.82rem; color: var(--text-faint); }

/* Compare selector: search + selected chips */
.selector-search {
  width: 100%;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
}
.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 12px;
  background: rgba(77, 107, 254, 0.1);
  border: 1px solid rgba(77, 107, 254, 0.3);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  animation: fadeUp 0.2s ease;
}
.selected-chip .chip-icon { font-size: 0.95rem; }
.selected-chip .chip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  transition: background 0.16s ease, color 0.16s ease;
}
.chip-remove:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.selector-subhead {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.selector-empty {
  padding: 24px 0 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.btn {
  padding: 8px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Compare table */
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 600px;
}
.compare-table th,
.compare-table td {
  padding: 11px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.compare-col-header {
  min-width: 140px;
}
.compare-model-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}
.compare-model-name a { color: var(--text); text-decoration: none; }
.compare-model-name a:hover { color: var(--accent); }
.compare-model-company {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 400;
  margin-top: 3px;
}
.compare-row-label {
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  background: var(--bg-soft);
}
.compare-cell { color: var(--text); }
.compare-best {
  color: #34d399;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.06);
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .topnav-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .topnav-right { margin-left: 0; width: auto; flex: 1; }
  .search-box { flex: 1; width: auto; min-width: 0; }
  .hero { padding: 56px 8px 40px; }
  .hero-stats { gap: 18px; }
  .section-head { flex-direction: column; gap: 4px; align-items: flex-start; }
  .section-more { margin-left: 0; }
  .detail-page { padding: 30px 0 50px; }
  .detail-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .detail-icon { width: 64px; height: 64px; font-size: 2rem; border-radius: 14px; }
  .detail-title { font-size: 1.4rem; }
  .detail-quick-stats { gap: 6px; margin-top: 12px; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .detail-info-cards { grid-template-columns: 1fr; }
  .detail-toc { position: static; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .detail-toc::-webkit-scrollbar { display: none; }
  .detail-section[id] { scroll-margin-top: 20px; }
  .score-value { font-size: 1.45rem; }
  .filter-search { width: 100%; min-width: 0; }
  .filter-bar .list-toolbar { margin-left: 0; width: 100%; justify-content: flex-start; }
  .filter-bar .search-count { width: 100%; order: -1; }
  .article-body { padding: 20px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: left; }
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
  .footer-left { max-width: none; }
  .footer-right { text-align: center; }
  .footer-links { align-items: center; }
  .footer-link-row { justify-content: center; }
  .pick-list { grid-template-columns: 1fr; }
}

.home-intro, .category-intro, .verdict {
  max-width: 860px;
  margin: 8px auto 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.home-intro h2, .verdict h2 { margin: 0 0 10px; font-size: 1.25rem; }
.home-intro p, .category-intro p, .verdict p { color: var(--text-dim); line-height: 1.65; margin: 0 0 12px; }
.home-intro p:last-child, .category-intro p:last-child, .verdict p:last-child { margin-bottom: 0; }
.home-intro a, .category-intro a { color: var(--accent); }
.category-intro { margin-top: 0; }
.category-intro h2 { font-size: 1.15rem; margin: 18px 0 8px; }
.category-intro h2:first-child { margin-top: 0; }
.category-intro ul, .category-intro ol { margin: 0 0 12px; padding-left: 1.2rem; color: var(--text-dim); }
.editors-kicker { color: var(--text-faint); font-size: 0.85rem; margin: -4px 0 12px; }
.pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.pick {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; color: var(--text-dim); line-height: 1.5;
}
.pick:hover { border-color: var(--border-strong); background: var(--card-hover); }
.pick strong { color: var(--text); }
.pick-kind { font-size: 0.75rem; color: var(--accent); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.guide-more { display: flex; flex-direction: column; gap: 8px; }
.guide-more a { color: var(--accent); }
.contact-form { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-dim); }
.contact-form input, .contact-form textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
.form-error { color: #f87171; margin: 0; font-size: 0.85rem; }
.form-success { color: #34d399; font-weight: 600; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }


/* ============ Cookie consent banner ============ */
.consent-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow-lg);
}
.consent-copy { max-width: 720px; }
.consent-copy strong { display: block; margin-bottom: 4px; }
.consent-copy p { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; }
.consent-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .consent-banner { flex-direction: column; align-items: stretch; }
}

/* ============ Footer subscribe ============ */
.footer-subscribe { display: flex; gap: 8px; margin: 14px 0 8px; flex-wrap: wrap; position: relative; }
.footer-subscribe input[type="email"] {
  flex: 1 1 200px; min-width: 0;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font: inherit;
}
.footer-subscribe button {
  background: var(--accent-grad); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.footer-note { color: var(--text-dim); font-size: 0.85rem; margin: 4px 0 0; }
.footer-note-error { color: #f87171; }

/* ============ Ad slot ============ */
.ad-slot {
  margin: 22px 0; padding: 10px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--bg-soft); min-height: 90px;
}

/* ============ Editor's note blocks ============ */
.note-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: -4px 0 14px; font-size: 0.85rem; }
.note-rating { color: var(--star); font-weight: 700; }
.note-reviewed, .note-author { color: var(--text-faint); }
.note-author:hover { color: var(--accent); }
.note-blocks { display: flex; flex-direction: column; gap: 16px; }
.note-block {
  border-left: 2px solid var(--border-strong); padding-left: 14px;
}
.note-block-title { font-size: 1rem; margin: 0 0 6px; }
.note-pros { border-left-color: #34d399; }
.note-cons { border-left-color: #f59e0b; }

/* ============ Reader reviews & questions ============ */
.community-score { color: var(--text-dim); font-size: 0.85rem; }
.community-subtitle { font-size: 1rem; margin: 20px 0 10px; }
.community-empty { color: var(--text-faint); font-size: 0.9rem; }
.review-list, .question-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 14px; }
.review-item, .question-item {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-author { font-weight: 600; }
.review-stars { color: var(--star); letter-spacing: 1px; }
.review-date { color: var(--text-faint); font-size: 0.8rem; margin-left: auto; }
.review-body, .question-body { margin: 0; color: var(--text-dim); line-height: 1.6; }
.question-answer { margin: 8px 0 0; color: var(--text-dim); border-left: 2px solid var(--accent); padding-left: 10px; }
.community-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; position: relative; }
.community-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-dim); }
.community-form input, .community-form select, .community-form textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
.community-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.community-note { color: var(--text-faint); font-size: 0.8rem; margin: 0; }
@media (max-width: 640px) { .community-row { grid-template-columns: 1fr; } }

/* ============ Glossary ============ */
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.glossary-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.glossary-card:hover { border-color: var(--border-strong); background: var(--card-hover); }
.glossary-term { font-weight: 700; color: var(--text); }
.glossary-short { color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; }

/* ============ Collections ============ */
.collection-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: col; }
.collection-item {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.collection-item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.collection-kind { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); font-weight: 700; }
.collection-name { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.collection-name:hover { color: var(--accent); }
.collection-desc { margin: 8px 0; color: var(--text-dim); line-height: 1.6; }
.collection-link { color: var(--accent); font-size: 0.85rem; }
