/* 团子圈 - 大学城美食地图 | 美团配色 + Google 地图风格 · 移动端优先 */
:root {
  /* 美团系：黄为主色、黑字、白底 */
  --meituan-yellow: #FFD100;
  --meituan-yellow-dark: #FFB800;
  --meituan-black: #111;
  --meituan-gray: #666;
  --meituan-gray-light: #999;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #111;
  --text-muted: #666;
  --primary: #FFD100;
  --primary-dark: #FFB800;
  --border: #eee;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  /* Google 地图风格 */
  --map-land: #e8eddf;
  --map-water: #c5dcea;
  --map-road: #d0d4c8;
  --map-poi: #ea4335;
  --map-poi-安利: #34a853;
  --map-poi-拔草: #ea4335;
  --green: #34a853;
  --green-light: #e6f4ea;
  --red: #ea4335;
  --red-light: #fce8e6;
  /* 移动端安全区 */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --bottom-nav-h: 56px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}

/* ========== 顶部导航（移动端可收窄） ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--meituan-black);
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg);
}
.nav-link.active {
  color: var(--meituan-black);
  background: var(--primary);
}
.header-login {
  font-size: 0.9rem;
  color: #3385ff;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
}
.header-login:hover {
  text-decoration: underline;
}

/* 小屏隐藏顶部文字导航，仅保留 logo（底部导航负责切换） */
@media (max-width: 480px) {
  .nav { display: none; }
  .logo { font-size: 1.1rem; }
}

/* ========== 主内容区 ========== */
.main {
  flex: 1;
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 641px) {
  .main { padding: 24px; }
}

.page {
  display: none;
}
.page.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== 首页 ========== */
.hero {
  text-align: center;
  padding: 28px 12px 32px;
}
.hero h1 {
  font-size: 1.75rem;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 700;
}
.tagline {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}
.quick-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: var(--primary);
  color: var(--meituan-black);
  border: none;
  box-shadow: 0 2px 8px rgba(255, 209, 0, 0.4);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 184, 0, 0.45);
}
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover, .btn-secondary:active {
  border-color: var(--primary);
  color: var(--meituan-black);
}

.school-tags {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.school-tags .label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-right: 4px;
}
.school-tag {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 40px;
}
.school-tag:hover,
.school-tag.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--meituan-black);
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
@media (min-width: 480px) {
  .feature-cards { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
.feature-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.feature-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 10px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}
.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ========== 地图页（Google 风格） ========== */
.map-page .main {
  max-width: 100%;
  padding: 0;
}
.map-filter-chips {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0.98) 0%, transparent 100%);
}
.map-filter-chips::-webkit-scrollbar {
  display: none;
}
.map-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: var(--font);
}
.map-chip:hover {
  border-color: var(--primary);
  background: var(--bg);
}
.map-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--meituan-black);
  font-weight: 500;
}
.map-search-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 11;
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}
.map-search-icon {
  font-size: 1rem;
  margin-right: 8px;
  opacity: 0.7;
}
.map-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: var(--font);
  background: transparent;
}
.map-search-input::placeholder {
  color: var(--text-muted);
}
.map-container {
  position: relative;
  background: var(--map-land);
  min-height: 50vh;
  min-height: 50dvh;
  border: none;
  overflow: hidden;
}
@media (min-width: 641px) {
  .map-container { min-height: 420px; border-radius: var(--radius); margin: 0 16px 16px; }
  .map-search-bar { left: 28px; right: 28px; }
  .map-filter-chips { left: 16px; right: 16px; padding: 10px 16px; }
}
.map-zoom-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.map-zoom-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--card);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.map-zoom-btn:last-child {
  border-bottom: none;
}
.map-zoom-btn:hover,
.map-zoom-btn:active {
  background: var(--bg);
}
.map-fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #ea4335;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(234, 67, 53, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.map-fab:hover,
.map-fab:active {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(234, 67, 53, 0.5);
}
.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 50vh;
  min-height: 50dvh;
  background-color: var(--map-land);
  background-image:
    linear-gradient(90deg, var(--map-road) 0%, transparent 1px),
    linear-gradient(0deg, var(--map-road) 0%, transparent 1px);
  background-size: 40px 40px;
}
.map-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-markers > * {
  pointer-events: auto;
}
/* 地图气泡：参考作品信息卡样式，含评分/店名/人均 */
.map-bubble {
  position: absolute;
  min-width: 100px;
  max-width: 140px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
  font-size: 0;
  line-height: 1.3;
}
.map-bubble:hover,
.map-bubble:active {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 5;
}
.map-bubble .bubble-score {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-right: 4px;
}
.map-bubble .bubble-score.high {
  color: var(--green);
}
.map-bubble .bubble-name {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.map-bubble .bubble-price {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.map-bubble .bubble-recommend {
  font-size: 0.65rem;
  color: var(--green);
  margin-left: 4px;
}
.map-bubble.安利 { border-left: 3px solid var(--green); }
.map-bubble.拔草 { border-left: 3px solid var(--red); }
.map-legend {
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--card);
  margin: 0 16px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.map-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--map-poi);
}
.map-legend .dot.安利 { background: var(--green); }
.map-legend .dot.拔草 { background: var(--red); }

