/* ===========================================================
   北京徒步小助手 · 小红书种草风
   配色:桃粉 + 奶油白 + 暖橙 + 莫兰迪紫
   =========================================================== */

:root {
  /* 主色系 */
  --peach: #FF8FA3;
  --peach-deep: #FF6B8B;
  --peach-soft: #FFD6E0;
  --peach-bg: #FFF0F3;

  --orange: #FFB347;
  --orange-soft: #FFE0B5;
  --orange-bg: #FFF7EC;

  --purple: #B5A8D5;
  --purple-deep: #8E7CC3;
  --purple-soft: #E5DEF5;

  --green: #7AB892;
  --green-soft: #C8E6CE;
  --green-bg: #EEF8F0;

  /* 中性色 */
  --cream: #FFF8F0;
  --cream-2: #FAF4ED;
  --paper: #FFFFFF;
  --line: #F2E5DC;
  --line-soft: #F8EEE5;

  /* 文字 */
  --ink: #2D3142;
  --ink-2: #5A5E6F;
  --ink-3: #8B8FA0;
  --ink-4: #B8BCC8;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(255, 143, 163, .08);
  --shadow-md: 0 8px 24px rgba(255, 143, 163, .12);
  --shadow-lg: 0 16px 40px rgba(255, 143, 163, .15);
  --shadow-hover: 0 20px 48px rgba(255, 107, 139, .22);

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 214, 224, .55) 0%, transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(229, 222, 245, .5) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(255, 224, 181, .4) 0%, transparent 45%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "HarmonyOS Sans SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ============ HERO / TOPBAR ============ */
.topbar {
  position: relative;
  overflow: hidden;
  padding: 44px 40px 38px;
  border-radius: var(--r-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .9) 0%, rgba(255, 248, 240, .85) 100%),
    var(--paper);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 214, 224, .55);
}

.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .55;
  animation: float 10s ease-in-out infinite;
}
.blob-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--peach) 0%, transparent 70%);
  top: -80px; right: -40px;
}
.blob-2 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--orange) 0%, transparent 70%);
  bottom: -60px; right: 180px;
  animation-delay: -3s;
  opacity: .35;
}
.blob-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
  top: 40px; right: 260px;
  animation-delay: -6s;
  opacity: .4;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 12px) scale(1.05); }
}

.sparkle {
  position: absolute;
  color: var(--orange);
  font-size: 18px;
  animation: twinkle 2.4s ease-in-out infinite;
}
.sparkle.s1 { top: 24px; right: 80px; font-size: 22px; }
.sparkle.s2 { top: 70px; right: 320px; font-size: 14px; animation-delay: .6s; color: var(--peach-deep); }
.sparkle.s3 { bottom: 40px; right: 60px; font-size: 16px; animation-delay: 1.2s; color: var(--purple-deep); }

@keyframes twinkle {
  0%, 100% { opacity: .3; transform: scale(.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(180deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--peach-soft), var(--orange-soft));
  border-radius: var(--r-full);
  color: var(--peach-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 139, .15);
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--peach-deep) 60%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-emoji {
  display: inline-block;
  -webkit-text-fill-color: initial;
  margin-left: 8px;
  animation: wave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}

.topbar p {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 500;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.hero-chip {
  padding: 8px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.hero-chip:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--peach-bg), var(--orange-bg));
  border-color: var(--peach-soft);
  color: var(--peach-deep);
}

.weather-state {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 2;
  padding: 10px 18px;
  background: var(--paper);
  border-radius: var(--r-full);
  color: var(--purple-deep);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--purple-soft);
}

/* ============ 控制栏 ============ */
.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
}

label {
  display: block;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
}

input,
select {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  transition: all .2s ease;
  cursor: pointer;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%23FF6B8B' d='M6 8L1 3h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--peach);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(255, 143, 163, .18);
}

input::placeholder {
  color: var(--ink-4);
  font-weight: 500;
}

/* ============ Summary 卡片 ============ */
.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-card {
  position: relative;
  padding: 20px 18px;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: all .25s ease;
}

.summary-card::before {
  content: "";
  position: absolute;
  top: -20px; right: -20px;
  width: 60px; height: 60px;
  border-radius: 50%;
  opacity: .12;
  transition: all .3s ease;
}

