/* ==========================================================================
   Base Layout & Editorial Components
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(28, 25, 23, 0.022) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

button, input, select {
  font-family: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.serif {
  font-family: var(--font-serif);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Editorial Masthead Navigation ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.masthead-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

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

.brand-issue {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  text-decoration: none;
  background: var(--surface-warm);
  color: var(--ink);
}

.nav-link.active {
  background: var(--ink);
  color: #FAF7F2;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--ink);
  background: var(--surface-warm);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---------- Mobile Bottom Tab Bar ---------- */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: var(--mobile-bar-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 4px 8px env(safe-area-inset-bottom, 0);
}

.mobile-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}

.mobile-tabbar a.active {
  color: var(--accent);
  font-weight: 600;
}

.mobile-tabbar svg {
  width: 20px;
  height: 20px;
}

/* ---------- Main Page Wrapper & Headings ---------- */
.page-main {
  padding: 32px 0 72px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.page-header {
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  font-weight: 700;
  margin: 6px 0 0;
  letter-spacing: -0.01em;
}

.page-lead {
  color: var(--muted);
  font-size: 15px;
  margin: 8px 0 0;
  max-width: 680px;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

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

/* ---------- Magazine Hero Cover (Index) ---------- */
.hero-editorial {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 28px;
  align-items: stretch;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  font-weight: 700;
  margin: 10px 0 14px;
  letter-spacing: -0.015em;
}

.hero-summary {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.metric-val {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--ink);
}

.metric-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.hero-cover-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--ink);
  min-height: 320px;
  cursor: zoom-in;
}

.hero-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-cover-frame:hover img {
  transform: scale(1.03);
}

.hero-cover-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 18px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(28, 25, 23, 0.78) 100%);
  color: #FAF7F2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.hero-cover-caption small {
  font-size: 12px;
  opacity: 0.88;
}

/* ---------- Cards & Grids ---------- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 20px;
}

.card-warm {
  background: var(--surface-warm);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* ---------- Badges & City Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.badge-neutral {
  background: var(--surface-warm);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.badge-zhuhai { background: var(--city-zhuhai-soft); color: var(--city-zhuhai); }
.badge-macau { background: var(--city-macau-soft); color: var(--city-macau); }
.badge-shenzhen { background: var(--city-shenzhen-soft); color: var(--city-shenzhen); }
.badge-hk { background: var(--city-hk-soft); color: var(--city-hk); }
.badge-gz { background: var(--city-gz-soft); color: var(--city-gz); }

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid var(--warn-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid var(--danger-border);
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid var(--ok-border);
}

/* ---------- Alert / Constraint Banners ---------- */
.alert-box {
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.6;
}

.alert-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-ink);
}

.alert-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.alert-warn .alert-label {
  background: var(--warn-ink);
  color: #FFFDF8;
}

.alert-danger .alert-label {
  background: var(--danger-ink);
  color: #FFFFFF;
}

/* ---------- Interactive Route Map Strip (Index) ---------- */
.route-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
}

.route-nodes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  position: relative;
}

.route-nodes::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 21px;
  height: 1px;
  border-top: 1px dashed var(--border-strong);
  z-index: 0;
  pointer-events: none;
}

.route-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 13px 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.route-node:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.route-node.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.route-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  margin-bottom: 7px;
}

.route-city {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
}

.route-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.route-mode {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  margin-top: 5px;
}

/* ---------- Day Directory Cards (Index) ---------- */
.day-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.day-card:hover {
  text-decoration: none;
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.day-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 0;
}

.day-card-desc {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.65;
}

.day-card-thumb {
  width: 100%;
  height: 138px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-warm);
}

.day-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.day-card:hover .day-card-thumb img {
  transform: scale(1.03);
}

.day-card-stops {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.day-card-stop-pill {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

.day-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Day Selector Strip (day.html) ---------- */
.day-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.day-pill {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 7px 13px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pill-city, var(--border-strong));
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  min-width: 98px;
}

.day-pill:hover {
  text-decoration: none;
  border-color: var(--ink);
  border-top-color: var(--pill-city, var(--ink));
  transform: translateY(-1px);
}

.day-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  border-top-color: var(--accent);
  color: #FAF7F2;
  box-shadow: 0 3px 10px rgba(28, 25, 23, 0.14);
}

