/* ========================================
   龙虎榜页面样式 - rankings/index.html
   依赖：/styles/main.css (导航、Footer样式)
   ======================================== */

/* Page-specific background override */
body {
  background: var(--bg-primary);
}

.mobile-menu .nav-link {
  padding: 12px 16px;
  font-size: 16px;
}

/* ===== RANKINGS PAGE ===== */
.rankings-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0px 20px 80px;
}

/* ===== PAGE HEADER ===== */
.rankings-header {
  text-align: center;
  padding: 120px 0 60px;
  position: relative;
}

.rankings-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(234,67,53,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.rankings-header h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.rankings-header h1 .gradient {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange), var(--accent-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rankings-header p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 12px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(255,71,87,0.1);
  color: var(--accent-red);
  border-radius: 20px;
}

/* 中国国旗图标 */
.icon-cn {
  display: inline-block;
  width: 20px;
  height: 14px;
  background: linear-gradient(135deg, #de2910 0%, #de2910 100%);
  border-radius: 2px;
  position: relative;
  vertical-align: middle;
  margin-right: 6px;
}

.icon-cn::before {
  content: '★';
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 8px;
  color: #ffde00;
  line-height: 1;
}



/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 32px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-red);
  border-bottom-color: var(--accent-red);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TOP 3 PODIUM ===== */
.top3-section {
  margin-bottom: 40px;
}

.top3-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 20px;
  align-items: end;
  max-width: 900px;
  margin: 0 auto;
}

.top3-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.top3-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.top3-card.rank-1 {
  border-color: #FFD700;
  background: linear-gradient(180deg, rgba(255,215,0,0.08) 0%, var(--bg-card) 100%);
  padding: 32px 24px;
  z-index: 2;
}

.top3-card.rank-2 {
  border-color: #C0C0C0;
  background: linear-gradient(180deg, rgba(192,192,192,0.08) 0%, var(--bg-card) 100%);
}

.top3-card.rank-3 {
  border-color: #CD7F32;
  background: linear-gradient(180deg, rgba(205,127,50,0.08) 0%, var(--bg-card) 100%);
}

.top3-rank {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  margin: 0 auto 16px;
}

.top3-card.rank-1 .top3-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
  box-shadow: 0 4px 16px rgba(255,215,0,0.4);
}

.top3-card.rank-2 .top3-rank {
  background: linear-gradient(135deg, #C0C0C0, #888);
  color: #333;
  box-shadow: 0 4px 16px rgba(192,192,192,0.4);
}

.top3-card.rank-3 .top3-rank {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
  color: #fff;
  box-shadow: 0 4px 16px rgba(205,127,50,0.4);
}

.top3-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}

