/* ============================================================
 * base.css —— 设计变量 / 重置 / 通用组件
 * 项目：全国KTV·酒吧娱乐地图标注系统
 * 主色 #552583  辅助色 绿色  背景 白
 * ============================================================ */

:root {
  /* ---- 主色（紫）---- */
  --c-primary: #552583;
  --c-primary-2: #6d33a6;
  --c-primary-3: #8b4fd1;
  --c-primary-soft: #f4eefb;
  --c-primary-line: #e4d6f3;

  /* ---- 辅助色（绿）---- */
  --c-green: #00c97b;
  --c-green-2: #12e08e;
  --c-green-deep: #009e60;
  --c-green-soft: #e6faf3;

  /* ---- 中性 ---- */
  --c-white: #ffffff;
  --c-page: #f5f5f8;
  --c-text: #17161c;
  --c-text-2: #5a5766;
  --c-text-3: #96939f;
  --c-line: #edebf2;
  --c-line-2: #e1dee9;

  /* ---- 功能色 ---- */
  --c-gold: #e8a33d;
  --c-gold-soft: #fdf3e3;
  --c-red: #e4405f;
  --c-red-soft: #fdecef;
  --c-blue: #3d7eff;

  /* ---- 圆角 / 阴影 ---- */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 22px;
  --r-full: 999px;
  --sh-1: 0 2px 10px rgba(23, 22, 28, .06);
  --sh-2: 0 6px 22px rgba(23, 22, 28, .1);
  --sh-primary: 0 8px 20px rgba(85, 37, 131, .28);
  --sh-green: 0 8px 20px rgba(0, 201, 123, .28);

  /* ---- 布局 ---- */
  --nav-h: 48px;
  --tabbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --h5-max: 560px;
}