.day-pill-date {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.78;
}

.day-pill-city {
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 22px;
}

.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ---------- Editorial Day Split Layout (Full-Viewport 50/50 Below Navbar on Desktop) ---------- */
body.page-day-split {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.page-day-split .masthead {
  flex-shrink: 0;
}

body.page-day-split .masthead .container {
  max-width: 100%;
  padding: 0 24px;
}

body.page-day-split .page-main {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

body.page-day-split .day-root-wrap {
  height: 100%;
  width: 100%;
}

body.page-day-split .site-footer {
  display: none;
}

.day-split-viewport {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 100%;
  width: 100%;
}

.day-content-pane {
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.day-top-block {
  padding: 0;
}

.day-top-block .day-pills {
  padding: 16px 22px 10px;
}

.day-top-block > :not(.day-pills) {
  margin-left: 22px;
  margin-right: 22px;
}

.day-body-block {
  padding: 4px 22px 44px;
}

.day-map-pane {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

.day-map-pane .day-map-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.day-map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.day-map-pane .day-map-canvas {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.day-map-floating-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  pointer-events: none;
}

.day-map-floating-controls > * {
  pointer-events: auto;
  height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(28, 25, 23, 0.14);
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.12);
  font-size: 12px;
  line-height: 1;
}

.day-map-floating-controls .btn:hover {
  background: #FFFFFF;
  border-color: var(--ink);
}

.day-map-pane .day-map-stops {
  flex-shrink: 0;
  max-height: 132px;
  overflow-y: auto;
}

.day-inline-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.day-guides-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.day-guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.day-guide-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 44px 16px 1fr;
  gap: 10px;
  position: relative;
}

.tl-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding-top: 14px;
}

.tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  margin-top: 18px;
  flex-shrink: 0;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.tl-dot.kind-transport { background: var(--city-shenzhen); }
.tl-dot.kind-activity { background: var(--city-macau); }
.tl-dot.kind-highlight { background: var(--accent); width: 12px; height: 12px; margin-top: 17px; }
.tl-dot.kind-food { background: #B45309; }
.tl-dot.kind-stay { background: var(--muted); }
.tl-dot.kind-alert { background: var(--danger-ink); }

.tl-line {
  width: 1px;
  flex: 1;
  background: var(--border-strong);
  margin-top: 4px;
}

.tl-item:last-child .tl-line {
  display: none;
}

.tl-body {
  min-width: 0;
  padding: 0 0 14px;
}

.tl-item:last-child .tl-body {
  padding-bottom: 0;
}

.tl-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.tl-card.is-alert {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.tl-card.is-highlight {
  border-left: 3px solid var(--accent);
}

.tl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tl-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tl-head-right .badge {
  height: 26px;
  padding: 0 9px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.tl-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--accent);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tl-nav-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
}

.tl-nav-icon svg {
  width: 13px;
  height: 13px;
}

.tl-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.tl-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}

.tl-tips {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- Editorial Photo & Diagram Galleries ---------- */
.media-grid {
  display: grid;
  gap: 14px;
}

.media-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.media-figure:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.media-figure .media-wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface-warm);
}

.media-figure.photo-landscape .media-wrap {
  aspect-ratio: 3 / 2;
}

.media-figure.photo-portrait .media-wrap {
  aspect-ratio: 3 / 4;
}

.media-figure.photo-landscape img,
.media-figure.photo-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.media-figure:hover img {
  transform: scale(1.02);
}

.media-figure.diagram .media-wrap {
  background: #FFFFFF;
  padding: 10px;
}

.media-figure.diagram img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.zoom-chip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(28, 25, 23, 0.72);
  color: #FAF7F2;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.media-figure figcaption {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  line-height: 1.55;
}

.media-figure figcaption strong {
  color: var(--ink);
}

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

table.editorial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 520px;
}

table.editorial-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-warm);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.editorial-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.editorial-table tbody tr {
  transition: background-color 0.12s ease;
}

