/* ========== HealthRank Global Styles ==========
   设计理念: 专业可信、数据驱动、医学严谨
   色彩: 深海蓝 + 医学白 + 理性灰
   ========== */

/* --- CSS Variables --- */
:root {
  --primary: #1e3a5f;
  --primary-light: #2d5f8a;
  --primary-dark: #0f2440;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --teal: #0d9488;
  --teal-light: #14b8a6;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --score-high: #059669;
  --score-mid: #d97706;
  --score-low: #dc2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-xl: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { color: var(--primary-dark); font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.25rem; letter-spacing: -0.5px; }
h2 { font-size: 1.75rem; letter-spacing: -0.3px; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; }
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 80px 0; }

/* --- Header --- */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; color: var(--primary); }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-alt);
  color: var(--primary);
}
.nav-search {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.nav-search input {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.875rem;
  width: 160px; max-width: 200px;
  outline: none;
  transition: border-color 0.2s;
}
.nav-search input:focus { border-color: var(--accent); width: 200px; }
.nav-links { display: flex; gap: 4px; flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; color: var(--primary); flex-shrink: 0; white-space: nowrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--bg-alt); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.25s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.card-interactive { cursor: pointer; }

/* --- Ranking Table --- */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ranking-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ranking-table th:hover { color: var(--primary); }
.ranking-table th.sorted { color: var(--accent); }
.ranking-table th .sort-arrow { margin-left: 4px; font-size: 0.7rem; }
.ranking-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ranking-table tr:hover td { background: var(--bg-alt); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-weight: 700; font-size: 0.85rem;
}
.rank-1 { background: #fbbf24; color: #92400e; }
.rank-2 { background: #cbd5e1; color: #475569; }
.rank-3 { background: #fcd34d; color: #b45309; }
.brand-name-cell { display: flex; align-items: center; gap: 12px; }
.brand-logo-placeholder {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
}
.brand-name-cell .brand-info { display: flex; flex-direction: column; }
.brand-name-cell .brand-name { font-weight: 600; color: var(--text); }
.brand-name-cell .brand-country { font-size: 0.8rem; color: var(--text-muted); }

/* --- Score Bar --- */
.score-bar-wrapper { display: flex; align-items: center; gap: 8px; }
.score-bar {
  flex: 1; height: 6px; background: var(--bg-alt);
  border-radius: 3px; overflow: hidden; min-width: 60px;
}
.score-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.6s ease;
}
.score-bar-fill.high { background: var(--score-high); }
.score-bar-fill.mid { background: var(--score-mid); }
.score-bar-fill.low { background: var(--score-low); }
.score-value { font-weight: 600; font-family: var(--font-mono); font-size: 0.85rem; min-width: 36px; text-align: right; }

/* --- Category Cards Grid --- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.category-card {
  padding: 32px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  background: white;
}
.category-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-xl); transform: translateY(-4px); }
.category-card .cat-icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-card .cat-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.category-card .cat-desc { font-size: 0.85rem; color: var(--text-secondary); }
.category-card .cat-count { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 2.8rem; color: white; margin-bottom: 16px; }
.hero .subtitle { font-size: 1.15rem; color: rgba(255,255,255,0.8); max-width: 600px; line-height: 1.7; }
.hero-stats { display: flex; gap: 40px; margin-top: 32px; }
.hero-stat { text-align: center; }
.hero-stat .stat-num { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); }
.hero-stat .stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

/* --- Stats Banner --- */
.stats-banner {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex; gap: 40px;
  margin-top: -30px;
  position: relative;
  box-shadow: var(--shadow);
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-item .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-family: var(--font-mono); }
.stat-item .stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* --- Top Brands Grid --- */
.top-brands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px; }
.top-brand-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
}
.top-brand-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.top-brand-card .tb-rank {
  font-size: 1.5rem; font-weight: 800; color: var(--text-muted);
  min-width: 40px; text-align: center;
}
.top-brand-card:nth-child(1) .tb-rank { color: #fbbf24; }
.top-brand-card:nth-child(2) .tb-rank { color: #cbd5e1; }
.top-brand-card:nth-child(3) .tb-rank { color: #fcd34d; }
.tb-score { margin-left: auto; text-align: right; }
.tb-score .score-num { font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); color: var(--primary); }
.tb-score .score-label { font-size: 0.75rem; color: var(--text-muted); }

/* --- Brand Detail Page --- */
.brand-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
.brand-header-inner {
  display: flex; align-items: flex-start; gap: 24px;
}
.brand-avatar {
  width: 80px; height: 80px; border-radius: 16px;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--primary);
  flex-shrink: 0;
}
.brand-meta { flex: 1; }
.brand-meta h1 { margin-bottom: 8px; }
.brand-meta .meta-tags { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: var(--bg-alt);
  border-radius: 4px; font-size: 0.8rem; color: var(--text-secondary);
}
.brand-overall-score {
  text-align: center;
  padding: 20px 32px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.brand-overall-score .big-score {
  font-size: 3rem; font-weight: 800; font-family: var(--font-mono);
  line-height: 1;
}
.brand-overall-score .big-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

.score-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.score-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.score-card .sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.score-card .sc-name { font-weight: 600; font-size: 1rem; }
.score-card .sc-value { font-size: 1.5rem; font-weight: 800; font-family: var(--font-mono); }
.score-card .sc-bar { height: 8px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.score-card .sc-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.score-card .sc-description {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
}
.score-card .sc-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.sc-sub { margin-top: 12px; }
.sc-sub-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 4px 0; color: var(--text-secondary); }

/* --- Radar Chart Container --- */
.radar-container { background: white; border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--border); }
.radar-container canvas { max-width: 100%; }

/* --- Comparison Tool --- */
.compare-selector { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.compare-select {
  padding: 10px 16px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.9rem;
  background: white; min-width: 200px;
  cursor: pointer; outline: none;
}
.compare-select:focus { border-color: var(--accent); }
.compare-selected { display: flex; gap: 8px; flex-wrap: wrap; }
.compare-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--primary);
  color: white; border-radius: 20px;
  font-size: 0.85rem; font-weight: 500;
}
.compare-chip .remove { cursor: pointer; font-weight: 700; font-size: 1.1rem; opacity: 0.7; }
.compare-chip .remove:hover { opacity: 1; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th { text-align: left; padding: 12px 16px; background: var(--bg-alt); font-weight: 600; font-size: 0.85rem; }
.compare-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; }
.compare-table tr:first-child td { font-weight: 700; font-size: 1rem; }
.compare-winner { color: var(--score-high); font-weight: 700; }

/* --- Methodology --- */
.methodology-content { max-width: 800px; }
.methodology-content h2 { margin: 40px 0 16px; }
.methodology-content h3 { margin: 24px 0 12px; }
.methodology-content p { margin-bottom: 16px; color: var(--text-secondary); line-height: 1.8; }
.methodology-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.methodology-content li { margin-bottom: 8px; color: var(--text-secondary); }
.weight-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.weight-table th, .weight-table td { padding: 12px 16px; border: 1px solid var(--border); text-align: left; }
.weight-table th { background: var(--bg-alt); font-weight: 600; }

/* --- Filter Bar --- */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer; background: white;
  color: var(--text-secondary); transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-col h4 { color: white; margin-bottom: 16px; font-size: 0.95rem; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); padding: 4px 0; font-size: 0.85rem; }
