/* ============================================================
   移动端H5基础样式 (玩家端/打手端共用)
   ============================================================ */
:root {
  --primary: #7b5bff;
  --primary-light: #a58fff;
  --primary-dark: #5d3fe0;
  --gradient: linear-gradient(135deg, #8b6bff 0%, #5d3fe0 100%);
  --success: #07c160;
  --danger: #ee0a24;
  --warning: #ff976a;
  --orange: #ff9800;
  --blue: #1989fa;
  --purple: #7b5bff;
  --gray: #969799;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text-main: #1a1a1a;
  --text-sub: #666666;
  --text-light: #999999;
  --border: #ebedf0;
  --radius: 12px;
  --navbar-h: 46px;
  --tabbar-h: 54px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text-main);
  line-height: 1.5; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; }

.page { min-height: 100vh; padding-bottom: 30px; }
.page.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); }
.container { padding: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-sub { color: var(--text-sub); }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs14 { font-size: 14px; }
.fs15 { font-size: 15px; } .fs16 { font-size: 16px; } .fs18 { font-size: 18px; }
.fs20 { font-size: 20px; } .fs24 { font-size: 24px; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--navbar-h); background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.navbar .nav-title { font-size: 17px; font-weight: 600; }
.navbar .nav-left, .navbar .nav-right { position: absolute; top: 0; height: var(--navbar-h); display: flex; align-items: center; padding: 0 12px; }
.navbar .nav-left { left: 0; } .navbar .nav-right { right: 0; }
.navbar .nav-back { font-size: 20px; color: var(--text-main); line-height: 1; }
.navbar.fixed + .page, .navbar.fixed + * { margin-top: 0; }
.navbar-static { height: var(--navbar-h); }
body.has-navbar { padding-top: var(--navbar-h); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  background: #fff; display: flex; border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.tabbar .tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-light); font-size: 11px; }
.tabbar .tab-item .tab-icon { font-size: 22px; line-height: 1; margin-bottom: 3px; position: relative; }
.tabbar .tab-item.active { color: var(--primary); }
.tabbar .tab-item .badge {
  position: absolute; top: -4px; right: -12px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; border-radius: 8px;
}

/* ---------- 卡片 ---------- */
.card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; }
.card + .card { margin-top: 12px; }
.card-pad { padding: 14px; }
.card-title { padding: 14px 14px 0; font-size: 16px; font-weight: 600; }
.card-title .more { font-size: 13px; color: var(--text-light); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 22px;
  font-size: 15px; font-weight: 500; transition: opacity .2s; white-space: nowrap;
}
.btn:active { opacity: .8; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--orange); color: #fff; }
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-gray { background: #f2f3f5; color: var(--text-main); }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 16px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn-round { border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 1px 8px; font-size: 11px; border-radius: 4px; line-height: 1.6;
}
.tag-primary { background: rgba(123,91,255,.12); color: var(--primary); }
.tag-green { background: rgba(7,193,96,.12); color: var(--success); }
.tag-orange { background: rgba(255,152,0,.12); color: var(--orange); }
.tag-red { background: rgba(238,10,36,.1); color: var(--danger); }
.tag-blue { background: rgba(25,137,250,.12); color: var(--blue); }
.tag-gray { background: #f2f3f5; color: var(--text-sub); }
.tag-purple { background: rgba(123,91,255,.12); color: var(--purple); }
.tag-gold { background: linear-gradient(135deg,#ffd700,#ff9800); color: #fff; }

/* ---------- 表单 ---------- */
.form-cell {
  display: flex; align-items: center; background: #fff; padding: 13px 14px;
  border-bottom: 1px solid var(--border); min-height: 50px;
}
.form-cell:last-child { border-bottom: none; }
.form-cell .label { width: 92px; color: var(--text-main); font-size: 15px; flex-shrink: 0; }
.form-cell .value { flex: 1; min-width: 0; }
.form-cell input[type=text], .form-cell input[type=number], .form-cell input[type=password], .form-cell input[type=tel] {
  width: 100%; border: none; font-size: 15px; color: var(--text-main); background: transparent;
}
.form-cell input::placeholder { color: var(--text-light); }
.form-cell .arrow { color: var(--text-light); font-size: 14px; }
.form-card { border-radius: var(--radius); overflow: hidden; margin: 12px; }
.form-textarea { width: 100%; border: none; min-height: 80px; resize: none; font-size: 15px; line-height: 1.6; }
.form-section { padding: 16px 12px 6px; font-size: 14px; color: var(--text-sub); font-weight: 600; }

/* ---------- 选择器/标签组 ---------- */
.selector { display: flex; flex-wrap: wrap; gap: 10px; }
.selector .sel-item {
  padding: 7px 16px; background: #f2f3f5; border-radius: 18px; font-size: 14px; color: var(--text-main); border: 1px solid transparent;
}
.selector .sel-item.active { background: rgba(123,91,255,.1); color: var(--primary); border-color: var(--primary); }

/* ---------- 分段控件 ---------- */
.seg { display: flex; background: #f2f3f5; border-radius: 20px; padding: 3px; }
.seg .seg-item { flex: 1; text-align: center; height: 34px; line-height: 34px; border-radius: 18px; font-size: 14px; color: var(--text-sub); }
.seg .seg-item.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; background: #fff; position: sticky; top: var(--navbar-h); z-index: 50; }
.tabs .tab { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--text-sub); position: relative; }
.tabs .tab.active { color: var(--primary); font-weight: 600; }
.tabs .tab.active::after {
  content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; border-radius: 2px; background: var(--gradient);
}

/* ---------- 列表 ---------- */
.list-item { background: #fff; padding: 14px; border-radius: var(--radius); margin-bottom: 10px; }
.list-item:active { background: #fafafa; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty .empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty .empty-text { font-size: 14px; }

/* ---------- 金额 ---------- */
.price { color: var(--danger); font-weight: 700; }
.price .sym { font-size: .8em; margin-right: 1px; }

/* ---------- 头像 ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #f0f0f0; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f0f0f0; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #f0f0f0; }

/* ---------- 星级 ---------- */
.stars { color: #ff9800; letter-spacing: 2px; font-size: 13px; }
.stars .off { color: #ddd; }

/* ---------- 底部操作栏 ---------- */
.footer-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: #fff; padding: 10px 12px calc(10px + var(--safe-bottom));
  display: flex; gap: 10px; box-shadow: 0 -1px 6px rgba(0,0,0,.06);
}

/* ---------- 轮播 ---------- */
.swiper { position: relative; overflow: hidden; border-radius: var(--radius); }
.swiper .swiper-track { display: flex; transition: transform .3s; }
.swiper .swiper-item { flex-shrink: 0; width: 100%; }
.swiper .swiper-item img { width: 100%; height: 150px; object-fit: cover; }
.swiper .swiper-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.swiper .swiper-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); }
.swiper .swiper-dots i.active { background: #fff; width: 14px; }

/* ---------- 弹窗/遮罩 ---------- */
.ui-mask {
  position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.ui-dialog { width: 300px; max-width: 86%; background: #fff; border-radius: 14px; overflow: hidden; }
.ui-dialog-title { padding: 18px 16px 0; text-align: center; font-size: 16px; font-weight: 600; }
.ui-dialog-content { padding: 12px 16px 20px; text-align: center; font-size: 14px; color: var(--text-sub); line-height: 1.7; }
.ui-dialog-btns { display: flex; border-top: 1px solid var(--border); }
.ui-dialog-btns .btn { flex: 1; height: 48px; border-radius: 0; background: none; }
.ui-dialog-cancel { color: var(--text-sub); }
.ui-dialog-ok { color: var(--primary); font-weight: 600; }
.ui-dialog-btns .btn + .btn { border-left: 1px solid var(--border); }

/* ---------- Toast ---------- */
.ui-toast { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ui-toast-box {
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; max-width: 70%; text-align: center;
}
.ui-toast-error .ui-toast-box { background: rgba(238,10,36,.85); }

/* ---------- 加载 ---------- */
.ui-loading { position: fixed; inset: 0; z-index: 1001; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; }
.ui-loading-box { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-sub); font-size: 13px; }
.ui-loading-spinner {
  width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 聊天 ---------- */
.chat-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 8px; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg .bubble {
  max-width: 68%; padding: 9px 12px; border-radius: 12px; font-size: 14px; word-break: break-all; line-height: 1.6;
}
.chat-msg .bubble img { border-radius: 8px; max-width: 160px; }
.chat-msg.other .bubble { background: #fff; border-top-left-radius: 2px; }
.chat-msg.mine .bubble { background: var(--gradient); color: #fff; border-top-right-radius: 2px; }
.chat-input-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: #fff; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}
.chat-input-bar input { flex: 1; height: 38px; border: none; background: #f2f3f5; border-radius: 19px; padding: 0 14px; font-size: 14px; }
.chat-input-bar .chat-actions { display: flex; gap: 10px; }
.chat-input-bar .chat-icon { font-size: 22px; color: var(--text-sub); }

/* ---------- 进度时间线 ---------- */
.timeline { padding: 6px 4px; }
.timeline-item { position: relative; padding-left: 22px; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item .dot { position: absolute; left: 1px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.timeline-item.active .dot { background: var(--primary); }
.timeline-item .tl-title { font-size: 14px; font-weight: 500; }
.timeline-item .tl-time { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ---------- 优惠券 ---------- */
.coupon {
  display: flex; background: #fff; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); position: relative;
}
.coupon .coupon-left { width: 96px; background: var(--gradient); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 4px; }
.coupon .coupon-left .c-amount { font-size: 24px; font-weight: 700; }
.coupon .coupon-left .c-sym { font-size: 12px; }
.coupon .coupon-right { flex: 1; padding: 12px 14px; }
.coupon .c-title { font-size: 15px; font-weight: 600; }
.coupon .c-desc { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.coupon.disabled { opacity: .5; }
.coupon.disabled .coupon-left { background: #bbb; }

/* ---------- 上传预览 ---------- */
.upload-box { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-item { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #f2f3f5; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-add { width: 84px; height: 84px; border-radius: 10px; border: 1px dashed #ccc; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-light); font-size: 12px; }
.upload-add .plus { font-size: 28px; line-height: 1; }
.upload-item .del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }

/* ---------- 骨架/分页 ---------- */
.load-more { text-align: center; padding: 16px 0; color: var(--text-light); font-size: 13px; }
