:root {
  --bg: #f6faf8;
  --paper: #ffffff;
  --ink: #17302f;
  --muted: #65736f;
  --line: #dce8e2;
  --sea: #0f6f78;
  --sea-strong: #0a5660;
  --leaf: #3d7655;
  --coral: #c85f45;
  --sun: #c18a2e;
  --shadow: 0 12px 28px rgba(22, 50, 46, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(15, 111, 120, 0.45);
  outline-offset: 2px;
}

main {
  padding-bottom: 88px;
}

.hero {
  position: relative;
  min-height: 430px;
  max-height: 560px;
  height: 54vh;
  overflow: hidden;
  color: #fff;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 35, 35, 0.76), rgba(9, 35, 35, 0.32) 54%, rgba(9, 35, 35, 0.08)),
    linear-gradient(0deg, rgba(9, 35, 35, 0.72), rgba(9, 35, 35, 0.08) 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(1120px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 28px 18px 26px;
}

.eyebrow,
.section-kicker,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.hero h1 {
  margin: 8px 0 6px;
  max-width: 760px;
  font-size: 2.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 0 0 18px;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.hero-meta-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-meta-item span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
}

.hero-meta-item strong {
  color: #fff;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.45;
}

.hero-weather {
  margin: 16px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
}

.app-section {
  scroll-margin-top: 18px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0 6px;
}

.section-header {
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-kicker {
  color: var(--sea);
  font-weight: 700;
}

.day-switch,
.map-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.segmented-button {
  min-width: 62px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.segmented-button span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.segmented-button.is-active {
  border-color: var(--sea);
  background: var(--sea);
  color: #fff;
}

.segmented-button.is-active span {
  color: rgba(255, 255, 255, 0.76);
}

.today-summary,
.weather-now,
.budget-summary,
.tips-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.today-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
  padding: 16px;
}

.today-summary h3 {
  margin: 4px 0 0;
  font-size: 1.18rem;
  line-height: 1.35;
}

.progress-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(15, 111, 120, 0.1);
  color: var(--sea-strong);
  padding: 8px 11px;
  font-size: 0.88rem;
  font-weight: 700;
}

.keyword-row,
.tag-row,
.dish-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword-chip,
.tag-row span,
.dish-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(61, 118, 85, 0.1);
  color: var(--leaf);
  font-size: 0.82rem;
  font-weight: 650;
}

.tag-row span {
  background: rgba(15, 111, 120, 0.09);
  color: var(--sea-strong);
}

.dish-row span {
  background: rgba(200, 95, 69, 0.1);
  color: var(--coral);
}

.period-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0 16px;
}

.period-tile {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--sun);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px 13px;
}

.period-tile span {
  color: var(--muted);
  line-height: 1.55;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 13px 13px 14px;
  box-shadow: 0 8px 18px rgba(22, 50, 46, 0.06);
}

.timeline-item.is-done {
  opacity: 0.72;
}

.timeline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.timeline-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-check input:checked + .check-mark {
  border-color: var(--leaf);
  background: var(--leaf);
}

.timeline-check input:checked + .check-mark::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.timeline-time {
  color: var(--sea-strong);
  font-weight: 800;
}

.timeline-body h3,
.weather-card h3,
.place-card h3,
.food-card h3 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.38;
}

.timeline-body p,
.place-card p,
.food-card p,
.tips-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.budget-note,
.caution {
  color: var(--coral) !important;
  font-weight: 650;
}

.weather-dashboard {
  display: grid;
  gap: 12px;
}

.weather-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 285px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sea);
  box-shadow: var(--shadow);
}

.weather-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 39, 43, 0.8), rgba(8, 39, 43, 0.28)),
    linear-gradient(0deg, rgba(8, 39, 43, 0.78), rgba(8, 39, 43, 0.04)),
    url("/assets/weather-sea.png") center / cover;
}

.weather-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  min-height: 285px;
  padding: 18px;
  color: #fff;
}

.weather-hero-content .section-kicker,
.weather-hero-content .muted {
  color: rgba(255, 255, 255, 0.72);
}

.weather-hero-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.weather-hero-top h3 {
  margin: 5px 0 0;
  font-size: 1.36rem;
  line-height: 1.25;
}

.refresh-button {
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.weather-live {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.weather-temp-block span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
}

.weather-temp-block strong {
  display: block;
  margin-top: 2px;
  font-size: 4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.weather-temp-block p,
.weather-live-note,
.weather-updated {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.55;
}

.weather-live-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weather-live-facts span,
.weather-metrics span {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 750;
}

.weather-live-facts span {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

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

.weather-mini-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(22, 50, 46, 0.06);
}

.weather-mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.weather-mini-card h3 {
  margin: 5px 0;
  font-size: 1.18rem;
}

.weather-mini-card strong,
.weather-mini-card span {
  display: block;
  line-height: 1.38;
}

.weather-mini-card strong {
  color: var(--coral);
  font-size: 0.96rem;
}

.weather-mini-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.weather-detail-grid,
.food-grid {
  display: grid;
  gap: 12px;
}

.weather-card,
.place-card,
.food-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
  box-shadow: 0 8px 18px rgba(22, 50, 46, 0.06);
}

.weather-card-head,
.food-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.temp-range {
  display: grid;
  min-width: 58px;
  text-align: right;
}

.temp-range strong {
  color: var(--coral);
  font-size: 1.2rem;
}

.temp-range span {
  color: var(--muted);
}

.weather-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
}