.footer-col a:hover { color: white; }
.footer-bottom {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center; font-size: 0.8rem;
}

/* --- Tags --- */
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  padding: 2px 8px; background: var(--bg-alt);
  border-radius: 4px; font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --- Breadcrumb --- */
.breadcrumb { display: flex; gap: 8px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); }

/* --- Section Header --- */
.section-header { margin-bottom: 32px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); font-size: 0.95rem; }

/* --- Search Results Dropdown --- */
.search-results {
  position: absolute; top: 100%; right: 0;
  width: 320px; max-height: 400px; overflow-y: auto;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  z-index: 200; display: none;
}
.search-results.visible { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg-alt); }
.search-result-item .sr-score { margin-left: auto; font-weight: 600; font-family: var(--font-mono); font-size: 0.85rem; }

/* --- Data Source Badge --- */
.source-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: var(--bg-alt);
  border-radius: 4px; font-size: 0.75rem;
  color: var(--text-muted);
}
.source-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-active { background: var(--score-high); }
.dot-pending { background: var(--warning); }

/* --- Trend Chart --- */
.trend-container {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.trend-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.trend-meta { font-size: 0.85rem; color: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 20px; }
  .nav-links { display: none; }
  .brand-header-inner { flex-direction: column; align-items: center; text-align: center; }
  .top-brands-grid { grid-template-columns: 1fr; }
  .stats-banner { gap: 20px; padding: 16px; }
  .compare-table { font-size: 0.8rem; }
  .ranking-table { font-size: 0.8rem; }
  .ranking-table th, .ranking-table td { padding: 8px; }
  .category-grid { grid-template-columns: 1fr; }
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, #e2e8f0 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* --- API Doc Styles --- */
.endpoint { margin-bottom: 24px; }
.endpoint .method {
  display: inline-block; padding: 4px 10px; border-radius: 4px;
  font-size: 0.8rem; font-weight: 700; font-family: var(--font-mono);
  margin-right: 8px;
}
.method-get { background: #dbeafe; color: #1e40af; }
.endpoint .path { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); }
.endpoint .desc { margin-top: 4px; font-size: 0.85rem; color: var(--text-secondary); }
.code-block {
  background: #1e293b; color: #e2e8f0;
  padding: 16px 20px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.85rem;
  overflow-x: auto; margin-top: 8px; line-height: 1.7;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }

/* ============================================================
   v2 新增：phb123 风格信息层级组件 (2026-Q2)
   ============================================================ */

/* --- 二级类目导航 --- */
.subcat-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.subcat-nav a {
  padding: 6px 14px; background: var(--bg-alt); border-radius: 6px;
  font-size: 0.82rem; color: var(--text-secondary); transition: all 0.2s;
  border: 1px solid transparent;
}
.subcat-nav a:hover, .subcat-nav a.active { background: var(--primary); color: white; border-color: var(--primary); }

/* --- 分页 --- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination button {
  min-width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px;
  background: white; font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 0.8rem; color: var(--text-muted); padding: 6px 12px; display: flex; align-items: center; }

/* --- 富品牌表格（phb123 style） --- */
.rank-table-rich { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.rank-table-rich thead th {
  background: var(--bg-alt); padding: 10px 14px; font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-secondary);
  border-bottom: 2px solid var(--border); white-space: nowrap; text-align: left; cursor: pointer;
}
.rank-table-rich thead th:hover { color: var(--primary); }
.rank-table-rich thead th.sorted { color: var(--accent); background: #eff6ff; }
.rank-table-rich tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.rank-table-rich tbody tr:hover td { background: #f8fafc; }
.rank-table-rich .col-rank { width: 50px; text-align: center; }
.rank-table-rich .col-name { min-width: 180px; }
.rank-table-rich .col-score { width: 110px; }
.rank-table-rich .col-rating { width: 90px; }
.rank-table-rich .col-value { width: 110px; }
.rank-table-rich .col-sales { width: 140px; }
.rank-table-rich .col-votes { width: 80px; }
.rank-table-rich .col-country { width: 60px; }
.rank-table-rich .col-subcat { width: 100px; }

/* --- 品牌详情页 v2 组件 --- */
.detail-section { margin-bottom: 48px; }
.detail-section-title {
  font-size: 1.3rem; font-weight: 700; color: var(--primary-dark);
  padding-bottom: 12px; border-bottom: 2px solid var(--border); margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.detail-section-title .icon { font-size: 1.4rem; }

/* 品牌档案表格 */
.profile-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.profile-table th,
.profile-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}
.profile-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-alt);
}
.profile-table th:first-child,
.profile-table td:first-child { font-weight: 600; color: var(--text-secondary); width: 140px; font-size: 0.85rem; }
.profile-table th:last-child,
.profile-table td:last-child { font-size: 0.95rem; }
#provenance-table {
  overflow-x: auto;
}
#provenance-table .profile-table {
  min-width: 860px;
}
#provenance-table .profile-table th:nth-child(3),
#provenance-table .profile-table td:nth-child(3) { width: 110px; }
#provenance-table .profile-table th:last-child,
#provenance-table .profile-table td:last-child { width: 150px; }

