/* 泊憩 H5 - 移动优先 + 桌面响应式 */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --blue: #2563eb;
  --amber: #d97706;
  --bg: #f6f7f4;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.hidden { display: none !important; }

/* 顶栏 */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 52px; background: var(--card); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); z-index: 900; }
.logo { font-size: 20px; font-weight: 800; color: var(--primary); cursor: pointer; }
.slogan { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.topbar-right { display: flex; gap: 8px; }
.city-btn, .ai-btn { font-size: 13px; padding: 6px 10px; border-radius: 20px; background: var(--bg); color: var(--text); }
.ai-btn { background: #ecfdf5; color: var(--primary-dark); font-weight: 600; }

/* 主区 & 底导航 */
#main { padding: 52px 0 60px; min-height: 100vh; }
#tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: 58px; background: var(--card); display: flex; box-shadow: 0 -1px 6px rgba(0,0,0,.07); z-index: 900; }
#tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); position: relative; }
#tabbar button span { font-size: 20px; }
#tabbar button.active { color: var(--primary); font-weight: 700; }
.dot { position: absolute; top: 8px; right: 28%; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; }

/* 首页 */
#map { width: 100%; height: 44vh; z-index: 1; }
.scene-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; background: var(--card); scrollbar-width: none; }
.scene-chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--bg); font-size: 13px; color: var(--text); border: 1px solid var(--border); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.poi-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }

/* 点位卡片 */
.poi-card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer; }
.poi-card .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.poi-card h3 { font-size: 16px; }
.poi-card .highlight { color: var(--primary-dark); font-size: 13px; margin: 6px 0; font-weight: 500; }
.poi-card .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); align-items: center; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.badge.free { background: #dcfce7; color: var(--primary-dark); }
.badge.member_free { background: #dbeafe; color: var(--blue); }
.badge.timed_free { background: #fef3c7; color: var(--amber); }
.badge.paid { background: #fee2e2; color: #b91c1c; }
.badge.verified { background: #ecfdf5; color: var(--primary-dark); font-weight: 400; }
.badge.pet { background: #fdf4ff; color: #a21caf; font-weight: 400; }

/* 详情页 */
.detail { background: var(--card); }
.detail-photos { display: flex; gap: 6px; overflow-x: auto; padding: 12px; }
.detail-photos img { height: 140px; border-radius: 10px; }
.detail-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.section { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; }
.section h4 { font-size: 14px; margin-bottom: 8px; color: var(--muted); font-weight: 600; }
.section .kv { font-size: 14px; line-height: 1.9; }
.section .kv b { color: var(--text); }
.guide-card { border-left: 3px solid var(--primary); background: #f0fdf4; padding: 10px 12px; border-radius: 0 10px 10px 0; margin-bottom: 8px; font-size: 14px; }
.guide-card .gt { font-weight: 700; color: var(--primary-dark); margin-right: 6px; }
.ai-summary { background: linear-gradient(135deg,#ecfdf5,#eff6ff); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; }
.review { border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 14px; }
.review .rhead { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.review .stars { color: #f59e0b; }
.tagchip { display: inline-block; background: var(--bg); border-radius: 6px; padding: 1px 7px; font-size: 12px; margin: 2px 3px 0 0; color: var(--muted); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary-dark); background: #fff; }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn:active { opacity: .8; }
.btn-block { width: 100%; text-align: center; }

/* 表单 */
.form-page { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 0 auto; }
.form-card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.form-card h3 { font-size: 15px; color: var(--primary-dark); }
label.fl { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row .chip { cursor: pointer; }
#pickMap, #detailMap { height: 220px; border-radius: 10px; z-index: 1; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-grid img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.photo-add { width: 72px; height: 72px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--muted); cursor: pointer; }

/* 消息 */
.conv { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--border); cursor: pointer; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #d1fae5; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary-dark); flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 170px); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size: 14px; background: var(--card); align-self: flex-start; word-break: break-word; }
.msg.mine { background: var(--primary); color: #fff; align-self: flex-end; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; background: var(--card); }
.quick-greet { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; background: var(--card); }

/* 我的 */
.mine-head { background: linear-gradient(135deg, var(--primary), #0d9488); color: #fff; padding: 24px 16px; display: flex; gap: 14px; align-items: center; }
.mine-head .avatar { width: 60px; height: 60px; font-size: 22px; }
.mine-menu { background: var(--card); margin: 12px; border-radius: var(--radius); overflow: hidden; }
.mine-menu .item { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 15px; cursor: pointer; }
.switch { position: relative; width: 44px; height: 24px; background: #d1d5db; border-radius: 12px; transition: .2s; cursor: pointer; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.switch.on::after { left: 22px; }

/* 弹层 & toast */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
#modalBox { background: var(--card); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; padding: 20px 16px; }
#toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 1100; max-width: 86vw; }
.stars-input span { font-size: 26px; color: #d1d5db; cursor: pointer; }
.stars-input span.on { color: #f59e0b; }
.user-pin { background: #fff; border: 2px solid var(--blue); border-radius: 50%; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.login-tip { text-align: center; padding: 30px 20px; }

/* ------- 桌面端 ------- */
@media (min-width: 1024px) {
  #tabbar { top: 0; bottom: auto; left: auto; right: 0; width: 340px; height: 52px; box-shadow: none; background: transparent; }
  #tabbar button { flex-direction: row; gap: 6px; font-size: 14px; }
  #topbar { padding-right: 360px; }
  #main { padding: 52px 0 0; }
  .home { display: grid; grid-template-columns: 440px 1fr; grid-template-rows: auto 1fr; height: calc(100vh - 52px); }
  #map { grid-column: 2; grid-row: 1 / 3; height: 100%; }
  .scene-chips { grid-column: 1; grid-row: 1; flex-wrap: wrap; }
  .poi-list { grid-column: 1; grid-row: 2; overflow-y: auto; background: var(--card); border-right: 1px solid var(--border); }
  .form-page, .detail { max-width: 760px; margin: 0 auto; }
  #modal { align-items: center; }
  #modalBox { border-radius: 18px; }
}
