/* ===== 穷鬼地图 · 样式 ===== */
:root {
  --paper: #F5EFE3;
  --paper-2: #EDE4D0;
  --card: #FBF7EE;
  --ink: #262019;
  --ink-soft: #6B6152;
  --ink-faint: #9A8F7B;
  --green: #2E5A4E;
  --green-deep: #23463C;
  --red: #D9482C;
  --yellow: #D9A23F;
  --line: #D8CDB8;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: #E7DFCC;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: var(--sans); }
input, select, textarea { font-family: var(--sans); font-size: 15px; color: var(--ink); }

.app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(38, 32, 25, 0.08), 0 12px 40px rgba(38, 32, 25, 0.12);
}

/* ===== 顶栏 ===== */
.app-header {
  flex: none;
  padding: 14px 16px 12px;
  border-bottom: 1.5px dashed var(--line);
  background: var(--paper);
}
.header-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.brand-mark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--green-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark .mark-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  flex: none;
}
.brand-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }
.header-stat { text-align: right; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.header-stat b { font-family: var(--serif); font-size: 16px; color: var(--red); font-weight: 700; }

/* ===== 主视图 ===== */
.view { flex: 1; overflow: hidden; position: relative; }

/* ===== 底部导航 ===== */
.tabbar {
  flex: none;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--green); font-weight: 700; }

/* ===== 分类筛选 chips ===== */
.chips {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.chip.active { background: var(--green); border-color: var(--green); color: #F5EFE3; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.chip.active .dot { outline: 1px solid rgba(245, 239, 227, 0.55); outline-offset: 1px; }

/* ===== 价格印章（签名元素） ===== */
.stamp {
  flex: none;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--red);
  color: #FFF7EC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 247, 236, 0.7);
  letter-spacing: 0.5px;
}
.stamp::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px dashed rgba(217, 72, 44, 0.55);
  border-radius: 50%;
}
.stamp.sm { width: 52px; height: 52px; font-size: 14px; }
.stamp.lg { width: 84px; height: 84px; font-size: 22px; }

