/* ================================
   CUSTOMER APP – 全局 & 手机壳
================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #ffffff00;
}

body.customer-app{
  height: 100%;
  overflow: hidden;   /* ✅只锁 customer 页面 */
}


/* 顶部小 logo bar */
/* 顶部小 logo bar（基础款：高度、背景不变） */
.app-header {
  padding: 0.8rem;
  background-color: #ffffff;
  height: 70px;
  display: flex;
  align-items: center;
  position: relative; /* ✅ 让居中定位更稳 */
  padding-top: env(safe-area-inset-top);
}

/* ✅ 登录 / Events：logo 居中（Scan 隐藏也不影响） */
.app-header.app-header--center {
  justify-content: center;
}

/* ✅ Home：左 logo + 右 Scan */
.app-header.app-header--home {
  justify-content: space-between;
}

/* logo 大小建议别等于 70px，不然会撑满 */
.app-logo {
  height: 70px;   /* 你要保持 70 也行，但视觉会挤 */
  width: auto;
  display: block;
}

/* 让 Scan 按钮只在 home 模式里出现（你已有 hidden / visible 逻辑也可继续用） */
.app-header--center .scan-qr-btn {
  display: none !important;
}

/* =========================
   Header top offset (Auth only)
========================= */

/* 默认：其它 screen / 其它页面都不下移 */
body.customer-app .app-header { 
  margin-top: 0; 
}

/* 仅当登录/验证码 screen active 时，下移 4rem */
body.customer-app:has(#screen-auth.active) .app-header,
body.customer-app:has(#screen-code.active) .app-header {
  margin-top: 4rem;
}

/* 可选：如果你不想 main 多出空白滚动，就保留；想简单就删掉这段 */
body.customer-app:has(#screen-auth.active) .app-main,
body.customer-app:has(#screen-code.active) .app-main {
  height: calc(100vh - 70px - 4rem);
}

/* ✅ 只在登录/验证码 screen 时放开裁切（让 Google 按钮完整显示） */
body.customer-app:has(#screen-auth.active) .app-main,
body.customer-app:has(#screen-code.active) .app-main{
  overflow: visible !important;
}


/* 主体 */
.app-main {
  background-color: #ffffff;
  position: relative;
  height: calc(100vh - 70px);    /* ✅header 70px */
  overflow: hidden;              /* ✅不让横竖溢出乱滚 */
  padding: 0;   
}

/* 所有 screen 叠在一起 */

/* 🚫 首次加载：禁用动画 */
body:not(.has-transitions) .screen{
  transition: none;
}

.screen{
  position: absolute;
  inset: 0;
  overflow-y: auto;              /* ✅滚动发生在screen内部 */
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1.6rem 1.2rem; /* ✅原来app-main的padding挪到这 */
  padding-bottom: 140px;         /* ✅给底部导航让位（关键） */
  opacity: 0;
  pointer-events: none;
  transition: opacity .10s cubic-bezier(.4,0,.2,1);
}

.screen.active{
  opacity: 1;
  pointer-events: auto;
}


/* 离开时 */
.screen.is-leaving{
  opacity: 0;
}


/* 通用小图标尺寸 */
.icon-16 { width: 16px; height: 16px; object-fit: cover; }
.icon-18 { width: 18px; height: 18px; object-fit: cover; }
.icon-20 { width: 30px; height: 30px; object-fit: cover; }
.icon-22 { width: 30px; height: 30px; object-fit: cover; }

/* ========== 登录 / 验证码界面共用 ========== */

.hero-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-icon.small { margin-bottom: 0.8rem; }

.hero-icon-inner {
  position: relative;
  width: 72px;
  height: 72px;
  background: #ffffff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-main-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0065ff;
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.35rem;
}

.welcome-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 1.3rem;
}

/* 登录 tab */
.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 0.18rem;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  padding: 0.45rem 0;
  cursor: pointer;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  color: #111827;
}

.tab-icon {
  width: 16px;
  height: 16px;
  object-fit: cover;
}

/* 输入区域 */
.auth-mode { margin-bottom: 1rem; }

.hidden {
  display: none;
}

.field-label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  display: block;
  color: #4b5563;
}

.input-with-icon { position: relative; }

.text-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 0.7rem 2.3rem 0.7rem 0.85rem;
  font-size: 0.95rem;
  outline: none;
}

