:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-soft: #f8f9fb;
  --line: #e6e9ef;
  --text: #121417;
  --muted: #667085;
  --primary: #111111;
  --accent: #4c6fff;
  --green: #19b36b;
  --orange: #f38b3c;
  --purple: #7f6bff;
  --shadow: 0 18px 42px rgba(17, 20, 23, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(76, 111, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #f5f6f8 0%, #edf0f5 100%);
  color: var(--text);
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.top-stack {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.98), rgba(243, 244, 246, 0.94));
  backdrop-filter: blur(10px);
}

.map-panel {
  position: relative;
  margin: 12px 12px 0;
  aspect-ratio: 2 / 1;
  height: auto;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #dfe5ef;
}

.map-panel.expanded {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 80;
  aspect-ratio: auto;
  height: 50vh;
  margin: 0;
  border-radius: 24px;
}

#trip-map {
  width: 100%;
  height: 100%;
}

.map-expand-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 700;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(17, 20, 23, 0.86);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(17, 20, 23, 0.22);
  cursor: pointer;
}

.map-credit {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 650;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(17, 20, 23, 0.08);
}

.detail-panel {
  position: relative;
  margin-top: 0;
  padding: 14px 16px 34px;
  border-radius: 24px 24px 0 0;
  background: var(--panel);
  min-height: 48vh;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-tab {
  position: relative;
  font-size: 16px;
  font-weight: 800;
  padding-bottom: 10px;
}

.detail-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.detail-caption {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.day-switcher {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 12px 10px;
  margin: 0;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(230, 233, 239, 0.92);
}

.day-switcher::-webkit-scrollbar {
  display: none;
}

.day-pill {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  transition: all 180ms ease;
}

.day-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.day-detail-head {
  margin-bottom: 18px;
}

.day-detail-date {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.day-detail-title {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  line-height: 1.18;
}

.day-detail-summary {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, rgba(76, 111, 255, 0.22), rgba(25, 179, 107, 0.18));
}

.timeline-item {
  position: relative;
  padding-left: 44px;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(76, 111, 255, 0.18);
}

.timeline-dot.route {
  background: var(--purple);
}

.timeline-dot.activity {
  background: var(--green);
}

.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(17, 20, 23, 0.04);
  overflow: hidden;
}

.timeline-card-head {
  padding: 16px 16px 10px;
}

.timeline-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #f3f6ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.timeline-title {
  margin: 12px 0 0;
  font-size: 28px;
  line-height: 1.24;
  font-family: "Songti SC", "STSong", serif;
}

.timeline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-content {
  padding: 0 16px 16px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.8;
}

.timeline-content li + li {
  margin-top: 8px;
}

.leaflet-container {
  font: inherit;
}

.leaflet-control-attribution {
  display: none;
}

.map-name-tooltip {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(18, 20, 23, 0.08);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(17, 20, 23, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 10px;
  white-space: nowrap;
}

.map-name-tooltip::before {
  display: none;
}

.map-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 18px rgba(17, 20, 23, 0.22);
}

.marker-blue {
  background: #4c6fff;
}

.marker-green {
  background: #19b36b;
}

.marker-orange {
  background: #f38b3c;
}

@media (min-width: 960px) {
  .app-shell {
    width: min(100%, 1180px);
    padding: 18px;
  }

  .map-panel {
    margin: 0;
    max-height: 460px;
  }

  .map-panel.expanded {
    left: 18px;
    right: 18px;
    top: 18px;
    height: 56vh;
  }

  .detail-panel {
    margin-top: 0;
    border-radius: 30px;
    padding: 28px;
  }

  .day-detail-title {
    font-size: 40px;
  }
}
