/* Fonts: self-hosted stack (no Google Fonts CDN — blocked in CN) */

:root {
  --font-serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --color-navy: #1a2b3c;
  --color-navy-mid: #2d4458;
  --color-cream: #f6f3ee;
  --color-warm-white: #fffefc;
  --color-accent: #c2553a;
  --color-accent-hover: #a34730;
  --color-gold: #b8956b;
  --color-text: #2c3338;
  --color-muted: #5f6b76;
  --color-border: #e5e0d8;
  --read-max-width: 42rem;
  --content-max-width: 76rem;
  --shadow-sm: 0 1px 3px rgba(26, 43, 60, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 43, 60, 0.08);
  --radius: 0.5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-warm-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  color: var(--color-navy);
}

.reading-width {
  max-width: var(--read-max-width);
}

.content-width {
  max-width: var(--content-max-width);
}

/* Header */
.site-header {
  background: var(--color-warm-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.01em;
}

.site-logo:hover {
  color: var(--color-accent);
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--color-navy);
}

.nav-link-active {
  color: var(--color-accent) !important;
  font-weight: 600;
}

#mobile-menu {
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

#mobile-menu.hidden-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobile-menu.open-menu {
  max-height: 24rem;
  opacity: 1;
}

/* Hero */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--color-navy);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 43, 60, 0.85) 0%, rgba(26, 43, 60, 0.55) 60%, rgba(26, 43, 60, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 36rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1rem;
}

/* Sections */
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 1.5rem;
}

.section-cream {
  background: var(--color-cream);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Cards */
.guide-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.guide-card img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  display: block;
}

.guide-card-body {
  padding: 1.25rem;
}

.guide-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-navy);
}

.guide-card p {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.tip-card {
  display: block;
  padding: 1.35rem 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease, border-color 0.2s;
}

.tip-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-navy);
}

.tip-card h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-navy);
}

.tip-card p {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.cta-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  background: var(--color-navy);
  border-radius: var(--radius);
  color: #fff;
  transition: background 0.2s;
}

.cta-card:hover {
  background: var(--color-navy-mid);
}

.cta-card h3 {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.2rem;
}

.cta-card p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Article images */
.article-hero-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--color-muted);
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--color-gold);
}

.site-footer-brand {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.1rem;
}

/* Trust bar */
.trust-bar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.trust-item {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.03em;
}

.trust-item strong {
  color: var(--color-navy);
  font-weight: 600;
}

/* Inline links */
a.text-link {
  color: var(--color-accent);
  font-weight: 500;
}

a.text-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Prose blocks in articles */
.prose-block {
  color: var(--color-text);
  line-height: 1.75;
}

.prose-block p + p {
  margin-top: 1rem;
}

/* Legacy compat */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.img-placeholder {
  background: var(--color-cream);
}

/* Page list / article listing */
.page-intro {
  font-size: 1.1rem;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 40rem;
}

.list-card {
  display: block;
  padding: 1.35rem 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.list-card h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-navy);
}