.text-input:focus {
  border-color: #0065ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.input-icon {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dev-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* 主按钮 */
.primary-btn {
  width: 100%;
  border-radius: 16px;
  border: none;
  background: #1E589F;
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.4rem;
}

.primary-btn:active { transform: translateY(1px); }

/* 分割线 */
.divider {
  display: flex;
  align-items: center;
  margin: 1.3rem 0 1rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.divider span {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider p { margin: 0 0.5rem; }

/* Google 官方按钮：外观统一（外层是你的卡片风格） */
/* Google 区块：默认就别溢出 */
.google-btn-wrap{
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;          /* ✅ 防止 iFrame 溢出造成裁切/横向溢出 */
  padding: 0 6px;            /* ✅ 给一点安全边距 */
}

/* holder 本身别撑满 */
.google-real-btn{
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: center;
}

/* 手机再多给点边距 */
@media (max-width: 480px){
  .google-btn-wrap{
    padding: 0 10px;         /* ✅ 手机多留点 */
  }
}





/* 会员权益 */
.benefits { margin-top: 1.6rem; }

.benefits-title {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  margin: 0 0 0.6rem;
}

.benefits-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.benefit-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.benefit-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #DB3D1B;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-card:nth-child(2) .benefit-icon { background: #1E589F; }
.benefit-card:nth-child(3) .benefit-icon { background: #221714; }

.benefit-icon img {
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.terms {
  font-size: 0.7rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 0.4rem;
}

/* 验证码屏幕 */
.code-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0.4rem 0 0.9rem;
}

.link-btn {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  cursor: pointer;
}

.link-btn.small { font-size: 0.8rem; }

/* ========== Home / My Account ========== */

.home-topbar {
  height: 32px;
  padding: 0 2px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.home-link {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #2563eb;
  cursor: pointer;
}

/* 用户信息 */
.home-user-row {
  padding: 5px 2px 5px;
  display: flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
}

.home-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-user-text { flex: 1; }

.home-user-greeting {
  font-size: 0.75rem;
  color: #6b7280;
}

.home-user-name {
  font-size: 0.95rem;
  font-weight: 600;
}

/* 登出按钮 */
.logout-btn {
  border: none;
  background: #db3e1b00;
  width: 25%;
  color: #DB3D1B;
  border-radius: 999px;
  padding: 8px 12px;
  height: 30px;  
  display: flex;
  align-items: center;
  justify-content:center;
  gap: 2px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.home-icon-btn {
  border: none;
  background: #f3f4f6;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.home-icon-btn img {
  width: 18px;
  height: 18px;
}

/* ===== Hero Carousel (Edge-to-edge + Auto + Swipe) ===== */
.home-hero{
  background-color: #000;
  /* ✅ 吃掉 .screen 的左右 padding（你 .screen 是 1.6rem） */
  margin-left: -1.6rem;
  margin-right: -1.6rem;

  /* ✅ 如果你希望顶部也紧贴（.screen 顶部 padding 0.5rem），打开这行 */
  /* margin-top: -0.5rem; */

  /* ✅ 外层不留 padding，否则永远有“白边/空隙” */
  padding: 0;

  color: #ffffff;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

/* 视口：真正全宽（无视父级 padding） */
.hero-viewport{
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  touch-action: pan-y;
}

/* 轨道 */
.hero-track{
  display: flex;
  width: 100%;
  transform: translate3d(0,0,0);
  will-change: transform;
  transition: transform 430ms cubic-bezier(.22,.61,.36,1);
  backface-visibility: hidden;
}

/* ✅ 每页铺满：背景在 slide 上，所以 slide 必须贴边 */
.hero-slide{
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;

  aspect-ratio: 430 / 132.95;   /* ✅ 锁死原比例 */
  padding: 0;                   /* ❗不要 padding，不然比例会被破坏 */

  background: #000;
}

/* 文字 */
.hero-text h2{
  font-size: 1.05rem;
  margin: 4px 0 4px;
}
.hero-text p{
  font-size: 0.78rem;
  opacity: 0.92;
}
.hero-tag{
  font-size: 0.7rem;
  opacity: 0.92;
}

/* 图片占位（你后期换 img.hero-img 即可） */
.hero-graphic{ flex-shrink: 0; }
.hero-img-placeholder{
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: rgba(255,255,255,0.22);
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.25);
}

/* dots：注意 dots 现在在 home-hero 里，home-hero 没 padding 了
   所以 dots 自己要加点上下间距 */
.hero-dots{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;              /* 覆盖在广告内部底部 */

  display: flex;
  justify-content: center;
  gap: 6px;

  z-index: 5;

  margin: 0;
  padding: 0;

  pointer-events: none;      /* ✅ 不挡滑动 */
}


.hero-dot{
  pointer-events: auto;      /* 只有 dot 能点 */
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 160ms ease, background 160ms ease, transform 160ms ease;
}

.hero-dot.active{
  width: 12px;
  background: #fff;
}


.hero-dot:active{
  transform: scale(0.96);
}

/* 拖拽时禁用轨道过渡 */
.hero-track.is-dragging{
  transition: none !important;
}

/* 降低动态偏好 */
@media (prefers-reduced-motion: reduce){
  .hero-track{ transition: none !important; }
}

.hero-bottom{
  /* 全宽（吃掉 .screen 的左右 padding） */
  margin-left:-1.6rem;
  margin-right:-1.6rem;

  /* 布局 */
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  padding: 10px 16px;
  line-height: 1.35;

  /* iOS 玻璃质感：几乎无色 */
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);

  /* “玻璃边缘”高光 + 轻分隔 */
  border-top: 1px solid rgba(255,255,255,0.65);
  border-bottom: 1px solid rgba(17,24,39,0.06);

  /* 轻阴影：浮起来一点点 */
  box-shadow:
    0 10px 24px rgba(17,24,39,0.10);

  /* 字体：高级、克制 */
  color: #111827;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}


.hero-text h2 {
  font-size: 1.05rem;
  margin: 4px 0 4px;
}

.hero-text p {
  font-size: 0.78rem;
  opacity: 0.9;
}

.hero-tag {
  font-size: 0.7rem;
  opacity: 0.9;
}

.hero-graphic { flex-shrink: 0; }

/* 图片 cover，但不参与布局 */
.hero-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.hero-dot.active {
  width: 12px;
  background: #ffffff;
}

/* 通用 section 容器 */
.home-section { padding: 18px 2px 0; }

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.home-section-header h3 {
  font-size: 0.95rem;
  margin: 0;
}

/* 通用卡片 */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.259);
}

/* Rewards 卡片 */
.reward-card { margin-bottom: 14px; }

.reward-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.reward-icon {
  width: 55px;
  height: 55px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: #DB3D1B;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-icon img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.reward-text .reward-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
}

.reward-text .reward-subtitle {
  font-size: 0.75rem;
  color: #374151;
}

/* stamp grid 两行 10 个 */
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-row-gap: 10px;
  grid-column-gap: 14px;
  margin: 8px 0 10px;
  width: 100%;        /* 默认 */
}

.stamp-dot {
  width: 100%;
  padding-top: 100%;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background-image: url("/img/stampdot.jpg");
  background-color: #d9d9d9;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 75%;
  position: relative; /* ✅ 加回这个，否则 Free 文本 absolute 会乱 */
}

/* ✅ 有 stamp 的高亮状态（JS 会加 stamp-dot--filled） */
.stamp-dot.stamp-dot--filled {
  background-image: url("/img/stampactive2.png");
  background-color: #2563eb;
  border-color: #1d4ed8;
}

.stamp-dot.free-dot {
  background-color: #e0f2fe;
  border-color: #2563eb;
}

.stamp-free-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 600;
  color: #1d4ed8;
}

.reward-footer-text {
  font-size: 0.7rem;
  color: #6b7280;
}

/* My Rewards 卡片 */
.list-card {
  width: 100%;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.259);
  cursor: pointer;
}

.list-card-icon {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  overflow: hidden;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-card-icon img {
  width: 34px;
  height: 34px;
  object-fit: cover;
}

.list-card-main { flex: 1; }

.list-card-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.list-card-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.list-card-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-card-arrow img {
  width: 30px;
  height: 30px;
}

/* Recent Activity */
.activity-card { margin-top: 4px; }

.activity-header {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.activity-empty {
  padding: 28px 10px 24px;
  text-align: center;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.activity-icon img {
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.activity-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.activity-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
}

.activity-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.activity-item-sub {
  font-size: 0.75rem;
  color: #6b7280;
}

.activity-right {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}


/* 底部预留空间 */
.home-bottom-spacer { height: 110px; }

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 414px;
  background: #ffffff;
  border-top: 1px solid #dfdfdf;
  justify-content: space-around;
  padding: 6px 0 8px;
  z-index: 20;
  display: none; /* 默认隐藏，登录后用 class 打开 */
}

.bottom-nav.bottom-nav--visible { display: flex; }

.bottom-nav-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.bottom-nav-item img { margin-bottom: 1px; }

.bottom-nav-item.active { color: #ef4444; }

/* Header 右侧 Scan 按钮（替代悬浮 fab） */
.scan-qr-btn {
  margin-right: 1rem;
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  height: 40px;                 /* 让它在 header 里更稳 */
  display: none;                /* 默认隐藏，登录后显示 */
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 5px rgba(37, 99, 235, 0.35);
}

.scan-qr-btn img {
  width: 20px;
  height: 20px;
}

/* ✅ 你原本的 visible 逻辑沿用（JS 加 class 就显示） */
.scan-qr-btn.scan-qr-fab--visible {
  display: inline-flex;
}

/* 按压效果 */
.scan-qr-btn:active {
  transform: translateY(1px);
}


/* ✅ My Rewards 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 关键：同时有 modal + hidden 时，强制隐藏 */
.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 51;
  width: 92%;
  max-width: 420px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 16px 16px 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  color: #6b7280;
}

.modal-body {
  font-size: 0.85rem;
  color: #374151;
  margin-top: 4px;
}

.modal-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.modal-primary-btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* 小屏自适应 */
@media (max-width: 480px) {
  .phone-frame {
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
  }

  .app-main { padding-bottom: 1rem; }
}

/* =========================
   Page Transition (Global)
========================= */

.page-transition{
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;

  /* 初始在右侧外面 */
  transform: translateX(100%);
  will-change: transform;

  /* 不用 display:none（会让 video 停） */
  visibility: hidden;
  pointer-events: none;

  /* ✅进入默认 420ms */
  transition: transform 700ms cubic-bezier(.22,.61,.36,1);
}

/* 激活：滑入并盖住 */
.page-transition.is-active{
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

/* 离开：向右滑走（✅这里改成 450ms） */
.page-transition.is-leaving{
  transition-duration: 680ms;
  transform: translateX(100%);
}

/* 新页面“瞬间盖住”用：去掉过渡 */
.page-transition.no-transition{
  transition: none !important;
}

.page-transition__inner{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.page-transition__video{
  width: 180px;
  height: 180px;
  display: block;
  background: #ffffff;
  object-fit: contain;
  transform: translateZ(0);
}

/* =========================
   iOS-like QR Sheet (top slide)
========================= */

#qrScannerModal.hidden { display:none; }

#qrScannerModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  padding-top: calc(env(safe-area-inset-top) + 10px);
}

#qrScannerBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 300ms ease;
}

/* ✅ 重点：sheet 默认在屏幕上方，看不见 */
#qrScannerModal .qr-scan-panel{
  position: relative;
  z-index: 1;
  width: min(420px, 94vw);
  border-radius: 20px;
  background: #fff;

  transform: translateY(-22px) scale(0.985);
  opacity: 0;

  transition:
    transform 520ms cubic-bezier(.16,1,.3,1), /* iOS-ish spring */
    opacity   220ms ease;
  will-change: transform, opacity;
  box-shadow: 0 28px 80px rgba(0,0,0,0.45),
              0 0 0 1px rgba(0,0,0,0.06);
}

/* 打开 */
#qrScannerModal.is-open #qrScannerBackdrop{ opacity: 1; }

#qrScannerModal.is-open .qr-scan-panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* 关闭：更快更干脆 */
#qrScannerModal.is-closing #qrScannerBackdrop{
  opacity: 0;
  transition-duration: 300ms;
}

#qrScannerModal.is-closing .qr-scan-panel{
  transform: translateY(-18px) scale(0.99);
  opacity: 0;
  transition-duration: 300ms;
}

