/* 热门产品热度榜 - 多平台综合 */
:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --surface-hover: #1f1f24;
  --border: #2a2a30;
  --text: #e8e8ec;
  --text-muted: #9090a0;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --gold: #eab308;
  --font-sans: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Main */
.main {
  flex: 1;
  padding: 32px 0 48px;
}

.section {
  margin-bottom: 32px;
}

/* Filters */
.filters {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 64px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-btn.type[data-type="c"].active { background: #3b82f6; border-color: #3b82f6; }
.filter-btn.type[data-type="b"].active { background: #8b5cf6; border-color: #8b5cf6; }
.filter-btn.type[data-type="g"].active { background: #0ea5e9; border-color: #0ea5e9; }
.filter-btn.type[data-type="ai"].active { background: #ec4899; border-color: #ec4899; }

.platform-tabs {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tab {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.tab:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Rankings */
.rank-header {
  margin-bottom: 20px;
}

.rank-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
}

.rank-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.rank-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.rank-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.rank-table tbody tr:hover {
  background: var(--surface-hover);
}

.rank-table tbody tr:last-child td {
  border-bottom: none;
}

.col-rank {
  width: 72px;
  text-align: center;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.rank-num.top1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-num.top2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-num.top3 { background: linear-gradient(135deg, #b45309, #92400e); color: #fff; }
.rank-num.default { background: var(--border); color: var(--text-muted); }

.col-product {
  min-width: 160px;
}

.product-name {
  font-weight: 600;
  color: var(--text);
}

.col-type {
  width: 88px;
}

.type-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.type-tag.c { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.type-tag.b { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.type-tag.g { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.type-tag.ai { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

.col-score {
  width: 100px;
}

.score-num {
  font-weight: 700;
  color: var(--accent);
}

.col-trend {
  width: 80px;
}

.trend-up {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 500;
}

.trend-down {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
}

.trend-flat {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  background: var(--surface-hover);
  color: var(--text-muted);
}

.data-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.data-note p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
  }
  .rank-table th.col-platforms,
  .rank-table td.col-platforms {
    display: none;
  }
}
