/* ==========================================================================
   洗浴中心 · 抖音店铺风格 静态框架
   作者：WorkBuddy | 结构：变量 → 基础 → 头图 → 认证条 → Tab → 分类 → Banner → 卡片
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 品牌色（抖音红） */
  --brand: #fe2c55;
  --brand-2: #ff5f8a;
  --brand-grad: linear-gradient(90deg, #ff2c55, #ff5f8a);

  /* 会员金 */
  --gold-1: #ffe9a8;
  --gold-2: #e7b84c;
  --gold-ink: #7a5a10;

  /* 中性色 */
  --ink: #16181d;
  --ink-2: #4b5058;
  --ink-3: #8b909a;
  --line: #eceef2;
  --bg: #f5f6f8;
  --card: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(22, 24, 29, .06);

  --phone-w: 430px;
  --pad: 14px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #0e0f12; /* 桌面端外底色，衬托手机外框 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* 空图片槽位：图片未放入时显示浅灰斜纹底，不显示任何文字标记 */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, #eff1f5 0 8px, #e7eaef 8px 16px);
}
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph--dark { background: repeating-linear-gradient(45deg, #2a2d35 0 8px, #23262d 8px 16px); }

/* ---------- 3. 手机外框 ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: var(--phone-w);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  /* 注意：此处不能设 overflow:hidden —— 它会把 .phone 变成滚动容器，
     导致内部 .actionbar 的 position:sticky 参照它而非视口，从而完全失效。
     移动端无圆角，无需裁剪；桌面端用 overflow:clip（不产生滚动容器）裁剪圆角。 */
  padding-bottom: 24px;
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .phone {
    min-height: auto;
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
    overflow: clip;
  }
}

/* ---------- 4. 头图区 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 268px;
  color: #fff;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: -2;
}
.hero__mask {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.05) 30%, rgba(0,0,0,.62) 78%, rgba(0,0,0,.82) 100%);
}

/* 语言切换（右上角） */
.lang {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: var(--pad);
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
}
.lang__btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, .8);
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.lang__btn.is-active {
  color: var(--ink);
  background: #fff;
}
.lang__btn:not(.is-active):active { background: rgba(255, 255, 255, .16); }