.list-card p {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.list-meta {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: var(--color-navy);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, background 0.15s;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  background: var(--color-accent);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-navy);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* TOC on long articles */
.page-toc {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}

.page-toc p {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.page-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.page-toc a {
  font-size: 0.9rem;
  color: var(--color-navy-mid);
}

.page-toc a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ===== Travel Tools ===== */
.tool-form { background: var(--color-cream); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.5rem; }
.tool-form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .tool-form-grid { grid-template-columns: 1fr 1fr; } }
.tool-field { display: flex; flex-direction: column; gap: 0.35rem; }
.tool-field span { font-size: 0.85rem; font-weight: 600; color: var(--color-navy-mid); }
.tool-field select, .tool-field input, .tool-input {
  padding: 0.6rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius);
  font-size: 1rem; background: #fff; width: 100%;
}
.tool-checkbox { display: flex; align-items: flex-start; gap: 0.5rem; margin: 1rem 0; font-size: 0.95rem; cursor: pointer; }
.tool-btn {
  display: inline-block; padding: 0.65rem 1.25rem; border-radius: var(--radius); font-weight: 600;
  font-size: 0.95rem; border: none; cursor: pointer; transition: background 0.15s;
}
.tool-btn--primary { background: var(--color-accent); color: #fff; }
.tool-btn--primary:hover { background: var(--color-accent-hover); }
.tool-btn--secondary { background: var(--color-navy); color: #fff; }
.tool-btn--secondary:hover { background: var(--color-navy-mid); }
.tool-result { margin-top: 1.5rem; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--color-border); }
.tool-result--ok { background: #f0faf4; border-color: #86efac; }
.tool-result--warn { background: #fffbeb; border-color: #fcd34d; }
.tool-result--info { background: #eff6ff; border-color: #93c5fd; }
.tool-result-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.75rem; }
.tool-result-lead { margin: 0.75rem 0; line-height: 1.6; }
.tool-badge { display: inline-block; padding: 0.25rem 0.65rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.75rem; }
.tool-badge--ok { background: #dcfce7; color: #166534; }
.tool-badge--warn { background: #fef3c7; color: #92400e; }
.tool-badge--info { background: #dbeafe; color: #1e40af; }
.tool-badge--danger { background: #fee2e2; color: #991b1b; }
.tool-list { margin: 0.75rem 0; padding-left: 1.25rem; list-style: disc; }
.tool-list li { margin: 0.35rem 0; line-height: 1.55; }
.tool-subhead { font-size: 1.1rem; font-weight: 600; margin-top: 1rem; }
.tool-note { font-size: 0.9rem; color: var(--color-muted); margin-top: 0.75rem; }
.tool-disclaimer { font-size: 0.8rem; color: var(--color-muted); margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.tool-alert { margin-top: 1rem; padding: 1rem; border-radius: var(--radius); }
.tool-alert--danger { background: #fef2f2; border: 1px solid #fecaca; }
.tool-alert--warn { background: #fffbeb; border: 1px solid #fde68a; }
.tool-meta { font-size: 0.85rem; color: var(--color-muted); }
.tool-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem; }
.tool-filters .tool-input { flex: 1; min-width: 140px; max-width: 280px; }
.tool-card { display: block; padding: 1.25rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; transition: box-shadow 0.15s, border-color 0.15s; }
.tool-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-gold); }
.tool-card-icon { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; }
.tool-card p { font-size: 0.9rem; color: var(--color-muted); margin-top: 0.35rem; }
.tool-info-box { background: var(--color-cream); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.port-grid, .attr-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .port-grid, .attr-grid { grid-template-columns: 1fr 1fr; } }
.port-card, .attr-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.25rem; background: #fff; }
.port-card-head, .attr-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; flex-wrap: wrap; }
.port-card h3, .attr-card h3 { font-size: 1rem; font-weight: 600; }
.port-code { font-family: monospace; font-size: 0.85rem; color: var(--color-muted); }
.port-meta, .port-note { font-size: 0.85rem; color: var(--color-muted); margin-top: 0.35rem; }
.attr-dl { margin: 0.75rem 0; font-size: 0.9rem; }
.attr-dl dt { font-weight: 600; color: var(--color-navy-mid); margin-top: 0.5rem; }
.attr-dl dd { color: var(--color-text); margin-left: 0; }
.attr-tips { font-size: 0.85rem; color: var(--color-muted); margin: 0.75rem 0; }
.fx-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.fx-output { flex: 1; min-width: 200px; }
.fx-big { font-size: 2rem; font-weight: 700; color: var(--color-navy); }
.fx-result { margin-top: 0.25rem; }
.checklist-print h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.checklist-meta { font-size: 0.9rem; color: var(--color-muted); margin: 0.25rem 0; }
.checklist-items { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.checklist-items li { padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); font-size: 0.95rem; }
.check-box { font-family: monospace; margin-right: 0.5rem; }
.checklist-footer { font-size: 0.8rem; color: var(--color-muted); margin-top: 1.5rem; }
@media print {
  .site-header, .site-footer, .back-to-top, .skip-link, .breadcrumb, .tool-form, #print-checklist, .section-eyebrow, h1.page-intro { display: none !important; }
  .checklist-print { padding: 0; }
  body { background: #fff; }
}

/* Reusable comparison / data table for articles */
.cmp-table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 30rem; }
.cmp-table caption { text-align: left; font-size: 0.85rem; color: var(--color-muted); margin-bottom: 0.5rem; }
.cmp-table th, .cmp-table td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.cmp-table thead th { background: var(--color-cream); color: var(--color-navy); font-weight: 600; border-bottom: 2px solid var(--color-border); }
.cmp-table tbody th { font-weight: 600; color: var(--color-navy); white-space: nowrap; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: none; }
