:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #1f2937;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --success: #34d399;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 17, 32, 0.88);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

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

.updated-pill {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.theme-btn:hover {
  border-color: var(--border-strong);
}

/* Hero */
.hero {
  padding: 36px 0 24px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-intro p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.notice-box {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Sections */
.section {
  padding: 20px 0 28px;
}

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

.section-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Filter Toolbar */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.filter-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.reset-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}

.reset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 500;
}

/* Tables */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-neutral {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Airport Cards */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.airport-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.airport-card:hover {
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 20px;
}

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

.card-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.price-hero {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.review-text {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.fit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.fit-box {
  flex: 1 1 280px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.fit-good {
  background: var(--success-soft);
  color: var(--text);
}

.fit-bad {
  background: var(--warning-soft);
  color: var(--text);
}

.fit-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.coupon-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  border: 1px dashed var(--warning);
  margin-bottom: 14px;
  font-size: 13.5px;
}

.coupon-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.copy-btn {
  border: 1px solid var(--warning);
  background: var(--surface);
  color: var(--warning);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.card-body-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: start;
}

.specs-grid {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.spec-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.spec-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.spec-label {
  color: var(--text-muted);
  font-weight: 600;
}

.spec-val {
  color: var(--text-secondary);
}

.plan-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.plan-box th, .plan-box td {
  padding: 8px 10px;
  font-size: 13px;
}

.speedtest-details {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 10px 14px;
}

.speedtest-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.speedtest-gallery {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.speedtest-gallery figure {
  margin: 0;
}

.speedtest-gallery figcaption {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.speedtest-gallery img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Pitfalls Grid */
.pitfalls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.pitfall-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.pitfall-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.pitfall-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* VPS Callout */
.vps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.vps-card h3 {
  margin: 0 0 10px;
}

.vps-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Archived / Delisted */
.archived-box {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius);
  padding: 18px 22px;
}

.archived-box h3 {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 16px;
}

.archived-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

@media (max-width: 860px) {
  .card-body-grid {
    grid-template-columns: 1fr;
  }
  .card-cta {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .updated-pill {
    display: none;
  }
  .hero-card, .airport-card {
    padding: 18px;
  }
  .spec-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Multi-page Navigation & Client Directory */
.nav-links a.nav-active {
  color: var(--primary);
  font-weight: 700;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.quick-picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.pick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.pick-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pick-apps {
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 6px;
}

.pick-note {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.protocol-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.protocol-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.protocol-card h3 {
  margin: 0;
  font-size: 15.5px;
}

.protocol-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.client-extra-links {
  margin-top: 4px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cross-link-banner {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cross-link-banner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}