/* 地图页底部抽屉（Google 地图式列表） */
.map-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  max-height: 45vh;
  max-height: 45dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  transition: transform 0.25s ease;
}
.map-bottom-sheet.collapsed {
  transform: translateY(calc(100% - 52px));
}
.map-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.map-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.map-sheet-title {
  font-weight: 600;
  font-size: 1rem;
}
.map-sheet-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-sheet-close:active {
  background: var(--bg);
}
.map-sheet-filters {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  flex-wrap: wrap;
  align-items: center;
}
.map-sheet-filter {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--bg);
}
.map-sheet-filter.tag {
  color: var(--green);
  background: var(--green-light);
}
.map-sheet-list {
  list-style: none;
  margin: 0;
  padding: 0 16px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.map-sheet-list .restaurant-card {
  padding: 14px 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.map-sheet-list .restaurant-card:last-child {
  border-bottom: none;
}
.map-sheet-list .restaurant-card .thumb {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

/* 非地图页隐藏底部抽屉 */
.page:not(.map-page) .map-bottom-sheet,
.map-page .map-bottom-sheet.hidden {
  display: none;
}
@media (min-width: 641px) {
  .map-bottom-sheet {
    position: relative;
    max-height: 280px;
    margin: 0 16px 16px;
    border-radius: var(--radius);
  }
  .map-sheet-handle { display: none; }
}

/* ========== 发现页 ========== */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
  flex: 1;
  min-width: 100px;
}
.restaurant-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.restaurant-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.restaurant-card:hover,
.restaurant-card:active {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(255, 209, 0, 0.15);
}
.restaurant-card .thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}
.restaurant-card .info {
  flex: 1;
  min-width: 0;
}
.restaurant-card .name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
}
.restaurant-card .card-score {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-dark);
  margin-left: 6px;
}
.restaurant-card .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.restaurant-card .verdicts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.verdict-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.verdict-tag.安利 {
  background: var(--green-light);
  color: var(--green);
}
.verdict-tag.拔草 {
  background: var(--red-light);
  color: var(--red);
}

/* ========== 学生说 ========== */
.section-desc {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.review-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.review-card {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.review-card.安利 { border-left-color: var(--green); }
.review-card.拔草 { border-left-color: var(--red); }
.review-card .head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.review-card .author {
  font-weight: 600;
  font-size: 0.9rem;
}
.review-card .restaurant-name {
  color: var(--meituan-black);
  font-size: 0.85rem;
  margin-top: 2px;
}
.review-card .verdict-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.review-card .verdict-badge.安利 { background: var(--green-light); color: var(--green); }
.review-card .verdict-badge.拔草 { background: var(--red-light); color: var(--red); }
.review-card .text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

/* ========== 详情弹层（移动端自底滑出） ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  cursor: pointer;
}
.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.modal.is-open .modal-content {
  transform: translateY(0);
}
@media (min-width: 641px) {
  .modal { align-items: center; }
  .modal-content {
    border-radius: var(--radius);
    max-height: 80vh;
    transform: scale(0.95);
  }
  .modal.is-open .modal-content {
    transform: scale(1);
  }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover,
.modal-close:active {
  color: var(--text);
  background: var(--border);
}
.detail-name {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}
.detail-score {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-dark);
  margin-left: 8px;
}
.detail-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.detail-verdicts {
  margin-bottom: 14px;
}
.detail-reviews {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.detail-reviews h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.detail-review-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}
.detail-review-item:last-child {
  border-bottom: none;
}
.detail-review-item .who {
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ========== 页脚 ========== */
.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-bottom: var(--bottom-nav-h);
}

/* ========== 底部导航（移动端主导航） ========== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  transition: color 0.2s;
  min-height: 56px;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--meituan-black);
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}
.bottom-nav-icon {
  font-size: 1.35rem;
  display: block;
  transition: transform 0.2s;
}
.bottom-nav-label {
  white-space: nowrap;
}

/* 大屏可隐藏底部导航，仅用顶部 nav */
@media (min-width: 641px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .site-footer { margin-bottom: 0; }
}
