:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --accent: #059669;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --accent: #10b981;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--surface-alt);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { font-size: 0.74rem; color: var(--text-muted); }

.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.menu-toggle { display: none; }

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
  background: radial-gradient(circle at top right, var(--primary-soft), transparent 55%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 820px; }
.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.2;
}
.hero-sub {
  margin: 0 0 1.6rem;
  font-size: 1.06rem;
  color: var(--text-muted);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.hero-stats strong { display: block; font-size: 1.15rem; }
.hero-stats span { font-size: 0.84rem; color: var(--text-muted); }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.page-header {
  padding: 2.5rem 0 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin: 0 0 0.5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-header p { margin: 0; color: var(--text-muted); }
.breadcrumb { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-head h2 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.section-desc { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.section-link { font-weight: 600; white-space: nowrap; }

/* Grids & Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.card-top h3 { margin: 0.35rem 0 0; font-size: 1.15rem; }
.card-top h3 a { color: var(--text); }
.card-tagline { margin: 0.65rem 0 0.9rem; color: var(--text-muted); font-size: 0.92rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
}
.badge-soft { background: var(--primary-soft); color: var(--primary); }

.score-pill {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}
.score-inline {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip {
  font-size: 0.78rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.chip-line { color: var(--primary); border-color: var(--primary-soft); background: var(--primary-soft); }
.chip-payg { color: var(--accent); border-color: rgba(16, 185, 129, 0.25); }

.card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.meta-label { display: block; color: var(--text-muted); font-size: 0.75rem; }

.card-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

/* Buttons & Filters */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: var(--surface-alt); color: var(--text); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
}
.filter-pill.active, .filter-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-alt); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* Posts & Prose */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.84rem; color: var(--text-muted); }
.post-card h3 { margin: 0.6rem 0; font-size: 1.15rem; }
.post-card h3 a { color: var(--text); }
.post-card p { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.93rem; }
.post-footer { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.post-footer .chip-row { margin-bottom: 0; }
.read-more { font-size: 0.88rem; font-weight: 600; white-space: nowrap; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
.prose h2 { margin: 1.8rem 0 0.75rem; font-size: 1.38rem; }
.prose h3 { margin: 1.35rem 0 0.5rem; font-size: 1.12rem; }
.prose p, .prose li { font-size: 0.98rem; }
.prose pre { background: var(--surface-alt); padding: 1rem; border-radius: 10px; overflow-x: auto; }
.prose blockquote { margin: 1rem 0; padding: 0.6rem 1rem; border-left: 4px solid var(--primary); background: var(--surface-alt); border-radius: 0 8px 8px 0; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 0.9rem; }

.toc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.toc-box h4 { margin: 0 0 0.75rem; }
.toc-box ul { list-style: none; padding: 0; margin: 0; }
.toc-box li { margin: 0.35rem 0; font-size: 0.88rem; }
.toc-l3 { padding-left: 0.9rem; }

/* Airport Detail */
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.score-box {
  text-align: center;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
}
.score-big { font-size: 2rem; font-weight: 800; line-height: 1; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.pros-cons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.pros, .cons { background: var(--surface-alt); padding: 1rem; border-radius: 10px; }
.pros h3, .cons h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.pros ul, .cons ul { margin: 0; padding-left: 1.15rem; font-size: 0.9rem; }

.metric-row { margin-bottom: 0.9rem; }
.metric-label { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 0.3rem; }
.metric-track { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.metric-fill { height: 100%; background: var(--primary); border-radius: 999px; }

.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.kv-list li:last-child { border-bottom: none; }
.kv-list span { color: var(--text-muted); }

/* FAQ */
.search-box { margin-bottom: 1.25rem; }
.search-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.96rem;
}
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
}
.faq-item summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  list-style: none;
}
.faq-cat {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.faq-a { margin-top: 0.7rem; color: var(--text-muted); font-size: 0.94rem; }
.faq-a p { margin: 0; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.75rem; }
.footer-brand { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5rem; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.footer-grid h4 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0.4rem 0; font-size: 0.88rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); }

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.toolbar-row .search-box { margin-bottom: 0; flex: 1 1 260px; }
.sort-select {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 50;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { border-color: var(--primary); color: var(--primary); }

.reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--primary);
  z-index: 45;
  transition: width 0.1s linear;
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout, .detail-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .menu-toggle { display: grid; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    align-items: stretch;
  }
  .main-nav.open { display: flex; }
  .grid-3, .grid-2, .pros-cons { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-head { flex-direction: column; align-items: flex-start; }
}