table.editorial-table tbody tr:hover {
  background: #FCF9F4;
}

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

.text-right {
  text-align: right;
}

/* ---------- Redline Stepper & Transport Boarding-Pass Cards ---------- */
.redline-card {
  background: var(--surface);
  border: 1px solid var(--danger-border);
  border-left: 4px solid var(--danger-ink);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.redline-steps {
  display: flex;
  flex-direction: column;
  margin: 14px 0 12px;
}

.redline-step {
  display: grid;
  grid-template-columns: 98px 16px 1fr;
  gap: 10px;
  align-items: stretch;
  font-size: 13.5px;
}

.redline-step-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--danger-ink);
  padding-top: 1px;
}

.redline-step-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.redline-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--danger-ink);
  margin-top: 6px;
  flex-shrink: 0;
}

.redline-step-line {
  width: 1px;
  flex: 1;
  background: var(--danger-border);
  min-height: 12px;
}

.redline-step:last-child .redline-step-line {
  display: none;
}

.redline-step-text {
  padding-bottom: 9px;
  color: var(--ink);
}

.redline-step:last-child .redline-step-text {
  padding-bottom: 0;
}

.ticket-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ticket-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ticket-card.is-alert {
  border-color: var(--danger-border);
  background: linear-gradient(180deg, #FFF9F8 0%, #FFFFFF 48%);
  box-shadow: inset 3px 0 0 var(--danger-ink);
}

.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.ticket-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.ticket-mode-chip svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.ticket-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0 2px;
}

.ticket-point-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.ticket-point-time {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 3px;
}

.ticket-mid {
  text-align: center;
  min-width: 92px;
}

.ticket-arrow {
  display: block;
  height: 1px;
  background: var(--border-strong);
  position: relative;
  margin: 6px 0;
}

.ticket-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  transform: rotate(45deg);
}

.ticket-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.ticket-foot {
  position: relative;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
}

.ticket-foot::before,
.ticket-foot::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.ticket-foot::before {
  left: -26px;
  clip-path: inset(0 0 0 6px);
}

.ticket-foot::after {
  right: -26px;
  clip-path: inset(0 6px 0 0);
}

/* ---------- Guides Page Sidebar Layout ---------- */
.guides-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.guides-toc {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.guides-toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
}

.toc-link:hover {
  text-decoration: none;
  background: var(--surface-warm);
  color: var(--ink);
}

.toc-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.guides-layout > * {
  min-width: 0;
}

.guide-article {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-xs);
  scroll-margin-top: calc(var(--nav-h) + 18px);
}

.guide-watermark {
  position: absolute;
  top: 12px;
  right: 22px;
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: rgba(154, 52, 18, 0.06);
  pointer-events: none;
  user-select: none;
}

.guide-article-head {
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.guide-article h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 6px 0 8px;
  line-height: 1.3;
}

.guide-article h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin: 22px 0 10px;
  color: var(--ink);
}

.guide-bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
}

.guide-bullets li {
  margin-bottom: 7px;
}

.xhs-callout {
  margin-top: 20px;
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.xhs-callout-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
}

/* ---------- Checklist & Budget Interactive Controls ---------- */
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-tint);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.check-row:hover {
  background: #FCF9F4;
}

.check-row.done {
  background: rgba(235, 245, 238, 0.36);
}

