:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1e1e2f;
  --muted: #5f6b7a;
  --line: #e2e8f0;
  --accent: #0ea5e9;
  --accent-soft: #f0f9ff;
  --warn: #cb3740;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.06rem;
  text-align: center;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  height: 30px;
  width: 30px;
  font-size: 1rem;
}

.icon-btn.hidden {
  visibility: hidden;
}

.view-stack {
  position: relative;
  overflow: hidden;
}

.route-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 12px;
  display: none;
  transform: translateX(14%);
  opacity: 0;
  pointer-events: none;
}

.route-view.active {
  display: block;
  animation: slide-in 220ms ease-out forwards;
  pointer-events: auto;
}

.route-view.leaving-left {
  display: block;
  animation: slide-out-left 220ms ease-in forwards;
  pointer-events: none;
}

.route-view.leaving-right {
  display: block;
  animation: slide-out-right 220ms ease-in forwards;
  pointer-events: none;
}

@keyframes slide-in {
  from {
    transform: translateX(14%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-left {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-14%);
    opacity: 0;
  }
}

@keyframes slide-out-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(14%);
    opacity: 0;
  }
}

.tag-filter-bar {
  display: flex;
  gap: 8px;
  overflow: visible;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  white-space: nowrap;
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chip-extra {
  display: none;
}

.chip-extra.visible {
  display: inline-flex;
}

.chip-more {
  border-style: dashed;
}

.suggest-chip {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.8rem;
}

.suggest-chip:disabled {
  opacity: 0.45;
}

.feed-search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.feed-search-wrap input {
  min-width: 0;
}

.feed-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 140px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}

.feed-card {
  cursor: pointer;
}

.cover {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.hero-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.feed-card h3 {
  margin: 8px 0 4px;
  font-size: 0.95rem;
}

.feed-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.tag {
  display: inline-block;
  margin-top: 4px;
  margin-right: 4px;
  border-radius: 99px;
  background: #eef2ff;
  color: #0ea5e9;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  font-size: 0.72rem;
}

.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.city-chip button {
  border: none;
  background: transparent;
  color: #0c4a6e;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-links a {
  color: #145ea8;
  text-decoration: none;
  font-size: 0.8rem;
}

.inline-links a:hover {
  text-decoration: underline;
}

.empty-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.fab {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
  z-index: 1100;
  transition: opacity 180ms ease, transform 180ms ease;
}

.fab.fab-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.fab-step-next {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: min(92vw, 360px);
  height: 50px;
  border-radius: 14px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.fab-step-next.hidden {
  display: none;
}

.segment-recommend-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  border: 1px solid #bae6fd;
  color: #0369a1;
  background: #e0f2fe;
}

.spot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.step-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.input-action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.input-action-row .btn {
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px;
  background: #fff;
}

label.check {
  grid-template-columns: 16px 1fr;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

label.check input {
  width: 14px;
  height: 14px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 11px;
}

.btn.ghost {
  background: #f8fafc;
}

.btn.selected {
  border-color: #7dd3fc;
  background: #e0f2fe;
  color: #075985;
}

.btn:disabled {
  opacity: 0.5;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.row.wrap {
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.alert {
  margin-top: 8px;
  border: 1px solid #ffd9a8;
  background: #fff7e8;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
}

.warn {
  color: var(--warn);
  font-weight: 700;
}

.mode-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.transport-option.selected,
.hotel-card.selected,
.mini-spot.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ticket-choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.ticket-choice input {
  width: 14px;
  margin-top: 2px;
}

.mini-spot {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
  background: #fff;
}

.mini-spot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.mini-spot-body {
  padding: 8px;
}

.video-card a {
  color: #145ea8;
  text-decoration: none;
}

.video-card a:hover {
  text-decoration: underline;
}

.food-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.food-item:last-child {
  border-bottom: none;
}

.food-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.inline-ticket-detail {
  margin-top: 8px;
}

.hotel-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  margin-top: 8px;
}

.hotel-card details {
  margin-top: 8px;
}

.hotel-card summary {
  cursor: pointer;
  color: #0369a1;
  font-size: 0.84rem;
}

#routeOrderHint .route-order-item {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
}

#planRestoreBar .btn {
  margin-top: 8px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.cost-line:last-child {
  border-bottom: none;
}

.cost-extra {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.weather-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.weather-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

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

.weather-city {
  font-size: 0.82rem;
  color: var(--muted);
}

.weather-condition {
  font-weight: 600;
  font-size: 0.9rem;
}

.weather-temp {
  font-size: 0.84rem;
  color: var(--muted);
}

.weather-score {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
}

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}

.tab-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 8px 0;
  color: var(--muted);
}

.tab-item.active {
  color: var(--text);
  border-color: #bae6fd;
  background: #f0f9ff;
}

.onboarding {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1400;
  padding: 18px 12px calc(90px + env(safe-area-inset-bottom));
  overflow: auto;
}

.onboarding.hidden {
  display: none;
  pointer-events: none;
}

.onboarding-card {
  margin: 0 auto;
  max-width: 520px;
}

.onboarding-card h3 {
  margin: 0 0 8px;
}

.onboarding-steps {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.onboarding-step strong {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  color: #0369a1;
}

@media (max-width: 560px) {
  .form-grid,
  .mode-summary-grid,
  .spot-actions {
    grid-template-columns: 1fr;
  }
}