/* ---------------- 重置 ---------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-page);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; outline: none; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea, select { border: 0; background: none; }
em { font-style: normal; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d9d6e2; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局容器 ---------------- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--h5-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-white);
  overflow-x: hidden;
}

.page { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
.page--plain { padding-bottom: calc(var(--safe-b) + 24px); }
.wrap { padding: 0 16px; }
.row { display: flex; align-items: center; }
.row--between { justify-content: space-between; }
.row--gap { gap: 10px; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 顶部导航 ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--nav-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
}
.navbar__back {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--c-text);
}
.navbar__back:active { background: var(--c-page); }
.navbar__title { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.navbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-2); }

/* ---------------- 底部导航（用户端） ---------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 70;
  width: 100%;
  max-width: var(--h5-max);
  display: flex;
  align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--c-line);
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--c-text-3);
  height: var(--tabbar-h);
}
.tabbar__item.is-active { color: var(--c-primary); font-weight: 600; }
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__fab { flex: 0 0 66px; position: relative; }
.tabbar__fab .fab {
  position: absolute;
  top: -18px; left: 50%; transform: translateX(-50%);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: linear-gradient(150deg, var(--c-green-2), var(--c-green-deep));
  color: #fff;
  box-shadow: var(--sh-green);
  font-size: 22px;
}
.tabbar__fab .fab:active { transform: translateX(-50%) scale(.94); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary)); color: #fff; box-shadow: var(--sh-primary); }
.btn--green { background: linear-gradient(135deg, var(--c-green-2), var(--c-green-deep)); color: #fff; box-shadow: var(--sh-green); }
.btn--ghost { background: var(--c-primary-soft); color: var(--c-primary); }
.btn--line { background: var(--c-white); color: var(--c-text-2); border: 1px solid var(--c-line-2); }
.btn--danger { background: var(--c-red); color: #fff; }
.btn--block { display: flex; width: 100%; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-full); }
.btn--xs { height: 26px; padding: 0 10px; font-size: 12px; border-radius: var(--r-full); }
.btn--lg { height: 50px; font-size: 16px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; }

/* ---------------- 卡片 / 区块 ---------------- */
.card {
  background: var(--c-white);
  border-radius: var(--r-l);
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.block { padding: 16px; }
.block + .block { border-top: 1px solid var(--c-line); }
.block__hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.block__title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.block__title::before {
  content: ""; width: 3px; height: 14px; border-radius: 99px;
  background: linear-gradient(180deg, var(--c-primary-3), var(--c-primary));
}
.block__more { font-size: 12px; color: var(--c-text-3); }

/* ---------------- 标签 Tag ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  height: 20px; padding: 0 7px;
  border-radius: 5px;
  font-size: 11px; line-height: 1;
  background: var(--c-page); color: var(--c-text-2);
  white-space: nowrap;
}
.tag--primary { background: var(--c-primary-soft); color: var(--c-primary); }
.tag--green { background: var(--c-green-soft); color: var(--c-green-deep); }
.tag--gold { background: var(--c-gold-soft); color: #b9761b; }
.tag--red { background: var(--c-red-soft); color: var(--c-red); }
.tag--line { background: transparent; border: 1px solid var(--c-line-2); }
.tag--solid { background: var(--c-primary); color: #fff; }

/* ---------------- 等级徽章 ---------------- */
.lv {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px 0 4px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #b9c3d8, #8e9bb6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  white-space: nowrap;
}
.lv__ico {
  width: 14px; height: 14px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .28);
  font-size: 9px; font-weight: 700;
}
.lv--member { background: linear-gradient(135deg, #b9c3d8, #8e9bb6); }
.lv--junior { background: linear-gradient(135deg, #12e08e, #00a862); }
.lv--senior { background: linear-gradient(135deg, #8b4fd1, #552583); }
.lv--owner  { background: linear-gradient(135deg, #f5c063, #d98a1f); }
.lv--admin  { background: linear-gradient(135deg, #ff6b86, #c2163a); }
.lv--lg { height: 26px; padding: 0 12px 0 5px; font-size: 12px; }
.lv--lg .lv__ico { width: 18px; height: 18px; font-size: 11px; }
.lv--plain { background: var(--c-page); color: var(--c-text-2); box-shadow: none; }

/* ---------------- 头像 ---------------- */
.avatar {
  position: relative;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  color: #fff; font-weight: 700;
  background: linear-gradient(140deg, var(--c-primary-3), var(--c-primary));
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 34px; height: 34px; font-size: 13px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar--xl { width: 76px; height: 76px; font-size: 26px; }
.avatar--ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c-primary-line); }
.avatar--m0 { background: linear-gradient(140deg, #b9c3d8, #8e9bb6); }
.avatar--m1 { background: linear-gradient(140deg, #12e08e, #00a862); }
.avatar--m2 { background: linear-gradient(140deg, #8b4fd1, #552583); }
.avatar--m3 { background: linear-gradient(140deg, #f5c063, #d98a1f); }
.avatar--m4 { background: linear-gradient(140deg, #ff6b86, #c2163a); }

/* ---------------- 表单 ---------------- */
.field { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.field:last-child { border-bottom: 0; }
.field__label { flex: 0 0 84px; font-size: 14px; color: var(--c-text-2); }
.field__label--req::after { content: "*"; color: var(--c-red); margin-left: 2px; }
.field__main { flex: 1; display: flex; align-items: center; gap: 8px; }
.field input, .field textarea, .field select { flex: 1; width: 100%; font-size: 14px; background: transparent; }
.field textarea { resize: none; padding-top: 6px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--c-text-3); }
.field__unit { font-size: 13px; color: var(--c-text-3); }
.field--col { display: block; }
.field--col .field__label { margin-bottom: 6px; }

.input-box {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px;
  border-radius: var(--r-m);
  background: var(--c-page);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.input-box:focus-within { border-color: var(--c-primary-3); background: #fff; }
.input-box input { flex: 1; background: transparent; font-size: 15px; }

.textarea-box {
  padding: 12px 14px;
  border-radius: var(--r-m);
  background: var(--c-page);
  border: 1px solid transparent;
}
.textarea-box:focus-within { border-color: var(--c-primary-3); background: #fff; }
.textarea-box textarea { width: 100%; border: 0; background: transparent; font-size: 14px; resize: none; }

.switch {
  position: relative; width: 44px; height: 26px; flex: 0 0 44px;
  border-radius: var(--r-full);
  background: var(--c-line-2);
  transition: background .18s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch.is-on { background: var(--c-green); }
.switch.is-on::after { transform: translateX(18px); }

.checkbox {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--c-text-2); cursor: pointer;
}
.checkbox i {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--c-line-2);
  display: grid; place-items: center;
  transition: all .15s;
}
.checkbox.is-on i { background: var(--c-primary); border-color: var(--c-primary); }
.checkbox.is-on i::after { content: "✓"; color: #fff; font-size: 11px; line-height: 1; }

/* ---------------- 单选/多选 chips ---------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--r-full);
  background: var(--c-page);
  color: var(--c-text-2);
  font-size: 13px;
  transition: all .15s;
}
.chip.is-active { background: var(--c-primary); color: #fff; font-weight: 600; }
.chip--green.is-active { background: var(--c-green); }

.scroll-x {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

/* ---------------- 分段控件 ---------------- */
.seg {
  display: flex; padding: 3px;
  background: var(--c-page);
  border-radius: var(--r-full);
}
.seg__item {
  flex: 1; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  font-size: 13px; color: var(--c-text-2);
  transition: all .18s;
}
.seg__item.is-active { background: #fff; color: var(--c-primary); font-weight: 700; box-shadow: var(--sh-1); }

/* ---------------- 列表项（通用） ---------------- */
.cell {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
}
.cell:last-child { border-bottom: 0; }
.cell:active { background: var(--c-page); }
.cell__ico {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.cell__body { flex: 1; min-width: 0; }
.cell__title { font-size: 14px; font-weight: 600; }
.cell__desc { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.cell__arrow { color: var(--c-text-3); font-size: 16px; }

/* ---------------- 星级评分 ---------------- */
.stars { display: inline-flex; align-items: center; gap: 1px; color: #ffb300; font-size: 12px; letter-spacing: 1px; }
.stars--empty { color: var(--c-line-2); }
.score { font-size: 13px; font-weight: 700; color: #ff8a00; }

/* ---------------- 会员内容遮罩 ---------------- */
.vip-mask { position: relative; overflow: hidden; }
.vip-mask__blur { filter: blur(7px); transform: scale(1.06); pointer-events: none; user-select: none; }
.vip-mask__layer {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .86));
  backdrop-filter: blur(1.5px);
  z-index: 2;
  text-align: center;
  padding: 12px;
}
.vip-mask__layer .lock {
  width: 34px; height: 34px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--c-gold), #d98a1f);
  color: #fff; font-size: 16px;
  box-shadow: 0 4px 12px rgba(217, 138, 31, .35);
}
.vip-mask__layer .txt { font-size: 13px; font-weight: 600; color: #7a5316; }
.vip-mask__layer .sub { font-size: 11px; color: var(--c-text-3); }
.vip-mask--own .vip-mask__layer { background: none; backdrop-filter: none; }
.vip-badge {
  display: inline-flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 7px;
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f5c063, #d98a1f);
  box-shadow: 0 2px 5px rgba(217, 138, 31, .3);
}
.vip-tip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--c-gold-soft);
  color: #8a5e14; font-size: 12px;
  border: 1px dashed #efd9ac;
}
.vip-tip .spacer { flex: 1; }

/* ---------------- 底部抽屉 / 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 15, 23, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.sheet-mask.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 101;
  width: 100%; max-width: var(--h5-max);
  transform: translate(-50%, 100%);
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
  padding-bottom: var(--safe-b);
  max-height: 86vh;
  display: flex; flex-direction: column;
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px;
  flex: 0 0 auto;
}
.sheet__title { font-size: 16px; font-weight: 700; }
.sheet__close { width: 30px; height: 30px; display: grid; place-items: center; color: var(--c-text-3); font-size: 18px; }
.sheet__body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px; }
.sheet__ft { flex: 0 0 auto; display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); }

.modal {
  position: fixed; z-index: 101;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.92);
  width: calc(100% - 64px); max-width: 400px;
  background: #fff; border-radius: var(--r-l);
  opacity: 0; pointer-events: none;
  transition: all .2s;
  overflow: hidden;
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal__hd { padding: 18px 18px 6px; font-size: 16px; font-weight: 700; text-align: center; }
.modal__bd { padding: 4px 18px 18px; font-size: 14px; color: var(--c-text-2); }
.modal__ft { display: flex; border-top: 1px solid var(--c-line); }
.modal__ft button { flex: 1; height: 48px; font-size: 15px; }
.modal__ft button + button { border-left: 1px solid var(--c-line); }
.modal__ft .ok { color: var(--c-primary); font-weight: 700; }
.modal__ft .no { color: var(--c-text-2); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  max-width: 70%;
  padding: 10px 18px;
  border-radius: var(--r-m);
  background: rgba(23, 22, 28, .86);
  color: #fff; font-size: 13px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.toast.is-open { opacity: 1; }

/* ---------------- 空状态 ---------------- */
.empty { padding: 48px 20px; text-align: center; color: var(--c-text-3); font-size: 13px; }
.empty__ico { font-size: 40px; opacity: .35; margin-bottom: 8px; }

/* ---------------- 分隔/其他 ---------------- */
.divider { height: 8px; background: var(--c-page); }
.tip-text { font-size: 12px; color: var(--c-text-3); line-height: 1.7; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-green); flex: 0 0 6px; }
.dot--gray { background: var(--c-text-3); }
.dot--red { background: var(--c-red); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.fade-up { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
