:root {
  color-scheme: light;
  --night: #132a32;
  --night-soft: #21434a;
  --qian: #12685e;
  --qian-soft: #dceee9;
  --lacquer: #d45a45;
  --moss-gold: #d8a13b;
  --mist: #f1f6f4;
  --paper: #ffffff;
  --ink: #172522;
  --muted: #64736f;
  --line: #dbe5e1;
  --shadow: 0 16px 40px rgba(19, 42, 50, 0.09), 0 2px 8px rgba(19, 42, 50, 0.05);
  --shadow-small: 0 8px 24px rgba(19, 42, 50, 0.08);
  --radius-large: 26px;
  --radius-medium: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--mist);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 4%, rgba(18, 104, 94, 0.08), transparent 24rem),
    var(--mist);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible + .check-ui {
  outline: 3px solid rgba(216, 161, 59, 0.8);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--mist);
  box-shadow: 0 0 80px rgba(19, 42, 50, 0.08);
}

.hero {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: max(16px, calc(var(--safe-top) + 12px)) 20px 14px;
  color: #f9fffc;
  background:
    radial-gradient(circle at 86% 16%, rgba(216, 161, 59, 0.26) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 18%, transparent 0 70px, rgba(255, 255, 255, 0.08) 72px 73px, transparent 75px),
    radial-gradient(circle at 84% 18%, transparent 0 112px, rgba(255, 255, 255, 0.06) 114px 115px, transparent 117px),
    linear-gradient(148deg, var(--night) 0%, #153c41 58%, #176257 140%);
  border-radius: 0 0 34px 34px;
}

.hero::after {
  position: absolute;
  right: -70px;
  bottom: 42px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 46% 54% 42% 58%;
  content: "";
  transform: rotate(24deg);
}

.hero__topline,
.hero__copy,
.route-strip {
  position: relative;
  z-index: 1;
}

.hero__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.section-heading__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.sync-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.sync-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss-gold);
  box-shadow: 0 0 0 4px rgba(216, 161, 59, 0.13);
}

.sync-status[data-state="live"] .sync-status__dot {
  background: #71d2b6;
  box-shadow: 0 0 0 4px rgba(113, 210, 182, 0.13);
}

.sync-status[data-state="error"] .sync-status__dot {
  background: #ff8b78;
  box-shadow: 0 0 0 4px rgba(255, 139, 120, 0.13);
}

.hero__copy {
  margin-top: 24px;
}

.hero__date {
  margin: 0 0 8px;
  color: var(--moss-gold);
  font-family: "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(2.35rem, 10.5vw, 4rem);
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.route-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 20px -20px 0;
  padding: 13px 10px 14px;
  list-style: none;
  background: rgba(5, 26, 29, 0.28);
  backdrop-filter: blur(16px);
}

.route-strip::before {
  position: absolute;
  top: 39px;
  right: 8.5%;
  left: 8.5%;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  content: "";
}

.route-strip li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.6rem;
}

.route-strip b {
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff;
  background: var(--night-soft);
  font-family: "DIN Alternate", system-ui, sans-serif;
  font-size: 0.74rem;
}

.route-strip li.is-today b {
  border-color: var(--moss-gold);
  color: var(--night);
  background: var(--moss-gold);
  box-shadow: 0 0 0 5px rgba(216, 161, 59, 0.12);
}

.section-nav {
  position: sticky;
  z-index: 900;
  top: calc(10px + var(--safe-top));
  display: grid;
  width: calc(100% - 32px);
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 16px auto 0;
  padding: 5px;
  border: 1px solid rgba(19, 42, 50, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px);
}

.section-nav__item {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 720;
  cursor: pointer;
}

.section-nav__item.is-active {
  color: #fff;
  background: var(--night);
  box-shadow: 0 5px 14px rgba(19, 42, 50, 0.18);
}

.content-section {
  scroll-margin-top: 86px;
  padding: 72px 18px calc(56px + var(--safe-bottom));
}

.content-section[hidden] {
  display: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 4px 24px;
}

.section-heading__eyebrow {
  margin-bottom: 7px;
  color: var(--qian);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.4rem);
  font-weight: 810;
  letter-spacing: -0.045em;
}

.loading-copy {
  padding: 34px 8px;
  color: var(--muted);
  text-align: center;
}

.itinerary-list {
  position: relative;
  display: grid;
  gap: 14px;
}

.itinerary-list::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 39px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--moss-gold), var(--qian));
  content: "";
}

.day-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  padding: 19px 18px 19px 13px;
  border-radius: var(--radius-medium);
  background: var(--paper);
  box-shadow: var(--shadow-small);
}

.day-card__date {
  z-index: 1;
  display: flex;
  width: 52px;
  height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--paper);
  border-radius: 18px;
  color: var(--night);
  background: var(--qian-soft);
  font-family: "DIN Alternate", system-ui, sans-serif;
  line-height: 1;
}

.day-card__date b {
  font-size: 1.15rem;
}

.day-card__date span {
  margin-top: 3px;
  color: var(--qian);
  font-size: 0.6rem;
  font-weight: 750;
}

.day-card h3 {
  margin: 2px 0 8px;
  font-size: 1.03rem;
}

.day-card__items {
  margin: 0;
  color: #495955;
  font-size: 0.86rem;
  line-height: 1.72;
}

.progress-card {
  margin-bottom: 18px;
  padding: 19px;
  border-radius: var(--radius-medium);
  color: #fff;
  background: linear-gradient(120deg, var(--night), var(--night-soft));
  box-shadow: var(--shadow);
}

.progress-card__numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.progress-card__numbers strong {
  font-size: 1.2rem;
}

.progress-card__numbers span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.progress-track {
  height: 7px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--moss-gold), #f2c96b);
  transition: width 220ms ease;
}

