/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --bg-table: #0d1117;
  --border: #21262d;
  --border-light: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --gold: #f0b429;
  --gold-bg: rgba(240, 180, 41, 0.1);
  --silver: #8b949e;
  --bronze: #c9853a;
  --green: #3fb950;
  --green-bg: rgba(63, 185, 80, 0.1);
  --purple: #bc8cff;
  --purple-bg: rgba(188, 140, 255, 0.1);
  --red: #f85149;
  --orange: #ffa657;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

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

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

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 28px; }

.logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

#last-update {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ===== COMBINED BAR：Tab + Stats 同一行 ===== */
.combined-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 61px;
  z-index: 90;
}

.combined-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
}

/* Tab 按钮区域 */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 22px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(88, 166, 255, 0.04);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-icon { font-size: 15px; }

/* Stats 行内区域（右侧） */
.stats-inline {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-left: 1px solid var(--border);
}

.stat-item-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  gap: 1px;
  flex-shrink: 0;
}

.stat-item-inline + .stat-item-inline {
  border-left: 1px solid var(--border);
}

.stat-num-inline {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label-inline {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.stat-divider-inline {
  display: none; /* 用 border-left 代替 */
}

/* ===== TRACK FILTER TAGS ===== */
.track-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.track-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.track-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
}

.track-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
  font-weight: 600;
}

/* ===== HIDDEN UTILITY ===== */
.hidden { display: none !important; }

/* ===== TAB PANELS ===== */
.tab-panel { display: block; }

/* ===== MAIN SECTIONS ===== */
main { padding: 40px 0 60px; }

.section { margin-bottom: 56px; }