.check-row:last-child {
  border-bottom: none;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.check-row.done .check-title {
  text-decoration: line-through;
  color: var(--muted);
}

.stay-input {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
}

.stay-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.budget-bar-row {
  margin-bottom: 12px;
}

.budget-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.budget-bar-track {
  height: 7px;
  border-radius: 99px;
  background: var(--surface-warm);
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

/* ---------- Lightbox Modal ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 16, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(28, 25, 23, 0.7);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: min(94vw, 1280px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  max-width: 760px;
  margin-top: 14px;
  text-align: center;
  color: #F5F1E8;
  font-size: 13.5px;
  line-height: 1.6;
}

.lightbox-source {
  margin-top: 4px;
  font-size: 11.5px;
  color: #C6BEB2;
}

/* ---------- Daily Interactive Amap Card ---------- */
.day-map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 0;
}

.day-map-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-map-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.day-map-canvas {
  width: 100%;
  height: 460px;
  background: var(--surface-tint);
  position: relative;
  z-index: 1;
}

.day-map-stops {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-stop-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-stop-chip:hover,
.map-stop-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.map-stop-num {
  width: 18px;
  height: 18px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
}

.amap-pin-wrap {
  background: transparent;
  border: none;
}

.amap-pin {
  width: 28px;
  height: 28px;
  border-radius: 99px;
  background: var(--pin-color, var(--accent));
  color: #FFFFFF;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 3px 10px rgba(28, 25, 23, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.map-popup {
  font-family: var(--font-sans);
  min-width: 190px;
  max-width: 250px;
  line-height: 1.5;
  color: var(--ink);
}

.map-popup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}

.map-popup-num {
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.map-popup-time {
  font-size: 11.5px;
  color: var(--accent);
  margin-top: 4px;
}

.map-popup-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.map-popup-actions {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
}

.map-offline {
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

.map-offline-chain {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.map-offline-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
}

.tl-card.has-coord {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.tl-card.has-coord:hover {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(154, 52, 18, 0.1);
}

.tl-card.is-focused {
  background: #FFF9F5;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(154, 52, 18, 0.2);
}

.tl-card.is-alert.is-focused {
  background: var(--danger-bg);
}

/* ---------- Modal Backdrop (AMap Key Config) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(28, 25, 23, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 42px;
  font-size: 12.5px;
  color: var(--muted);
}

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

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 980px) {
  .hero-editorial {
    grid-template-columns: 1fr;
  }
  .route-nodes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .route-nodes::before {
    display: none;
  }
  body.page-day-split {
    height: auto;
    overflow: visible;
    display: block;
  }
  body.page-day-split .masthead .container {
    padding: 0 16px;
  }
  body.page-day-split .page-main {
    overflow: visible;
    padding: 0 0 calc(var(--mobile-bar-h) + 20px);
  }
  body.page-day-split .site-footer {
    display: block;
  }
  .day-inline-footer {
    display: none;
  }
  .day-split-viewport {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    max-width: 100%;
  }
  .day-content-pane {
    display: contents;
  }
  .day-top-block {
    order: 1;
    min-width: 0;
    width: 100%;
    padding: 0 0 12px;
  }
  .day-top-block .day-pills {
    padding: 14px 16px 8px;
  }
  .day-top-block > :not(.day-pills) {
    margin-left: 16px;
    margin-right: 16px;
  }
  .day-map-pane {
    order: 2;
    height: auto;
    min-width: 0;
    width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .day-body-block {
    order: 3;
    min-width: 0;
    width: 100%;
    padding: 12px 16px 20px;
  }
  .day-map-pane .day-map-canvas {
    flex: none;
    height: 280px;
  }
  .day-map-pane .day-map-stops {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    padding: 9px 12px;
  }
  .day-map-pane .map-stop-chip {
    flex-shrink: 0;
  }
  .guides-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .guides-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .guides-toc-title {
    width: 100%;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }
  .brand-issue {
    display: none;
  }
  .brand-title {
    font-size: 16.5px;
  }
  .day-map-floating-controls #day-map-status {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .mobile-tabbar {
    display: flex;
  }
  .page-main {
    padding: 22px 0 calc(var(--mobile-bar-h) + 32px);
  }
  .site-footer {
    padding-bottom: calc(var(--mobile-bar-h) + 28px);
  }
  .hero-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .route-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2, .grid-3, .grid-4,
  .media-grid.cols-2, .media-grid.cols-3 {
    grid-template-columns: 1fr;
  }
  .tl-item {
    grid-template-columns: 40px 14px 1fr;
    gap: 8px;
  }
  .tl-card {
    padding: 12px 13px;
  }
  .tl-title {
    font-size: 14.5px;
  }
  .tl-time {
    font-size: 11.5px;
  }
  .guide-article {
    padding: 18px;
  }
}
