/* 南太平洋纵贯线 · 互动攻略样式 */

:root {
  --color-au: #c9a227;
  --color-nz: #2d6a4f;
  --color-fj: #0077b6;
  --color-vu: #9d0208;
  --bg-dark: #0f1419;
  --bg-card: #1a2332;
  --text-primary: #e6edf3;
  --text-muted: #8b9cad;
  --serif: 'Noto Serif SC', serif;
  --sans: 'Noto Sans SC', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
}

.guide-topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.guide-topnav a {
  color: var(--text-muted);
  text-decoration: none;
}
.guide-topnav a:hover {
  color: var(--text-primary);
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(180deg, rgba(15, 20, 25, 0.7) 0%, var(--bg-dark) 100%),
    url('https://picsum.photos/seed/pacific/1920/1080');
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 640px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.btn-hero {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--color-fj);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.4);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scroll-arrow {
  animation: bounce 2s ease-in-out infinite;
}

/* ----- 简约版行程总结 ----- */
.summary-compact {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.summary-compact-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.summary-compact-table {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.summary-compact-row {
  display: grid;
  grid-template-columns: 1fr 0.9fr 0.5fr 2fr;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
}

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

.summary-compact-row.header {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-compact-row span:last-child {
  color: var(--text-muted);
}

.summary-compact-foot {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .summary-compact-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
  }
  .summary-compact-row.header {
    display: none;
  }
  .summary-compact-row span:nth-child(4) {
    grid-column: 1;
    margin-top: 0.25rem;
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ----- Section 通用 ----- */
.section-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  text-align: center;
  margin: 0 0 0.5rem;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- 地图区块 ----- */
.map-section {
  padding: 4rem 1.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.map-container {
  width: 100%;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}

.map-container .leaflet-container {
  background: #1a2332;
  font-family: var(--sans);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.pin-au { background: var(--color-au); }
.pin-nz { background: var(--color-nz); }
.pin-fj { background: var(--color-fj); }
.pin-vu { background: var(--color-vu); }

/* Leaflet 主地图 - 红色定位钉（内联样式兜底，此处统一尺寸与形状） */
.custom-marker {
  background: none !important;
  border: none !important;
}

.custom-marker .marker-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: block;
  box-sizing: border-box;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0.5rem;
}

.leaflet-popup-content {
  margin: 0.5rem 0.75rem;
  min-width: 140px;
}

.popup-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.popup-content p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 段落卡片（地图下方） */
.segment-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.segment-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.segment-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.segment-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.segment-card strong {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.segment-card span:last-child {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ----- 行程段落 ----- */
.segment {
  padding: 4rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.segment-header {
  margin-bottom: 2rem;
}

.segment-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.segment h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}

.segment-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.plan-variant {
  margin: 0 0 1.75rem;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  background: rgba(45, 106, 79, 0.18);
  border: 1px solid rgba(45, 106, 79, 0.35);
}

.plan-variant h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.plan-variant ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.plan-variant p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.segment-visual {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.segment-visual img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.day-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.day-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.2s, border-color 0.2s;
}

.day-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.day-card.highlight {
  border-color: var(--color-fj);
  box-shadow: 0 0 0 1px rgba(0, 119, 182, 0.3);
}

.day-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-fj);
  margin-bottom: 0.5rem;
}

.day-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.day-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-map {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--color-fj);
  text-decoration: none;
  transition: color 0.2s;
}

.link-map:hover {
  color: #38bdf8;
}

/* ----- 各段小地图 ----- */
.segment-map-wrap {
  margin-bottom: 2rem;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.segment-map-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  padding: 1rem 1.25rem 0.5rem;
  color: var(--text-muted);
}

.segment-map {
  width: 100%;
  height: 320px;
  background: #1a2332;
}

.segment-map .leaflet-container {
  background: #1a2332;
  font-family: var(--sans);
}

.segment-label-marker {
  background: none !important;
  border: none !important;
}

.segment-label-marker .segment-pin {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin: 0 auto 4px;
  box-sizing: border-box;
}

.segment-label-marker .segment-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 auto;
}

/* ----- 滚动动画 ----- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

.segment.in-view .segment-visual {
  animation: fadeScale 0.8s ease-out;
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ----- 总结区 ----- */
.summary-section {
  padding: 4rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-section h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-align: center;
  margin: 0 0 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.summary-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.summary-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.summary-card span {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.exec-tips {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.exec-tips h3 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.exec-tips ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.exec-tips li {
  margin-bottom: 0.5rem;
}

/* ----- Footer ----- */
.page-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
  .map-container {
    height: 360px;
  }

  .segment-visual img {
    height: 220px;
  }

  .day-cards {
    grid-template-columns: 1fr;
  }
}
