/* ================= 群聊式下注界面（桌投） ================= */
body.chat-page {
  background: #eef1f6;
  overflow: hidden;
}
body.chat-page .chat-app {
  background: #eef1f6;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.ct-bar {
  flex: 0 0 auto;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: linear-gradient(96deg, #35b5f7 0%, #1a9ce8 55%, #1590dd 100%);
  color: #fff;
  position: relative;
  z-index: 20;
}
.ct-back {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ct-back svg { width: 22px; height: 22px; }
.ct-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.ct-title .ct-online { font-weight: 400; opacity: .92; font-size: 14px; }
.ct-title .ct-online em { font-style: normal; }
.ct-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, .9);
  margin-left: 4px;
}
.ct-icons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.ct-icons a {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ct-icons svg { width: 21px; height: 21px; }

/* ---------- 盘口下拉 ---------- */
.room-menu {
  top: 50px;
  left: auto;
  right: 12px;
  transform: none;
  min-width: 186px;
}

/* ---------- 期号 / 余额 ---------- */
.ct-status {
  flex: 0 0 auto;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f7;
}
.cs-left { flex: 0 0 auto; padding-right: 14px; text-align: center; }
.cs-split { width: 1px; height: 34px; background: #e6ebf2; }
.cs-right { flex: 1 1 auto; padding-left: 14px; text-align: center; }
.cs-label { font-size: 12px; color: #6b7c93; display: flex; align-items: center; justify-content: center; gap: 4px; }
.cs-label b { color: #148fe0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-clock {
  display: inline-block;
  margin-top: 5px;
  background: #16324f;
  color: #fff;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .6px;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
}
.cs-clock.warn { background: #f4566b; }
.cs-clock.closed { background: #8b98a8; }
.cs-money {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 700;
  color: #16324f;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.cs-refresh { display: inline-flex; color: #9aabbf; margin-left: 2px; }
.cs-refresh svg { width: 13px; height: 13px; }

/* ---------- 上期开奖条 ---------- */
.ct-last {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  position: relative;
}
.cl-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #5c6f85;
  min-width: 0;
}
.cl-issue b { color: #16324f; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-balls, .ch-balls { display: inline-flex; align-items: center; gap: 3px; }
.cl-balls em { font-style: normal; color: #9aabbf; font-size: 12px; }
.cb {
  width: 21px; height: 21px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4cb9f8, #1f8ff0);
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.cb.sum { background: linear-gradient(180deg, #ff8b73, #f4566b); }
.cl-tag { color: #f4566b; font-weight: 600; }
.cl-shape {
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  background: #f1f5fa;
  color: #7b8fa6;
}
.cl-shape.rf { background: #fff3e2; color: #c07a00; }
.cl-caret {
  flex: 0 0 auto;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #a9b7c7;
  margin-left: 8px;
  transition: transform .2s;
}
.ct-last.open .cl-caret { transform: rotate(180deg); }

/* ---------- 近 10 期 ---------- */
.ct-hist {
  flex: 0 0 auto;
  display: none;
  background: #fff;
  border-bottom: 1px solid #edf1f7;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ct-hist.on { display: block; }
.ch-hd, .ch-row {
  display: grid;
  grid-template-columns: 88px 1fr 32px 62px 52px 52px;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 11px;
}
.ch-hd {
  color: #9aabbf;
  background: #f7f9fc;
  position: sticky;
  top: 0;
  z-index: 2;
}
.ch-row { border-top: 1px solid #f4f7fb; color: #43566a; }
.ch-issue { font-variant-numeric: tabular-nums; color: #5c6f85; }
.ch-sum { font-weight: 600; color: #16324f; font-variant-numeric: tabular-nums; }
.ch-sp { color: #4c6079; }
.ch-shape { color: #7b8fa6; }
.ch-shape.rf { color: #c07a00; font-weight: 600; }
.ch-time { color: #a9b7c7; }
.ch-more {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #148fe0;
  padding: 9px 0;
  border-top: 1px solid #f4f7fb;
}

/* ---------- 聊天区 ---------- */
.ct-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 0;
}
#chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}
.cm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
}
.cm-ava {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  position: relative;
}
.cm-face {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #dde3ec url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aab6c6'%3E%3Ccircle cx='12' cy='8.6' r='4.2'/%3E%3Cpath d='M12 14c-4.2 0-7.2 2.5-7.2 6.2V24h14.4v-3.8C19.2 16.5 16.2 14 12 14z'/%3E%3C/svg%3E") center/78% no-repeat;
}
.cm-vip {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 8px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 7px;
  color: #fff;
  white-space: nowrap;
  background: linear-gradient(180deg, #9b8cf5, #6f5bd8);
  box-shadow: 0 1px 3px rgba(70, 50, 160, .3);
  font-weight: 500;
}
.cm-vip.v1 { background: linear-gradient(180deg, #b9c6d6, #8c9db1); }
.cm-vip.v2 { background: linear-gradient(180deg, #8fdcb6, #46b686); }
.cm-vip.v3 { background: linear-gradient(180deg, #7fd0ee, #3d9ed8); }
.cm-vip.v4 { background: linear-gradient(180deg, #ffbd6b, #f09022); }
.cm-vip.v5 { background: linear-gradient(180deg, #ff9db4, #ef5f86); }
.cm-vip.v6 { background: linear-gradient(180deg, #a6b8ff, #6478e6); }
.cm-vip.v7 { background: linear-gradient(180deg, #f0a0e6, #cf5ec0); }
.cm-vip.v8 { background: linear-gradient(180deg, #ffd66b, #e2a30c); }
.cm-vip.v9 { background: linear-gradient(180deg, #a99af7, #6a56d4); }
.cm-main { flex: 1 1 auto; min-width: 0; }
.cm-name {
  font-size: 12px;
  color: #8b98a9;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-me {
  font-style: normal;
  font-size: 10px;
  background: #e3f3ff;
  color: #148fe0;
  border-radius: 3px;
  padding: 0 4px;
}
.cm-bubble {
  display: inline-block;
  max-width: 100%;
  background: #fff;
  color: #22303f;
  font-size: 15px;
  line-height: 1.42;
  padding: 8px 12px;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(31, 66, 107, .05);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cm.mine .cm-bubble { background: #d4e9ff; }
.cm-sys {
  margin: 0 auto 12px;
  max-width: 92%;
  text-align: center;
  font-size: 12px;
  color: #8b98a9;
  background: #e2e8f1;
  border-radius: 13px;
  padding: 4px 12px;
  width: fit-content;
  line-height: 1.5;
}
.cm-sys b { color: #f4566b; font-variant-numeric: tabular-nums; }
.cm-sys.danger { background: #ffe8ec; color: #c8324a; }
.cm-empty { text-align: center; color: #9aa7b8; font-size: 13px; padding: 28px 0; }

/* ---------- 输入栏 ---------- */
.ct-input {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f4f6fa;
  border-top: 1px solid #e7ecf3;
}
.ci-box {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #e7ecf3;
}
.ci-box input {
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  font-size: 16px;
  color: #22303f;
}
.ci-box input::placeholder { color: #b2bfcd; }
.ci-send {
  flex: 0 0 auto;
  height: 35px;
  padding: 0 18px;
  border-radius: 18px;
  border: 0;
  background: linear-gradient(180deg, #3eb7f9, #1a95e6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.ci-send:active { opacity: .85; }

/* ---------- 底部导航 ---------- */
.ct-tabs {
  flex: 0 0 auto;
  display: flex;
  background: #fff;
  border-top: 1px solid #e7ecf3;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.ct-tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #7b8a9d;
}
.ct-tabs svg { width: 21px; height: 21px; }
.ct-tabs a.on { color: #1a9ce8; font-weight: 600; }

/* ---------- 快投面板 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(14, 28, 46, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 40;
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }
.quick-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 102%);
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 50;
  transition: transform .24s ease;
  display: flex;
  flex-direction: column;
  max-height: 78vh;
  box-shadow: 0 -6px 24px rgba(20, 50, 90, .12);
}
.quick-sheet.on { transform: translate(-50%, 0); }
.qs-hd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f8;
}
.qs-tab {
  font-size: 14px;
  color: #7b8a9d;
  padding-bottom: 4px;
  position: relative;
}
.qs-tab.on { color: #148fe0; font-weight: 700; }
.qs-tab.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: #148fe0;
}
.qs-close { margin-left: auto; color: #a9b7c7; font-size: 16px; padding: 4px 6px; }
.qs-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 10px 4px; }
.qs-ft {
  flex: 0 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #eef2f8;
}
.qs-ft .chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.qs-ft .chips::-webkit-scrollbar { display: none; }
.qs-ft .chip {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 13px;
  border-radius: 15px;
  background: #f2f5fa;
  border: 1px solid #e6ecf4;
  color: #4d6a86;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qs-ft .chip.on { background: #e3f3ff; border-color: #9fd4ff; color: #148fe0; font-weight: 600; }
.qs-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #7b8a9d;
}
.qs-cart b { color: #f4566b; font-weight: 700; margin: 0 1px; font-variant-numeric: tabular-nums; }
.qs-cart .btn-clear {
  margin-left: auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: #f2f5fa;
  color: #6b7c93;
  font-size: 13px;
}
.qs-cart .btn-submit {
  height: 36px;
  padding: 0 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #3eb7f9, #1a95e6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.qs-cart .btn-submit:disabled { background: #b9d8ee; }
.quick-sheet .grid { gap: 8px; }
.quick-sheet .bet-card { padding: 10px 4px 7px; box-shadow: 0 1px 3px rgba(31, 66, 107, .07); }
.quick-sheet .bet-card .n { font-size: 17px; }
.quick-sheet .bet-card .meta { margin-top: 4px; }

/* ---------- 更多菜单 ---------- */
.more-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 102%);
  width: 100%;
  max-width: 560px;
  background: #f4f6fa;
  border-radius: 14px 14px 0 0;
  z-index: 55;
  transition: transform .22s ease;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.more-sheet.on { transform: translate(-50%, 0); }
.ms-item {
  background: #fff;
  text-align: center;
  font-size: 15px;
  color: #22303f;
  border-bottom: 1px solid #f2f5fa;
  position: relative;
}
.ms-item a { display: block; padding: 14px 0; position: relative; }
.ms-item:first-child a { border-radius: 14px 14px 0 0; }
.ms-cancel {
  margin-top: 8px;
  background: #fff;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  color: #6b7c93;
  font-weight: 500;
}
.kf-dot {
  display: none;
  position: absolute;
  top: 12px;
  right: 50%;
  margin-right: -46px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f4566b;
}
.kf-dot.on { display: inline-block; }

/* ---------- 开奖弹层 ---------- */
.rv-mask {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 42, .55);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rv-mask.on { display: flex; }
.rv-card {
  width: 100%;
  max-width: 310px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(10, 30, 60, .3);
}
.rv-title {
  background: linear-gradient(96deg, #35b5f7, #1590dd);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}
.rv-title b { font-size: 15px; font-variant-numeric: tabular-nums; }
.rv-title span { opacity: .85; }
.rv-body {
  position: relative;
  padding: 18px 14px 14px;
  text-align: center;
  overflow: hidden;
}
.rv-nums { display: flex; align-items: center; justify-content: center; gap: 7px; }
.rv-nums i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4cb9f8, #1f8ff0);
  color: #fff;
  font-style: normal;
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.rv-nums i.sum { background: linear-gradient(180deg, #ff8b73, #f4566b); }
.rv-nums em { font-style: normal; color: #b6c4d3; font-size: 16px; }
.rv-tags { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; }
.rv-tags .big { color: #f4566b; }
.rv-tags .small { color: #148fe0; }
.rv-tags .odd { color: #7c5cf5; }
.rv-tags .even { color: #0aa9a9; }
.rv-shape {
  margin-top: 8px;
  font-size: 13px;
  color: #7b8fa6;
  min-height: 18px;
}
.rv-shape b { color: #c07a00; }
.rv-scratch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  touch-action: none;
}
.rv-card[data-mode="scratch"] .rv-scratch { display: block; }
.rv-hint {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 11px;
  color: #a9b7c7;
  pointer-events: none;
}
.rv-card[data-mode="scratch"] .rv-hint { display: block; }
.rv-foot {
  border-top: 1px solid #f2f5fa;
  padding: 10px 14px 12px;
  text-align: center;
}
.rv-tip { display: block; font-size: 12px; color: #9aabbf; margin-bottom: 8px; }
.rv-close {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  border: 0;
  background: linear-gradient(180deg, #3eb7f9, #1a95e6);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* 小屏微调 */
@media (max-height: 640px) {
  .ct-status { padding: 7px 12px; }
  .cs-money { font-size: 19px; }
  .cm { margin-bottom: 11px; }
}

/* ===== 快投：最近下注（点一条跟注） ===== */
.qs-recent-hd {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px 4px; font-size: 12px; color: #5b6b7e; font-weight: 600;
}
.qs-recent-hd i { font-style: normal; font-weight: 400; color: #9aabbf; }
.qs-recent {
  max-height: 132px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 10px 6px;
}
.qs-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin-bottom: 5px;
  background: #f6f9fc; border: 1px solid #e8eef6; border-radius: 9px;
  font-size: 12px; color: #33475e;
}
.qs-row:active { background: #eef6ff; border-color: #bcdcff; }
.qs-row .qs-name {
  flex: 0 0 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}
.qs-row .qs-name i {
  font-style: normal; margin-left: 4px; padding: 0 4px;
  background: #1ba3ef; color: #fff; border-radius: 3px; font-size: 10px;
}
.qs-row .qs-play { flex: 1 1 auto; color: #148fe0; font-weight: 600; }
.qs-row .qs-amt { flex: 0 0 auto; color: #f4566b; font-weight: 700; font-variant-numeric: tabular-nums; }
.qs-row .qs-follow {
  flex: 0 0 auto; padding: 1px 7px; border-radius: 20px;
  background: #e3f3ff; color: #148fe0; font-size: 11px; font-weight: 600;
}
.qs-empty { padding: 10px 6px; text-align: center; color: #9aabbf; font-size: 12px; }

/* ===== 开奖弹层：刮奖遮罩 & 直接看结果 ===== */
.rv-scratch { transition: opacity .32s ease; }
.rv-scratch.done { opacity: 0; pointer-events: none; }
.rv-skip {
  display: none; margin-right: auto; font-size: 12px; color: #8fa2b6; text-decoration: underline;
}
.rv-card[data-mode="scratch"] .rv-skip { display: inline-block; }

/* ---------- 不遮挡版：底部浮条，不挡期号/余额/聊天 ---------- */
.rv-mask.plain {
  background: transparent;
  pointer-events: none;
  align-items: flex-end;
  padding: 0 10px 116px;
}
.rv-mask.plain .rv-card {
  pointer-events: auto;
  max-width: 380px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(10, 30, 60, .26);
  animation: rvRise .3s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes rvRise {
  from { transform: translateY(22px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.rv-mask.plain .rv-head { padding: 9px 12px; font-size: 14px; border-radius: 16px 16px 0 0; }
.rv-mask.plain .rv-body { padding: 10px 12px 8px; }
.rv-mask.plain .rv-nums i { width: 32px; height: 32px; font-size: 16px; }
.rv-mask.plain .rv-nums em { font-size: 14px; }
.rv-mask.plain .rv-tags { margin-top: 6px; font-size: 13px; }
.rv-mask.plain .rv-shape { margin-top: 3px; font-size: 12px; min-height: 0; }
.rv-mask.plain .rv-foot { padding: 6px 10px 9px; border-top: 1px solid #f2f5fa; }
.rv-mask.plain .rv-tip { font-size: 11px; margin-bottom: 5px; }
.rv-mask.plain .rv-close { height: 32px; font-size: 13px; border-radius: 16px; }
@media (max-width: 360px) {
  .rv-mask.plain { padding: 0 8px 108px; }
}