/* 店招 */
.shop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px var(--pad) 22px;
}
.shop__logo {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}
.shop__text { flex: 1 1 auto; min-width: 0; }
.shop__name {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.shop__en {
  margin-top: 5px;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 5. 官方认证条 ---------- */
.certify {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px var(--pad);
  font-size: 12px;
  color: #6a4a12;
  background: linear-gradient(90deg, #fdf3dc, #fbf6ea 60%, #fdf3dc);
  border-top: 1px solid #f2e3c0;
  border-bottom: 1px solid #f2e3c0;
}
.certify__tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  color: #8a5b00;
  flex: none;
}
.certify__tag svg { width: 14px; height: 14px; color: #e6a817; }
.certify__line { width: 1px; height: 12px; background: #e3cf9c; flex: none; }
.certify__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- 6. Tab 导航 ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 22px;
  padding: 0 var(--pad);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  padding: 14px 2px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color .2s;
}
.tab.is-active { color: var(--ink); font-weight: 800; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-grad);
  transform: translateX(-50%);
}

/* ---------- 7. 主 Banner（最大展示图） ---------- */
.banner {
  position: relative;
  margin: 14px var(--pad) 4px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.banner__pic {
  width: 100%;
  /* 4:5 竖版画幅，贴合实景竖构图照片，裁切最少 */
  aspect-ratio: 4 / 5;
}

/* ---------- 9. 通用分区 & 卡片 ---------- */
.section {
  margin-top: 14px;
  padding: 16px var(--pad);
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section__head h2 { font-size: 16px; font-weight: 800; }
.section__more { font-size: 12px; color: var(--ink-3); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  /* 卡片本体是 <button>，需重置按钮默认样式 */
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  transition: box-shadow .2s, transform .2s;
}
.card:active { transform: scale(.98); box-shadow: var(--shadow); }

/* 不可点击卡片（敬请期待） */
.card--soon { cursor: default; opacity: .72; }
.card--soon:active { transform: none; box-shadow: none; }

/* 卡片图位：5:6 贴合套餐海报原图比例（1080×1300 ≈ 0.83），避免上下文字被裁 */
.card__pic { display: block; width: 100%; aspect-ratio: 5 / 6; }
.card__title {
  display: -webkit-box;
  padding: 9px 9px 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 9px;
}
.card__tags span {
  padding: 1px 6px;
  font-size: 10px;
  color: var(--brand);
  background: #fff0f3;
  border-radius: 4px;
}
.card__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 9px 10px;
  font-size: 17px;
  font-weight: 900;
  color: var(--brand);
}
.card__price em { font-size: 11px; font-style: normal; }
.card__price s { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.card__gift {
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  color: #fff;
  background: var(--brand);
  border-radius: 4px;
}
.card__price--soon {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-3);
}

/* ---------- 10. 门店信息 ---------- */
.info { display: flex; flex-direction: column; gap: 1px; }
.info li {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.info li:last-child { border-bottom: 0; }
.info__k { flex: none; width: 68px; color: var(--ink-3); }
.info__v { flex: 1 1 auto; color: var(--ink); }
.info__v a { color: var(--brand); font-weight: 700; }

/* ---------- 11. 页脚 & 底部操作条 ---------- */
.foot {
  padding: 22px var(--pad) 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.9;
}

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 10px;
  padding: 10px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.actionbar__main {
  flex: 1 1 0;
  height: 44px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(254, 44, 85, .35);
}

/* ---------- 12. 微信预约弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
  animation: modalFade .2s ease both;
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 300px;
  /* 矮屏（横屏/小屏）下允许内部滚动，避免内容被裁掉 */
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 24px 22px 26px;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .32);
  animation: modalPop .24s cubic-bezier(.2, .9, .3, 1.15) both;
}
.modal__close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  border-radius: 50%;
  transition: background .15s;
}
.modal__close:active { background: var(--line); }
.modal__title { font-size: 18px; font-weight: 800; }
.modal__desc { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.modal__qr {
  /* 二维码原图为 958×1415 竖版卡片（含头像/昵称/提示语），
     容器比例与之一致，object-fit:cover 即等于完整显示、不裁切 */
  width: 100%;
  max-width: 215px;
  aspect-ratio: 958 / 1415;
  margin: 16px auto 0;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* 电话预约兜底 */
.modal__phone {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.modal__phone-hint {
  font-size: 12.5px;
  color: var(--ink-3);
}
.modal__phone-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 11px;
}
.modal__phone-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--brand);
  background: #fff0f3;
  border-radius: 10px;
  transition: background .15s;
}
.modal__phone-list a:active { background: #ffe0e8; }
.modal__phone-list svg { width: 15px; height: 15px; flex: none; }

/* ---------- 12.1 套餐详情弹层 ---------- */
.modal__card--pkg {
  max-width: 320px;
  padding: 26px 22px 22px;
  text-align: left;
}
.pkg__brand {
  margin-bottom: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #b08d3f;
}
.modal__card--pkg .modal__title { text-align: center; font-size: 19px; }
.pkg__meta {
  margin-top: 7px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.pkg__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.pkg__list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.pkg__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-grad);
}
.pkg__note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-3);
}
.pkg__cta {
  width: 100%;
  height: 44px;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(254, 44, 85, .3);
}
.pkg__cta:active { transform: scale(.98); }

@keyframes modalFade { from { opacity: 0; } }
@keyframes modalPop {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
}

/* 弹层打开时锁定背景滚动 */
body.modal-open { overflow: hidden; }

/* ---------- 13. 无障碍：可见焦点 ---------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 13. 英文版排版微调（英文词更长，需放宽固定宽度） ---------- */
html[lang="en"] .shop__name {
  font-size: 19px;
  letter-spacing: .3px;
}
html[lang="en"] .info__k { width: 100px; }
html[lang="en"] .pkg__brand {
  /* 英文品牌行较长，左右留白避开右上角关闭按钮（实测间距约 14px） */
  padding: 0 32px;
  font-size: 10.5px;
  letter-spacing: .5px;
}

/* ---------- 14. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
