/* ================= 加拿大28 前台样式（移动端优先）================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --blue: #29a9f5;
  --blue-d: #148fe0;
  --blue-l: #6dc8ff;
  --cyan: #2bb6f7;
  --pink: #ff7089;
  --orange: #ff8f1f;
  --bg: #eef3f9;
  --card: #ffffff;
  --txt: #1f2a37;
  --txt2: #6b7c93;
  --txt3: #9aabbf;
  --line: #e8eef6;
  --green: #14c07a;
  --red: #f4566b;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(31, 66, 107, .06);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, select, textarea { font-family: inherit; font-size: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 132px; position: relative; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, #33b5f8 0%, #1ba3ef 100%);
  color: #fff; height: 50px; display: flex; align-items: center; padding: 0 12px; gap: 8px;
}
.topbar .back { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.topbar .back svg { width: 20px; height: 20px; stroke: #fff; }
.topbar .title {
  flex: 1; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.topbar .title .caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: #fff; margin-top: 4px; }
.topbar .tool { display: flex; align-items: center; gap: 12px; }
.topbar .tool svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 1.8; }
.room-menu {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(20, 60, 100, .18);
  min-width: 200px; padding: 6px; display: none; z-index: 60;
}
.room-menu.on { display: block; }
.room-menu a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 8px; color: #2b3a4d; font-size: 14px; }
.room-menu a.on, .room-menu a:hover { background: #eef7ff; color: var(--blue-d); }
.room-menu a span { color: var(--txt3); font-size: 12px; }

/* ---------- 期号 / 余额 ---------- */
.banner {
  background: #fff; border-radius: var(--radius); margin: 10px; padding: 12px 14px 14px;
  display: flex; align-items: flex-start; box-shadow: var(--shadow);
}
.banner .col { flex: 1; }
.banner .col.r { text-align: right; flex: 0 0 42%; border-left: 1px solid var(--line); padding-left: 10px; }
.banner .lb { font-size: 13px; color: #4a5a6d; margin-bottom: 8px; font-weight: 500; }
.banner .lb b { color: #22303f; font-weight: 600; }
.countdown {
  display: inline-flex; align-items: center; gap: 6px; background: #5c6b7f; color: #fff;
  border-radius: 6px; padding: 5px 10px; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; min-width: 86px; justify-content: center;
}
.countdown.warn { background: #f4566b; }
.balance { font-size: 22px; font-weight: 700; color: #ff5a3c; font-variant-numeric: tabular-nums; }
.balance small { font-size: 13px; font-weight: 500; color: var(--txt2); margin-left: 2px; }
.reload-btn { display: inline-block; margin-left: 4px; vertical-align: 2px; }
.reload-btn svg { width: 13px; height: 13px; stroke: var(--txt3); fill: none; stroke-width: 2; }

/* ---------- 上一期开奖 ---------- */
.lastdraw { background: #fff; padding: 10px 14px 12px; border-top: 1px solid #f4f8fd; }
.lastdraw .row1 { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: #34455a; }
.lastdraw .issue { font-weight: 500; }
.lastdraw .res { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.lastdraw .res .lab { font-size: 13px; color: var(--txt2); margin-left: 4px; }
.ball {
  width: 24px; height: 24px; border-radius: 50%; background: var(--cyan); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.ball.sum { background: var(--pink); width: 26px; height: 26px; }
.plus, .eq { color: #a9b8c9; font-size: 14px; }
.tag-size { font-size: 13px; margin-left: 8px; font-weight: 600; }
.tag-size.big { color: #f4566b; }
.tag-size.small { color: var(--blue-d); }
.tag-parity { font-size: 13px; font-weight: 600; }
.tag-parity.odd { color: #7c5cf5; }
.tag-parity.even { color: #0aa9a9; }
.collapse-ico { color: var(--txt3); font-size: 12px; }

/* ---------- 玩法标签 ---------- */
.tabs { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.tabs .tab {
  padding: 7px 14px; font-size: 14px; color: #4a5a6d; border-radius: 8px; font-weight: 500;
  background: #fff; box-shadow: var(--shadow);
}
.tabs .tab.on { background: #fff; color: var(--blue-d); font-weight: 700; box-shadow: 0 2px 8px rgba(41, 169, 245, .18); }
.tabs .tab.ghost { background: transparent; box-shadow: none; color: #5d7086; padding: 7px 6px; display: flex; align-items: center; gap: 4px; }
.tabs .help { margin-left: auto; color: var(--blue-d); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.tabs .help .q { width: 15px; height: 15px; border-radius: 50%; background: #c9d8e8; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- 投注卡片 ---------- */
.panel { padding: 4px 10px 10px; }
.grid { display: grid; gap: 8px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.bet-card {
  background: #fff; border-radius: 9px; padding: 12px 6px 8px; text-align: center;
  box-shadow: var(--shadow); border: 1.5px solid transparent; transition: .15s; position: relative;
  user-select: none;
}
.bet-card:active { transform: scale(.97); }
.bet-card.on { border-color: var(--blue); background: #f3faff; }
.bet-card .n { font-size: 19px; font-weight: 600; color: #1f2f40; line-height: 1.2; }
.bet-card .o { font-size: 12px; color: #97a9bd; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bet-card .o i { font-style: normal; color: #aebdcd; }
.bet-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding: 0 2px; color: #b3c1d1; font-size: 10px; }
.bet-card .meta span { display: inline-flex; align-items: center; gap: 2px; }
.bet-card .meta svg { width: 10px; height: 10px; fill: #c3d0de; }
.bet-card .mybet {
  position: absolute; top: -7px; right: -4px; background: var(--orange); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 8px; font-weight: 600;
}
.num-card { padding: 10px 4px 8px; }
.num-card .n { font-size: 17px; }

/* ---------- 底部筹码条 ---------- */
.betbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px;
  background: #fff; box-shadow: 0 -2px 12px rgba(31, 66, 107, .08); z-index: 40;
  padding: 8px 10px 6px;
}
.chips { display: flex; gap: 6px; margin-bottom: 8px; }
.chip {
  flex: 1; height: 40px; border-radius: 7px; background: #f4f8fd; color: #4d6a86;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 500;
  border: 1px solid #e7eff8; font-variant-numeric: tabular-nums;
}
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.chip.gear { flex: 0 0 44px; background: #f4f8fd; }
.chip.gear svg { width: 19px; height: 19px; stroke: #8aa1b8; fill: none; }
.betrow { display: flex; gap: 8px; align-items: center; }
.bet-sum {
  flex: 1; height: 42px; border-radius: 7px; background: #eef3f9; display: flex; align-items: center;
  padding: 0 12px; font-size: 15px; color: #4b5f75; min-width: 0;
}
.bet-sum b { color: #ff5a3c; font-weight: 700; margin: 0 3px; }
.bet-sum .arrow { margin-left: 6px; color: #a9bccd; font-size: 12px; }
.btn-clear { height: 42px; padding: 0 14px; border-radius: 7px; background: #eef3f9; color: #5b7189; font-size: 15px; }
.btn-submit { height: 42px; padding: 0 20px; border-radius: 7px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; }
.btn-submit:disabled { background: #b9d8ee; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px;
  background: #fff; display: none;
}
.tabbar { z-index: 39; }
.tabbar a { flex: 1; text-align: center; padding: 6px 0 8px; color: #8a9bad; font-size: 11px; }
.tabbar a.on { color: var(--blue); }
.tabbar svg { width: 21px; height: 21px; display: block; margin: 0 auto 2px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ---------- 客服悬浮球 ---------- */
.kf-fab {
  position: fixed; right: max(12px, calc(50% - 268px)); bottom: 168px; width: 46px; height: 46px;
  border-radius: 50%; background: linear-gradient(180deg, #ffa03d, #ff7a1a); color: #fff; z-index: 45;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(255, 122, 26, .45);
}
.kf-fab svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.9; }

/* ---------- 通用卡片 / 列表 ---------- */
.card { background: #fff; border-radius: var(--radius); margin: 10px; padding: 14px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: #22303f; }
.muted { color: var(--txt2); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; width: 100%; }
.btn.block { width: 100%; }
.btn.gray { background: #eef3f9; color: #4d6a86; }
.btn.small { height: 34px; font-size: 13px; padding: 0 12px; width: auto; border-radius: 7px; }
.btn.red { background: var(--red); }

/* 充值方式选择 */
.paylist { display: grid; gap: 8px; }
.payitem { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fbfdff; }
.payitem.on { border-color: var(--blue); background: #f3faff; }
.payitem .ico { width: 34px; height: 34px; border-radius: 8px; background: #eaf4ff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.payitem .t { font-size: 14px; font-weight: 600; }
.payitem .d { font-size: 12px; color: var(--txt3); margin-top: 2px; }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amount-grid .chip { height: 42px; flex: none; }

/* 表单 */
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: #5b7086; margin-bottom: 6px; }
.input { width: 100%; height: 44px; border-radius: 8px; background: #f4f8fd; padding: 0 12px; font-size: 15px; color: #22303f; border: 1px solid #e7eff8; }
.input:focus { border-color: var(--blue); background: #fff; }
textarea.input { height: 80px; padding: 10px 12px; resize: vertical; }

/* 记录表格 */
.rec-head { display: flex; background: #f5f9fd; border-radius: 8px; padding: 10px 8px; font-size: 12px; color: #7d8fa3; }
.rec-head div, .rec-row div { flex: 1; text-align: center; }
.rec-head div:first-child, .rec-row div:first-child { flex: 1.2; text-align: left; }
.rec-row { display: flex; padding: 11px 8px; border-bottom: 1px solid #f2f7fc; font-size: 13px; align-items: center; }
.rec-row > div { text-align: center; }
.rec-row > div:first-child { text-align: left; }
.rec-row .num { font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; }
.badge.wait { background: #fff4e5; color: #d98600; }
.badge.ok { background: #e8f9f0; color: #0d9e63; }
.badge.no { background: #fdecef; color: #d63c53; }
.badge.blue { background: #eaf4ff; color: #1785d6; }

/* 登录页 */
.auth-wrap { min-height: 100vh; background: linear-gradient(180deg, #33b5f8 0%, #eef3f9 42%); padding: 40px 20px; }
.auth-logo { text-align: center; color: #fff; margin-bottom: 24px; }
.auth-logo .big { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.auth-logo .sub { font-size: 12px; opacity: .9; margin-top: 6px; }
.auth-card { background: #fff; border-radius: 14px; padding: 22px 18px; box-shadow: 0 8px 30px rgba(23, 70, 115, .12); }
.auth-card h2 { font-size: 18px; margin-bottom: 16px; }
.auth-tip { text-align: center; font-size: 13px; color: #7d8fa3; margin-top: 14px; }
.auth-tip a { color: var(--blue-d); font-weight: 600; }

/* 客服聊天 */
.chat-wrap { display: flex; flex-direction: column; height: 100vh; background: #eef3f9; }
.chat-head { background: linear-gradient(180deg, #33b5f8, #1ba3ef); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.chat-head .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--blue-d); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.chat-head .nm { font-size: 15px; font-weight: 600; }
.chat-head .st { font-size: 11px; opacity: .9; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }
.msg.ad { align-self: flex-start; background: #fff; color: #22303f; border-bottom-left-radius: 3px; box-shadow: var(--shadow); }
.msg .tm { display: block; font-size: 10px; opacity: .65; margin-top: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px; background: #fff; }
.chat-input .input { height: 40px; }
.chat-input .btn { width: auto; height: 40px; padding: 0 18px; flex: 0 0 auto; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px 8px; background: #fff; }
.quick span { flex: 0 0 auto; font-size: 12px; color: #4d6a86; background: #f4f8fd; border-radius: 14px; padding: 5px 10px; white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); background: rgba(20, 32, 45, .88);
  color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 999; max-width: 76%;
  text-align: center; opacity: 0; pointer-events: none; transition: .22s; line-height: 1.5;
}
.toast.on { opacity: 1; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(12, 24, 38, .45); z-index: 200; display: none; }
.mask.on { display: block; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px;
  background: #fff; border-radius: 16px 16px 0 0; z-index: 201; padding: 18px 16px 22px; display: none;
}
.sheet.on { display: block; }
.sheet h4 { font-size: 16px; margin-bottom: 12px; text-align: center; }

/* 玩法说明弹层 */
.rules-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 88%; max-width: 420px;
  background: #fff; border-radius: 12px; z-index: 201; padding: 18px; display: none; max-height: 76vh; overflow-y: auto;
}
.rules-modal.on { display: block; }
.rules-modal h4 { text-align: center; font-size: 16px; margin-bottom: 12px; }
.rules-modal p { font-size: 13px; color: #43566a; line-height: 1.8; }
.rules-modal p b { color: #22303f; }

/* 空状态 */
.empty { text-align: center; color: var(--txt3); font-size: 13px; padding: 26px 0; }
.notice-bar { background: #fff8e8; color: #b47800; font-size: 12px; padding: 7px 12px; display: flex; gap: 6px; align-items: center; }
.notice-bar svg { width: 13px; height: 13px; fill: #e0a33a; flex: 0 0 auto; }

@media (min-width: 561px) {
  .app { box-shadow: 0 0 40px rgba(30, 80, 130, .10); }
  body { background: #dfe8f2; }
}

/* ================= 补充组件（充值/提现/客服/表格） ================= */
.orange { color: #ff8f1f; }
.hr { height: 1px; background: #eef3f9; margin: 12px 0; }
.kv { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 13px; color: #6b8098; padding: 6px 0; }
.kv b { color: #22303f; font-weight: 600; text-align: right; word-break: break-all; }
.alert { margin: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.alert.err { background: #fdecef; color: #c8324b; }
.alert.ok { background: #e8f9f0; color: #0d7a4d; }
.alert a { color: inherit; text-decoration: underline; }

/* 金额选择 */
.amt-chip {
  height: 44px; border-radius: 9px; background: #f4f8fd; border: 1.5px solid #e7eff8;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
  color: #33506b; cursor: pointer;
}
.amt-chip.on { background: #eaf6ff; border-color: var(--blue); color: var(--blue-d); }

/* 支付方式 */
.pay-list { display: grid; gap: 8px; }
.pay-item {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 9px;
  border: 1.5px solid var(--line); background: #fbfdff; cursor: pointer;
}
.pay-item input { display: none; }
.pay-item:has(input:checked) { border-color: var(--blue); background: #f3faff; }
.pi-ico {
  width: 32px; height: 32px; border-radius: 8px; background: #eaf4ff; color: #1785d6;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: 0 0 auto;
}
.pay-box { background: #f7fbff; border: 1px dashed #cfe4f7; border-radius: 9px; padding: 10px 12px; }

/* 客服页 */
.chat-body { background: #eef3f9; }
.chat-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 4px; }
.kf-card {
  background: #fff; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.kf-face {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(160deg, #6dc8ff, #1ba3ef); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.kf-name { font-size: 15px; font-weight: 600; color: #22303f; }
.kf-tip { font-size: 12px; color: #7d8fa3; line-height: 1.7; padding: 10px 4px; }
.kf-links { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.kf-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f2f7fc; font-size: 14px; }
.kf-link:last-child { border-bottom: 0; }
.chat-list { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 10px; }
.bubble { max-width: 80%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.bubble.kf { align-self: flex-start; background: #fff; color: #22303f; border-top-left-radius: 3px; box-shadow: var(--shadow); }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-top-right-radius: 3px; }
.b-time { font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; background: #fff; }
.q-chip {
  flex: 0 0 auto; font-size: 12px; color: #4d6a86; background: #f4f8fd;
  border-radius: 14px; padding: 6px 11px; white-space: nowrap; cursor: pointer;
}
.chat-input {
  display: flex; gap: 8px; padding: 8px 10px 10px; background: #fff;
  border-top: 1px solid #eef3f9; padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.chat-input input {
  flex: 1; height: 40px; border-radius: 20px; background: #f4f8fd; border: 1px solid #e7eff8;
  padding: 0 14px; font-size: 15px; color: #22303f;
}
.chat-input #btn-send {
  height: 40px; padding: 0 18px; border-radius: 20px; background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 600; border: 0; cursor: pointer;
}
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ef0a8; display: inline-block; margin-right: 4px; }

/* 桌面端遮罩下的通用列表行 */
.rec-row:last-child { border-bottom: 0; }
table.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
