/* ===== 名山打卡 - 清新自然风格 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #2D8C4E;
  --primary-dark: #1E6B3A;
  --primary-light: #4CAF50;
  --accent: #FF6B35;
  --bg: #F7F9FC;
  --card-bg: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #666680;
  --text-light: #9999A9;
  --border: #EAEAEF;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶部 Banner ===== */
.hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
}

.hero-content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: white;
}

.hero-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.hero-logo span {
  font-size: 28px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ===== 搜索框 ===== */
.search-section {
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(255, 255, 255, 0.95);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 44px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  background: #F0F2F5;
  color: var(--text);
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  background: #E8EAED;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.search-box input::placeholder {
  color: #A0A4AF;
}

.search-box::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239999A9' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* ===== 定位 ===== */
.location-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: #F7F9FC;
  font-size: 13px;
  color: var(--text-secondary);
}

.location-bar.success {
  color: var(--primary);
}

.location-bar.error {
  color: #FF5252;
}

.location-bar svg {
  width: 16px;
  height: 16px;
}

/* ===== Tab ===== */
.tabs {
  display: flex;
  background: white;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: calc(70px + env(safe-area-inset-top));
  z-index: 99;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1 0 88px;
  min-height: 50px;
  padding: 12px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* ===== 内容区 ===== */
.content {
  padding: 14px 16px 88px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* ===== 区域筛选 ===== */
.district-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.district-scroll::-webkit-scrollbar {
  display: none;
}

.district-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.district-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== 景点卡片 ===== */
.spots-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spot-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s ease;
}

.spot-card:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.spot-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.spot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spot-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.spot-rank.top {
  background: var(--accent);
}

.spot-info {
  padding: 16px;
}

.spot-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.spot-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.spot-district-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: #E8F5E9;
  color: var(--primary);
  border-radius: 20px;
  font-weight: 500;
}

.spot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}

.spot-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.spot-stat strong {
  color: var(--text);
  font-weight: 600;
}

.spot-distance-tag {
  color: var(--accent) !important;
  font-weight: 600 !important;
}

.spot-brief {
  font-size: 13px;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

/* ===== 详情弹窗 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  background: var(--bg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
  transform: translateY(0);
  display: flex;
}

.modal-header {
  position: relative;
  height: 260px;
  flex-shrink: 0;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.modal-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: -20px;
  position: relative;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal-alias {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-tag {
  padding: 6px 14px;
  background: #FFF3E0;
  color: #E65100;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.modal-grid-item {
  background: #F7F9FC;
  padding: 14px;
  border-radius: var(--radius-sm);
}

.modal-grid-item label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.modal-grid-item span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.modal-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chip {
  padding: 8px 16px;
  background: #E8F5E9;
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ===== 加载 ===== */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading.hidden {
  display: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E8EAED;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading p {
  margin-top: 16px;
  color: var(--text-light);
  font-size: 14px;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.empty p {
  color: var(--text-light);
  font-size: 15px;
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
  .hero {
    height: 280px;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .spots-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .spot-img-wrap {
    height: 200px;
  }
  
  .content {
    max-width: 800px;
    margin: 0 auto;
  }
  
  .search-section,
  .tabs {
    max-width: 800px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .hero {
    height: 200px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .location-bar {
    padding: 10px 16px;
  }

  .district-scroll {
    gap: 8px;
    margin-bottom: 6px;
  }

  .district-btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
    touch-action: manipulation;
  }

  .spot-card {
    border-radius: 14px;
    -webkit-user-select: none;
    user-select: none;
  }

  .spot-img-wrap {
    height: 160px;
  }

  .spot-name {
    font-size: 17px;
  }

  .spot-stat {
    font-size: 12px;
  }

  .modal-header {
    height: 220px;
  }

  .modal-body {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .tabs {
    top: calc(66px + env(safe-area-inset-top));
  }

  .content {
    padding: 12px 12px 84px;
  }

  .tab-btn {
    min-height: 46px;
    font-size: 14px;
  }

  .spot-info {
    padding: 14px;
  }

  .search-box input {
    min-height: 46px;
    border-radius: 14px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-title {
    font-size: 22px;
  }

  .feature-chip {
    font-size: 12px;
    padding: 7px 12px;
  }
}