.summary-card:nth-child(1)::before { background: var(--peach-deep); }
.summary-card:nth-child(2)::before { background: var(--green); }
.summary-card:nth-child(3)::before { background: var(--orange); }
.summary-card:nth-child(4)::before { background: var(--purple-deep); }
.summary-card:nth-child(5)::before { background: var(--peach); }

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.summary-card:hover::before {
  transform: scale(1.6);
  opacity: .2;
}

.summary-card b {
  display: block;
  color: var(--peach-deep);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}
.summary-card:nth-child(2) b { color: var(--green); }
.summary-card:nth-child(3) b { color: var(--orange); }
.summary-card:nth-child(4) b { color: var(--purple-deep); }

.summary-card span {
  display: block;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

/* ============ 路线卡片 ============ */
.route-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.route-card {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

.route-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--peach), var(--orange), var(--purple));
  opacity: 0;
  transition: opacity .25s ease;
}

.route-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.route-card:hover::before {
  opacity: 1;
}

.route-card.open {
  box-shadow: var(--shadow-lg);
  border-color: var(--peach-soft);
}
.route-card.open::before { opacity: 1; }

.route-head {
  padding: 22px 22px 14px;
  padding-right: 100px;  /* 给右上角浮动按钮腾位置 */
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--peach-bg);
  color: var(--peach-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  border: 1px solid rgba(255, 107, 139, .18);
}

.badge.warn {
  background: var(--orange-bg);
  color: #C2611E;
  border-color: var(--orange-soft);
}

.badge:first-child {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 107, 139, .3);
}

.badge:nth-child(n+3) {
  background: var(--purple-soft);
  color: var(--purple-deep);
  border-color: rgba(142, 124, 195, .2);
}

.route-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.2px;
}

.location {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.location::before {
  content: "📍 ";
}

.card-footer {
  padding: 0 22px 18px;
  display: flex;
  justify-content: center;
}

.detail-toggle {
  width: 100%;
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--peach-bg), var(--orange-bg));
  color: var(--peach-deep);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .5px;
}

.detail-toggle:hover {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 139, .35);
  transform: translateY(-1px);
}

.detail-toggle:active {
  transform: scale(.98);
}

.route-card.open .detail-toggle {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 22px 14px;
}

.fact {
  min-height: 66px;
  padding: 12px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--cream), var(--paper));
  border: 1px solid var(--line-soft);
  transition: all .2s ease;
}
.fact:hover {
  background: linear-gradient(135deg, var(--peach-bg), var(--paper));
  border-color: var(--peach-soft);
}

.fact b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.fact span {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ============ 天气 ============ */
.weather {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 22px 18px;
}

.weather-day {
  min-height: 90px;
  padding: 12px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fff, var(--cream-2));
  border: 1.5px solid var(--line);
  transition: all .2s ease;
}

.weather-day.clear {
  background: linear-gradient(180deg, #FFF9DB, #FFFCEC);
  border-color: #FCE7A1;
}
.weather-day.cloudy {
  background: linear-gradient(180deg, var(--purple-soft), #FAF8FF);
  border-color: rgba(142, 124, 195, .25);
}
.weather-day.rainy {
  background: linear-gradient(180deg, #DDE7F5, #F0F5FC);
  border-color: #B8CFEA;
}

.weather-day b,
.weather-day span {
  display: block;
}

.weather-day b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.weather-day span {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* ============ 详情区 ============ */
.details {
  display: none;
  padding: 0 22px 22px;
  animation: detailIn .35s ease;
}

@keyframes detailIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.route-card.open .details {
  display: block;
}

.detail-block {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--cream), var(--paper));
  border: 1px solid var(--line-soft);
}

.detail-block h3 {
  margin: 0 0 10px;
  color: var(--peach-deep);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-block h3::before {
  content: "🌟";
  font-size: 13px;
}

.detail-block p,
.detail-block li {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  font-weight: 500;
}

.detail-block p {
  margin: 0;
}

.detail-block ul {
  margin: 0;
  padding-left: 20px;
}

.detail-block li::marker {
  color: var(--peach-deep);
}

.route-map {
  height: 240px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--peach-soft);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.map-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.nav-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 107, 139, .3);
  transition: all .2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 139, .45);
}

/* ============ 导入面板 ============ */
.import-panel {
  margin-top: 18px;
}

.import-panel details {
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: all .25s ease;
}

.import-panel details[open] {
  box-shadow: var(--shadow-md);
}

.import-toggle {
  padding: 18px 22px;
  color: var(--peach-deep);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
}

.import-toggle::after {
  content: "▾";
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform .2s ease;
  color: var(--peach);
}

details[open] .import-toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

