/* C 端样式。移动端优先，桌面端可用即可（PRD 第 3 节开头）。 */
:root {
  --bg: #0E0E11;
  --panel: #17171C;
  --panel-2: #1F1F26;
  --line: rgba(255, 255, 255, .10);
  --text: #F2F2F5;
  --muted: #9A9AA6;
  --gold: #E0B357;
  --gold-dim: #4A3410;
  --green: #2FBF95;
  --violet: #9B7BFF;
  --amber: #F0A020;
  --red: #E14D4D;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--gold); }

#map { position: fixed; inset: 0; background: #101014; }
/* 高德的 canvas 覆盖层不该吃走地图手势 */
.amap-container canvas { outline: none; }

/* ── 地图加载失败降级（PRD 3.11）───────────────────────────── */
#mapFail {
  position: fixed; inset: 0; z-index: 60; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px; text-align: center; background: var(--bg);
}
#mapFail h2 { margin: 0; font-size: 17px; }
#mapFail p { margin: 0; color: var(--muted); font-size: 13px; max-width: 300px; }
#mapFail button { padding: 10px 22px; border-radius: 999px; background: var(--gold); color: #1A1408; font-weight: 600; }

/* ── 顶栏 ──────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; gap: 8px; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 8px;
  background: linear-gradient(180deg, rgba(14, 14, 17, .95) 55%, rgba(14, 14, 17, 0));
}
.searchbox {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.searchbox b { color: var(--text); font-weight: 500; }
.iconbtn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
}
.iconbtn.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.iconbtn .badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--gold); color: #1A1408;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* 已选条件回显（PRD 3.5.4）*/
.chips {
  position: fixed; z-index: 20; left: 0; right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  display: flex; gap: 6px; padding: 0 12px; overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips:empty { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  background: var(--gold-dim); border: 1px solid var(--gold); color: var(--gold);
}
.chip .x { opacity: .7; font-size: 14px; line-height: 1; }
.chip.clear { background: var(--panel); border-color: var(--line); color: var(--muted); }

/* 附近模式的中心基准提示（PRD 3.4.2）*/
#centerPin {
  position: fixed; left: 50%; top: 50%; z-index: 15;
  transform: translate(-50%, -100%); font-size: 26px; pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
}

/* ── 底栏 ──────────────────────────────────────────────────── */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; padding: 6px 8px calc(var(--safe-b) + 6px);
  background: linear-gradient(0deg, rgba(14, 14, 17, .96) 60%, rgba(14, 14, 17, 0));
}
.bottombar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: 11px; color: var(--muted);
}
.bottombar button i { font-style: normal; font-size: 19px; line-height: 1; }
.bottombar button.on { color: var(--gold); }

.fab {
  position: fixed; right: 14px; z-index: 21;
  bottom: calc(var(--safe-b) + 74px);
  width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--gold); color: #1A1408;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.fab.locate {
  bottom: calc(var(--safe-b) + 130px);
  background: var(--panel); color: var(--text); border: 1px solid var(--line); font-size: 18px;
}

/* ── 弹层通用 ──────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: var(--bg);
}
.modal header {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px;
  border-bottom: 1px solid var(--line);
}
.modal header h3 { flex: 1; margin: 0; font-size: 16px; }
.modal header .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.modal .body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(var(--safe-b) + 24px); }
.close { width: 32px; height: 32px; border-radius: 999px; background: var(--panel-2); font-size: 18px; }

.field {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.field:focus { outline: none; border-color: var(--gold); }

.rowitem {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 11px 12px; margin-bottom: 8px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); text-align: left;
}
.rowitem .name { font-weight: 600; }
.rowitem .meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.rowitem .right { margin-left: auto; flex: none; font-size: 12px; color: var(--gold); }
.rowitem img { width: 52px; height: 52px; flex: none; border-radius: 8px; object-fit: cover; background: var(--panel-2); }

.empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* 筛选组 */
.group { margin-bottom: 18px; }
.group h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 7px 13px; border-radius: 999px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.opt.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.filter-actions {
  position: sticky; bottom: 0; display: flex; gap: 10px;
  padding: 12px 0 0; margin-top: 4px; background: var(--bg);
}
.filter-actions button { flex: 1; height: 44px; border-radius: 12px; font-weight: 600; }
.btn-ghost { background: var(--panel); border: 1px solid var(--line); }
.btn-primary { background: var(--gold); color: #1A1408; }

/* ── 详情抽屉（PRD 3.6）────────────────────────────────────── */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  max-height: 88vh; display: flex; flex-direction: column;
  border-radius: 18px 18px 0 0; background: var(--panel);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
  transform: translateY(0); transition: transform .22s ease;
}
.sheet[hidden] { display: none; }
.sheet .grip { flex: none; padding: 8px 0 4px; text-align: center; }
.sheet .grip span { display: inline-block; width: 38px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.sheet .content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(var(--safe-b) + 20px); }

