/* 金石桥旅游导航 — 静态演示样式 */
:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --primary: #1a5f4a;
  --primary-light: #e8f3ef;
  --accent: #c45c26;
  --text: #1c1c1c;
  --text-secondary: #6b6b6b;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(26, 95, 74, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: #2a2a2a;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100%;
  padding: 12px 0 24px;
}

.demo-tag {
  position: fixed;
  top: 10px;
  right: max(10px, calc(50% - 195px));
  z-index: 9999;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(196, 92, 38, 0.92);
  border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100dvh;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* —— 小镇名片 —— */
.town-card {
  flex-shrink: 0;
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 1;
}

.town-card__cover {
  height: 140px;
  background:
    linear-gradient(160deg, rgba(26, 95, 74, 0.75) 0%, rgba(26, 95, 74, 0.35) 50%, transparent 100%),
    url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80") center / cover no-repeat;
}

.town-card__body {
  padding: 14px 18px 16px;
  margin-top: -36px;
  position: relative;
}

.town-card__region {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.town-card__name {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.town-card__subtitle {
  font-size: 14px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

.town-card__intro {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 10px;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    margin-top 0.3s ease,
    opacity 0.25s ease;
}

.town-card__intro.is-collapsed {
  max-height: 0 !important;
  margin-top: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.town-card__intro.is-expanded {
  max-height: 24em;
  opacity: 1;
  visibility: visible;
}

.town-card.is-intro-compact .town-card__body {
  padding-bottom: 10px;
}

.town-card__more {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* —— 地图 —— */
.map-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  isolation: isolate;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: #d8e8e0;
}

.map-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 500;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 10px;
  border-radius: 12px;
  pointer-events: none;
}

.amap-marker {
  cursor: pointer;
  line-height: 0;
}

.amap-marker.marker-active {
  filter: drop-shadow(0 0 6px rgba(196, 92, 38, 0.9));
  transform: scale(1.15);
  transition: transform 0.2s ease;
}

.map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 38vh;
  padding: 24px;
  text-align: center;
  background: #e8f0ec;
}

.map-fallback__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.map-fallback__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.map-fallback__desc code {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 5px;
  border-radius: 4px;
}

/* —— 旅游导航（景点列表） —— */
.rank-panel {
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  padding: 16px 16px calc(16px + var(--safe-bottom));
  max-height: 42vh;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.rank-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.rank-panel__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.rank-panel__progress {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rank-panel__progress strong {
  color: var(--primary);
  font-size: 15px;
}

.rank-panel__ring {
  position: relative;
  width: 48px;
  height: 48px;
}

.rank-panel__ring svg {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: #eee;
  stroke-width: 3;
}

.ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  stroke-dashoffset: 97.4;
  transition: stroke-dashoffset 0.4s ease;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
}

.poi-list {
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.poi-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}

.poi-item:active,
.poi-item.is-active {
  background: var(--primary-light);
  border-color: rgba(26, 95, 74, 0.15);
}

.poi-item__order {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.poi-item.is-done .poi-item__order {
  background: var(--primary);
  color: #fff;
  font-size: 0;
}

.poi-item.is-done .poi-item__order::after {
  content: "✓";
  font-size: 14px;
}

.poi-item__info {
  flex: 1;
  min-width: 0;
}

.poi-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.poi-item.is-done .poi-item__name {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: rgba(26, 95, 74, 0.35);
}

.poi-item__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-item__nav {
  flex-shrink: 0;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.poi-item__nav:active {
  background: var(--primary-light);
}

.poi-item__badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
}

.poi-item.is-done .poi-item__badge {
  background: #f0f0f0;
  color: #999;
}

.poi-item .poi-item__badge.is-featured {
  background: #fff3eb;
  color: var(--accent);
}

/* —— 点位详情 —— */
.poi-sheet[hidden] {
  display: none !important;
}

.poi-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px;
}

.poi-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.poi-sheet__card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(24px + var(--safe-bottom));
  animation: sheet-up 0.28s ease;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.poi-sheet__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.poi-sheet__cover {
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), #d4e8df);
  margin-bottom: 14px;
}

.poi-sheet__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.poi-sheet__addr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
}

.poi-sheet__addr {
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  min-width: 0;
}

.poi-sheet__nav-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(26, 95, 74, 0.35);
}

.poi-sheet__nav-btn:active {
  opacity: 0.9;
  transform: scale(0.98);
}

.poi-sheet__nav-icon {
  font-size: 12px;
  line-height: 1;
}

.poi-sheet__desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 8px;
}

.poi-sheet__dist {
  font-size: 13px;
  color: var(--accent);
  margin-top: 10px;
  font-weight: 500;
}

.poi-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.poi-sheet__btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

.poi-sheet__btn.is-ready {
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26, 95, 74, 0.35);
}

.poi-sheet__btn.is-done {
  background: var(--primary-light);
  color: var(--primary);
  cursor: default;
}

.poi-sheet__note {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 10px;
}

.poi-sheet__simulate {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
}

@media (min-width: 440px) {
  body {
    align-items: center;
    padding: 24px 0;
  }

  .app {
    min-height: 90vh;
    border-radius: 24px;
    overflow: hidden;
  }
}
