:root {
  --ink: #17211c;
  --muted: #63716a;
  --line: #dfe6df;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --green: #1f6f55;
  --green-dark: #164f3e;
  --coral: #de5d48;
  --gold: #c9953d;
  --sky: #d9ecf3;
  --mist: #f4f7f1;
  --shadow: 0 18px 55px rgba(24, 39, 30, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(217, 236, 243, 0.9), rgba(244, 247, 241, 0.95)),
    #f4f7f1;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(360px, 1fr);
  gap: 20px;
  align-items: stretch;
}

.planner-panel,
.result-panel,
.loading-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.planner-panel {
  border-radius: 8px;
  padding: 28px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(222, 93, 72, 0.3);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.planner-form {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input[type="date"],
input[type="text"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 85, 0.13);
}

.city-field {
  position: relative;
}

.city-picker {
  position: relative;
}

.city-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.city-toggle span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-toggle.is-open,
.city-toggle:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 85, 0.13);
  outline: none;
}

.selected-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.city-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
  color: var(--green-dark);
  background: #eef7f2;
  font-size: 13px;
  font-weight: 800;
}

.city-tag button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.city-tag button:hover {
  background: rgba(31, 111, 85, 0.12);
}

.city-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(24, 39, 30, 0.18);
}

.city-menu input {
  margin-bottom: 10px;
}

.city-options {
  max-height: 286px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.city-group {
  display: grid;
  gap: 6px;
}

.city-group-title {
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.city-option {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8faf7;
  cursor: pointer;
  text-align: left;
}

.city-option:hover,
.city-option.is-selected {
  border-color: rgba(31, 111, 85, 0.28);
  background: #eef7f2;
}

.city-option-name {
  display: grid;
  gap: 1px;
}

.city-option-name strong {
  font-size: 14px;
}

.city-option-name small {
  color: var(--muted);
  font-size: 11px;
}

.city-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #fff;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.city-option.is-selected .city-check {
  border-color: var(--green);
  background: var(--green);
}

.city-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chip-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.chip span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 700;
}

.chip input:checked + span {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.range-row {
  display: grid;
  gap: 6px;
}

input[type="range"] {
  accent-color: var(--green);
}

.pace-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.ghost-button,
.mini-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  height: 52px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(31, 111, 85, 0.22);
}

.primary-button:hover {
  background: var(--green-dark);
}

.hero-visual {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 8px;
  background: #d9ecf3;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(18, 32, 27, 0.34));
  pointer-events: none;
  z-index: 2;
}

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

.comic-burst {
  position: absolute;
  inset: -70px -90px auto auto;
  width: 360px;
  height: 360px;
  background:
    conic-gradient(
      from -8deg,
      rgba(255, 255, 255, 0.75) 0 8deg,
      transparent 8deg 18deg
    );
  opacity: 0.75;
  z-index: 0;
}

.speed-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.speed-lines span {
  position: absolute;
  height: 5px;
  background: #111;
  border-radius: 999px;
  transform: rotate(-11deg);
}

.speed-lines span:nth-child(1) {
  left: 26px;
  top: 86px;
  width: 132px;
}

.speed-lines span:nth-child(2) {
  left: 56px;
  top: 142px;
  width: 82px;
}

.speed-lines span:nth-child(3) {
  right: 42px;
  top: 238px;
  width: 128px;
}

.speed-lines span:nth-child(4) {
  left: 84px;
  bottom: 236px;
  width: 104px;
}

.speed-lines span:nth-child(5) {
  right: 76px;
  bottom: 176px;
  width: 164px;
}

.sun {
  position: absolute;
  top: 76px;
  right: 76px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(#111 1px, transparent 1.2px) 0 0 / 10px 10px,
    #ff5f4d;
  border: 4px solid #111;
  box-shadow: 8px 8px 0 #111;
  z-index: 2;
}

.cloud {
  position: absolute;
  width: 116px;
  height: 42px;
  border: 4px solid #111;
  border-radius: 999px;
  background: #fffdf2;
  box-shadow: 6px 6px 0 #111;
  z-index: 2;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 48px;
  height: 48px;
  border: 4px solid #111;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: #fffdf2;
}

.cloud::before {
  left: 18px;
}

.cloud::after {
  right: 16px;
  width: 40px;
  height: 40px;
}

.cloud-a {
  top: 98px;
  left: 56px;
}

.cloud-b {
  top: 178px;
  right: 152px;
  transform: scale(0.74);
}

.mountain {
  position: absolute;
  left: 50%;
  width: 520px;
  height: 360px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 8px 22px 8px 22px;
  border: 5px solid #111;
  z-index: 3;
}

.mountain-back {
  bottom: 68px;
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(255, 255, 255, 0.42) 44% 56%, transparent 56%),
    #7fc0a8;
}