.v-head { display: flex; align-items: flex-start; gap: 8px; }
.v-head h2 { flex: 1; margin: 0; font-size: 18px; line-height: 1.35; }
.medal {
  flex: none; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--gold); color: #1A1408;
}
.banner {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px;
}
.banner b { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .28); }
.banner.alliance  { background: rgba(47, 191, 149, .14); color: #7FE9C8; }
.banner.community { background: rgba(155, 123, 255, .14); color: #C7B5FF; }
.banner.perk      { background: rgba(240, 160, 32, .14); color: #FFD189; }

.addr { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--muted); }
.addr p { flex: 1; margin: 0; }
.actbtn {
  flex: none; display: grid; place-items: center; gap: 2px;
  width: 46px; padding: 6px 0; border-radius: 10px; font-size: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.actbtn i { font-style: normal; font-size: 16px; }

.attrs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.attrs .kv { color: var(--muted); }
.attrs .kv b { color: var(--text); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.pill.tag { color: var(--gold); border-color: rgba(224, 179, 87, .35); }
.pill.open { color: var(--green); border-color: rgba(47, 191, 149, .4); }
.pill.closed { color: var(--muted); }

.links { display: flex; gap: 8px; margin-top: 12px; }
.links a {
  flex: 1; padding: 10px; border-radius: 10px; text-align: center; font-size: 13px;
  text-decoration: none; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.nolink {
  margin-top: 12px; padding: 11px 12px; border-radius: 10px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border: 1px dashed var(--line);
}

.gallery { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 148px; height: 100px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.intro { margin-top: 14px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.section-t { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }

#lightbox {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(0, 0, 0, .94);
}
#lightbox img { max-width: 100%; max-height: 100%; }

/* 社群 */
.qr { display: block; width: 200px; height: 200px; margin: 12px auto; border-radius: 12px; background: #fff; object-fit: contain; }
.wxid {
  display: flex; align-items: center; gap: 10px; margin: 12px auto; max-width: 320px;
  padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.wxid code { flex: 1; font-size: 15px; }

/* 行业信息海报轮播 */
.poster { display: flex; flex-direction: column; gap: 10px; }
.poster img { width: 100%; border-radius: 12px; }
.poster h4 { margin: 0; font-size: 16px; }
.poster p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); white-space: pre-wrap; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.carousel-nav button { width: 38px; height: 38px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.carousel-nav span { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 96px); z-index: 90;
  transform: translateX(-50%); padding: 9px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, .86); font-size: 13px; white-space: nowrap;
}

/* ── 米饭改版新增 ─────────────────────────────────────────── */

/* 顶栏行政区选择器（替换旧搜索框） */
.districtbar {
  flex: 1; display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.districtbar .pin { font-size: 13px; }
.districtbar b { font-weight: 600; }
.districtbar .caret { color: var(--muted); font-size: 12px; }
.districtbar .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 底栏筛选徽标 */
.bottombar button { position: relative; }
.bottombar .badge {
  position: absolute; top: 2px; right: calc(50% - 22px);
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
  background: var(--gold); color: #1A1408; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}

/* 详情：总评分徽标 */
.score-badge { flex: none; display: flex; align-items: baseline; gap: 2px; padding: 3px 10px; border-radius: 8px; background: var(--gold-dim); border: 1px solid var(--gold); }
.score-badge b { font-size: 18px; color: var(--gold); }
.score-badge span { font-size: 11px; color: var(--gold); }

/* emoji 标签行 + 内容简介展开 */
.flag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; margin-top: 12px; padding: 0; text-align: left; background: none; }
.flag { padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); }
.flag-more { margin-left: auto; font-size: 12px; color: var(--gold); }
.brief { margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.7; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); white-space: pre-wrap; }

/* 三项整星评分 */
.scorelist { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.scoreline { display: flex; align-items: center; gap: 10px; }
.scoreline .k { width: 40px; flex: none; font-size: 13px; color: var(--muted); }
.stars { letter-spacing: 2px; }
.star { color: rgba(255, 255, 255, .18); font-size: 15px; }
.star.on { color: var(--gold); }
.new-badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(47, 191, 149, .16); color: var(--green); }

/* 营业时间：工作日 / 节假日 场次 */
.hours { margin-top: 14px; }
.sessionline { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sessionline .k { width: 40px; flex: none; font-size: 13px; color: var(--muted); }
.sess { padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(47, 191, 149, .14); color: #7FE9C8; border: 1px solid rgba(47, 191, 149, .3); }
.sessionline .muted { color: var(--muted); font-size: 12px; }

/* 宣传区 + 占位游戏规则 */
.promo-block { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.intro.muted { color: var(--muted); }

@media (min-width: 720px) {
  .topbar, .bottombar { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .sheet { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .modal { max-width: 480px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