.import-body {
  padding: 0 22px 22px;
}

.import-hint {
  margin: 0 0 12px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
}

#importText {
  width: 100%;
  height: 120px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  color: var(--ink);
}

#importText:focus {
  outline: none;
  border-color: var(--peach);
  background: var(--paper);
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.import-actions button {
  width: auto;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 107, 139, .2);
  transition: all .2s ease;
}

.import-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 139, .35);
}

.import-actions button.danger {
  background: linear-gradient(135deg, #FFE0E0, #FFC9C9);
  color: #C2271E;
  box-shadow: none;
}

.import-actions input[type=file] {
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}

.import-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--cream);
}

.import-status:empty {
  display: none;
}

.import-status.ok {
  background: var(--green-bg);
  color: #2D7A4D;
}

.import-status.bad {
  background: #FFEAEA;
  color: #C2271E;
}

/* ============ 空状态 ============ */
.empty-state {
  grid-column: 1 / -1;
  padding: 60px 32px;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 2px dashed var(--peach-soft);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.7;
}

.empty-state::before {
  content: "🌿";
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
}

/* ============ Leaflet 控件颜色微调 ============ */
.leaflet-container {
  font-family: inherit !important;
  border-radius: var(--r-md);
}

/* ============ 响应式 ============ */
/* ============ 视图切换 Tab ============ */
.view-switcher {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 8px;
  background: var(--paper);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  width: fit-content;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 0;
  background: transparent;
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s ease;
}

.view-tab:hover {
  color: var(--peach-deep);
}

.view-tab.active {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 139, .3);
}

.tab-emoji {
  font-size: 16px;
}

.tab-count {
  min-width: 24px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, .25);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.view-tab:not(.active) .tab-count {
  background: var(--peach-bg);
  color: var(--peach-deep);
}

/* ============ 卡片浮动操作区(收藏+海报)============ */
.card-floating {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.fav-btn,
.poster-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  backdrop-filter: blur(8px);
  transition: all .2s ease;
}

.fav-btn {
  background: rgba(255, 255, 255, .92);
  color: var(--peach-deep);
  font-size: 20px;
}

.fav-btn:hover {
  transform: scale(1.1);
  background: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 139, .25);
}

.fav-btn[aria-pressed="true"] .heart {
  text-shadow: 0 2px 8px rgba(255, 107, 139, .55);
  color: var(--peach-deep);
}

