:root {
  --bg: #0c0f14;
  --bg-elevated: #121722;
  --bg-card: #151b27;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf1;
  --muted: #8b95a8;
  --accent: #3dd6c6;
  --accent-dim: rgba(61, 214, 198, 0.15);
  --heat: #ffb547;
  --up: #4ade80;
  --down: #f87171;
  --flat: #94a3b8;
  --spark-up: #4ade80;
  --spark-down: #f87171;
  --spark-flat: #94a3b8;
  --radius: 12px;
  --font: "DM Sans", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.12), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 181, 71, 0.08), transparent), var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2a9d8f);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #04221e;
  letter-spacing: -0.02em;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
  margin-left: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-link:hover h1 {
  color: var(--accent);
}

.boards-section {
  margin-bottom: 1.75rem;
}

.boards-section-head {
  margin-bottom: 1rem;
}

.boards-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.boards-lede {
  margin: 0;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (min-width: 960px) {
  .boards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mini-board.card {
  overflow: visible;
}

.mini-board {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
}

.mini-board-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem 0.25rem;
  border-bottom: none;
}

.mini-board-hd h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.mini-board-more {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.mini-board-desc {
  margin: 0;
  padding: 0 1rem 0.65rem;
  line-height: 1.4;
}

.mini-board-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.65rem;
  border-top: 1px solid var(--border);
}

.mini-board-list li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mini-board-list li:last-child {
  border-bottom: none;
}

.mini-rank {
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mini-board-list li:nth-child(1) .mini-rank {
  color: var(--heat);
}

.mini-kw {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.mini-heat {
  font-variant-numeric: tabular-nums;
  color: var(--heat);
  font-weight: 600;
  font-size: 0.78rem;
}

.mini-trend {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  justify-self: end;
}

.mini-empty {
  padding: 1rem;
  margin: 0;
}

.explore-cta {
  margin: 1rem 0 0;
}

.explore-cta a {
  color: var(--muted);
}

.explore-cta a:hover {
  color: var(--accent);
}

.list-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.breadcrumb {
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
}

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

.list-header-block {
  margin-bottom: 1.25rem;
}

.list-h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.list-sub {
  margin: 0 0 0.5rem;
  max-width: 60ch;
  line-height: 1.5;
}

.list-meta {
  margin: 0;
}

.list-meta strong {
  color: var(--text);
  font-weight: 600;
}

.list-table-card {
  padding-bottom: 0.5rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  padding: 1rem 1rem 1.15rem;
  border-top: 1px solid var(--border);
}

.pagination.pagination-hidden {
  display: none;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

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

button.page-link {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.page-link.is-current {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.page-link.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-info {
  order: 0;
}

@media (min-width: 640px) {
  .pagination {
    justify-content: flex-start;
  }
  .pagination-info {
    order: unset;
    margin: 0 0.25rem;
  }
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.hero h2 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero .lede {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.stat-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat-card .value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.filters {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 5.5rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 120px;
}

.filter-field label {
  font-size: 0.75rem;
  color: var(--muted);
}

.filter-field input,
.filter-field select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  min-width: 140px;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent);
}

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.layout-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .layout-split {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-hd {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-hd h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(61, 214, 198, 0.04);
}

.col-rank {
  width: 56px;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
}

tbody tr:nth-child(1) .rank-num {
  background: linear-gradient(135deg, rgba(255, 181, 71, 0.25), rgba(255, 181, 71, 0.05));
  color: var(--heat);
}

tbody tr:nth-child(2) .rank-num {
  color: #cbd5e1;
}

tbody tr:nth-child(3) .rank-num {
  color: #b45309;
}

.col-kw {
  min-width: 200px;
}

.related {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.related span {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pill-platform {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 198, 0.35);
  color: var(--accent);
}

.col-heat {
  font-weight: 600;
  color: var(--heat);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-trend {
  white-space: nowrap;
}

.trend-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-right: 0.5rem;
}

.t-up {
  color: var(--up);
}
.t-down {
  color: var(--down);
}
.t-flat {
  color: var(--flat);
}

.spark {
  width: 88px;
  height: 28px;
  vertical-align: middle;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 2rem !important;
}

.side-card {
  padding: 1rem;
}

.side-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 3rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
}

.bar-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2a9d8f);
}

.bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 0.75rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0.25rem 0;
}