.food-list {
  display: grid;
  gap: 12px;
}

.category-card {
  overflow: hidden;
  border-radius: var(--radius-medium);
  background: var(--paper);
  box-shadow: var(--shadow-small);
}

.category-card summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}

.category-card summary::-webkit-details-marker {
  display: none;
}

.category-card summary::after {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.category-card[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.category-card__title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
}

.category-card__glyph {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--qian);
  background: var(--qian-soft);
  font-size: 1.05rem;
}

.category-card__name {
  min-width: 0;
}

.category-card__name strong,
.category-card__name span {
  display: block;
}

.category-card__name strong {
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card__name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.category-card__body {
  padding: 0 12px 12px;
}

.category-taste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  padding: 10px 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.check-label {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.check-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-ui {
  position: relative;
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #b8c8c3;
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 0 -2px 0 rgba(19, 42, 50, 0.05);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.check-label input:checked + .check-ui {
  border-color: var(--qian);
  background: var(--qian);
  transform: translateY(-1px);
}

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

.check-label input:disabled + .check-ui {
  cursor: wait;
  opacity: 0.5;
}

.shop-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 14px 12px;
  border-radius: 14px;
  background: #f7faf9;
}

.shop-card.is-checked {
  background: #eef4f2;
}

.shop-card.is-checked .shop-card__name {
  color: #74827e;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.shop-card__content {
  min-width: 0;
}

.shop-card__name {
  margin: 2px 0 5px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.shop-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.shop-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.shop-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--qian);
  background: #e2f1ed;
  font-size: 0.7rem;
  font-weight: 730;
  text-decoration: none;
}

.shop-action--map {
  color: #8c493d;
  background: #f9e7e2;
}

.shop-action--pending {
  color: #7a6850;
  background: #eeeae3;
}

.map-heading {
  align-items: center;
}

.locate-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--qian);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(18, 104, 94, 0.2);
}

.locate-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.map-summary {
  margin: -12px 4px 13px;
  color: var(--muted);
  font-size: 0.78rem;
}

.map-frame {
  position: relative;
  min-height: min(66vh, 590px);
  overflow: hidden;
  border: 6px solid var(--paper);
  border-radius: var(--radius-large);
  background: #dfe9e5;
  box-shadow: var(--shadow);
}

.map {
  min-height: min(66vh, 590px);
}

.map-gate {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: var(--night);
  background:
    radial-gradient(circle at 24% 20%, rgba(18, 104, 94, 0.16), transparent 16rem),
    linear-gradient(145deg, #edf4f1, #d8e6e1);
  text-align: center;
}

.map-gate[hidden] {
  display: none;
}

.map-gate__pin {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border: 6px solid rgba(255, 255, 255, 0.82);
  border-radius: 19px 19px 19px 6px;
  color: #fff;
  background: var(--lacquer);
  box-shadow: 0 12px 25px rgba(126, 54, 43, 0.2);
  font-size: 1.35rem;
  transform: rotate(-7deg);
}

.map-gate button {
  margin-top: 18px;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--night);
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(19, 42, 50, 0.18);
}

.shop-marker-wrapper {
  display: grid !important;
  place-items: center;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}

.shop-marker {
  position: relative;
  display: flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 9px 9px 9px 3px;
  color: #fff;
  background: var(--lacquer);
  box-shadow: 0 5px 12px rgba(80, 35, 29, 0.32);
  font-size: 0.66rem;
  transform: rotate(-5deg);
}

.shop-marker__star {
  transform: rotate(5deg);
}

.shop-marker__label {
  position: absolute;
  top: -3px;
  left: 34px;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  border: 2px solid #fff;
  border-radius: 9px;
  color: var(--night);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(19, 42, 50, 0.18);
  font-family: "PingFang SC", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: rotate(5deg);
}

.map:not(.labels-visible) .shop-marker__label,
.shop-marker__label[data-collided="true"] {
  display: none;
}

.location-marker {
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #2487ef;
  box-shadow: 0 0 0 8px rgba(36, 135, 239, 0.2), 0 4px 12px rgba(20, 64, 110, 0.28);
}

.shop-popup {
  min-width: 190px;
  font-family: "PingFang SC", system-ui, sans-serif;
}

.shop-popup strong {
  display: block;
  margin-bottom: 6px;
  color: var(--night);
  font-size: 0.86rem;
}

.shop-popup p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.68rem;
}

.shop-popup__actions {
  display: flex;
  gap: 7px;
}

.shop-popup a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 9px;
  color: #fff;
  background: var(--qian);
  font-size: 0.7rem;
  font-weight: 730;
  text-decoration: none;
}

.shop-popup a:last-child {
  background: var(--lacquer);
}

.leaflet-control-attribution {
  font-size: 11px !important;
}

.toast {
  position: fixed;
  z-index: 2000;
  right: 16px;
  bottom: calc(18px + var(--safe-bottom));
  left: 16px;
  width: min(520px, calc(100% - 32px));
  margin: auto;
  padding: 13px 16px;
  border-radius: 14px;
  color: #fff;
  background: rgba(19, 42, 50, 0.94);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  text-align: center;
  backdrop-filter: blur(12px);
}

noscript {
  display: block;
  padding: 16px;
  color: #fff;
  background: #8b3428;
  text-align: center;
}

@media (min-width: 620px) {
  .hero {
    padding-right: 38px;
    padding-left: 38px;
  }

  .route-strip {
    margin-right: -38px;
    margin-left: -38px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .content-section {
    padding-right: 32px;
    padding-left: 32px;
  }

  .itinerary-list {
    grid-template-columns: 1fr 1fr;
  }

  .itinerary-list::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