.top3-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.top3-company {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.top3-score {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.top3-card.rank-1 .top3-score { color: #FFD700; }
.top3-card.rank-2 .top3-score { color: #C0C0C0; }
.top3-card.rank-3 .top3-score { color: #CD7F32; }

.top3-score-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.top3-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.top3-stat {
  text-align: center;
}

.top3-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.top3-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== INTRO SECTION ===== */
.intro-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.intro-card .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.intro-card .label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== RANKING TABLE ===== */
.ranking-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

.ranking-table thead {
  background: var(--bg-card);
}

.ranking-table th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.ranking-table th:hover {
  color: var(--text-primary);
}

.ranking-table th.num-col {
  width: 60px;
  text-align: center;
}

.ranking-table th.score-col {
  width: 100px;
  text-align: center;
}

.ranking-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  white-space: nowrap;
}

.ranking-table tbody tr {
  transition: background 0.15s;
}

.ranking-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

/* Rank badge - Unified style */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-badge.rank-1 { 
  background: linear-gradient(135deg, #FFD700, #FFA500); 
  color: #333;
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}
.rank-badge.rank-2 { 
  background: linear-gradient(135deg, #C0C0C0, #888); 
  color: #333;
  box-shadow: 0 2px 8px rgba(192,192,192,0.3);
}
.rank-badge.rank-3 { 
  background: linear-gradient(135deg, #CD7F32, #8B4513); 
  color: #fff;
  box-shadow: 0 2px 8px rgba(205,127,50,0.3);
}
.rank-badge.rank-other { 
  background: var(--bg-primary); 
  color: var(--text-muted); 
  border: 1px solid var(--border-color);
}

/* Product name cell */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s;
}

.product-name:hover {
  color: var(--accent-red);
}

.product-company {
  font-size: 12px;
  color: var(--text-muted);
}

/* Data cells */
.data-cell {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.data-highlight {
  color: var(--text-primary);
  font-weight: 600;
}

.data-red {
  color: var(--accent-red);
  font-weight: 700;
}

.data-green {
  color: #22c55e;
  font-weight: 600;
}

/* Score bar - Enhanced */
.score-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}

.score-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-red), #ff6b8a);
  transition: width 0.5s ease;
  position: relative;
}

.score-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
}

.score-num {
  font-weight: 800;
  font-size: 14px;
  min-width: 36px;
  text-align: right;
  color: var(--text-primary);
}

/* Tags - Enhanced */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
  border: 1px solid transparent;
}

.tag-free { background: rgba(34,197,94,0.1); color: #22c55e; border-color: rgba(34,197,94,0.2); }
.tag-oss { background: rgba(59,130,246,0.1); color: #3b82f6; border-color: rgba(59,130,246,0.2); }
.tag-enterprise { background: rgba(255,71,87,0.1); color: var(--accent-red); border-color: rgba(255,71,87,0.2); }
.tag-new { background: rgba(168,85,247,0.1); color: #a855f7; border-color: rgba(168,85,247,0.2); }
.tag-closed { background: rgba(100,100,100,0.1); color: var(--text-muted); border-color: rgba(100,100,100,0.2); }

/* Trend indicator - Enhanced */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-primary);
}

.trend.up { 
  color: #22c55e; 
  background: rgba(34,197,94,0.1);
}
.trend.down { 
  color: var(--accent-red); 
  background: rgba(255,71,87,0.1);
}
.trend.new { 
  color: #a855f7; 
  background: rgba(168,85,247,0.1);
}

/* ===== METHODOLOGY ===== */
.methodology {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.methodology h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.method-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.method-item .method-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.method-item .method-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .top3-grid {
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 16px;
  }
  .top3-card {
    padding: 20px 16px;
  }
  .top3-card.rank-1 {
    padding: 24px 20px;
  }
}

@media (max-width: 768px) {
  .rankings-header h1 { font-size: 28px; }
  .rankings-container { padding: 90px 16px 60px; }
  
  .top3-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .top3-card.rank-1 {
    order: -1;
    padding: 24px 20px;
  }
  .top3-card.rank-2,
  .top3-card.rank-3 {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    text-align: left;
    align-items: center;
  }
  .top3-card.rank-2 .top3-rank,
  .top3-card.rank-3 .top3-rank {
    margin: 0;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .top3-card.rank-2 .top3-logo,
  .top3-card.rank-3 .top3-logo {
    display: none;
  }
  .top3-card.rank-2 .top3-stats,
  .top3-card.rank-3 .top3-stats {
    border-top: none;
    padding-top: 0;
    flex-direction: column;
    gap: 4px;
  }
  
  .intro-cards { grid-template-columns: 1fr; }
  .tabs { gap: 0; overflow-x: auto; }
  .tab-btn { padding: 12px 20px; font-size: 14px; white-space: nowrap; }
  .method-grid { grid-template-columns: 1fr; }
  
  .ranking-table {
    font-size: 13px;
  }
  .ranking-table th,
  .ranking-table td {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .rankings-header h1 { font-size: 24px; }
  .ranking-table th,
  .ranking-table td {
    padding: 10px 8px;
  }
  .product-logo {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .product-name {
    font-size: 13px;
  }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-logo-icon {
  font-size: 28px;
}

.footer-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.social-link:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
}

.footer-column h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-meta {
  display: flex;
  gap: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