.section:first-child { margin-top: 20px; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(88, 166, 255, 0.2);
  margin-bottom: 8px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== DATE FILTER ===== */
.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.date-filter label {
  font-size: 13px;
  color: var(--text-secondary);
}

select {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

select:hover, select:focus { border-color: var(--accent); }

/* ===== TOP 3 GRID ===== */
.top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .top3-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .section-header { flex-direction: column; }
}

.top3-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.top3-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.top3-card.rank-1::before { background: linear-gradient(90deg, var(--gold), #ffd700); }
.top3-card.rank-2::before { background: linear-gradient(90deg, var(--silver), #c0c0c0); }
.top3-card.rank-3::before { background: linear-gradient(90deg, var(--bronze), #cd7f32); }

.top3-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
}

.rank-1 .card-rank-badge { background: var(--gold-bg); color: var(--gold); }
.rank-2 .card-rank-badge { background: rgba(139,148,158,0.15); color: var(--silver); }
.rank-3 .card-rank-badge { background: rgba(201,133,58,0.15); color: var(--bronze); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  color: inherit;
}

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

.card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.score-bar-fill.vibe { background: var(--accent); }
.score-bar-fill.moat { background: var(--purple); }
.score-bar-fill.track { background: var(--green); }
.score-bar-fill.growth { background: var(--orange); }

.score-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 20px;
  text-align: right;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.card-stars {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.total-score {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.total-score .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.rank-1 .total-score .num { color: var(--gold); }
.rank-2 .total-score .num { color: var(--silver); }
.rank-3 .total-score .num { color: var(--bronze); }

.total-score .denom {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  pointer-events: none;
}

#search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 7px 12px 7px 32px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  width: 220px;
  outline: none;
  transition: border-color var(--transition);
}

#search-input::placeholder { color: var(--text-muted); }
#search-input:focus { border-color: var(--accent); }

/* ===== HISTORY TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table thead {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.history-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
}

.history-table th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}

.history-table th.sortable:hover { color: var(--text-primary); }
.history-table th.active { color: var(--accent); }

.history-table th.sortable::after {
  content: ' ↕';
  opacity: 0.4;
  font-size: 10px;
}

.history-table th.active.asc::after { content: ' ↑'; opacity: 1; }
.history-table th.active.desc::after { content: ' ↓'; opacity: 1; }

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

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

.history-table tbody tr {
  background: var(--bg-table);
  transition: background var(--transition);
  cursor: pointer;
}

.history-table tbody tr:hover { background: var(--bg-card); }

.col-rank { width: 48px; text-align: center; }
.col-title { min-width: 200px; max-width: 320px; }
.col-date { width: 100px; }
.col-stars { width: 76px; text-align: center; }
.col-score { width: 64px; text-align: center; }
.col-top { width: 56px; text-align: center; }

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
}

.project-title {
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.project-title a {
  color: inherit;
}

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

.project-desc-short {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
}

.score-chip.total {
  min-width: 34px;
  height: 26px;
  font-size: 13px;
}

.score-chip.high { background: rgba(63,185,80,0.15); color: var(--green); }
.score-chip.mid { background: rgba(255,166,87,0.15); color: var(--orange); }
.score-chip.low { background: rgba(139,148,158,0.1); color: var(--text-secondary); }

.top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.date-tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.stars-tag {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

/* ===== LOADING ===== */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
  gap: 12px;
  grid-column: 1 / -1;
}

.loading-cell {
  text-align: center;
  padding: 60px !important;
}

.loading-cell .spinner, .loading-placeholder .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 1060px;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 1;
  flex-shrink: 0;
}

.modal-close:hover { background: var(--red); border-color: var(--red); color: #fff; }

.modal-content { padding: 20px 24px 20px; flex: 1; overflow-y: auto; }

/* 弹窗双栏布局 */
.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 16px;
  margin-top: 12px;
}

.modal-body-left,
.modal-body-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 评分四格改为2x2 */
.modal-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 700px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
}

.modal-rank-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.modal-title a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.modal-title a::after {
  content: '↗';
  font-size: 14px;
  opacity: 0.6;
}

.modal-stars-row {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

.modal-section { margin-bottom: 10px; }

.modal-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-section-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.modal-metaphor {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

.modal-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-score-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-score-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
}

.modal-score-badge {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
}

.modal-score-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.modal-score-value.vibe { color: var(--accent); }
.modal-score-value.moat { color: var(--purple); }
.modal-score-value.track { color: var(--green); }
.modal-score-value.growth { color: var(--orange); }

.modal-score-max {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-score-bar-wrap {
  width: 100%;
}

.modal-score-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.modal-score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.modal-score-bar-fill.vibe { background: var(--accent); }
.modal-score-bar-fill.moat { background: var(--purple); }
.modal-score-bar-fill.track { background: var(--green); }
.modal-score-bar-fill.growth { background: var(--orange); }

.modal-score-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.modal-total {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.modal-total-label { font-size: 12px; color: var(--text-secondary); }
.modal-total-value { font-size: 24px; font-weight: 800; color: var(--gold); }
.modal-total-denom { font-size: 12px; color: var(--text-muted); }

/* ===== 使用场景 ===== */
.modal-usage {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-scene-item {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}

.usage-scene-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

.site-footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
}

.page-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
  cursor: default;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Trending 弹窗：单栏全宽布局 */
.modal-trending-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* ===== TRENDING TABLE ===== */
.trending-list-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.trending-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trending-table thead {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.trending-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

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

.trending-table tbody tr {
  background: var(--bg-table);
  transition: background var(--transition);
  cursor: pointer;
}

.trending-table tbody tr:hover { background: var(--bg-card); }

.trending-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent) !important;
  background: rgba(88, 166, 255, 0.08) !important;
  border: 1px solid rgba(88, 166, 255, 0.2);
}

/* 语言标签 */
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lang-dot-inline {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 4px;
}

/* 今日新增 Stars */
.stars-today-tag {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.stars-today-tag.has-stars {
  color: var(--green);
  font-weight: 600;
}

.forks-tag {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* trending 表格列宽 */
.trending-table .col-rank { width: 52px; text-align: center; }
.trending-table .col-title { min-width: 220px; }
.trending-table .col-lang { width: 110px; }
.trending-table .col-stars { width: 90px; text-align: right; }
.trending-table .col-stars-today { width: 100px; text-align: right; }
.trending-table .col-forks { width: 90px; text-align: right; }

/* Trending 弹窗：单栏全宽布局 */
.modal-trending-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* ===== TRENDING TABLE ===== */
.trending-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* 弹窗 meta 行（Stars + 今日新增 + Forks + 语言） */
.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  margin-bottom: 2px;
}

.modal-stars-row {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.modal-stars-today {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.modal-forks {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-lang {
  font-size: 12px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
}

/* ===== REDDIT 黑马榜 ===== */

/* 子版块导航 */
.reddit-sub-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.reddit-sub-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

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

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

/* 观点快速筛选 */
.reddit-verdict-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reddit-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}

.reddit-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.reddit-filter-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.reddit-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
  font-weight: 600;
}

.reddit-filter-btn.filter-yes.active {
  border-color: #22c55e;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}

.reddit-filter-btn.filter-watch.active {
  border-color: #f59e0b;
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
}

.reddit-filter-btn.filter-no.active {
  border-color: #ef4444;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

/* 帖子列表 */
.reddit-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 帖子卡片 */
.reddit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.reddit-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.reddit-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.reddit-rank {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

.reddit-card-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.reddit-card-title a {
  color: inherit;
  text-decoration: none;
}

.reddit-card-title a:hover {
  color: var(--accent);
}

.reddit-heat {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.heat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.heat-score {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.heat-1 { background: rgba(100,100,100,0.15); color: var(--text-secondary); }
.heat-2 { background: rgba(59,130,246,0.15); color: #3b82f6; }
.heat-3 { background: rgba(245,158,11,0.15); color: #f59e0b; }
.heat-4 { background: rgba(249,115,22,0.15); color: #f97316; }
.heat-5 { background: rgba(239,68,68,0.15); color: #ef4444; }

.reddit-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.reddit-sub-label {
  color: var(--accent);
  font-weight: 500;
}

.reddit-card-summary {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reddit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.reddit-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reddit-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

.reddit-read-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

/* Reddit Modal */
.modal-reddit-grid {
  padding: 20px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.heat-dots-row {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.heat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.15s;
}

.heat-dot.active {
  background: #f97316;
}

.heat-score-big {
  font-size: 20px;
  font-weight: 700;
}

.reddit-heat-detail {
  margin-top: 6px;
}

/* ===== Reddit 黑马榜 v2 新增样式 ===== */

/* 卡片标题：中文主标题 + 英文副标题 */
.reddit-card-title-wrap {
  flex: 1;
}

.reddit-card-title-en {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 观点结论（卡片内）*/
.reddit-verdict {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid;
}

.verdict-yes {
  background: rgba(34,197,94,0.08);
  border-color: #22c55e;
  color: #16a34a;
}

.verdict-watch {
  background: rgba(245,158,11,0.08);
  border-color: #f59e0b;
  color: #d97706;
}

.verdict-no {
  background: rgba(239,68,68,0.08);
  border-color: #ef4444;
  color: #dc2626;
}

/* Modal 中的观点结论 */
.modal-verdict {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 4px solid;
}

/* Modal 中英文原标题 */
.modal-title-en {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  padding: 0 24px;
  line-height: 1.4;
}

/* 综合评分徽章（卡片meta行）*/
.reddit-total-score {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(139,92,246,0.12);
  color: #7c3aed;
}
