:root {
  --c-bg: #f8fafc;
  --c-bg-card: #ffffff;
  --c-text: #334155;
  --c-text-dark: #0f172a;
  --c-primary: #0891b2; /* Bay cyan */
  --c-primary-hover: #06b6d4;
  --c-deep: #0f172a; /* Deep sea blue */
  --c-border: #e2e8f0;
  --nav-h: 60px;
  --border-radius: 8px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
}

a {
  color: var(--c-primary);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--c-text-dark);
  margin-bottom: 1rem;
}

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

/* Progress bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--c-primary);
  width: 0%;
  z-index: 1000;
  transition: width 0.1s;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  z-index: 999;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--c-deep);
}

.logo-svg {
  width: 24px;
  height: 24px;
  color: var(--c-primary);
}

.desktop-nav {
  display: flex;
  gap: 20px;
}

.desktop-nav a {
  color: var(--c-text);
  font-weight: 500;
  transition: color 0.3s;
}

.desktop-nav a:hover {
  color: var(--c-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-deep);
}

/* Main Layout */
.main-content {
  display: flex;
  margin-top: calc(var(--nav-h) + 40px);
  gap: 40px;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.toc-area {
  width: 260px;
  flex-shrink: 0;
}

/* Sections */
.section-block {
  background: var(--c-bg-card);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  border-top: 4px solid transparent;
}

/* Hero */
.hero-section {
  text-align: center;
  background: linear-gradient(135deg, var(--c-deep) 0%, #1e293b 100%);
  color: white;
}

.hero-section h1 {
  color: white;
  font-size: 2.5rem;
}

.hero-section .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.update-time {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: bold;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--c-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--c-primary-hover);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--c-deep);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
  background: var(--c-primary);
  color: white;
  border-radius: 4px;
}
.btn-small:hover {
  color: white;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--border-radius);
  background: var(--c-bg);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th, .comparison-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.comparison-table th {
  background: var(--c-bg);
  font-weight: 600;
  color: var(--c-deep);
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.table-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.rating-badge {
  background: #f59e0b;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
}

/* Provider Section */
.provider-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.provider-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.provider-short {
  color: var(--c-text);
  font-size: 1.1rem;
}

.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  background: var(--c-bg);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.meta-item {
  font-size: 0.95rem;
}

.provider-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.pros, .cons {
  padding: 20px;
  border-radius: var(--border-radius);
}

.pros {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.pros h4 { color: #166534; }
.pros li { color: #15803d; }

.cons {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.cons h4 { color: #991b1b; }
.cons li { color: #b91c1c; }

.provider-action {
  margin-top: 25px;
}

/* FAQ */
.faq-item {
  margin-bottom: 20px;
}
.faq-item h4 {
  margin-bottom: 5px;
}

/* TOC */
.sticky-toc {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  background: var(--c-bg-card);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sticky-toc h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}

.sticky-toc ul {
  list-style: none;
}

.toc-link {
  display: block;
  padding: 8px 0;
  color: var(--c-text);
  font-size: 0.95rem;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all 0.2s;
}

.toc-link:hover, .toc-link.active {
  color: var(--c-primary);
  border-left-color: var(--c-primary);
  font-weight: bold;
}

.toc-child {
  padding-left: 20px;
  font-size: 0.9rem;
}

.back-to-top {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--c-text);
}

.site-footer {
  text-align: center;
  padding: 40px 0;
  color: var(--c-text);
  margin-top: 40px;
  border-top: 1px solid var(--c-border);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--c-bg-card);
  box-shadow: -4px 0 15px rgba(0,0,0,0.1);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
}

.drawer-title {
  font-weight: bold;
  font-size: 1.2rem;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text);
}

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

/* Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  display: none;
}
.drawer-overlay.open {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
  }
  .toc-area {
    display: none;
  }
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .provider-pros-cons {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
  }
}

/* --- COMPARISON TABLE OPTIMIZATIONS --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  background: #ffffff;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 800px; /* Force horizontal scroll on mobile */
  font-size: 0.95rem;
}

.comparison-table th, 
.comparison-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.comparison-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.comparison-table tbody tr:hover {
  background-color: #f1f5f9;
  transition: background-color 0.2s ease;
}

.brand-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.table-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-cell strong {
  color: #0f172a;
  font-weight: 600;
  font-size: 1.05rem;
}

.col-price, .col-traffic, .col-network, .col-bestfor {
  color: #334155;
  white-space: nowrap;
}

.pill-badge {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 2px;
  white-space: nowrap;
}

.btn-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background-color: #0891b2;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-detail:hover {
  background-color: #0e7490;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .table-responsive::before {
    content: "← 左右滑动查看完整表格 →";
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    padding: 8px 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
  }
}
/* --- END COMPARISON TABLE OPTIMIZATIONS --- */