.fav-btn.pop {
  animation: popHeart .5s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes popHeart {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.poster-btn {
  background: rgba(229, 222, 245, .85);
  color: var(--purple-deep);
}

.poster-btn:hover {
  transform: translateY(-1px) scale(1.1);
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(142, 124, 195, .35);
}

/* 收藏后卡片样式 */
.route-card.is-fav {
  background: linear-gradient(135deg, #fff, #FFF7F9);
  border-color: var(--peach-soft);
}

.route-card.is-fav .badges::before {
  content: "❤️ 已收藏";
  display: inline-block;
  margin-right: 6px;
  padding: 5px 10px;
  background: linear-gradient(135deg, var(--peach-deep), var(--orange));
  color: #fff;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
}


/* ============ 海报弹窗 ============ */
.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.poster-modal.open {
  display: flex;
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.poster-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 49, 66, .55);
  backdrop-filter: blur(8px);
}

.poster-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100vh;
  animation: dialogIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.poster-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 5;
  transition: transform .15s ease;
}
.poster-close:hover { transform: rotate(90deg); }

.poster-stage {
  position: relative;
  width: min(380px, calc(100vw - 80px));
  aspect-ratio: 540 / 960;
  max-height: calc(100vh - 200px);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
}

/* ============ 海报本身(渲染为图)============ */
.poster-card {
  --pc1: #FFB5C5;
  --pc2: #FFE0B5;
  --pc3: #E5DEF5;
  position: absolute;
  top: 0;
  left: 0;
  width: 540px;
  height: 960px;
  background:
    radial-gradient(circle at 0% 0%, var(--pc1) 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, var(--pc3) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, var(--pc2) 0%, transparent 50%),
    linear-gradient(180deg, #FFFAF5 0%, #FFF4E8 100%);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  transform-origin: top left;
  transform: scale(calc(min(380px, 100vw - 80px) / 540));
}

.poster-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.p-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .55;
}
.pb1 {
  width: 320px; height: 320px;
  background: var(--pc1);
  top: -60px; left: -40px;
}
.pb2 {
  width: 260px; height: 260px;
  background: var(--pc2);
  bottom: 120px; right: -40px;
  opacity: .4;
}
.pb3 {
  width: 200px; height: 200px;
  background: var(--pc3);
  bottom: -40px; left: 40px;
  opacity: .5;
}

.p-sparkle {
  position: absolute;
  color: #FF8FA3;
  font-size: 20px;
  opacity: .7;
}
.ps1 { top: 80px; right: 60px; font-size: 28px; }
.ps2 { top: 200px; right: 220px; font-size: 16px; color: #8E7CC3; }
.ps3 { bottom: 80px; left: 80px; font-size: 18px; color: #FFB347; }

.poster-content {
  position: relative;
  z-index: 1;
  padding: 50px 44px 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.p-eyebrow {
  display: inline-block;
  align-self: flex-start;
  padding: 7px 16px;
  background: rgba(255, 255, 255, .8);
  border-radius: 999px;
  color: #FF6B8B;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.p-name {
  margin-top: 22px;
  font-size: 38px;
  font-weight: 900;
  color: #2D3142;
  line-height: 1.2;
  letter-spacing: -.5px;
  word-break: break-word;
}

.p-location {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #5A5E6F;
}
.p-location::before { content: "📍 "; }

.p-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.p-badge {
  padding: 6px 14px;
  background: rgba(229, 222, 245, .8);
  color: #8E7CC3;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.p-badge-main {
  background: linear-gradient(135deg, #FF8FA3, #FF6B8B);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 107, 139, .3);
}

.p-badge-warn {
  background: linear-gradient(135deg, #FFD3A0, #FFB347);
  color: #fff;
}

.p-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, .75);
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.p-stat {
  text-align: center;
}

.p-stat-icon { font-size: 22px; line-height: 1; }
.p-stat-value {
  margin-top: 6px;
  color: #2D3142;
  font-size: 14px;
  font-weight: 800;
}
.p-stat-label {
  margin-top: 2px;
  color: #8B8FA0;
  font-size: 11px;
  font-weight: 600;
}

.p-section {
  margin-top: 22px;
}

.p-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #FF6B8B;
  margin-bottom: 10px;
}

.p-highlights {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.p-highlights li {
  position: relative;
  padding: 6px 0 6px 22px;
  color: #2D3142;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.p-highlights li::before {
  content: "✿";
  position: absolute;
  left: 0;
  color: #FF8FA3;
  font-weight: 700;
}

.p-route {
  padding: 12px 16px;
  background: rgba(255, 255, 255, .7);
  border-radius: 12px;
  color: #2D3142;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.p-footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1.5px dashed rgba(255, 143, 163, .4);
  padding-top: 18px;
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.p-brand-emoji {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF8FA3, #FF6B8B);
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(255, 107, 139, .35);
}

.p-brand-name {
  color: #2D3142;
  font-size: 15px;
  font-weight: 900;
}
.p-brand-sub {
  color: #8B8FA0;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

.p-cta {
  padding: 8px 14px;
  background: linear-gradient(135deg, #FFE0B5, #FFD3A0);
  color: #C2611E;
  font-size: 11px;
  font-weight: 800;
  border-radius: 12px;
  line-height: 1.3;
  max-width: 180px;
  text-align: center;
}

/* ============ 海报操作区 ============ */
.poster-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}

.btn-primary,
.btn-ghost {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 139, .3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 139, .45);
}

.btn-ghost {
  background: var(--purple-soft);
  color: var(--purple-deep);
}

.btn-ghost:hover {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
}

.poster-hint {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}

@media (max-width: 820px) {
  .app {
    padding: 16px 14px 40px;
  }

  .topbar {
    padding: 32px 22px 28px;
  }

  h1 {
    font-size: 32px;
  }

  .topbar p {
    font-size: 14px;
  }

  .weather-state {
    position: static;
    display: inline-block;
    margin-top: 16px;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

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

  .summary-card b {
    font-size: 26px;
  }

  .route-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .hero-chips {
    gap: 6px;
  }
  .hero-chip {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }

  .summary {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============ 决策增强模块 ============ */
.planner-panel,
.today-panel,
.map-panel,
.compare-tray {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-md);
}

.planner-head,
.section-title-row,
.compare-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  display: inline-block;
  color: var(--peach-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.planner-head h2,
.section-title-row h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.planner-head p {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}

.planner-head button,
.section-title-row button,
.compare-actions button,
.modal-actions button,
.pitfall-save {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 139, .22);
}

.planner-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-results,
.today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-card,
.mini-route {
  min-height: 150px;
  padding: 16px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--cream), #fff);
  border: 1px solid var(--line-soft);
}

.plan-card em {
  color: var(--peach-deep);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.plan-card h3,
.mini-route b {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.plan-card p,
.mini-route span,
.mini-route p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 600;
}

.plan-card ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.mini-route button {
  margin-top: 12px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--purple-soft);
  color: var(--purple-deep);
  font-weight: 900;
  cursor: pointer;
}

.compare-tray {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.compare-tray b,
.compare-tray span {
  display: block;
}

.compare-tray b {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.compare-tray span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}

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

.compare-actions button:last-child {
  background: var(--purple-soft);
  color: var(--purple-deep);
  box-shadow: none;
}

.overview-map-wrap {
  margin-top: 14px;
}

.overview-map {
  height: 380px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--peach-soft);
  overflow: hidden;
}

.summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.badge.status.ok {
  background: var(--green-bg);
  color: #2D7A4D;
  border-color: var(--green-soft);
}

.badge.status.rain,
.badge.status.hot {
  background: var(--orange-bg);
  color: #C2611E;
  border-color: var(--orange-soft);
}

.badge.status.cold {
  background: var(--purple-soft);
  color: var(--purple-deep);
  border-color: rgba(142, 124, 195, .2);
}

.score-panel {
  display: grid;
  gap: 8px;
  padding: 0 22px 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}

.score-row i {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--cream);
}

.score-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach), var(--orange));
}

.score-row em {
  color: var(--peach-deep);
  font-style: normal;
  text-align: right;
}

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

.weather-risk {
  grid-column: 1 / -1;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--cream);
}

.weather-risk b,
.weather-risk span {
  display: block;
}

.weather-risk b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.weather-risk span {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.weather-risk.good {
  background: var(--green-bg);
  border-color: var(--green-soft);
}

.weather-risk.warn {
  background: var(--orange-bg);
  border-color: var(--orange-soft);
}

.weather-risk.bad {
  background: #FFEAEA;
  border-color: #FFC9C9;
}

.equip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equip-list span {
  padding: 7px 12px;
  border-radius: var(--r-full);
  background: var(--green-bg);
  color: #2D7A4D;
  font-size: 12px;
  font-weight: 800;
}

.pitfall-box {
  display: grid;
  gap: 10px;
}

.pitfall-list p {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--cream);
}

.pitfall-input,
#inviteText {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.compare-btn,
.done-btn,
.invite-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-2);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  backdrop-filter: blur(8px);
  transition: all .2s ease;
}