/* 好评率大数字 */
.rating-hero {
  display: flex; align-items: center; gap: 16px; padding: 20px 28px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-radius: var(--radius-lg); border: 1px solid #a7f3d0;
}
.rating-hero .big-num { font-size: 3rem; font-weight: 800; color: var(--score-high); font-family: var(--font-mono); line-height: 1; }
.rating-hero .rating-meta { font-size: 0.85rem; color: var(--text-secondary); }
.rating-hero .stars { color: #f59e0b; font-size: 1.2rem; letter-spacing: 2px; }

/* 销量/价值卡片 */
.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.metric-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-align: center;
}
.metric-card .metric-icon { font-size: 1.5rem; margin-bottom: 8px; }
.metric-card .metric-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); font-family: var(--font-mono); }
.metric-card .metric-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* 相关品牌推荐 */
.related-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.related-brand-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: white; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
}
.related-brand-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.related-brand-card .rb-score { margin-left: auto; font-weight: 700; font-family: var(--font-mono); color: var(--primary); }
.related-brand-card .rb-rank { font-size: 0.75rem; color: var(--text-muted); }

/* 品牌投票 */
.vote-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.vote-bar .vote-btn {
  padding: 8px 20px; background: var(--primary); color: white; border: none;
  border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.vote-bar .vote-btn:hover { background: var(--primary-light); }
.vote-count { font-size: 0.85rem; color: var(--text-secondary); }

/* 热门标签云 */
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-cloud .tag-item {
  padding: 6px 14px; background: var(--bg-alt); border-radius: 20px;
  font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s; border: 1px solid transparent;
}
.tag-cloud .tag-item:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* 品牌 Logo 图片 */
.brand-logo-img {
  width: 48px; height: 48px; border-radius: 8px; object-fit: contain;
  background: var(--bg-alt); flex-shrink: 0;
}
.brand-logo-img.lg { width: 80px; height: 80px; border-radius: 16px; }

/* 来源引用 */
.source-ref { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.source-ref a { color: var(--text-muted); text-decoration: underline; }

/* 更新提示 */
.update-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: 12px; font-size: 0.75rem; color: var(--score-high);
}
.update-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--score-high); }
.ai-verify-text {
  color: var(--score-high);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 搜索高亮 */
mark { background: #fef08a; padding: 1px 3px; border-radius: 2px; }

/* Toast */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--primary-dark); color: white; padding: 12px 24px;
  border-radius: 8px; font-size: 0.9rem; z-index: 999;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ========== News Module ========== */
.news-grid { display: grid; gap: 16px; }
.news-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: all 0.2s; }
.news-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-light); transform: translateY(-2px); }
.news-card-body { padding: 24px; }
.news-card h3 { font-size: 1.15rem; margin: 12px 0 8px; line-height: 1.4; }
.news-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-cat-tag { display: inline-block; padding: 3px 10px; background: var(--bg-alt); border-radius: 4px; font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.news-date { font-size: 0.8rem; color: var(--text-muted); margin-left: 8px; }
.news-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; gap: 8px; }
.news-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.article-content { max-width: 780px; margin: 0 auto; }
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: 1.8rem; margin-top: 12px; line-height: 1.35; }
.article-summary { font-size: 1.05rem; color: var(--text-secondary); margin-top: 12px; line-height: 1.7; padding: 16px 20px; background: var(--bg-alt); border-radius: var(--radius); border-left: 3px solid var(--primary); }
.article-body { font-size: 1rem; line-height: 1.85; color: var(--text); }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin-bottom: 18px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--primary-dark); }
.article-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); }
.article-related { margin-top: 40px; padding: 24px; background: var(--bg-alt); border-radius: var(--radius-lg); }
.article-related h4 { margin-bottom: 16px; }


/* --- Language Toggle --- */
#lang-switch { display: flex; align-items: center; margin-left: 8px; flex-shrink: 0; }
.lang-btn {
  padding: 6px 16px; border: 1.5px solid var(--primary); border-radius: 20px;
  background: white; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  color: var(--primary); transition: all 0.15s; white-space: nowrap;
  line-height: 1.4;
}
.lang-btn:hover { background: var(--primary); color: white; }
