/* aivip 积分返利商城 H5 — 样式 */
:root {
  --blue: #1e9fff;
  --blue-d: #0d8ae8;
  --green: #3cb878;
  --green-d: #1aad19;
  --orange: #f78b2d;
  --red: #e64340;
  --bg: #f2f3f5;
  --line: #e0e0e0;
  --line-2: #cccccc;
  --text: #333;
  --sub: #777;
  --gray: #999;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #dfe3e8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  position: relative; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select { font-family: inherit; }

/* ---------- 页面容器 ---------- */
.page { display: none; min-height: 100vh; padding-bottom: 58px; }
.page.active { display: block; }
.page.no-tab { padding-bottom: 60px; }

/* ---------- 首页 ---------- */
.top-notice {
  background: #fff8e6; color: #b8860b; font-size: 12px; padding: 8px 12px;
  border-bottom: 1px solid #f0e2c0; display: flex; align-items: center; gap: 6px;
}
.grid { display: flex; flex-wrap: wrap; padding: 12px 12px 4px; }
.p-card {
  width: calc(50% - 6px); margin: 0 12px 14px 0; background: #fff;
  border: 1px solid var(--line-2); cursor: pointer;
}
.p-card:nth-child(2n) { margin-right: 0; }
.p-card:active { opacity: .85; }
.p-card .img { width: 100%; aspect-ratio: 1 / .82; overflow: hidden; background: #eef2f6; }
.p-card .img img { width: 100%; height: 100%; object-fit: cover; }
.p-card .name {
  padding: 8px 8px 4px; font-size: 14px; font-weight: bold; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card .desc {
  padding: 0 8px 6px; font-size: 11px; color: var(--sub); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card .meta { padding: 0 8px 10px; display: flex; align-items: baseline; gap: 6px; }
.p-card .meta .now { color: var(--green); font-weight: bold; font-size: 15px; }
.p-card .meta .old { color: var(--gray); font-size: 11px; text-decoration: line-through; }
.p-card .tag {
  display: inline-block; font-size: 10px; color: #fff; background: var(--orange);
  border-radius: 2px; padding: 1px 4px; margin-left: auto;
}

/* ---------- 底部导航 ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: none; height: 52px; background: #fff;
  border-top: 1px solid var(--line-2); z-index: 50;
}
#tabbar.show { display: flex; }
#tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 14px; color: #555; border-right: 1px solid var(--line-2);
}
#tabbar .tab:last-child { border-right: none; }
#tabbar .tab.active { background: var(--blue); color: #fff; font-weight: bold; }
#tabbar .tab .ico { font-size: 16px; line-height: 1; }

/* ---------- 通用导航栏 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 40; height: 46px; background: #fff;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 12px;
  font-size: 16px; font-weight: bold;
}
.navbar .back { color: var(--blue); font-size: 15px; font-weight: normal; margin-right: 10px; }
.navbar .right { margin-left: auto; font-size: 13px; font-weight: normal; color: var(--blue); }

/* ---------- 详情页 ---------- */
.d-banner { background: #fff; padding: 12px; }
.d-banner img { width: 100%; border: 1px solid var(--line); }
.price-bar { background: var(--green); color: #fff; padding: 8px 12px; display: flex; align-items: baseline; }
.price-bar .p1 { font-size: 20px; font-weight: bold; }
.price-bar .p2 { font-size: 12px; opacity: .9; text-decoration: line-through; margin-left: 8px; }
.price-bar .p3 { margin-left: auto; font-size: 12px; }
.d-block { background: #fff; margin-top: 10px; padding: 12px; }
.d-name { font-size: 16px; font-weight: bold; margin-bottom: 8px; }
.d-desc { font-size: 13px; color: #666; line-height: 1.85; text-indent: 2em; }
.d-sep-title {
  display: inline-block; background: #efefef; border: 1px solid var(--line-2);
  font-size: 13px; padding: 6px 22px; margin-bottom: 10px;
}
.detail-img img { width: 100%; border: 1px solid var(--line); }
.rebate-tip {
  margin-top: 10px; background: #fff9ec; border: 1px solid #f2dcae; color: #a9761a;
  font-size: 12px; line-height: 1.7; padding: 8px 10px; border-radius: 4px;
}

/* ---------- 底部操作栏 ---------- */
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%;
  max-width: 480px; height: 54px; background: #fff; border-top: 1px solid #bbb;
  display: none; z-index: 60;
}
.actionbar.show { display: flex; }
.actionbar .btn {
  flex: 1; display: flex; align-items: center; justify-content: center; font-size: 16px;
  border-right: 1px solid #bbb;
}
.actionbar .btn:last-child { border-right: none; }
.actionbar .btn.ghost { color: var(--green-d); background: #fff; }
.actionbar .btn.primary { color: #fff; background: var(--blue); font-weight: bold; }
.actionbar .btn.pay { color: var(--green-d); background: #fff; font-weight: bold; }
.actionbar .btn[disabled] { color: #bbb; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 80; display: none; }
.mask.show { display: block; }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%;
  max-width: 480px; background: #f7f7f7; border-radius: 14px 14px 0 0; z-index: 90;
  display: none; flex-direction: column; max-height: 88vh; animation: slideUp .22s ease-out;
}
.sheet.show { display: flex; }
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: .6; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-body { overflow-y: auto; padding: 16px 16px 72px; -webkit-overflow-scrolling: touch; }
.sheet-title { text-align: center; font-weight: bold; font-size: 15px; padding: 2px 0 6px; }

/* 活动 / 实名认证 */
.rules-title { font-size: 14px; font-weight: bold; }
.rules-text {
  font-size: 13px; color: #444; line-height: 1.85; margin: 6px 0 16px;
  white-space: pre-wrap; word-break: break-word;
}
.form-row { display: flex; align-items: center; margin-bottom: 12px; font-size: 14px; }
.form-row > label { width: 76px; color: #333; flex-shrink: 0; }
.form-row input, .form-row select {
  flex: 1; height: 34px; border: 1px solid #bbb; background: #fff; padding: 0 8px;
  font-size: 14px; border-radius: 2px; min-width: 0;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--blue); }
.pair { display: flex; gap: 10px; flex: 1; min-width: 0; }
.pair select { flex: 1; }
.form-hint { font-size: 11px; color: var(--gray); margin: -6px 0 12px 76px; }

/* 支付 */
.pay-sub { text-align: center; font-size: 13px; color: #555; margin: 16px 0 6px; }
.pay-amount { text-align: center; color: var(--green); font-size: 30px; font-weight: bold; margin-bottom: 18px; }
.pay-methods { padding: 0 6px; }
.pay-method {
  display: flex; align-items: center; background: #fff; border: 1px solid #ddd;
  border-radius: 6px; padding: 12px; margin-bottom: 10px; font-size: 14px;
}
.pay-method.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.pay-method .ico {
  width: 26px; height: 26px; border-radius: 50%; margin-right: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 13px; font-weight: bold;
}
.pay-method .radio { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #ccc; flex-shrink: 0; }
.pay-method.sel .radio { border-color: var(--green); background: radial-gradient(circle at center, #fff 0 4px, var(--green) 4px 10px); }

/* 下单成功 */
.success-wrap { background: #f2f2f2; }
.success-box {
  margin: 26px auto; width: 80%; background: #fbe3b6; border: 2px solid #4caf50;
  border-radius: 14px; padding: 24px 10px; text-align: center;
}
.success-box .big { color: var(--green-d); font-size: 24px; font-weight: bold; }
.success-box .sub { font-size: 14px; font-weight: bold; margin-top: 10px; }
.success-box .note { font-size: 12px; color: #7a6a4d; margin-top: 8px; line-height: 1.6; }

/* ---------- 我的 ---------- */
.user-card {
  margin: 12px; background: #fae8cd; border-radius: 10px; padding: 14px;
  display: flex; align-items: center;
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange);
  margin-right: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.user-info { min-width: 0; }
.user-info .t { font-size: 17px; font-weight: bold; }
.user-info .id { font-size: 13px; color: #666; margin-top: 4px; }
.user-info .login-tip { font-size: 12px; color: var(--blue); margin-top: 4px; }

.seg {
  display: flex; margin: 0 12px; border: 2px solid var(--blue);
  border-radius: 6px; overflow: hidden; background: #fff;
}
.seg .seg-item {
  flex: 1; text-align: center; padding: 9px 0; font-size: 14px; color: var(--blue);
  border-right: 2px solid var(--blue);
}
.seg .seg-item:last-child { border-right: none; }
.seg .seg-item.active { background: var(--blue); color: #fff; font-weight: bold; }

/* 订单卡片 */
.order-card {
  background: #f4f4f4; border: 1px solid #ddd; border-radius: 8px;
  margin: 12px; padding: 10px 12px; font-size: 13px;
}
.order-card .date { font-weight: bold; margin-bottom: 8px; }
.order-main { display: flex; }
.order-main img { width: 84px; height: 70px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line-2); }
.order-main .mid { flex: 1; padding-left: 10px; min-width: 0; }
.order-main .oname {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; color: #555; line-height: 1.5;
}
.order-main .prices { margin-top: 6px; font-size: 12px; color: #555; line-height: 1.6; }
.order-main .rb { color: var(--red); font-weight: bold; margin-left: 6px; }
.order-status {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 6px; flex-shrink: 0; padding-left: 8px;
}
.st { color: var(--green); font-size: 13px; white-space: nowrap; }
.st.warn { color: var(--orange); }
.st.gray { color: var(--gray); }
.order-ops { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.mini-btn {
  font-size: 12px; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--blue);
  color: var(--blue); background: #fff;
}
.mini-btn.solid { background: var(--blue); color: #fff; }

/* 钱包 */
.wallet-card { background: #f7f7f7; border: 1px solid #ddd; border-radius: 8px; margin: 12px; padding: 16px 14px; }
.w-row { display: flex; align-items: center; font-size: 15px; margin-bottom: 14px; }
.w-row:last-of-type { margin-bottom: 0; }
.w-row .num { font-weight: bold; margin: 0 4px; }
.w-row .ex {
  color: var(--blue); font-size: 13px; margin-left: auto; border: 1px solid var(--blue);
  border-radius: 3px; padding: 3px 10px;
}
.w-row .ex[disabled] { color: #bbb; border-color: #ddd; }
.w-divider { height: 1px; background: #ddd; margin: 14px 0 12px; }
.cash-title { font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.period { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px dashed #ddd; font-size: 12px; }
.period:last-child { border-bottom: none; }
.period .pl { flex: 1; min-width: 0; }
.period .pname { color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period .pmeta { color: var(--sub); margin-top: 3px; }
.period .pr { width: 158px; text-align: right; flex-shrink: 0; }
.period .pts { color: var(--blue); }
.period .pts.got { color: var(--green); }
.period .pts.dim { color: #aaa; }
.period .pts.exp { color: var(--red); }
.period .act { margin-left: 8px; }
.period .act.link { color: var(--blue); font-weight: bold; }
.period .act.done { color: var(--green); }
.period .act.exp { color: var(--red); }
.period .act.future { color: #aaa; }
.empty-tip { text-align: center; color: #bbb; font-size: 13px; padding: 34px 10px; line-height: 1.8; }

/* 通用对话框 */
.dialog { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; }
.dialog.show { display: flex; }
.dialog .d-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.dialog .d-box { position: relative; width: 84%; max-width: 350px; background: #fff; border-radius: 10px; padding: 20px; }
.dialog .d-t { text-align: center; font-weight: bold; font-size: 15px; margin-bottom: 14px; }
.dialog .d-c { font-size: 13px; color: #666; line-height: 1.7; margin-bottom: 14px; white-space: pre-wrap; }
.dialog input {
  width: 100%; height: 38px; border: 1px solid #bbb; border-radius: 4px;
  padding: 0 10px; font-size: 14px; margin-bottom: 14px;
}
.dialog .d-btns { display: flex; gap: 10px; }
.dialog .d-btns button { flex: 1; height: 38px; border-radius: 4px; font-size: 14px; border: 1px solid #ccc; background: #fff; color: #555; }
.dialog .d-btns button.ok { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Toast / Loading */
#toast {
  position: fixed; top: 44%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .78); color: #fff; font-size: 14px; padding: 12px 22px;
  border-radius: 8px; z-index: 200; display: none; max-width: 76%; text-align: center; line-height: 1.5;
}
#loading {
  position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .5);
}
#loading.show { display: flex; }
#loading .box { background: rgba(0, 0, 0, .75); color: #fff; padding: 12px 22px; border-radius: 8px; font-size: 13px; }
.reset-link { display: block; text-align: center; color: #bbb; font-size: 12px; margin: 20px auto 30px; }

/* ---------- 合规页脚（协议 / 隐私政策 / ICP 备案号） ---------- */
.legal-foot {
  padding: 22px 16px 90px;
  text-align: center;
  font-size: 11px;
  color: #9aa0a6;
  line-height: 1.9;
}
.legal-foot a { color: #9aa0a6; text-decoration: none; }
.legal-foot .sep { padding: 0 8px; color: #dcdfe3; }
.legal-foot [data-icp] a { color: #9aa0a6; text-decoration: none; }