/* ✅ 视频区域：你要调主体高度就改这里 */
.qr-video-wrap{
  border-radius: 16px;
  overflow: hidden;
  background: #0b1220;
  position: relative;
}

/* iOS 上建议用动态视口单位，避免地址栏抖动 */
:root{
  --qr-video-h: min(52dvh, 360px); /* ✅你要更高就改这个：比如 60dvh / 420px */
}

#qrVideo{
  width: 100%;
  height: var(--qr-video-h);
  object-fit: cover;
  display: block;
  background: #000;
}

/* “正在启动相机”遮罩（JS 会加 class） */
#qrScannerModal.is-starting .qr-video-wrap::after{
  content: "Starting camera…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.92);
  font-weight: 650;
  font-size: 0.95rem;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(8px);
}

/* ✅ 防误触：打开后短时间不允许点遮罩关闭 */
#qrScannerModal.no-close #qrScannerBackdrop{
  pointer-events: none;
}

/* ✅ 扫码成功：覆盖在视频上方的 iOS-like 成功提示 */
#qrScannerModal .qr-video-wrap::after{
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

/* 开始相机提示仍然优先 */
#qrScannerModal.is-starting .qr-video-wrap::after{
  content: "Starting camera…";
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.92);
  font-weight: 650;
  font-size: 0.95rem;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(8px);
  opacity: 1;
  transform: none;
}

/* ✅ 成功提示 */
#qrScannerModal.is-success:not(.is-starting) .qr-video-wrap::after{
  content: "✓";
  display: grid;
  place-items: center;
  font-size: 56px;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  background: rgba(11, 18, 32, 0.35);
  backdrop-filter: blur(6px);
  opacity: 1;
  transform: scale(1);
}


@media (prefers-reduced-motion: reduce){
  #qrScannerBackdrop,
  #qrScannerModal .qr-scan-panel{ transition: none !important; }
}


