/* ============================================================
   碰一碰落地页
   设计取向：暖白纸感 + 墨黑文字 + 朱砂红点睛。
   刻意避开「渐变紫蓝 + 玻璃拟态」那套通用 AI 观感 ——
   这是门店里给顾客看的东西，要的是清楚、可信、点得下去。
   ============================================================ */

:root {
  --paper: #faf8f5;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #43474e;
  --muted: #7b8087;
  --line: #e8e4de;
  --accent: #b23a2e;
  --accent-ink: #8f2c22;
  --accent-soft: #fbeeea;
  --wifi: #1f6f5c;
  --wifi-soft: #e8f4f0;
  --groupon: #b5791a;
  --groupon-soft: #fdf3e2;
  --video: #2b3f6b;
  --video-soft: #ecf0f8;
  --review: #5a4a7a;
  --review-soft: #f1eef8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 8px 24px -12px rgba(22, 24, 29, .16);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 26px 20px calc(30px + var(--safe-b));
}

/* ---------------------------------------------------------- 品牌区 */
.brand { display: flex; align-items: center; gap: 13px; }

.brand__mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0;
  overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }

.brand__text { min-width: 0; }

.brand__name {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------- 状态胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  padding: 5px 11px 5px 9px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 550;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.pill--ended { background: #f0efed; color: var(--muted); }
.pill--ended::before { background: var(--muted); }

/* ---------------------------------------------------------- 视频首屏 */
/*
  只在商家配了「可直接播放的视频文件」时出现（见 app.js 的 playableVideo）。
  比例固定 9:16 竖屏，跟顾客在抖音/视频号里习惯的形状一致。

  max-height 定在 50vh 是个权衡的结果：再高一点（试过 62vh）视频更好看，
  但会把「领券」整个挤到首屏之外，顾客不往下滑就看不到 —— 券是这个页面的转化项，
  不能为了视频好看把它埋掉。50vh 能让第一个入口卡在首屏露头，
  「下面还有东西」这件事不用教。
*/
.hero { margin: 18px 0 0; }

.hero__stage {
  position: relative;
  /*
    居中。aspect-ratio + max-height 会把宽度从内容区宽（350）收到 9:16 对应的 237，
    而块级元素收缩后仍然靠左贴边 —— 结果是右侧空出 113px，视频像是没摆正
    （归档截图里一直是这样，只是没人专门盯这一处）。
    margin-inline: auto 让它在内容区里居中，不改变高度，首屏预算不受影响。
  */
  margin-inline: auto;
  /* 让下面的 .hero__aigc 能用 cqi（容器宽度百分比）定字号，见该处注释 */
  container-type: inline-size;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101216;
  aspect-ratio: 9 / 16;
  max-height: 50vh;
  box-shadow: var(--shadow);
}

.hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101216;
}

.hero__hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 18, 22, .62);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/*
  AI 生成标识。压在画面左上角、始终可见，不参与任何隐藏逻辑。

  法规依据（GB 45438—2025）：
  - 我们这一处属于 §5.6「交互场景界面显式标识」—— 标记加在页面上，不是加进视频文件里。
    该条要求：文字提示 + 同时含「人工智能/AI」与「生成/合成」两个要素
    + 在内容附近**持续显示** + 字型颜色清晰可辨。**没有字号要求。**
  - §5.4 那条「文字高度不低于画面最短边的 5%、持续不少于 2s」是给**视频内容显式标识**
    的（即烧进画面里的那种）。我们没做那种，所以本来不适用。
  - 但还是按 5% 来定字号：万一有人按 §5.4 来读这个角标也不会踩线，成本是零。
    用 cqi（容器宽度百分比）而不是固定 px —— 画面宽度由 aspect-ratio + 50vh 决定，
    换一个屏幕就变，固定值在宽屏上会掉到 5% 以下。最小 12px 兜底可读性。
  - 位置选左上角而不是标准示例里的右下角：竖屏视频右下角常被平台水印和进度条占着。
*/
.hero__aigc {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(16, 18, 22, .58);
  color: #fff;
  font-size: 12px;
  font-size: max(12px, 5.2cqi);
  font-weight: 560;
  letter-spacing: .2px;
  pointer-events: none;
}

/* 内容页里的同一件事，用文字而不是角标 —— 那里是一段说明，不是画面上的水印 */
.aigc-note {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  line-height: 1.6;
}