/* ===== 地图页 ===== */
.map-wrap { height: 100%; display: flex; flex-direction: column; }
.map { flex: 1; min-height: 0; width: 100%; }
.map-empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.map-reset {
  position: absolute;
  right: 14px;
  top: 64px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(38, 32, 25, 0.1);
}
.map-locate {
  position: absolute;
  left: 14px;
  top: 64px;
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(38, 32, 25, 0.1);
}
.map-locate svg { width: 15px; height: 15px; }
.map-card {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(38, 32, 25, 0.16);
}
.map-card[hidden] { display: none; }
.map-card .info { flex: 1; min-width: 0; }
.map-card h3 { font-family: var(--serif); font-size: 16px; line-height: 1.35; }
.map-card p { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.map-card .tip { color: var(--ink); margin-top: 5px; font-size: 12px; line-height: 1.5; }
.map-card-btn {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #F5EFE3;
  font-size: 13px;
  cursor: pointer;
}
.map-card-close {
  flex: none;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  position: absolute;
  right: 6px; top: 6px;
}
.map-card-close svg { width: 16px; height: 16px; }
.map-foot {
  flex: none;
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 6px 12px 10px;
  border-top: 1px dashed var(--line);
  background: var(--paper);
}

/* ===== 列表页 ===== */
.list-wrap { height: 100%; display: flex; flex-direction: column; }
.list-head { flex: none; background: var(--paper); }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 4px;
  padding: 0 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.search-box svg { width: 18px; height: 18px; color: var(--ink-faint); flex: none; }
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  min-height: 44px;
}
.search-box input::placeholder { color: var(--ink-faint); }
.filters {
  display: flex;
  gap: 8px;
  padding: 4px 12px 10px;
  flex: none;
}
.filters select {
  flex: 1;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
}
.list-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.spot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
}
.spot-card:active { background: var(--paper-2); }
.spot-main { flex: 1; min-width: 0; }
.spot-main h3 {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.spot-tip { font-size: 12px; color: var(--ink); margin-top: 4px; line-height: 1.5; }
.spot-meta { font-size: 12px; color: var(--ink-soft); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.badge {
  flex: none;
  font-size: 10px;
  font-family: var(--sans);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green);
  color: #F5EFE3;
  vertical-align: 2px;
}
.badge-deal { background: var(--yellow); color: #262019; }
.badge-order-pending { background: var(--yellow); color: #262019; }
.badge-order-used { background: #C9C0AC; color: #262019; }
.list-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}
.list-empty .sub { margin-top: 8px; font-size: 12px; color: var(--ink-faint); }
.deals-head { padding: 12px 12px 10px; }
.deals-intro { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.deal-shop { font-size: 12px; color: var(--ink-soft); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.detail-deals {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 18px 4px;
}
.detail-deals h4 {
  font-family: var(--serif);
  font-size: 15px;
  padding: 12px 0 8px;
  color: var(--green-deep);
  border-bottom: 1px dashed var(--line);
}
.deal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.deal-row:last-child { border-bottom: 0; }
.deal-row b { font-size: 14px; display: block; line-height: 1.5; }
.deal-row span { font-size: 11px; color: var(--ink-faint); }
.deal-price { font-family: var(--serif); font-weight: 700; color: var(--red); font-size: 16px; flex: none; }
.deal-right { display: flex; align-items: center; gap: 10px; flex: none; }
.deal-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.order-btn {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #FFF7EC;
  font-size: 12px;
  cursor: pointer;
}
.order-btn.sm { min-height: 32px; padding: 0 12px; font-size: 11px; }
.order-btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.order-btn:disabled { opacity: 0.55; }
.orders-head { padding: 12px 12px 10px; }
.page-title { font-family: var(--serif); font-size: 17px; color: var(--green-deep); }
.assistant-search { display: flex; gap: 8px; margin-top: 10px; }
.assistant-search input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 0 12px;
  font-size: 14px;
  outline: 0;
}
.assistant-search input:focus { border-color: var(--green); }
.hot-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-hot {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.chip-hot:active { background: var(--yellow); color: #262019; }
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(38, 32, 25, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-mask[hidden] { display: none; }
.pay-sheet {
  width: 100%;
  max-width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 6px dashed var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
}
.pay-head { font-family: var(--serif); font-size: 17px; color: var(--green-deep); }
.pay-shop { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.pay-deal { margin-top: 4px; font-size: 15px; color: var(--ink); }
.pay-price { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--red); margin-top: 10px; }
.pay-note { margin-top: 8px; font-size: 11px; color: var(--ink-faint); }
.pay-actions { display: flex; gap: 10px; margin-top: 16px; }
.pay-actions .order-btn { flex: 1; min-height: 42px; }
.orders-intro { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.order-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 12px 14px;
}
.order-main { flex: 1; min-width: 0; }
.order-main h3 {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.order-shop { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.order-meta { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.order-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.order-actions { display: flex; gap: 6px; }
.list-foot {
  flex: none;
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 6px 12px 10px;
  border-top: 1px dashed var(--line);
  background: var(--paper);
}

/* ===== 详情页 ===== */
.detail {
  height: 100%;
  overflow-y: auto;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
}
.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  margin-bottom: 6px;
}
.back svg { width: 20px; height: 20px; }
.detail-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.detail-hero h1 { font-family: var(--serif); font-size: 22px; line-height: 1.4; }
.detail-tip { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.detail-cat { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.detail-rows {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 18px;
}
.detail-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.detail-rows > div:last-child { border-bottom: 0; }
.detail-rows dt { color: var(--ink-faint); flex: none; }
.detail-rows dd { color: var(--ink); text-align: right; line-height: 1.6; }
.detail-rows dd.price { font-family: var(--serif); font-weight: 700; color: var(--red); font-size: 16px; }
.detail-note {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.6;
  padding: 0 4px;
}
.detail-cta {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #F5EFE3;
  font-size: 15px;
  cursor: pointer;
}
.detail-empty { padding: 60px 20px; text-align: center; color: var(--ink-soft); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translate(-50%, -8px);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