.weather-metrics span {
  background: rgba(15, 111, 120, 0.09);
  color: var(--sea-strong);
}

.weather-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.period-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.period-list > div {
  border-left: 3px solid var(--sea);
  border-radius: 8px;
  background: #f3fbfa;
  padding: 10px 12px;
}

.period-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.period-list strong {
  margin-right: 0;
}

.period-list span {
  color: var(--sea-strong);
  font-weight: 700;
}

.period-list p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.period-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.rain-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 111, 120, 0.1);
  margin-top: 8px;
}

.rain-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sea);
}

.risk-medium {
  border-color: rgba(193, 138, 46, 0.38);
}

.risk-medium .rain-meter i {
  background: var(--sun);
}

.risk-high {
  border-color: rgba(200, 95, 69, 0.42);
}

.risk-high .rain-meter i {
  background: var(--coral);
}

.map-layout {
  display: grid;
  gap: 12px;
}

.map-pane {
  min-width: 0;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.map-provider {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--sea-strong);
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.map-canvas {
  position: relative;
  height: 50vh;
  min-height: 330px;
  max-height: 540px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(15, 111, 120, 0.18), rgba(61, 118, 85, 0.08)),
    #eaf5f2;
}

.map-canvas .leaflet-container,
.leaflet-container {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: var(--sea-strong);
}

.map-placeholder span {
  color: var(--muted);
}

.place-list {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: none;
}

.place-card {
  cursor: pointer;
}

.place-card-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.place-title {
  min-width: 0;
}

.place-card.is-selected {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(15, 111, 120, 0.12);
}

.marker-label,
.amap-custom-marker,
.leaflet-custom-marker {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--sea);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(22, 50, 46, 0.22);
}

.marker-label.hotel,
.amap-custom-marker.hotel,
.leaflet-custom-marker.hotel {
  background: var(--coral);
}

.marker-label.station,
.amap-custom-marker.station,
.leaflet-custom-marker.station {
  background: var(--ink);
}

.marker-label.nightmarket,
.amap-custom-marker.nightmarket,
.leaflet-custom-marker.nightmarket {
  background: var(--sun);
}

.leaflet-marker-wrap {
  background: transparent;
  border: 0;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

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

.action-row a,
.action-row button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--sea-strong);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.action-row a:first-of-type,
.secondary-button {
  border-color: var(--sea);
  background: var(--sea);
  color: #fff;
}

.food-card-head strong {
  flex: 0 0 auto;
  color: var(--coral);
  font-size: 0.95rem;
}

.dish-row {
  margin-top: 12px;
}

.tips-panel {
  margin-top: 12px;
  padding: 14px;
}

.tips-panel strong {
  color: var(--coral);
}

.budget-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.budget-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--coral);
  font-size: 1.55rem;
}

.budget-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.budget-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px;
}

.budget-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.budget-row small {
  color: var(--muted);
  line-height: 1.4;
}

.budget-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 8px max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  backdrop-filter: blur(18px);
}

.bottom-nav-item {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.bottom-nav-item.is-active {
  background: rgba(15, 111, 120, 0.12);
  color: var(--sea-strong);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 30;
  max-width: calc(100% - 36px);
  transform: translateY(12px);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 11px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.map-info-window {
  max-width: 220px;
  color: var(--ink);
}

.map-info-window p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.fatal {
  width: min(520px, calc(100% - 32px));
  margin: 14vh auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

@media (min-width: 680px) {
  .period-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weather-detail-grid,
  .food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .place-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 920px) {
  .hero {
    height: 50vh;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .app-section {
    padding-top: 38px;
  }

  .map-layout {
    grid-template-columns: minmax(0, 1.1fr) 390px;
    align-items: start;
  }

  .place-list {
    max-height: 620px;
    overflow: auto;
    padding-right: 2px;
  }

  .map-canvas {
    height: 58vh;
    max-height: 620px;
  }
}

@media (max-width: 430px) {
  .hero {
    min-height: 420px;
    height: 56vh;
  }

  .hero h1 {
    font-size: 2.15rem;
  }

  .hero-meta-item {
    grid-template-columns: 38px 1fr;
  }

  .today-summary,
  .weather-card-head,
  .food-card-head {
    align-items: start;
  }

  .weather-live {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .weather-temp-block strong {
    font-size: 3.3rem;
  }

  .weather-day-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-toolbar {
    grid-template-columns: 1fr;
  }

  .map-provider {
    width: fit-content;
  }

  .budget-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }
}
