/* ============================================================
   校园向导 — 样式
   移动端优先，校园清新主题
   ============================================================ */

:root {
  --green: #2e7d32;
  --green-light: #4caf50;
  --green-bg: #e8f5e9;
  --blue: #1565c0;
  --blue-light: #e3f2fd;
  --orange: #e65100;
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #1f2d27;
  --text-sub: #5a6b62;
  --border: #e0e6e3;
  --shadow: 0 2px 12px rgba(46, 125, 50, 0.08);
  --radius: 16px;
  --tab-h: 62px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  position: relative;
}

/* ---- 页面容器 ---- */
.page {
  padding: 16px 16px 24px;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-head {
  margin-bottom: 16px;
}
.page-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-head .subtitle {
  color: var(--text-sub);
  font-size: 14px;
  margin-top: 4px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--green);
  font-size: 17px;
  font-weight: 600;
  padding: 4px 0 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.route-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.route-title svg { color: var(--green-light); flex-shrink: 0; }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

/* ---- 导航表单 ---- */
.nav-form .field {
  margin-bottom: 14px;
}
.nav-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.select {
  width: 100%;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.select:focus {
  outline: none;
  border-color: var(--green-light);
}

.swap-row {
  display: flex;
  justify-content: center;
  margin: -6px 0 8px;
}
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.btn-icon:active { transform: rotate(180deg); border-color: var(--green-light); }

/* ---- 按钮 ---- */
.btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:active { transform: scale(0.98); }

.btn-share {
  width: 100%;
  height: 48px;
  border: 2px solid var(--green-light);
  border-radius: 14px;
  background: var(--card);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

/* ---- 提示卡 ---- */
.tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tip-icon { font-size: 22px; line-height: 1; }
.tip strong { font-size: 14px; }
.tip p { font-size: 13px; color: var(--text-sub); margin-top: 3px; line-height: 1.5; }

/* ---- 路线结果 ---- */
.video-card { padding: 0; overflow: hidden; }
.video-wrap { position: relative; }
.video-wrap video {
  width: 100%;
  display: block;
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.video-note {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-sub);
  background: var(--green-bg);
  text-align: center;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--green-light);
  border-radius: 2px;
}

.route-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ---- 图片预览（可点击放大）---- */
.img-preview {
  position: relative;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.img-preview .route-img { margin-bottom: 0; transition: transform 0.2s; }
.img-preview:active .route-img { transform: scale(0.98); }
.img-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

/* ---- 大图 Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
  padding: 20px;
}
.lightbox.show { opacity: 1; }
.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-tip {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin-top: 16px;
}
.route-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.step-list {
  list-style: none;
  padding: 0;
}
.step-list .step-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin: 14px 0 8px;
  padding-left: 0;
}
.step-list .step-header:first-child { margin-top: 0; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.5;
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-sub); font-size: 14px; margin-bottom: 18px; }

/* ---- 地标列表 ---- */
.lm-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lm-card {
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.lm-card:active { transform: scale(0.98); }
.lm-cover {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  display: block;
}
.lm-body { padding: 14px 16px; }
.lm-body h3 { font-size: 17px; margin: 8px 0 6px; }
.lm-body p { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.lm-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ---- 地标详情弹层 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--card);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
}
.modal .lm-cover {
  aspect-ratio: 16 / 9;
}
.modal-body { padding: 18px 20px 28px; }
.modal-body h2 { font-size: 22px; margin: 10px 0; }
.lm-intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 18px;
}
.detail-list { border-top: 1px solid var(--border); }
.detail-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.detail-label {
  flex-shrink: 0;
  width: 72px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}
.detail-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

/* ---- 美食卡片 ---- */
.food-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.food-rating {
  font-size: 13px;
  font-weight: 700;
  color: #f57c00;
}
.food-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}

/* ---- 广告占位 ---- */
.ads-placeholder {
  text-align: center;
  padding: 56px 20px;
}
.ads-icon { font-size: 52px; margin-bottom: 14px; }
.ads-placeholder h3 { font-size: 18px; margin-bottom: 8px; }
.ads-placeholder p { color: var(--text-sub); font-size: 14px; line-height: 1.6; }

/* ---- 底部 Tab 栏 ---- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.tab {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-sub);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--green); font-weight: 600; }

/* ---- 轻提示 ---- */
.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + 30px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 45, 39, 0.92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- 大屏适配 ---- */
@media (min-width: 481px) {
  body { box-shadow: 0 0 40px rgba(0,0,0,0.06); }
}

/* ---- 右上角分享按钮 ---- */
.share-site-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.share-site-btn svg { width: 20px; height: 20px; }
.share-site-btn:active { transform: scale(0.9); background: var(--green-bg); }

/* ---- 分享弹窗 ---- */
.share-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.share-modal.hidden { display: none; }
.share-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}
.share-modal-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 82%;
  max-width: 320px;
  text-align: center;
  animation: popIn 0.25s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.share-modal-close {
  position: absolute; top: 8px; right: 12px;
  border: none; background: none;
  font-size: 26px; color: var(--text-sub);
  cursor: pointer; line-height: 1;
}
.share-modal-close:active { color: var(--text); }
.share-modal-box h3 { font-size: 18px; margin-bottom: 4px; color: var(--text); }
.share-modal-tip { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }
.share-qr-wrap {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.share-qr { width: 200px; height: 200px; display: block; }
.share-url-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.share-url-text {
  flex: 1; font-size: 12px; color: var(--text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-copy-btn {
  flex-shrink: 0;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.share-copy-btn:active { background: var(--green-light); }
.share-modal-hint { font-size: 12px; color: var(--text-sub); line-height: 1.6; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
