:root {
  --primary: #FFD100;
  --primary2: #FFC300;
  --bg: #F6F7FB;
  --text: #1F1F1F;
  --muted: #8A8F99;
  --card: #FFFFFF;
  --line: #EDEFF3;
  --danger: #E02E24;
  --ok: #06A561;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; position: relative; }

/* 顶部金额区 */
.pay-head {
  padding: 26px 20px 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,0));
}
.pay-head .cap { font-size: 14px; color: var(--muted); letter-spacing: 1px; }
.pay-head .amount { margin-top: 10px; font-size: 44px; font-weight: 700; letter-spacing: -.5px; }
.pay-head .amount i { font-size: 24px; font-style: normal; margin-right: 4px; }
.pay-head .timer { margin-top: 8px; font-size: 13px; color: #6B7280; }
.pay-head .timer b {
  display: inline-block;
  min-width: 30px;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 6px;
  background: #2B2F36;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* 付款须知 */
.notice {
  margin: 0 16px 16px;
  padding: 14px 16px 14px 16px;
  background: #FFF8E1;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #7A6320;
}
.notice .t { font-weight: 700; margin-bottom: 6px; color: #6B5416; }
.notice ol { margin: 0; padding-left: 16px; }

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 50px; border-radius: 26px; border: 0;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); opacity: .92; }
.btn-main { background: var(--primary); color: #1F1F1F; }
.btn-ghost {
  background: #fff; color: #3A3F47; border: 1px solid #E3E6EB;
}
.btn-line { background: transparent; color: var(--muted); border: 0; font-weight: 500; font-size: 14px; height: 42px; }
.actions { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }

/* 商品卡 */
.shop {
  margin: 18px 16px 0;
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(20, 25, 40, .05);
}
.shop .shop-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.shop .shop-name .logo { font-size: 18px; }
.goods { display: flex; align-items: center; gap: 12px; padding: 14px 0 2px; }
.goods .thumb {
  width: 62px; height: 62px; border-radius: 12px; flex: 0 0 62px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, #FFF3C4, #FFE082);
}
.goods .info { flex: 1; min-width: 0; }
.goods .info .name { font-size: 14.5px; color: #23262B; line-height: 1.4; }
.goods .info .sku { margin-top: 6px; font-size: 12px; color: var(--muted); }
.goods .price { font-size: 15px; font-weight: 600; }
.goods .price small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-align: right; }
.sum { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sum b { color: #23262B; }

/* 状态层 */
.mask {
  position: fixed; inset: 0; background: rgba(16, 18, 22, .55);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 24px;
}
.mask.show { display: flex; }
.dialog {
  width: 100%; max-width: 320px; background: #fff; border-radius: 18px; padding: 22px 20px 16px; text-align: center;
}
.dialog .ico { font-size: 44px; line-height: 1; }
.dialog h3 { margin: 12px 0 6px; font-size: 17px; }
.dialog p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.dialog .btn { height: 44px; font-size: 15px; }

.poster-box { text-align: center; }
.poster-box img { width: 100%; max-width: 300px; border-radius: 14px; display: block; margin: 0 auto 12px; }
.tip { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 首页 */
.top {
  padding: 18px 18px 12px; display: flex; align-items: center; gap: 10px;
  background: #fff; position: sticky; top: 0; z-index: 20;
}
.top .brand { font-size: 16px; font-weight: 700; flex: 1; }
.searchbar {
  margin: 12px 16px; height: 40px; border-radius: 20px; background: #F1F3F7;
  display: flex; align-items: center; padding: 0 16px; color: #9AA1AC; font-size: 13.5px; gap: 8px;
}
.total-card {
  margin: 0 16px 14px; background: #fff; border-radius: 16px; padding: 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 6px 20px rgba(20,25,40,.05);
}
.total-card .lb { font-size: 13px; color: var(--muted); }
.total-card .val { font-size: 24px; font-weight: 700; margin-top: 4px; }
.total-card .val small { font-size: 13px; font-weight: 400; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 16px 0; }
.tile {
  position: relative; border-radius: 16px; padding: 18px 14px 14px; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px solid transparent; transition: transform .12s ease, border-color .12s ease;
}
.tile:active { transform: scale(.98); }
.tile.on { border-color: #1F1F1F; }
.tile .em { font-size: 30px; line-height: 1; }
.tile .nm { font-size: 14.5px; font-weight: 700; }
.tile .use { font-size: 11.5px; opacity: .9; }
.tile .tag {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.24); color: #fff;
  font-size: 10.5px; padding: 2px 7px; border-radius: 10px;
}
.tile.light { color: #1F1F1F; }
.tile.light .tag { background: rgba(0,0,0,.08); }

.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.footer-bar .inner { max-width: 480px; margin: 0 auto; }
.footer-bar .btn { background: #16181D; color: #fff; }
.footer-bar .btn[disabled] { opacity: .5; }

/* 分享落地（k2） */
.chat { max-width: 480px; margin: 0 auto; background: #EDEDED; min-height: 100vh; padding: 18px 14px; }
.chat .card {
  background: #fff; border-radius: 8px; overflow: hidden; width: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.chat .card .head { display: flex; gap: 8px; padding: 12px; font-size: 13px; color: #576B95; align-items: center; }
.chat .card .body { padding: 0 12px 12px; }
.chat .card .banner {
  border-radius: 6px; overflow: hidden; color: #fff; padding: 22px 14px;
  display: flex; flex-direction: column; justify-content: center; min-height: 132px;
}
.chat .card .banner .k { font-size: 12px; opacity: .9; }
.chat .card .banner .v { font-size: 34px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.5px; }
.chat .card .banner .cd { font-size: 12px; opacity: .9; }
.chat .card .foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 12px; color: #9AA1AC; font-size: 11.5px; }
.chat .card .ping { font-size: 11px; color: #B2B8C2; display: flex; gap: 6px; align-items: center; }
.chat .go { margin-top: 18px; }
.bubble {
  background: #95EC69; color: #111; padding: 10px 12px; border-radius: 6px; font-size: 14px; max-width: 78%;
  margin-left: auto; position: relative; line-height: 1.5;
}
.bubble:after {
  content: ''; position: absolute; right: -6px; top: 12px; border: 6px solid transparent; border-left-color: #95EC69;
}

/* 成功页 */
.state-hero { text-align: center; padding: 48px 20px 20px; }
.state-hero .ico { font-size: 56px; }
.state-hero h2 { margin: 14px 0 8px; font-size: 20px; }
.state-hero p { margin: 0; color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 9px 16px; border-radius: 18px;
  font-size: 13px; z-index: 99; opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; }
