/* ============================================
   渡仓 · 统一支付模块样式（pay.js 配套）
   任何页面引入本文件 + js/pay.js 即拥有支付能力
   ============================================ */

/* ===== 支付方式弹层（液态玻璃底部弹层） ===== */
.pay-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(22, 26, 32, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: payMaskIn 0.22s ease both;
}

@media (min-width: 560px) {
  .pay-mask {
    align-items: center;
    padding: 20px;
  }
}

@keyframes payMaskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pay-panel {
  width: 100%;
  max-width: 460px;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  animation: payPanelIn 0.32s var(--ease-spring) both;
}

@media (min-width: 560px) {
  .pay-panel {
    border-radius: 22px;
  }
}

@keyframes payPanelIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.pay-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.pay-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(22, 26, 32, 0.06);
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-body {
  padding: 4px 20px 22px;
}

.pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  padding: 12px 0 20px;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.pay-yen {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-2);
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-right-color: rgba(148, 166, 194, 0.24);
  border-bottom-color: rgba(148, 166, 194, 0.24);
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 22px -12px rgba(22, 26, 32, 0.2);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}

.pay-method:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.78);
}

.pay-method[disabled] {
  opacity: 0.55;
  cursor: default;
}

.pay-method-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 8px rgba(22, 26, 32, 0.14);
}

.pay-method-ico svg {
  width: 24px;
  height: 24px;
}

.pay-method-ico.wechat { background: linear-gradient(145deg, #2fd06b, #07a34e); }
.pay-method-ico.face { background: linear-gradient(145deg, #ffb340, #f08c00); }

.pay-method-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pay-method-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.pay-method-desc {
  font-size: 11px;
  color: var(--ink-3);
}

.pay-method-arrow {
  font-size: 20px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.pay-tip {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
  white-space: pre-line;
}

.pay-tip.error {
  color: var(--danger);
}

/* 支付页跳转提示 */
.pay-tip.strong {
  color: var(--accent);
  font-weight: 600;
}

/* ===== 订单卡片底部便捷按钮（去支付 / 我已取货 / 订单详情） ===== */
.order-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.order-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-right-color: rgba(148, 166, 194, 0.24);
  border-bottom-color: rgba(148, 166, 194, 0.24);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.order-quick-btn:active {
  transform: scale(0.95);
}

/* 去支付（红色渐变玻璃胶囊） */
.order-quick-btn.pay {
  border: 1px solid rgba(255, 122, 105, 0.45);
  background: linear-gradient(135deg, rgba(255, 92, 77, 0.92), rgba(235, 47, 83, 0.92));
  box-shadow:
    0 6px 18px rgba(235, 47, 83, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #fff;
  font-weight: 700;
}

.order-pay-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.order-pay-ico svg {
  width: 100%;
  height: 100%;
  stroke: #fff;
}

/* 我已取货（绿色胶囊） */
.order-quick-btn.pickup {
  border-color: rgba(69, 192, 122, 0.4);
  background: linear-gradient(135deg, rgba(69, 192, 122, 0.16), rgba(47, 158, 99, 0.14));
  color: #2f9e63;
  font-weight: 700;
}

/* 订单详情（中性胶囊） */
.order-quick-btn.detail {
  flex: 0 0 auto;
}

/* ===== 未付款倒计时条（叉掉支付弹层后浮出） =====
   材质沿用网站在用的「浮层玻璃」配方（与顶部 toast 同一族：中高透明白 + 大半径模糊 + 白高光边 + 冷调暗边 + 柔和投影），
   再叠加 .liquid-glass 的色散环。首页背景是浅色卡片，若只用大卡片的 0.14 底会糊成一片灰、文字被下层图标干扰，
   所以这里比卡片略实一点，但仍是玻璃而不是白板。
   位置由 pay.js 按页面底部栏实测高度动态设置 bottom，这里的 bottom 只是兜底值 */
.pay-pending {
  position: fixed;
  /* 与全站底部固定栏同一套居中写法：小屏左右各留 12px，大屏最宽 496px。
     用 left/right 会受页面横向溢出影响（内容撑宽时浮条右侧会被顶出屏幕），这里改居中 + 百分比宽度 */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 496px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 880;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;              /* 覆盖 .liquid-glass 的 --radius-lg，浮条用更小的圆角 */
  /* 覆盖 .liquid-glass 的材质层，做出「浮在内容之上」的玻璃感 */
  background: rgba(250, 252, 255, 0.62);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-right-color: rgba(148, 166, 194, 0.28);
  border-bottom-color: rgba(148, 166, 194, 0.28);
  box-shadow:
    /* 外部：贴地柔影 + 近距接触影，让它"浮"起来 */
    0 20px 44px -16px rgba(22, 26, 32, 0.3),
    0 2px 8px rgba(22, 26, 32, 0.06),
    /* 内部：上沿强高光 / 下沿折射暗边 / 整体淡光泽 */
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 1px 0 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 22px rgba(255, 255, 255, 0.2);
  animation: payPendingIn 0.26s cubic-bezier(0.34, 0.96, 0.6, 0.99) both;
}

@keyframes payPendingIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.pay-pending-main {
  flex: 1;
  min-width: 0;
}

.pay-pending-line1 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.pay-pending-line1 .ppb-time {
  color: #d94a3d;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.pay-pending-line2 {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-3);
  /* 允许折成两行：手机上单号 + 「可在我的订单找到」一行放不下，
     用 ellipsis 会断在引号里很难看，索性让它自然换行（浮条高度自适应，不影响遮挡判断） */
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;   /* 万一折行（大字号/长单号），两行长度自动均衡，不会出现末尾孤字 */
}

.pay-pending-btn {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, rgba(96, 134, 190, 0.94), rgba(74, 108, 168, 0.94));
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 16px -8px rgba(91, 127, 184, 0.6);
  transition: transform 0.16s var(--ease-spring);
}

.pay-pending-btn:active { transform: scale(0.96); }

/* 点「继续支付」时要先向后端确认订单还在（约 0.1–0.3s），期间禁用防止连点 */
.pay-pending-btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.pay-pending-close {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.pay-pending-close:active { background: rgba(22, 26, 32, 0.06); }

@media (max-width: 360px) {
  .pay-pending-line2 { display: none; }
}