.hero__meta { margin-top: 14px; }
.hero__title { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.hero__lead { margin-top: 3px; font-size: 14px; color: var(--muted); }

.hero__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.hero__actions .btn { flex: 1; }

.hero__note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------------------------------------------------------- 优惠区 */
/*
  券和团购单独成块（见 app.js renderSections）。做成独立的视觉层而不是复用 .entry，
  是为了让「这店现在有好处」在扫一眼的时候就成立 —— 它是这个页面的转化项。

  没有券也没有团购时整块不渲染，所以不存在「空标题」这种状态。
*/
.promo { margin: 22px 0 0; }

.promo__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo__card {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 14px;
  border: 1px solid #f1d9d3;
  border-radius: var(--radius);
  /* 暖底而不是纯白：不靠颜色喊，靠「和下面的白卡不是一层」来分区 */
  background: linear-gradient(180deg, #ffffff 0%, #fdf6f4 100%);
  box-shadow: var(--shadow);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.promo__card:active { transform: scale(.985); box-shadow: 0 1px 2px rgba(22, 24, 29, .06); }

/* 左上角一小段朱砂红：给卡片一个「这是活动」的记号，比整块红底克制 */
.promo__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.promo__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.promo__icon svg { width: 21px; height: 21px; }
.promo__card[data-type="groupon"] .promo__icon { background: var(--groupon-soft); color: var(--groupon); }

.promo__body { flex: 1; min-width: 0; }
.promo__title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.1px;
  color: var(--accent-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.promo__card[data-type="groupon"] .promo__title { color: #7a4f0d; }
.promo__hint {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo__cta {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.promo__card[data-type="groupon"] .promo__cta { background: var(--groupon); }

/* ---------------------------------------------------------- 分区标题 */
.section__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.05px;
  color: var(--ink-2);
}
/* .entries 是 flex 列（gap:10px），标题的上下外边距会和 gap 叠加，
   所以进列表的标题只留一点上边距，把「上一段结束」和「这一段开始」分开即可 */
.entries .section__title { margin: 6px 0 0; }

/* ---------------------------------------------------------- 入场动效 */
/*
  逐条 60ms 错开。给的是「页面在展开」的感觉，不是装饰 ——
  一次全出现和一条条出现，后者更让人觉得页面是活的，成本只有 CSS。
*/
@keyframes rise-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.hero,
.promo__list > li,
.entries > li {
  animation: rise-in .36s cubic-bezier(.2, .8, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

/* ---------------------------------------------------------- 入口列表 */
.entries {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry {
  /* 用 <button> 而不是 <div>：键盘可达、点击区域天然正确、无障碍标签免费 */
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.entry:active { transform: scale(.985); box-shadow: 0 1px 2px rgba(22,24,29,.06); }

.entry__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry__icon svg { width: 21px; height: 21px; }

.entry__body { flex: 1; min-width: 0; }
.entry__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry__hint {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  /* 允许两行：说明文字被截在「觉得有意...」这种位置比换行更难看 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry__chev { flex: 0 0 auto; color: #c3c0ba; }

.entry[data-type="video"]   .entry__icon { background: var(--video-soft);    color: var(--video); }
.entry[data-type="groupon"] .entry__icon { background: var(--groupon-soft);  color: var(--groupon); }
.entry[data-type="coupon"]  .entry__icon { background: var(--accent-soft);   color: var(--accent); }
.entry[data-type="wifi"]    .entry__icon { background: var(--wifi-soft);     color: var(--wifi); }
.entry[data-type="review"]  .entry__icon { background: var(--review-soft);   color: var(--review); }

/* ---------------------------------------------------------- 空态 / 结束态 */
.empty {
  margin: 26px 0 0;
  padding: 30px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty__title { font-size: 17px; font-weight: 650; margin: 0 0 6px; }
.empty__text { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* ---------------------------------------------------------- 页脚 */
.foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
}
.foot p { margin: 0 0 6px; }
.foot .foot__note { color: #9a9ea4; }

/* ---------------------------------------------------------- 弹层 */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 29, .42);
  animation: fade .18s ease;
}
.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(26px + var(--safe-b));
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
  max-width: 480px;
  margin: 0 auto;
}
.sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 24, 29, .06);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}

@keyframes rise { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet__title { margin: 0 0 4px; font-size: 20px; font-weight: 680; letter-spacing: -.3px; }
.sheet__lead { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .12s ease, transform .12s ease;
}
.btn:active { transform: scale(.985); opacity: .92; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 550;
}
.btn--accent { background: var(--accent); }
.btn + .btn { margin-top: 10px; }

/* ---------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-2);
}
.field input {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-size: 16px; /* iOS 上小于 16px 会触发自动缩放 */
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field input[inputmode="numeric"] { letter-spacing: 1.5px; }

/* ---------------------------------------------------------- 隐私同意 */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.consent span { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.consent em { font-style: normal; color: var(--accent-ink); font-weight: 600; }

/* ---------------------------------------------------------- 券结果 */
.coupon-code {
  margin: 4px 0 0;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.coupon-code__amt { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.coupon-code__val {
  margin: 8px 0 4px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.coupon-code__tip { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------- Wi-Fi */
.wifi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 10px;
}
.wifi-row__label { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.wifi-row__value {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: .3px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.copy-btn {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink);
  cursor: pointer;
}
.copy-btn:active { background: var(--line); }

/* ---------------------------------------------------------- 外链降级 */
.fallback {
  padding: 16px;
  border: 1px solid #f0dcc8;
  border-radius: 12px;
  background: var(--groupon-soft);
}
.fallback__title { font-size: 14.5px; font-weight: 620; margin: 0 0 6px; color: #7a4f0d; }
.fallback__text { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: #6b5327; }
.fallback ol { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.85; color: #6b5327; }

/* ---------------------------------------------------------- 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #ece8e2 25%, #f4f1ec 37%, #ece8e2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
}
.skeleton.brand__mark { border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(34px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 80;
  padding: 11px 20px;
  border-radius: 100px;
  background: rgba(22, 24, 29, .93);
  color: #fff;
  font-size: 13.5px;
  font-weight: 520;
  white-space: nowrap;
  animation: fade .15s ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  /* animation-delay 也要归零：入场动效用了 both 填充，延迟期间停在 opacity:0，
     只把 duration 压到 .01ms 的话，列表会「先空一秒再一起冒出来」 */
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}