.route-head {
  padding-right: 250px;
}

.card-floating {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 230px;
}

.compare-btn:hover,
.done-btn:hover,
.invite-btn:hover,
.compare-btn.active,
.done-btn.active {
  transform: translateY(-1px) scale(1.08);
  background: linear-gradient(135deg, var(--green), var(--peach));
  color: #fff;
}

.route-card.is-done {
  border-color: var(--green-soft);
  background: linear-gradient(135deg, #fff, var(--green-bg));
}

.route-card.is-done .route-head::after {
  content: "已完成";
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.tool-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tool-modal.open {
  display: flex;
}

.tool-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 49, 66, .55);
  backdrop-filter: blur(8px);
}

.tool-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--r-xl);
  background: var(--paper);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .25);
}

.tool-dialog.wide {
  width: min(960px, 100%);
}

.tool-dialog h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 22px;
}

.tool-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  color: var(--peach-deep);
  font-weight: 900;
}

.modal-actions {
  margin-top: 12px;
}

@media (max-width: 920px) {
  .planner-head,
  .section-title-row,
  .compare-tray {
    align-items: flex-start;
    flex-direction: column;
  }

  .planner-controls,
  .plan-results,
  .today-grid {
    grid-template-columns: 1fr;
  }

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

  .card-floating {
    top: 10px;
    right: 10px;
    gap: 5px;
  }

  .compare-btn,
  .done-btn,
  .invite-btn,
  .fav-btn,
  .poster-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .route-head {
    padding-right: 132px;
  }

  .card-floating {
    max-width: 118px;
  }

  .overview-map {
    height: 320px;
  }

  .view-switcher {
    width: 100%;
    max-width: 100%;
  }

  .view-tab {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 9px 10px;
  }

  .tab-label {
    white-space: nowrap;
  }
}
