/* C 端样式。移动端优先，桌面端可用即可（PRD 第 3 节开头）。 */
/* 配色 A「午夜金」：近黑打底，金色只留给评分与推广位——
 * 主色到处用等于没有主色，所以场次等次要信息一律走中性灰（原来的绿已去掉）。 */
:root {
  --bg: #0B0B0F;
  --panel: #16161C;
  --panel-2: #1E1E26;
  --line: rgba(255, 255, 255, .09);
  --text: #F2F2F5;
  --muted: #8E8E9A;
  --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; }
/* 必须 !important：下面的浮层各自设了 display，作者源会压掉 UA 的 [hidden]{display:none}，
 * 于是 hidden 属性失效、浮层常驻（tests/frontend.test.js 有回归用例守着）。 */
[hidden] { display: none !important; }
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: #0B0B0F; }
/* 地图 SDK 的 canvas 不该吃走手势/描边（写成容器选择器，不绑厂商类名） */
#map 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(11, 11, 15, .95) 55%, rgba(11, 11, 15, 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(11, 11, 15, .96) 60%, rgba(11, 11, 15, 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); }
/* 暂无门店的行政区：列出来但点不了 */
.opt.off, .rowitem.off { opacity: .38; cursor: default; }
.rowitem.off .right { color: var(--muted); }
.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-close {
  position: absolute; top: 6px; right: 10px; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px;
  color: var(--muted); background: var(--panel-2);
}
.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: center; gap: 9px; margin-top: 4px; }
/* 店名让位给标签：名字长就省略号，标签和评分永远不被挤走 */
.v-head h2 { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 18px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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: center; 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; }
.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 { font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.section-t { margin: 18px 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .3px; }

#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: none; display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--panel); color: var(--gold); font-weight: 600;
  border: 1px solid rgba(224, 179, 87, .45);   /* 主色描边＝这里能点 */
}
.districtbar .pin { font-size: 13px; }
.districtbar b { font-weight: 600; }
.districtbar .caret { font-size: 10px; opacity: .65; }
/* 计数：中性灰、无描边强调，一看就是只读信息 */
.cnt {
  margin-left: auto; flex: none; display: flex; align-items: center;
  height: 38px; padding: 0 13px; border-radius: 999px; font-size: 12px;
  background: var(--panel); border: 1px solid var(--line); 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; gap: 6px; align-items: center; flex: 1; min-width: 0; }
/* 圆形 emoji 徽章，点开看说明；主色描边提示「这里能点」 */
.flag {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
  background: var(--panel-2); border: 1px solid var(--line);
  border-bottom-color: rgba(224, 179, 87, .5);
}

/* ── 标签说明弹层（层级压在详情抽屉之上）───────────────────── */
#flagPop {
  position: fixed; inset: 0; z-index: 65; display: grid; place-items: center;
  padding: 24px; background: rgba(0, 0, 0, .55);
}
#flagPop .box {
  width: 100%; max-width: 320px; padding: 18px 18px 14px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
#flagPop h3 { margin: 0 0 8px; font-size: 16px; }
#flagPop p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; }
#flagPop button { display: block; width: 100%; margin-top: 14px; padding: 9px 0; border-radius: 10px; background: var(--gold); color: #1A1408; font-weight: 600; }

/* 三项整星评分 */
/* 每个信息块一张独立卡片：比抽屉底色浅一档 + 细描边 + 间距，块之间才分得开 */
.v-card { margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); }
.v-card .section-t { margin: 0 0 7px; }
.v-body { 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: var(--gold-dim); color: var(--gold); }

/* 营业时间：工作日 / 节假日 场次 */
.sessionline { display: flex; align-items: center; gap: 8px; }
.sessionline .k { width: 40px; flex: none; font-size: 13px; color: var(--muted); }
.sess { padding: 3px 10px; border-radius: 7px; font-size: 12px; background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.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); }
}