.mountain-front {
  bottom: -26px;
  width: 620px;
  height: 430px;
  background:
    radial-gradient(#fff 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    linear-gradient(135deg, #fff 0 16%, transparent 16% 100%),
    #2d7c68;
  box-shadow: 10px 10px 0 #111;
}

.track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 104px;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #111 0 28px,
    transparent 28px 40px
  );
  z-index: 5;
}

.track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 6px;
  background: #111;
}

.train {
  position: absolute;
  left: 12%;
  right: 10%;
  bottom: 124px;
  height: 58px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border: 4px solid #111;
  border-radius: 36px 8px 8px 36px;
  background: #fffdf2;
  box-shadow: 10px 10px 0 #111;
  z-index: 6;
}

.train-nose {
  position: absolute;
  left: -18px;
  top: 8px;
  width: 44px;
  height: 36px;
  border: 4px solid #111;
  border-right: 0;
  border-radius: 36px 0 0 36px;
  background: #fffdf2;
}

.train span {
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.7), transparent 48%),
    #78c8e2;
  border: 3px solid #111;
  border-bottom: 8px solid #ff5f4d;
}

.speech-bubble {
  position: absolute;
  top: 54px;
  left: 34%;
  padding: 12px 18px;
  color: #111;
  background: #fffdf2;
  border: 4px solid #111;
  border-radius: 999px;
  box-shadow: 6px 6px 0 #111;
  font-weight: 900;
  transform: rotate(-8deg);
  z-index: 7;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -14px;
  width: 18px;
  height: 18px;
  background: #fffdf2;
  border-right: 4px solid #111;
  border-bottom: 4px solid #111;
  transform: rotate(45deg);
}

.city-card {
  position: absolute;
  left: 28px;
  bottom: 28px;
  width: min(310px, calc(100% - 56px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(24, 39, 30, 0.18);
  z-index: 3;
}

.city-card p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.city-card strong {
  font-size: 20px;
}

.loading-panel,
.result-panel {
  grid-column: 1 / -1;
  border-radius: 8px;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
}

.loader {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(31, 111, 85, 0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-panel {
  padding: 24px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.result-header h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.result-header p:last-child {
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 8px;
}

.transport-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf8;
}

.transport-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.transport-heading h3 {
  margin-bottom: 0;
  font-size: 20px;
}

#transportBadge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  color: #5b4825;
  background: #fff4dc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.transport-list {
  display: grid;
  gap: 10px;
}

.transport-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.7fr) minmax(120px, 0.8fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e8eee6;
  border-radius: 8px;
  background: #fff;
}

.transport-route {
  display: grid;
  gap: 4px;
}

.transport-route strong {
  font-size: 15px;
}

.transport-route span,
.transport-meta,
.transport-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.transport-mode {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.transport-main {
  display: grid;
  gap: 6px;
}

.transport-main strong {
  font-size: 15px;
}

.transport-note {
  padding-left: 12px;
  border-left: 3px solid #fff4dc;
}

.ghost-button,
.mini-button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--green);
  background: #eef7f2;
}

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

.day-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.day-index {
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.day-card h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.mini-button {
  min-width: 86px;
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.slot {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
}

.slot-time {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.slot-body {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2ee;
}

.slot-body strong {
  display: block;
  margin-bottom: 4px;
}

.slot-body p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.map-card {
  margin-top: 10px;
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e3ece6;
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 111, 85, 0.08), rgba(217, 236, 243, 0.34)),
    #fff;
  text-decoration: none;
}

.map-card:hover {
  border-color: rgba(31, 111, 85, 0.32);
  box-shadow: 0 8px 18px rgba(24, 39, 30, 0.08);
}

.map-card span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.map-card b {
  font-size: 13px;
}

.map-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card em {
  min-width: 42px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.tips-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tip {
  padding: 7px 9px;
  border-radius: 8px;
  color: #5b4825;
  background: #fff4dc;
  font-size: 12px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .hero-visual {
    min-height: 360px;
    order: -1;
  }

  .sun {
    top: 36px;
    right: 36px;
    width: 82px;
    height: 82px;
  }

  .mountain-back {
    bottom: 20px;
  }

  .mountain-front {
    bottom: -90px;
  }

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

  .transport-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .planner-panel,
  .result-panel {
    padding: 18px;
  }

  .field-grid,
  .chip-group {
    grid-template-columns: 1fr;
  }

  .result-header,
  .day-card-header {
    display: grid;
  }

  .result-actions {
    width: 100%;
  }

  .transport-heading {
    display: grid;
  }

  .ghost-button {
    flex: 1;
  }
}
