/* ==== 主题色变量 ====
   - 深海军蓝/深色背景:  #0f2744   (页面整体背景 & 深色头部)
   - 深青绿面板:         #12505a   (历史表格背景 / 下注区 / 开奖区卡片)
   - 红色块 (大 / 单):   #d7382f   (开奖历史大小单双色块 + 主按钮)
   - 蓝色块 (小 / 双):   #2b8fc0   (开奖历史大小单双色块)
   - 深底上的白色文字
   - 浅色卡片背景:       #ffffff   (用户列表等浅色卡片)
*/
:root {
  --theme-page-bg:      #0f2744;   /* 页面整体背景色: 深海军蓝 */
  --theme-panel-bg:     #12505a;   /* 深青绿面板背景色: 历史表格、开奖区、下注区 */
  --theme-panel-bg-2:   #145b66;   /* 深青绿面板渐变的深色调 (card header) */
  --theme-surface:      #ffffff;   /* 浅色卡片背景色 (如用户列表) */
  --theme-surface-2:    #f5f7fb;   /* 浅色次级背景色 */
  --theme-divider:      rgba(255,255,255,0.15);   /* 深色面板中的分割线颜色 */

  --theme-primary:      #d7382f;   /* 主色/红色块色: 开奖历史 大/单 红块 + 主按钮渐变 */
  --theme-primary-dk:   #b32620;   /* 主色深色/按钮渐变深色: 按钮、倒计时背景 */
  --theme-secondary:    #097432;   /* 次色/蓝色块色: 开奖历史 小/双 蓝块 */
  --theme-secondary-dk: #206e96;   /* 次色深色: badge-info 等蓝信息色 */

  --theme-text:         #1a2332;   /* 浅色底上的正文文字颜色 */
  --theme-text-light:   #ffffff;   /* 深底上的正文文字颜色 (白色) */
  --theme-text-muted:   #b7d0dc;   /* 深底上的次要文字颜色 (期号、辅助文字) */
  --theme-text-muted-2: #e6ecee;   /* 深底上的辅助文字颜色 (再亮一档) */

  --theme-warn:         #e65100;   /* 警告色/橙色: 钱包按钮渐变、badge-warning */
  --theme-ok:           #2ecc71;   /* 成功色/绿色 */

  --shadow-card:        0 2px 12px rgba(0,0,0,0.18);   /* 卡片阴影色 */
  --shadow-card-hover:  0 8px 24px rgba(0,0,0,0.28);   /* 卡片悬浮时阴影色 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;   /* 全局字体族 */
  background: var(--theme-page-bg);   /* 页面背景色: 深海军蓝 */
  color: var(--theme-text);   /* 全局默认文字颜色: 深灰蓝 (浅色底用) */
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  background: linear-gradient(135deg, #0f2744 0%, #12505a 100%);   /* 头部背景渐变色: 深海军蓝→深青绿 */
  color: var(--theme-text-light);   /* 头部文字颜色: 白色 */
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;   /* Logo文字字号: 大 */
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--theme-text-light);   /* Logo文字颜色: 白色 */
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--theme-text-light);   /* Logo圆形图标背景色: 白色 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-primary);   /* Logo图标文字颜色: 主红色 */
  font-size: 20px;   /* Logo图标字体大小: 中等 */
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  color: var(--theme-text-light);   /* 导航链接文字颜色: 白色 */
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background 0.3s;
}

.nav a:hover, .nav a.active {
  background: rgba(255,255,255,0.18);   /* 导航悬停/选中背景色: 半透明白色 */
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.balance {
  background: rgba(255,255,255,0.18);   /* 余额胶囊背景色: 半透明白色 */
  color: var(--theme-text-light);   /* 余额文字颜色: 白色 */
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;   /* 按钮字号: 中 */
  font-weight: 500;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dk) 100%);   /* 主按钮渐变背景色: 红色渐变 */
  color: white;   /* 主按钮文字颜色: 白色 */
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(215, 56, 47, 0.45);
}

.btn-secondary {
  background: #e6ecee;   /* 次按钮背景色: 浅灰 */
  color: var(--theme-text);   /* 次按钮文字颜色: 深灰蓝 */
}

.btn-secondary:hover {
  background: #d0dade;   /* 次按钮悬停背景色: 浅灰加深 */
}

.btn-success {
  background: linear-gradient(135deg, var(--theme-panel-bg) 0%, var(--theme-panel-bg-2) 100%);   /* 成功按钮渐变背景色: 深青绿渐变 */
  color: white;   /* 成功按钮文字颜色: 白色 */
}

.btn-success:hover {
  transform: translateY(-2px);
}

.btn-danger {
  background: #e53935;   /* 删除按钮背景色: 红色 */
  color: white;   /* 删除按钮文字颜色: 白色 */
}

.btn-danger:hover {
  background: #c62828;   /* 删除按钮悬停背景色: 深红 */
  transform: translateY(-2px);
}

.btn-wallet {
  background: linear-gradient(135deg, var(--theme-warn) 0%, #c74200 100%);   /* 钱包按钮渐变背景色: 橙色渐变 */
  color: white;   /* 钱包按钮文字颜色: 白色 */
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  background: var(--theme-surface);   /* 卡片背景色: 白色 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

.card-header {
  padding: 20px;
  background: linear-gradient(135deg, var(--theme-panel-bg) 0%, var(--theme-panel-bg-2) 100%);   /* 卡片头部渐变背景色: 深青绿渐变 */
  color: var(--theme-text-light);   /* 卡片头部文字颜色: 白色 */
  text-align: center;
}

.card-icon {
  font-size: 40px;   /* 卡片图标字号: 特大 */
  margin-bottom: 10px;
}

.card-title {
  font-size: 18px;   /* 卡片标题字号: 大 */
  font-weight: bold;
}

.card-subtitle {
  font-size: 13px;   /* 卡片副标题字号: 小 */
  opacity: 0.9;
  margin-top: 5px;
}

.card-body {
  padding: 15px 20px;
}

.card-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;   /* 卡片信息字号: 小 */
  color: #666;   /* 卡片信息文字颜色: 中灰 */
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  background: #fff1ef;   /* 默认徽标背景色: 浅粉 (主页彩种"热"标) */
  color: var(--theme-primary);   /* 默认徽标文字颜色: 主红色 */
  border-radius: 12px;
  font-size: 12px;   /* 徽标字号: 特小 */
  font-weight: 500;
}

.badge-success {
  background: #e6f6ec;   /* 成功徽标背景色: 浅绿 */
  color: #1b7d45;   /* 成功徽标文字颜色: 深绿 */
}

.badge-warning {
  background: #fff3e0;   /* 警告徽标背景色: 浅橙 */
  color: var(--theme-warn);   /* 警告徽标文字颜色: 橙色 */
}

.badge-info {
  background: #e1f1fa;   /* 信息徽标背景色: 浅蓝 */
  color: var(--theme-secondary-dk);   /* 信息徽标文字颜色: 深蓝 */
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--theme-page-bg) 0%, var(--theme-panel-bg) 100%);   /* 登录页渐变背景色: 深海军蓝→深青绿 */
  padding: 20px;
}

.auth-card {
  background: var(--theme-surface);   /* 登录卡片背景色: 白色 */
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dk) 100%);   /* 登录图标渐变背景色: 红色渐变 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 40px;   /* 登录图标字号: 特大 */
  color: white;   /* 登录图标文字颜色: 白色 */
}

.auth-title {
  font-size: 24px;   /* 登录页标题字号: 大 */
  font-weight: bold;
  color: var(--theme-text);   /* 登录页标题文字颜色: 深灰蓝 */
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;   /* 表单标签字号: 中 */
  color: #666;   /* 表单标签文字颜色: 中灰 */
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #dde4ea;   /* 输入框边框颜色: 浅灰蓝 */
  border-radius: 8px;
  font-size: 14px;   /* 输入框字号: 中 */
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--theme-primary);   /* 输入框聚焦边框颜色: 主红色 */
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 16px;   /* 通栏按钮字号: 大 */
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  color: #666;   /* 登录页底部辅助文字颜色: 中灰 */
  font-size: 14px;   /* 登录页底部辅助文字字号: 中 */
}

.auth-footer a {
  color: var(--theme-primary);   /* 登录页底部链接文字颜色: 主红色 */
  text-decoration: none;
  font-weight: 500;
}

.game-page {
  padding: 20px 0;
}

.game-header {
  background: var(--theme-panel-bg);   /* 购彩页头部卡片背景色: 深青绿 */
  color: var(--theme-text-light);   /* 购彩页头部卡片文字颜色: 白色 */
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.game-title {
  font-size: 20px;   /* 游戏标题字号: 超大 */
  font-weight: bold;
  color: var(--theme-text-light);   /* 游戏标题文字颜色: 白色 */
  margin-bottom: 15px;
}

.game-info {
  display: flex;
  gap: 30px;
  align-items: center;
}

.countdown {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dk) 100%);   /* 倒计时卡片渐变背景色: 红色渐变 */
  color: white;   /* 倒计时卡片文字颜色: 白色 */
  padding: 15px 30px;
  border-radius: 12px;
  text-align: center;
}

.countdown-label {
  font-size: 12px;   /* 倒计时标签字号: 特小 */
  opacity: 0.9;
}

.countdown-time {
  font-size: 32px;   /* 倒计时数字字号: 特大 */
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.current-period {
  font-size: 18px;   /* 当前期号字号: 大 */
  color: var(--theme-text-muted);   /* 当前期号文字颜色: 浅蓝灰(次要文字色) */
}

.last-draw {
  background: var(--theme-panel-bg);   /* 最新开奖卡片背景色: 深青绿 */
  color: var(--theme-text-light);   /* 最新开奖卡片文字颜色: 白色 */
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.last-draw-title {
  font-size: 16px;   /* 最新开奖标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--theme-text-light);   /* 最新开奖标题文字颜色: 白色 */
}

.number-display {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.number-ball {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;   /* 开奖号码球字号: 中等偏大 */
  font-weight: bold;
  color: white;   /* 开奖号码球文字颜色: 白色 */
  animation: ballAppear 0.5s ease-out;
}

@keyframes ballAppear {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.dice {
  width: 50px;
  height: 50px;
  background: linear-gradient(145deg, #ffffff, #e0e0e0);
  border-radius: 10px;
  box-shadow:
    2px 2px 6px rgba(0, 0, 0, 0.3),
    inset 1px 1px 2px rgba(255, 255, 255, 0.9),
    inset -1px -1px 2px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  gap: 2px;
  animation: diceRoll 0.6s ease-out;
}

@keyframes diceRoll {
  0% { transform: rotate(-20deg) scale(0.5); opacity: 0; }
  60% { transform: rotate(10deg) scale(1.1); opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

/* === 开奖中摇骰子动画 (3D摇动, 模仿9tt406: 骰子立体翻转露出不同面) ===
   说明: 只保留一套动画, 避免两个同名规则后者覆盖前者导致两台电脑效果不一致。
   perspective 提供3D透视, 骰子沿 X/Y 轴立体翻转摇动(不平面转圈),
   配合 JS 每50ms 切换点数面 → 形成"3D摇动所有骰子面"效果。 */
#numberDisplay {
  perspective: 600px;
}
#numberDisplay.rolling .new-dice {
  animation: diceSpin 0.5s linear infinite;
  transform-style: preserve-3d;
}
#numberDisplay.rolling .new-dice:nth-child(1) { animation-delay: 0s; }
#numberDisplay.rolling .new-dice:nth-child(2) { animation-delay: 0.12s; }
#numberDisplay.rolling .new-dice:nth-child(3) { animation-delay: 0.24s; }

@keyframes diceSpin {
  0%   { transform: rotateX(0deg) rotateY(0deg); }
  25%  { transform: rotateX(180deg) rotateY(90deg); }
  50%  { transform: rotateX(360deg) rotateY(180deg); }
  75%  { transform: rotateX(540deg) rotateY(270deg); }
  100% { transform: rotateX(720deg) rotateY(360deg); }
}

.dice-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6a6a6a, #2a2a2a 55%, #0d0d0d);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.55), 0 1px 1px rgba(255,255,255,0.18);
  justify-self: center;
  align-self: center;
}

.dice-dot.red-dot {
  background: radial-gradient(circle at 30% 30%, #ff8a8a, #d63232 55%, #9a1818);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.35), 0 1px 1px rgba(255,255,255,0.25);
}

.dice-face-1 { grid-template-areas: ". . ." ". c ." ". . ."; }
.dice-face-1 .dice-dot { grid-area: c; }

.dice-face-2 { grid-template-areas: ". . a" ". . ." ". . b"; }
.dice-face-2 .dice-dot:nth-child(1) { grid-area: a; }
.dice-face-2 .dice-dot:nth-child(2) { grid-area: b; }

.dice-face-3 { grid-template-areas: "a . ." ". c ." ". . b"; }
.dice-face-3 .dice-dot:nth-child(1) { grid-area: a; }
.dice-face-3 .dice-dot:nth-child(2) { grid-area: c; }
.dice-face-3 .dice-dot:nth-child(3) { grid-area: b; }

.dice-face-4 { grid-template-areas: "a . b" ". . ." "c . d"; }
.dice-face-4 .dice-dot:nth-child(1) { grid-area: a; }
.dice-face-4 .dice-dot:nth-child(2) { grid-area: b; }
.dice-face-4 .dice-dot:nth-child(3) { grid-area: c; }
.dice-face-4 .dice-dot:nth-child(4) { grid-area: d; }

.dice-face-5 { grid-template-areas: "a . b" ". c ." "d . e"; }
.dice-face-5 .dice-dot:nth-child(1) { grid-area: a; }
.dice-face-5 .dice-dot:nth-child(2) { grid-area: b; }
.dice-face-5 .dice-dot:nth-child(3) { grid-area: c; }
.dice-face-5 .dice-dot:nth-child(4) { grid-area: d; }
.dice-face-5 .dice-dot:nth-child(5) { grid-area: e; }

.dice-face-6 { grid-template-areas: "a . b" "c . d" "e . f"; }
.dice-face-6 .dice-dot:nth-child(1) { grid-area: a; }
.dice-face-6 .dice-dot:nth-child(2) { grid-area: b; }
.dice-face-6 .dice-dot:nth-child(3) { grid-area: c; }
.dice-face-6 .dice-dot:nth-child(4) { grid-area: d; }
.dice-face-6 .dice-dot:nth-child(5) { grid-area: e; }
.dice-face-6 .dice-dot:nth-child(6) { grid-area: f; }

.dice-face-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;   /* 大骰子数字字号: 特大 */
  font-weight: bold;
  color: #333;   /* 大骰子默认数字颜色: 深灰 */
  text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
}

.dice-face-number.red {
  color: #c62828;   /* 大骰子红色数字色: 深红 */
}

.dice-face-number.blue {
  color: #1565c0;   /* 大骰子蓝色数字色: 深蓝 */
}

.dice-face-number.green {
  color: #2e7d32;   /* 大骰子绿色数字色: 深绿 */
}

.dice-face-number.gold {
  color: #ef6c00;   /* 大骰子金色数字色: 深橙 */
}

.history-dice {
  width: 28px;
  height: 28px;
  background: linear-gradient(145deg, #ffffff, #e0e0e0);
  border-radius: 6px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25),
              inset 1px 1px 1px rgba(255, 255, 255, 0.9),
              inset -1px -1px 1px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
  gap: 1px;
  flex-shrink: 0;
}

.history-dice .dice-dot {
  width: 6px;
  height: 6px;
}

.history-dice-face-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;   /* 历史表格骰子数字字号: 特小 */
  font-weight: bold;
  color: #333;   /* 历史表格骰子默认数字颜色: 深灰 */
}

.history-dice-face-number.red { color: #c62828; }   /* 历史表格骰子红色数字色: 深红 */
.history-dice-face-number.blue { color: #1565c0; }   /* 历史表格骰子蓝色数字色: 深蓝 */
.history-dice-face-number.green { color: #2e7d32; }   /* 历史表格骰子绿色数字色: 深绿 */
.history-dice-face-number.gold { color: #ef6c00; }   /* 历史表格骰子金色数字色: 深橙 */

.draw-info {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
  font-size: 14px;   /* 开奖信息(和值/大小/单双)标签字号: 中 */
  color: var(--theme-text-muted);   /* 开奖信息标签文字颜色: 浅蓝灰(次要文字色) */
}

.draw-info span {
  font-weight: bold;
  color: var(--theme-text-light);   /* 开奖信息数值文字颜色: 白色 */
}

.bet-section {
  background: var(--theme-panel-bg);   /* 下注区卡片背景色: 深青绿 */
  color: var(--theme-text-light);   /* 下注区卡片文字颜色: 白色 */
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.bet-title {
  font-size: 16px;   /* 下注区标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--theme-text-light);   /* 下注区标题文字颜色: 白色 */
}

.bet-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  min-width: 0;   /* 允许在父grid中收缩,防止内容撑开溢出 */
}

.bet-option {
  padding: 15px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
  background: rgba(255,255,255,0.06);   /* 下注选项默认背景色: 半透明白色 */
  color: var(--theme-text-light);   /* 下注选项文字颜色: 白色 */
}

.bet-option:hover {
  border-color: var(--theme-primary);   /* 下注选项悬停边框色: 主红色 */
  background: rgba(215,56,47,0.15);   /* 下注选项悬停背景色: 半透明主红色 */
}

.bet-option.selected {
  border-color: var(--theme-primary);   /* 下注选项选中边框色: 主红色 */
  background: rgba(215,56,47,0.22);   /* 下注选项选中背景色: 半透明主红色加深 */
}

.bet-option-name {
  font-size: 14px;   /* 下注选项名称字号: 中 */
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--theme-text-light);   /* 下注选项名称文字颜色: 白色 */
}

.bet-option-odds {
  font-size: 12px;   /* 下注赔率字号: 特小 */
  color: #ffcf7b;   /* 下注赔率文字颜色: 金黄色 (突出赔率) */
  font-weight: bold;
}

.bet-option-desc {
  font-size: 11px;   /* 下注选项说明字号: 极小 */
  color: var(--theme-text-muted);   /* 下注选项说明文字颜色: 浅蓝灰(次要文字色) */
  margin-top: 5px;
}

.bet-group-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.bet-option-base {
  padding: 10px 5px;
}

.bet-option-base .bet-option-name {
  font-size: 13px;   /* 紧凑版下注选项名称字号: 小 */
  margin-bottom: 3px;
}

.bet-option-base .bet-option-odds {
  font-size: 11px;   /* 紧凑版下注赔率字号: 极小 */
}

.sum-bet-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sum-bet-section {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  overflow: hidden;
}

.sum-bet-header {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dk) 100%);   /* 和值分组表头渐变背景色: 红色渐变 */
  color: white;   /* 和值分组表头文字颜色: 白色 */
  padding: 6px 12px;
  font-size: 13px;   /* 和值分组表头字号: 小 */
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sum-bet-odds {
  font-size: 11px;   /* 和值分组表头赔率字号: 极小 */
  font-weight: normal;
  opacity: 0.9;
}

.sum-bet-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.12);   /* 和值选项格子间分隔色: 半透明白色 */
}

.sum-bet-option {
  padding: 12px 5px;
  background: rgba(255,255,255,0.06);   /* 和值下注选项默认背景色: 半透明白色 */
  color: var(--theme-text-light);   /* 和值下注选项文字颜色: 白色 */
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sum-bet-option:hover {
  background: rgba(255,255,255,0.14);   /* 和值下注选项悬停背景色: 半透明白色加深 */
}

.sum-bet-option.selected {
  background: rgba(215,56,47,0.24);   /* 和值下注选项选中背景色: 半透明主红色 */
  border: none;
  box-shadow: inset 0 0 0 2px var(--theme-primary);   /* 和值下注选项选中内描边色: 主红色 */
}

.sum-bet-name {
  font-size: 18px;   /* 和值数字字号: 大 (突出和值) */
  font-weight: bold;
  color: var(--theme-text-light);   /* 和值数字文字颜色: 白色 */
}

.sum-bet-payout {
  font-size: 11px;   /* 和值赔率字号: 极小 */
  color: #ffcf7b;   /* 和值赔率文字颜色: 金黄色 */
  font-weight: 500;
}

/* ============ 统一4列网格布局样式 (模仿9tt406快三布局) ============ */
.unified-bet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;   /* 网格间距: 8px */
  grid-column: 1 / -1;   /* 横跨父容器所有列 */
  width: 100%;
  margin-bottom: 8px;
}

.unified-option {
  border: 1px solid rgba(255,255,255,0.5);   /* 选项边框: 半透明白 */
  background: transparent;   /* 选项默认背景: 透明 */
  color: #fff;   /* 选项文字颜色: 白色 */
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: background 0.15s;
  height: 48px;   /* 选项固定高度: 48px */
  padding: 0;
}

.unified-option:hover {
  background: #40916c;   /* 选项悬停背景色: 绿色 */
}

.unified-option.selected {
  background: #40916c;   /* 选项选中背景色: 绿色 */
  border-color: #fff;   /* 选项选中边框: 白色 */
}

.unified-option-name {
  font-size: 18px;   /* 选项名称字号: 大 */
  line-height: 1;
  margin-bottom: 2px;
  color: #fff;   /* 选项名称文字颜色: 白色 */
}

.unified-option-odds {
  font-size: 13px;   /* 选项赔率字号: 小 */
  line-height: 1;
  color: #fff;   /* 选项赔率文字颜色: 白色 */
}

/* ============ 固定底栏样式 (模仿9tt406快三) ============ */
.fixed-bet-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;   /* 底栏背景色: 黑色 */
  z-index: 100;
  display: none;   /* 默认隐藏,移动端显示 */
  flex-direction: row;
  align-items: stretch;
}

.fixed-bet-bar-left {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  gap: 24px;
  background: #2c2c2c;   /* 左侧背景色: 深灰 */
  height: 52px;
}

.fixed-clear-btn {
  color: #ff9900;   /* 清空按钮颜色: 橙色 */
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin-right: 16px;
}

.fixed-bet-count {
  color: #fff;   /* 注数文字颜色: 白色 */
  font-size: 14px;
}

.fixed-submit-btn {
  color: #fff;   /* 投注按钮文字颜色: 白色 */
  background: #dc3b40;   /* 投注按钮背景色: 红色 */
  border: none;
  border-radius: 0;
  padding: 0 24px;
  font-size: 18px;   /* 投注按钮字号: 大 */
  cursor: pointer;
  height: 52px;
  white-space: nowrap;
}

.bet-form {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.bet-amount {
  flex: 1;
}

.bet-amount input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255,255,255,0.25);   /* 下注金额输入框边框色: 半透明白色 */
  background: rgba(255,255,255,0.06);   /* 下注金额输入框背景色: 半透明白色 */
  color: var(--theme-text-light);   /* 下注金额输入框文字颜色: 白色 */
  border-radius: 8px;
  font-size: 16px;   /* 下注金额输入框字号: 大 (突出金额) */
}

.bet-amount input::placeholder {
  color: rgba(255,255,255,0.4);   /* 下注金额输入框占位文字颜色: 半透明白色 */
}

.bet-amount input:focus {
  outline: none;
  border-color: var(--theme-primary);   /* 下注金额输入框聚焦边框色: 主红色 */
  background: rgba(255,255,255,0.1);   /* 下注金额输入框聚焦背景色: 半透明白色加深 */
}

.bet-summary {
  background: var(--theme-panel-bg);   /* 下注汇总卡片背景色: 深青绿 */
  color: var(--theme-text-light);   /* 下注汇总卡片文字颜色: 白色 */
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.bet-summary-title {
  font-size: 16px;   /* 下注汇总标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--theme-text-light);   /* 下注汇总标题文字颜色: 白色 */
}

.bet-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);   /* 下注汇总分割线颜色: 半透明白色 */
  color: var(--theme-text-light);   /* 下注汇总项文字颜色: 白色 */
}

.bet-summary-item:last-child {
  border-bottom: none;
}

.bet-summary-label {
  color: var(--theme-text-muted);   /* 下注汇总标签文字颜色: 浅蓝灰(次要文字色) */
}

.bet-summary-value {
  font-weight: bold;
  color: var(--theme-text-light);   /* 下注汇总数值文字颜色: 白色 */
}

.bet-total {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  margin-top: 10px;
  border-top: 2px solid rgba(255,255,255,0.2);   /* 下注总额顶部粗分割线颜色: 半透明白色 */
  font-size: 18px;   /* 下注总额字号: 大 (突出总额) */
  font-weight: bold;
  color: var(--theme-text-light);   /* 下注总额文字颜色: 白色 */
}

.bet-total .win {
  color: #ffcf7b;   /* 预计中奖金额文字颜色: 金黄色 (突出可赢金额) */
}

.history-draws {
  background: var(--theme-panel-bg);   /* 历史开奖卡片背景色: 深青绿 */
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.history-numbers-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.history-title {
  font-size: 16px;   /* 历史开奖标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 12px;
  color: #fff;   /* 历史开奖标题文字颜色: 白色 */
}

.history-list {
  max-height: 360px;
  overflow-y: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;   /* 历史开奖表格正文字号: 中 */
  color: #fff;   /* 历史开奖表格正文文字颜色: 白色 */
  background: transparent;
  table-layout: fixed;
}

.history-table thead {
  background: rgba(255,255,255,0.08);   /* 历史开奖表头背景色: 半透明白色 */
}

.history-table thead th {
  text-align: center !important;
  padding: 8px 4px !important;
  font-weight: 600 !important;
  color: #d7f5e8 !important;   /* 历史开奖表头文字颜色: 浅青绿 */
  font-size: 13px;   /* 历史开奖表头字号: 小 */
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.2) !important;   /* 历史开奖表头底部分割线颜色: 半透明白色 */
  background: rgba(255,255,255,0.08) !important;   /* 历史开奖表头背景色: 半透明白色 */
}

.history-table tbody td {
  text-align: center;
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.12);   /* 历史开奖表格行分割线颜色: 半透明白色虚线 */
  font-weight: 500;
  background: transparent;
  color: #fff;   /* 历史开奖表格单元格文字颜色: 白色 */
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover td {
  background: rgba(255,255,255,0.05);   /* 历史开奖表格行悬停背景色: 极浅半透明白色 */
}

.history-table .col-period {
  width: 100px;
  text-align: center;
  font-size: 11px;   /* 历史表格期号字号: 特小 */
  font-weight: 500;
  color: var(--theme-text-muted);   /* 历史表格期号文字颜色: 浅蓝灰(次要文字色) */
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}

.history-table .col-sum {
  width: 40px;
  text-align: center;
  font-size: 15px;   /* 历史表格和值字号: 中偏大 (突出和值) */
  font-weight: bold;
  color: #fff;   /* 历史表格和值文字颜色: 白色 */
  white-space: nowrap;
}

.history-table .col-numbers {
  text-align: center;
  width: auto;
}

.history-numbers-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.history-table .col-size,
.history-table .col-parity {
  width: 48px;
  text-align: center;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;   /* 历史表格大小单双标签字号: 中 */
  color: #d8d8d8;   /* 历史表格大小单双标签文字颜色: 暗白 */
  text-align: center;
  line-height: 1;
  padding: 0;
}

.history-tag.tag-red {
  background: #a8443a;   /* 历史表格红色标签背景色: 暗红 (大/双) */
}

.history-tag.tag-blue {
  background: #1f7591;   /* 历史表格蓝色标签背景色: 暗蓝 (小/单) */
}

/* 旧历史样式保留兼容 */
.history-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;   /* 旧版历史列表字号: 小 */
}

.history-item:last-child {
  border-bottom: none;
}

.history-period {
  width: 120px;
  color: #666;   /* 旧版历史期号文字颜色: 中灰 */
}

.history-numbers {
  flex: 1;
  display: flex;
  gap: 5px;
  justify-content: center;
}

.history-ball {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;   /* 旧版历史号码球字号: 特小 */
  font-weight: bold;
  color: white;   /* 旧版历史号码球文字颜色: 白色 */
}

.ball-red {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);   /* 旧版红色号码球渐变背景色: 红色渐变 */
}

.ball-blue {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);   /* 旧版蓝色号码球渐变背景色: 蓝色渐变 */
}

.ball-green {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);   /* 旧版绿色号码球渐变背景色: 绿色渐变 */
}

.ball-gold {
  background: linear-gradient(135deg, #fb8c00 0%, #ef6c00 100%);   /* 旧版金色号码球渐变背景色: 橙色渐变 */
}

.history-sum {
  width: 60px;
  text-align: center;
  color: #666;   /* 旧版历史和值文字颜色: 中灰 */
}

.history-color {
  width: 50px;
  text-align: center;
}

.pending-bets {
  background: white;   /* 待开奖投注卡片背景色: 白色 */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.pending-title {
  font-size: 16px;   /* 待开奖投注标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 15px;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #fafafa;   /* 待开奖投注单项背景色: 极浅灰 */
  border-radius: 8px;
}

.pending-info {
  display: flex;
  flex-direction: column;
}

.pending-game {
  font-weight: 500;
}

.pending-detail {
  font-size: 12px;   /* 待开奖投注详情字号: 特小 */
  color: #666;   /* 待开奖投注详情文字颜色: 中灰 */
}

.pending-amount {
  text-align: right;
}

.pending-bet {
  color: #c62828;   /* 待开奖投注金额文字颜色: 深红 */
  font-weight: bold;
}

.pending-potential {
  font-size: 12px;   /* 待开奖预计派奖字号: 特小 */
  color: #2e7d32;   /* 待开奖预计派奖文字颜色: 深绿 */
}

.admin-sidebar {
  width: 250px;
  background: #1a1a2e;   /* 管理后台侧边栏背景色: 深紫黑 */
  color: white;   /* 管理后台侧边栏文字颜色: 白色 */
  min-height: 100vh;
  padding: 20px 0;
  position: fixed;
  left: 0;
  top: 0;
}

.admin-logo {
  padding: 20px;
  font-size: 18px;   /* 管理后台Logo字号: 大 */
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.1);   /* 管理后台Logo底部分割线颜色: 半透明白色 */
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-menu {
  list-style: none;
  padding: 20px 0;
}

.admin-menu li {
  padding: 15px 25px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-menu li:hover, .admin-menu li.active {
  background: rgba(255,255,255,0.1);   /* 管理后台菜单项悬停/选中背景色: 半透明白色 */
}

.admin-menu li .icon {
  font-size: 18px;   /* 管理后台菜单图标字号: 大 */
}

.admin-menu li .nav-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.admin-main {
  margin-left: 250px;
  padding: 30px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-title {
  font-size: 24px;   /* 管理后台页面标题字号: 特大 */
  font-weight: bold;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;   /* 统计卡片背景色: 白色 */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.stat-label {
  font-size: 14px;   /* 统计标签字号: 中 */
  color: #666;   /* 统计标签文字颜色: 中灰 */
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;   /* 统计数值字号: 特大 (突出数字) */
  font-weight: bold;
  color: #333;   /* 统计数值文字颜色: 深灰 */
}

.stat-change {
  font-size: 12px;   /* 统计变动百分比字号: 特小 */
  margin-top: 5px;
}

.stat-change.positive {
  color: #2e7d32;   /* 统计正向变动文字颜色: 深绿 */
}

.stat-change.negative {
  color: #c62828;   /* 统计负向变动文字颜色: 深红 */
}

.admin-content {
  background: white;   /* 管理后台内容区背景色: 白色 */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;   /* 内容区头部分割线颜色: 浅灰 */
}

.content-title {
  font-size: 18px;   /* 内容区标题字号: 大 */
  font-weight: bold;
}

/* === 越南语翻译器面板样式 === */
.translate-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.translate-toolbar {
  background: #f5f7fb;   /* 工具栏背景: 浅灰蓝 */
  padding: 12px 16px;
  border-radius: 8px;
}

.translate-direction {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.translate-label {
  font-size: 14px;
  color: #1a2332;
  font-weight: 500;
}

/* === 纵向单列面板 (原文/译文上下排列) */
.translate-single-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid #dde4ea;
  border-radius: 8px;
  overflow: hidden;
}

.translate-output-panel {
  border-color: #b7e0cb;   /* 译文面板绿色边框, 与原文框区分 */
  box-shadow: 0 1px 3px rgba(9, 116, 50, 0.08);
}

.translate-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f7fb;
  border-bottom: 1px solid #dde4ea;
}

.translate-output-panel .translate-panel-header {
  background: #e8f5ee;   /* 译文表头浅绿色背景: 浅绿 */
  border-bottom-color: #b7e0cb;
}

.translate-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
}

.translate-output-title {
  color: #097432;      /* 译文标题: 深绿 */
}

.translate-char-count {
  font-size: 12px;
  color: #6b7280;
}

.translate-copy-btn {
  font-size: 12px;
}

.translate-textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.8;
  color: #1a2332;
  background: #fff;
  box-sizing: border-box;
}

/* 译文显示div（在原文下方直接显示 */
.translate-output-display {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 2;
  color: #0f5132;          /* 深绿 */
  background: #f5fbf7;        /* 极浅绿背景 */
  white-space: pre-wrap;      /* 保留换行 */
  word-break: break-word;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: inherit;
}
.translate-output-display:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
}

.translate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
}

.translate-history {
  border-top: 1px solid #eee;
  padding-top: 16px;
  margin-top: 8px;
}

.translate-history-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a2332;
  margin-bottom: 10px;
}

.translate-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.translate-history-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  padding: 24px;
}

.translate-history-item {
  background: #f5f7fb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.translate-history-item:hover {
  background: #eef2f7;
  border-color: #c5cbd3;
}

.translate-history-item .th-time {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.translate-history-item .th-orig {
  font-size: 13px;
  color: #1a2332;
  margin-bottom: 2px;
}

.translate-history-item .th-trans {
  font-size: 13px;
  color: #0f5132;
  font-weight: 500;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input, .search-box select {
  padding: 10px 15px;
  border: 1px solid #ddd;   /* 搜索框边框颜色: 浅灰 */
  border-radius: 8px;
  font-size: 14px;   /* 搜索框字号: 中 */
}

.search-box input {
  flex: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;   /* 表格行分割线颜色: 浅灰 */
}

th {
  background: #f8f8f8;   /* 表格表头背景色: 极浅灰 */
  font-weight: 600;
  font-size: 13px;   /* 表格表头字号: 小 */
  color: #666;   /* 表格表头文字颜色: 中灰 */
}

td {
  font-size: 14px;   /* 表格单元格字号: 中 */
}

tr:hover {
  background: #f8f8f8;   /* 表格行悬停背景色: 极浅灰 */
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;   /* 状态徽标字号: 特小 */
}

.status-active {
  background: #e8f5e9;   /* 启用状态徽标背景色: 浅绿 */
  color: #2e7d32;   /* 启用状态徽标文字颜色: 深绿 */
}

.status-disabled {
  background: #ffebee;   /* 禁用状态徽标背景色: 浅红 */
  color: #c62828;   /* 禁用状态徽标文字颜色: 深红 */
}

.status-pending {
  background: #fff3e0;   /* 待处理状态徽标背景色: 浅橙 */
  color: #e65100;   /* 待处理状态徽标文字颜色: 深橙 */
}

.status-won {
  background: #e3f2fd;   /* 已中奖状态徽标背景色: 浅蓝 */
  color: #1565c0;   /* 已中奖状态徽标文字颜色: 深蓝 */
}

.status-lost {
  background: #f5f5f5;   /* 未中奖状态徽标背景色: 浅灰 */
  color: #666;   /* 未中奖状态徽标文字颜色: 中灰 */
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;   /* 分页按钮边框颜色: 浅灰 */
  background: white;   /* 分页按钮背景色: 白色 */
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover, .pagination button.active {
  background: #c62828;   /* 分页按钮悬停/选中背景色: 深红 */
  color: white;   /* 分页按钮悬停/选中文字颜色: 白色 */
  border-color: #c62828;   /* 分页按钮悬停/选中边框颜色: 深红 */
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 100%;
  max-width: 500px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;   /* 弹窗标题字号: 大 */
  font-weight: bold;
}

.modal-close {
  cursor: pointer;
  font-size: 24px;   /* 弹窗关闭按钮字号: 特大 */
  color: #999;   /* 弹窗关闭按钮文字颜色: 中灰 */
  background: none;
  border: none;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 15px 25px;
  background: #333;   /* 默认Toast背景色: 深灰 */
  color: white;   /* Toast文字颜色: 白色 */
  border-radius: 8px;
  z-index: 3000;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  background: #2e7d32;   /* 成功Toast背景色: 深绿 */
}

.toast.error {
  background: #c62828;   /* 错误Toast背景色: 深红 */
}

.toast.warning {
  background: #e65100;   /* 警告Toast背景色: 深橙 */
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.section-title {
  font-size: 20px;   /* 大分区标题字号: 超大 */
  font-weight: bold;
  margin: 30px 0 20px;
  color: #333;   /* 大分区标题文字颜色: 深灰 */
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;   /* 空状态提示文字颜色: 浅灰 */
}

.empty-state-icon {
  font-size: 60px;   /* 空状态图标字号: 特大 */
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;   /* Tabs底部分割线颜色: 浅灰 */
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s;
}

.tab.active {
  border-bottom-color: #c62828;   /* 选中Tab底部高亮线颜色: 深红 */
  color: #c62828;   /* 选中Tab文字颜色: 深红 */
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.banner {
  background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);   /* 活动Banner渐变背景色: 深红渐变 */
  border-radius: 12px;
  padding: 30px;
  color: white;   /* 活动Banner文字颜色: 白色 */
  margin-bottom: 30px;
  text-align: center;
}

.banner h2 {
  font-size: 28px;   /* 活动Banner大标题字号: 特大 */
  margin-bottom: 10px;
}

.banner p {
  font-size: 16px;   /* 活动Banner说明文字字号: 中偏大 */
  opacity: 0.9;
}

.promotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.promotion-card {
  background: white;   /* 活动卡片背景色: 白色 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.promotion-image {
  height: 150px;
  background: linear-gradient(135deg, #ff6f00 0%, #e65100 100%);   /* 活动卡片图区渐变背景色: 橙色渐变 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;   /* 活动卡片图区图标字号: 特大 */
  color: white;   /* 活动卡片图区图标颜色: 白色 */
}

.promotion-body {
  padding: 20px;
}

.promotion-title {
  font-size: 16px;   /* 活动卡片标题字号: 中偏大 */
  font-weight: bold;
  margin-bottom: 8px;
}

.promotion-desc {
  font-size: 13px;   /* 活动卡片说明字号: 小 */
  color: #666;   /* 活动卡片说明文字颜色: 中灰 */
  margin-bottom: 15px;
}

.promotion-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #ff6f00 0%, #e65100 100%);   /* 活动按钮渐变背景色: 橙色渐变 */
  color: white;   /* 活动按钮文字颜色: 白色 */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.footer {
  background: #333;   /* 页脚背景色: 深灰 */
  color: #999;   /* 页脚默认文字颜色: 浅灰 */
  padding: 30px 0;
  margin-top: 50px;
  text-align: center;
}

.footer a {
  color: #ccc;   /* 页脚链接文字颜色: 浅灰白 */
  text-decoration: none;
}

.footer a:hover {
  color: white;   /* 页脚链接悬停文字颜色: 白色 */
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.footer-copy {
  font-size: 13px;   /* 页脚版权信息字号: 小 */
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;   /* 移动端底部导航背景色: 白色 */
  border-top: 1px solid #eee;   /* 移动端底部导航顶部分割线颜色: 浅灰 */
  padding: 10px 0;
  z-index: 1000;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 15px;
  color: #666;   /* 移动端导航项默认文字颜色: 中灰 */
  text-decoration: none;
  font-size: 12px;   /* 移动端导航项字号: 特小 */
}

.mobile-nav-item.active {
  color: #c62828;   /* 移动端导航项选中文字颜色: 深红 */
}

.mobile-nav-item .icon {
  font-size: 24px;   /* 移动端导航图标字号: 特大 */
  margin-bottom: 3px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

/* ============ 移动端响应式适配 (≤768px) ============ */
@media (max-width: 768px) {
  /* 隐藏PC端导航，显示移动端导航 */
  .nav {
    display: none;
  }
  
  .mobile-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--theme-panel-bg);   /* 移动端底部导航背景色: 深青绿 */
    border-top: 1px solid rgba(255,255,255,0.15);   /* 底部导航顶部分割线: 半透明白色 */
    padding: 6px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  }

  .mobile-nav-items {
    display: flex;
    justify-content: space-around;
    max-width: 500px;
    margin: 0 auto;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
    color: var(--theme-text-muted);   /* 移动端导航默认文字颜色: 浅蓝灰 */
    text-decoration: none;
    font-size: 11px;   /* 移动端导航文字字号: 特小 */
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item.active {
    color: var(--theme-primary);   /* 移动端导航选中文字颜色: 主红色 */
  }

  .mobile-nav-item .icon {
    font-size: 22px;   /* 移动端导航图标字号: 大 */
    margin-bottom: 2px;
  }
  
  body {
    padding-bottom: 70px;   /* 为底部导航留出空间 */
    font-size: 14px;   /* 移动端基础字号: 中 */
  }

  /* 头部导航移动端适配 */
  .header {
    padding: 10px 0;
    position: sticky;
  }

  .header .container {
    padding: 0 10px;
  }

  .logo span {
    display: none;   /* 隐藏Logo文字，节省空间 */
  }

  .logo {
    font-size: 18px;   /* 移动端Logo字号: 大 */
  }

  .user-info {
    gap: 8px;
  }

  .balance {
    padding: 6px 10px;
    font-size: 13px;   /* 移动端余额字号: 小 */
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;   /* 移动端按钮字号: 小 */
  }

  .btn-wallet, .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;   /* 移动端小按钮字号: 特小 */
  }

  /* 主内容区适配 */
  .container {
    padding: 0 10px;
  }

  /* 首页网格布局 */
  .grid-4, .grid-3 {
    grid-template-columns: 1fr;   /* 移动端单列布局,避免内容撑开溢出 */
    gap: 10px;
  }

  .grid-3 > *, .grid-4 > * {
    min-width: 0;   /* 允许grid子项收缩,防止内容min-width撑开 */
  }

  /* 游戏管理/后台侧栏适配 */
  .admin-sidebar {
    width: 60px;
    overflow: hidden;
  }

  .admin-sidebar .admin-menu li span:not(.icon) {
    display: none;
  }

  .admin-main {
    margin-left: 60px;
    padding: 15px;
  }

  /* 购彩页适配 */
  .game-page {
    padding: 10px 0;
  }

  .game-header {
    padding: 15px;
    margin-bottom: 10px;
  }

  .game-title {
    font-size: 16px;   /* 移动端游戏标题字号: 中偏大 */
    margin-bottom: 10px;
  }

  .game-info {
    flex-direction: column;
    gap: 10px;
  }

  /* 倒计时卡片适配 */
  .countdown {
    padding: 10px 15px;
    width: 100%;
    text-align: center;
  }

  .countdown-label {
    font-size: 11px;   /* 移动端倒计时标签字号: 极小 */
  }

  .countdown-time {
    font-size: 24px;   /* 移动端倒计时数字字号: 特大 */
  }

  .current-period {
    font-size: 14px;   /* 移动端期号字号: 中 */
    text-align: center;
  }

  /* 最新开奖适配 */
  .last-draw {
    padding: 15px;
    margin-bottom: 10px;
  }

  .last-draw-title {
    font-size: 14px;   /* 移动端最新开奖标题字号: 中 */
    margin-bottom: 10px;
  }

  .number-ball {
    width: 32px;
    height: 32px;
    font-size: 14px;   /* 移动端开奖号码球字号: 中 */
  }

  .dice {
    width: 32px;
    height: 32px;
    padding: 4px;
  }

  .dice-dot {
    width: 7px;
    height: 7px;
  }

  .dice-face-number {
    font-size: 14px;   /* 移动端大骰子数字字号: 中 */
  }

  .draw-info {
    font-size: 13px;   /* 移动端开奖信息字号: 小 */
    gap: 15px;
  }

  /* 下注区适配 */
  .bet-section {
    padding: 15px;
    margin-bottom: 10px;
  }

  .bet-title {
    font-size: 14px;   /* 移动端下注区标题字号: 中 */
  }

  .bet-options {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .bet-option {
    padding: 10px 8px;
  }

  .bet-option-name {
    font-size: 13px;   /* 移动端下注选项名称字号: 小 */
  }

  .bet-option-odds {
    font-size: 11px;   /* 移动端赔率字号: 极小 */
  }

  /* 统一网格布局移动端适配 (模仿9tt406快三) */
  .unified-bet-grid {
    gap: 8px;   /* 移动端网格间距: 8px */
    grid-column: 1 / -1;
    width: 100%;
  }

  .unified-option {
    height: 48px;   /* 移动端选项高度: 48px */
    padding: 0;
  }

  .unified-option-name {
    font-size: 17px;   /* 移动端选项名称字号: 中偏大 */
  }

  .unified-option-odds {
    font-size: 12px;   /* 移动端赔率字号: 小 */
  }

  .bet-option-desc {
    font-size: 10px;   /* 移动端下注说明字号: 极小 */
  }

  .bet-group-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 10px;
  }

  .bet-option-base {
    padding: 8px 3px;
  }

  /* 和值下注网格适配 */
  .sum-bet-name {
    font-size: 15px;   /* 移动端和值数字字号: 中偏大 */
  }

  .sum-bet-payout {
    font-size: 10px;   /* 移动端和值赔率字号: 极小 */
  }

  .sum-bet-row {
    grid-template-columns: repeat(3, 1fr);   /* 移动端每行3个 */
  }

  /* 下注表单适配 */
  .bet-form {
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
  }

  /* 移动端显示固定底栏 */
  .fixed-bet-bar {
    display: flex;   /* 移动端显示底栏 */
  }

  body {
    padding-bottom: 52px;   /* 为底栏留出空间 */
  }

  .bet-amount input {
    font-size: 16px;   /* 移动端下注金额字号: 大 (防止iOS缩放) */
    padding: 10px 14px;
  }

  /* 投注汇总适配 */
  .bet-summary {
    padding: 15px;
  }

  .bet-summary-title {
    font-size: 14px;   /* 移动端汇总标题字号: 中 */
  }

  .bet-total {
    font-size: 16px;   /* 移动端下注总额字号: 中偏大 */
  }

  /* 历史开奖表格适配 */
  .history-draws {
    padding: 12px;
  }

  .history-title {
    font-size: 14px;   /* 移动端历史标题字号: 中 */
  }

  .history-list {
    max-height: 300px;
  }

  .history-table {
    font-size: 12px;   /* 移动端历史表格字号: 特小 */
  }

  .history-table thead th {
    font-size: 11px;   /* 移动端表头字号: 极小 */
    padding: 4px 1px !important;   /* 收紧表头内边距,配合fixed列宽靠拢 */
    letter-spacing: 0;
  }

  .history-table tbody td {
    padding: 3px 1px;
  }

  /* 旧类名兼容(若存在col-period等),统一收紧 */
  .history-table .col-period {
    width: 20%;
    font-size: 10px;
  }

  .history-table .col-sum {
    width: 10%;
    font-size: 12px;
  }

  .history-table .col-size,
  .history-table .col-parity {
    width: 21%;
  }

  .history-tag {
    width: 24px;
    height: 24px;
    font-size: 12px;   /* 移动端大小单双标签字号: 特小 */
  }

  .history-dice {
    width: 22px;
    height: 22px;
  }

  .history-dice-face-number {
    font-size: 9px;   /* 移动端历史骰子数字字号: 极小 */
  }

  /* 待开奖列表适配 */
  .pending-bets {
    padding: 15px;
  }

  .pending-title {
    font-size: 14px;   /* 移动端待开奖标题字号: 中 */
  }

  .pending-detail {
    font-size: 11px;   /* 移动端待开奖详情字号: 极小 */
  }

  /* 卡片通用适配 */
  .card {
    margin-bottom: 10px;
  }

  .card-header {
    padding: 15px;
  }

  .card-icon {
    font-size: 32px;   /* 移动端卡片图标字号: 中等偏大 */
  }

  .card-icon .game-icon-img {
    width: 42px;
    height: 42px;
  }

  .history-period {
    width: 110px;
  }

  .history-period .game-icon-img {
    width: 18px;
    height: 18px;
  }

  .card-title {
    font-size: 15px;   /* 移动端卡片标题字号: 中偏大 */
  }

  .card-subtitle {
    font-size: 12px;   /* 移动端卡片副标题字号: 特小 */
  }

  .card-info {
    font-size: 12px;   /* 移动端卡片信息字号: 特小 */
    flex-direction: column;
    gap: 3px;
  }

  /* Banner适配 */
  .banner {
    padding: 20px 15px;
  }

  .banner h2 {
    font-size: 20px;   /* 移动端Banner标题字号: 超大 */
  }

  .banner p {
    font-size: 14px;   /* 移动端Banner说明字号: 中 */
  }

  /* 活动卡片适配 */
  .promotion-grid {
    grid-template-columns: 1fr;   /* 移动端单列布局 */
  }

  .promotion-title {
    font-size: 14px;   /* 移动端活动卡片标题字号: 中 */
  }

  .promotion-desc {
    font-size: 12px;   /* 移动端活动说明字号: 特小 */
  }

  /* 弹窗适配 */
  .modal-content {
    margin: 10px;
    padding: 20px;
    max-width: none;
    width: auto;
  }

  .modal-title {
    font-size: 16px;   /* 移动端弹窗标题字号: 中偏大 */
  }

  /* Toast通知适配 */
  .toast {
    top: auto;
    bottom: 75px;   /* 显示在底部导航上方 */
    right: 10px;
    left: 10px;
    padding: 12px 20px;
    font-size: 14px;   /* 移动端Toast字号: 中 */
    text-align: center;
  }

  /* 表单适配 */
  .form-label {
    font-size: 13px;   /* 移动端表单标签字号: 小 */
  }

  .form-input {
    font-size: 16px;   /* 移动端输入框字号: 大 (防止iOS缩放) */
  }

  .auth-card {
    padding: 25px 20px;
    margin: 10px;
    max-width: 100%;
  }

  .auth-title {
    font-size: 20px;   /* 移动端登录标题字号: 超大 */
  }

  .auth-logo-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;   /* 移动端登录图标字号: 超大 */
  }

  /* 后台表格适配 */
  table {
    font-size: 12px;   /* 移动端后台表格字号: 特小 */
  }

  th, td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .stat-value {
    font-size: 22px;   /* 移动端统计数值字号: 超大 */
  }

  .admin-title {
    font-size: 20px;   /* 移动端后台标题字号: 超大 */
  }

  .section-title {
    font-size: 16px;   /* 移动端分区标题字号: 中偏大 */
  }

  /* 触控优化 */
  button, .btn, .bet-option, .sum-bet-option {
    min-height: 44px;   /* 移动端最小触控目标: 44px */
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .bet-option-name, .bet-option-odds {
    pointer-events: none;   /* 防止文字误触 */
  }
}

/* 小屏幕手机适配 (≤380px) */
@media (max-width: 380px) {
  .grid-4, .grid-3 {
    grid-template-columns: 1fr;   /* 超小屏幕单列 */
  }

  .history-table .col-period {
    width: 20%;
    font-size: 9px;   /* 超小屏期号字号: 极小 */
  }

  .history-table .col-sum {
    width: 10%;
    font-size: 12px;   /* 超小屏和值字号: 极小 */
  }

  .history-tag {
    width: 20px;
    height: 20px;
    font-size: 11px;   /* 超小屏大小单双标签字号: 极小 */
    border-radius: 3px;
  }

  .mobile-nav-item {
    font-size: 10px;   /* 超小屏导航字号: 极小 */
    padding: 4px 6px;
  }

  .mobile-nav-item .icon {
    font-size: 18px;   /* 超小屏导航图标字号: 中 */
  }

  .number-ball {
    width: 28px;
    height: 28px;
    font-size: 12px;   /* 超小屏号码球字号: 极小 */
  }

  .bet-group-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .sum-bet-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============ 管理后台移动端适配 ============ */
.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--theme-text);
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  margin-right: 10px;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  }

  .admin-sidebar.mobile-show {
    left: 0;
  }

  .admin-sidebar .admin-menu li span:not(.icon) {
    display: inline;
  }

  .admin-main {
    margin-left: 0 !important;
    width: 100%;
  }

  .admin-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 15px;
  }

  .admin-title {
    font-size: 16px;   /* 移动端后台标题字号: 中偏大 */
    flex: 1;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 15px 10px;
  }

  .stat-value {
    font-size: 20px;   /* 移动端统计数值字号: 超大 */
  }

  /* 后台表格移动端滚动 */
  .admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  /* 后台按钮组适配 */
  .admin-actions {
    flex-wrap: wrap;
    gap: 5px;
  }

  .admin-actions .btn {
    padding: 5px 10px;
    font-size: 12px;   /* 移动端后台操作按钮字号: 特小 */
  }
}

@media (max-width: 380px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-title {
    font-size: 14px;   /* 超小屏后台标题字号: 中 */
  }
}

/* ============ 移动端历史开奖卡片视图 (≤380px) ============ */
.history-cards-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-card-mobile {
  background: var(--theme-bg-light);   /* 移动端卡片背景色: 浅青绿 */
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-card-period {
  font-size: 11px;   /* 移动端卡片期号字号: 极小 */
  color: var(--theme-text-muted);   /* 移动端卡片期号颜色: 浅蓝灰 */
  margin-bottom: 6px;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.history-card-numbers {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;   /* 移动端卡片信息字号: 小 */
}

.history-card-sum {
  font-weight: bold;
  color: var(--theme-text);   /* 移动端卡片和值颜色: 白色 */
}

/* 移动端下注按钮组触控优化 */
.bet-group-row,
.sum-bet-row {
  touch-action: manipulation;
}

/* 移动端输入框优化 (防止iOS自动缩放) */
@media screen and (max-width: 768px) {
  input[type="number"],
  input[type="text"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;   /* 防止iOS自动缩放页面 */
  }
}

/* 移动端下注区域优化 */
@media (max-width: 480px) {
  .bet-options {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .bet-group-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .bet-option-base {
    padding: 6px 2px;
    font-size: 12px;
  }

  .sum-bet-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .sum-bet-option {
    padding: 6px 4px;
  }

  .sum-bet-name {
    font-size: 13px;
  }
}

/* 移动端横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    padding: 5px 0;
  }

  .game-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .last-draw {
    padding: 10px;
  }

  .number-ball,
  .dice {
    width: 25px;
    height: 25px;
  }

  .dice-dot {
    width: 5px;
    height: 5px;
  }
}

/* ============ 拖拽编辑器样式 ============ */

/* 编辑模式切换按钮 */
.edit-toggle-btn {
  position: fixed;
  right: 20px;
  bottom: 100px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  z-index: 9998;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.edit-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.edit-toggle-btn.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
}

.edit-toggle-icon {
  font-size: 20px;
  line-height: 1;
}

.edit-toggle-text {
  font-size: 10px;
  color: white;
  margin-top: 2px;
}

/* 编辑工具栏 */
.edit-toolbar {
  position: fixed;
  top: 10px;
  right: 10px;
  background: white;
  border-radius: 12px;
  padding: 10px 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.save-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.reset-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.size-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.size-btn.active {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.edit-hint {
  font-size: 12px;
  color: #666;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #eee;
}

/* 编辑模式下的面板样式 */
body.edit-mode .drag-panel {
  position: relative !important;
  outline: 2px dashed #667eea;
  outline-offset: -2px;
  cursor: move;
  transition: box-shadow 0.2s;
  margin: 10px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.edit-mode .drag-panel:hover {
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
  outline-color: #764ba2;
}

/* 拖拽手柄 */
.drag-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.9), rgba(102, 126, 234, 0.5));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: grab;
  border-radius: 12px 12px 0 0;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

body.edit-mode .drag-panel:hover .drag-handle {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

/* 调整大小手柄 */
.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, transparent 50%, #667eea 50%);
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

body.edit-mode .drag-panel:hover .resize-handle {
  opacity: 1;
}

/* 调整大小模式下的样式 */
body.resize-mode .drag-panel {
  cursor: default;
}

body.resize-mode .drag-panel:hover {
  outline-color: #fa709a;
}

body.resize-mode .resize-handle {
  opacity: 1;
  width: 30px;
  height: 30px;
}

/* 编辑模式下隐藏底部导航 */
body.edit-mode .mobile-nav {
  display: none !important;
}

body.edit-mode {
  padding-bottom: 20px !important;
}

/* 编辑模式下添加网格背景 */
body.edit-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}

body.edit-mode .container {
  position: relative;
  z-index: 1;
}

/* 编辑模式下面板内容半透明 */
body.edit-mode .drag-panel > *:not(.drag-handle):not(.resize-handle) {
  opacity: 0.6;
  pointer-events: none;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .edit-toggle-btn {
    right: 15px;
    bottom: 90px;
    width: 50px;
    height: 50px;
  }

  .edit-toggle-icon {
    font-size: 16px;
  }

  .edit-toggle-text {
    font-size: 9px;
  }

  .edit-toolbar {
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .edit-btn {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    min-width: 60px;
  }

  .edit-hint {
    width: 100%;
    margin-left: 0;
    margin-top: 5px;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid #eee;
    padding-top: 5px;
    text-align: center;
  }
}

/* 拖拽中的样式 */
.dragging {
  opacity: 0.8 !important;
  z-index: 10000 !important;
  transform: scale(1.02);
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4) !important;
}

/* 保存成功动画 */
@keyframes saveSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.save-animation {
  animation: saveSuccess 0.3s ease;
}

/* ============ 9tt406.com 超级3分快3 完整移动端布局 (模仿) ============ */
/* 色板来源:
   页面主背景:    #1a472a  深墨绿
   开奖面板背景:  #19593C  中绿
   投注区背景:    #317455  浅绿
   头部/底栏:     #000000  纯黑
   Tab底栏左侧:   #2c2c2c  深灰
   投注按钮红:    #dc3b40  大红
   清空按钮橙:    #ff9900  橙色
   文字主色:      #ffffff  白色
   文字辅助色:    #caebda  浅绿白
   骰子背景:      (使用白色方块+黑点,替代 sprite 图)
   大小红块:      #cc5848  砖红 (18x18)
   大小蓝块:      #2e93b0  蓝   (18x18)
*/

/* 重置旧的购彩页面桌面布局，启用新的移动端全屏布局 */
body.mobile-only {
  background: #0d2818;   /* 外围画布背景色: 更深墨绿 (PC访问时手机两侧深色留白) */
  color: #fff;           /* 页面文字主色: 白色 */
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.mobile-only .header,
body.mobile-only .container,
body.mobile-only .game-header,
body.mobile-only .last-draw,
body.mobile-only .grid.grid-3,
body.mobile-only .bet-section,
body.mobile-only .bet-summary,
body.mobile-only .pending-bets,
body.mobile-only .history-draws,
body.mobile-only .mobile-nav {
  display: none !important;
}

body.mobile-only .toast {
  z-index: 9999;
}

body.mobile-only {
  padding-bottom: 52px;   /* 底部固定栏预留高度: 52px */
}

/* === 根容器 (h-screen) === */
.mobile-app {
  min-height: 100vh;
  max-width: 420px;         /* 手机画布最大宽度: 420px (与常见手机竖屏一致,PC访问两侧留深色边) */
  margin: 0 auto;           /* 画布在PC窗口居中 */
  background: #1a472a;      /* 画布内部主背景色: 深墨绿 (9tt406同款) */
  color: #fff;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  overflow-x: hidden !important;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);   /* PC画布阴影: 强化手机屏感觉 */
}

/* === 顶部黑色栏 (sticky top-0) === */
.mobile-header {
  background: #000;           /* 头部背景色: 纯黑 */
  padding: 12px 12px 12px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-header-left {
  display: flex;
  align-items: center;
  margin-top: 2px;
  cursor: pointer;
}

.mobile-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-title {
  color: #fff;              /* 主标题文字颜色: 白色 */
  font-size: 16px;          /* 主标题字号: 中 */
  font-weight: 500;
  margin-bottom: 4px;
}

.mobile-playtype {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.mobile-playtype-label {
  display: flex;
  flex-direction: column;
  font-size: 14.7px;        /* "玩法"两字竖排字号 */
  line-height: 1.1;
  color: #fff;              /* "玩法"文字颜色: 白色 */
  margin-right: 8px;
}

.mobile-playtype-select {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.5);   /* 下拉框边框: 半透明白色 */
  border-radius: 4px;
  padding: 0 8px 0 12px;
  cursor: pointer;
  color: #fff;              /* 下拉框文字颜色: 白色 */
  font-size: 16px;          /* 下拉框字号: 中 */
}

.mobile-header-right {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px;
}

/* === Tab栏 (黑色: 我要投注 / 余额) === */
.mobile-tabs {
  background: #000;           /* Tab栏背景色: 纯黑 */
  padding: 0 16px 4px 16px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid #333;   /* Tab栏下边框色: 深灰 */
  font-size: 14px;                 /* Tab栏字号: 小 */
}

.mobile-tabs-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.mobile-tab {
  border-bottom: 2px solid #fff;   /* 激活Tab下边框色: 白色粗线 */
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  color: #fff;
  display: flex;
  align-items: center;
}

.mobile-tab.tab-muted {
  color: #9ca3af;             /* 非激活Tab文字颜色: 灰 #9ca3af */
  border-bottom: 2px solid transparent;
}

.mobile-tab.tab-muted:hover {
  color: #d1d5db;             /* 非激活Tab悬停颜色: 浅灰 */
}

.mobile-tabs-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}

.mobile-balance-label {
  color: #fff;               /* "余额"标签文字颜色: 白色 */
  margin-right: 2px;
}

.mobile-balance-value {
  color: #fff;               /* 余额数字颜色: 白色 */
  font-weight: 500;
}

.wallet-icon {
  width: 20px;               /* 钱包图标尺寸: 20px */
  height: 20px;
  color: #fff;               /* 钱包图标颜色: 白色 */
  fill: currentColor;
}

.mobile-recharge {
  color: #eab308;            /* "充值"按钮文字颜色: 黄 */
  font-size: 13px;           /* "充值"字号: 小 */
  cursor: pointer;
  margin-left: 4px;
  padding: 2px 6px;
}

/* === 开奖信息 2列面板 === */
.draw-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 2列等宽布局: 左开奖/右截止倒计时 */
  background: #19593C;          /* 开奖面板背景色: 中绿 */
  position: relative;
  z-index: 10;
}

.draw-left {
  padding: 0 8px 0 8px;
  border-right: 1px solid rgba(255,255,255,0.2);   /* 2列分割线: 半透明白 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.draw-left-label {
  font-size: 13px;              /* 左栏期号标签字号: 小 */
  color: #caebda;              /* 左栏期号文字颜色: 浅绿白 */
  margin-top: 4px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.draw-left-content {
  display: flex;
  align-items: center;
  padding-bottom: 0;
  min-height: 44px;
}

.draw-dice {
  display: flex;
  gap: 1.2px;                 /* 骰子间距: 1.2px (极小) */
  align-items: center;
}

.draw-dice-empty {
  color: #9ca3af;             /* 空状态文字颜色: 灰 */
  font-size: 12px;
}

.toggle-history-btn {
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.toggle-history-btn svg {
  transition: transform 0.3s ease;   /* 折叠/展开旋转动画: 0.3s */
}

.toggle-history-btn.open svg {
  transform: rotate(180deg);   /* 展开时箭头旋转: 180度 */
}

.draw-right {
  padding: 0 8px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.draw-right-label {
  font-size: 13px;              /* 右栏期号标签字号: 小 */
  color: #caebda;              /* 右栏期号文字颜色: 浅绿白 */
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.countdown-big {
  font-size: 24px;              /* 倒计时大字号: 特大 */
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #caebda;              /* 倒计时文字颜色: 浅绿白 */
  font-weight: 500;
  line-height: 1.2;
}

/* === 可折叠历史开奖面板 (默认收起, 展开时覆盖下注区) === */
.history-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #19593C;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.history-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid #000;   /* 历史面板顶部分割线: 黑色 */
  z-index: 5;
}
/* === 历史开奖面板 — 默认显示12期, 可滚动查看更多 === */
.history-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #19593C;
  width: 100%;
  box-sizing: border-box;
}

.history-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #19593C;
  font-size: 12px;
  box-sizing: border-box;
}

.history-head-row {
  display: flex;
  width: 100%;
  background: #19593C;
  border-top: 1px solid #477A63;
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  z-index: 20;
}

.history-head-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  color: #caebda;
  font-weight: normal;
  font-size: 12px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 列宽比例: 期号22 | 分割2 | 号码34 | 和值10 | 大小22 | 单双8 = 98 */
.history-head-row .th-period  { flex: 22; }
.history-head-row .th-divider  { flex: 2;  padding: 0; position: relative; }
.history-head-row .th-numbers { flex: 34; }
.history-head-row .th-sum     { flex: 10; }
.history-head-row .th-size    { flex: 22; }
.history-head-row .th-parity  { flex: 8; }

/* 数据行 — flex 布局,与表头同比例 */
.history-row {
  display: flex;
  width: 100%;
  background: #19593C;
  border-bottom: none;
  margin-bottom: 2px;
  box-sizing: border-box;
}

.history-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  color: #d1d5db;
  font-size: 12px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}

/* 行内列宽比例与表头一致 (期号22, 分割2, 单双8) */
.history-row .td-period,
.history-row .period-cell    { flex: 22; font-size: 10px; font-weight: bold; }
.history-row .td-divider     { flex: 2;  padding: 0; position: relative; }
.history-row .td-numbers     { flex: 34; }
.history-row .td-sum         { flex: 10; color: #bcc7c1; font-size: 12px; font-weight: bold; }
.history-row .td-size        { flex: 22; }
.history-row .td-parity      { flex: 8; }

/* 分割线装饰 - 连续无缺口的竖线,跨越行间距 */
.th-divider::before,
.td-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: rgba(0,0,0,0.8);
  transform: translateX(-50%);
}

.th-divider::after,
.td-divider::after {
  content: none;
  display: none;
}

/* 骰子容器 */
.history-dice-wrap {
  display: flex;
  gap: 1px;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible;
}

.sz-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;                    /* 正方形标签宽度: 18px */
  height: 18px;                   /* 正方形标签高度: 18px */
  border-radius: 4px;             /* 标签圆角: 小 */
  font-size: 14px;                /* 标签文字字号: 中 */
  color: #d8d8d8;                    /* 标签文字颜色: 暗白 */
  margin: 0 auto;
  line-height: 1;
  padding: 0;
}

.sz-tag.sz-red {
  background: #a8443a;            /* 红块背景色: 暗砖红 (大/双) */
}

.sz-tag.sz-blue {
  background: #1f7591;            /* 蓝块背景色: 暗蓝 (小/单) */
}

/* 收起按钮 (历史面板底部) */
.collapse-history-btn {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  background: #19593C;            /* 收起按钮背景色: 中绿 */
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 0 0 8px 8px;
  height: 34px;
  font-size: 13px;                /* 收起按钮文字字号: 小 */
  color: #fff;                    /* 收起按钮文字颜色: 白 */
  cursor: pointer;
  white-space: nowrap;
}

.check-icon {
  width: 13.5px;
  height: 13.5px;
  fill: currentColor;
  overflow: hidden;
  vertical-align: middle;
}

.source-icon {
  height: 13px;
  width: 13px;
  margin-left: 12px;
  fill: none;
}

.collapse-text {
  color: #fff;                    /* 收起按钮文字颜色: 白 */
}

/* === 投注主体滚动区 === */
.bet-main-area {
  flex: 1;
  overflow: hidden;
  background: #317455;            /* 投注区外背景色: 浅绿 */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 投注选项区容器 — 历史面板展开时仅覆盖此区域, 不影响底部"我的投注" */
.bet-scroll-wrap {
  flex: 1;
  position: relative;             /* 作为 .history-panel 绝对定位的参照 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bet-scroll {
  padding: 12px 0 16px 0;
  overflow-y: auto;
  flex: 1;
}

.bet-hint {
  text-align: center;
  margin: 8px 12px 12px 12px;
  font-size: 13.5px;              /* 玩法提示字号: 小 */
  color: #d1d5db;                /* 玩法提示文字颜色: 浅灰 */
}

.bet-content-wrap {
  flex: 1;
  padding: 0 16px 28px 16px;
}

/* === 投注选项 4列网格 (模仿9tt406) === */
.bet-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unified-bet-grid {
  display: contents;
}

.base-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 大小单双4列等宽 */
  gap: 8px;
  margin-bottom: 4px;
}

.sum-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 和值3-18 4列等宽 */
  column-gap: 8px;
  row-gap: 8px;
  margin-bottom: 8px;
}

.unified-option {
  border: 1px solid rgba(255,255,255,0.5);   /* 投注选项边框: 半透明白色 */
  background: transparent;                   /* 投注选项默认背景: 透明 */
  color: #fff;                               /* 投注选项文字颜色: 白 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: background 0.15s;
  height: 48px;                              /* 投注选项高度: 48px 正方形网格 */
  padding: 0;
  border-radius: 0;
  user-select: none;
}

.unified-option:hover {
  background: #40916c;                       /* 悬停背景色: 绿色 */
}

.unified-option.selected {
  background: #40916c;                       /* 选中背景色: 绿色 */
  border-color: #fff;                        /* 选中边框色: 白色加粗感 */
}

.unified-option-name {
  font-size: 18px;                           /* 投注选项名称字号: 大 */
  line-height: 1;
  margin-bottom: 2px;
  color: #fff;
}

.unified-option-odds {
  font-size: 13px;                           /* 投注选项赔率字号: 小 */
  line-height: 1;
  color: #fff;
}

/* === 金额输入 + 快捷金额 (模仿9tt406布局) === */
.bet-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px 0;
}

.bet-amount-input-wrap {
  flex: 1;
}

.bet-amount-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.3);   /* 输入框边框: 半透明白 */
  border-radius: 8px;
  background: rgba(0,0,0,0.15);             /* 输入框背景: 半透明黑 */
  color: #fff;                               /* 输入框文字颜色: 白 */
  font-size: 15px;                           /* 输入框字号: 中 */
  outline: none;
}

.bet-amount-input::placeholder {
  color: rgba(255,255,255,0.5);             /* 占位符颜色: 半透明白 */
}

.btn-bet-confirm {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 15px;                           /* 确认下注按钮字号: 中 */
}

.bet-quick-amounts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.amount-btn {
  flex: 1;
  min-width: 60px;
  padding: 10px 0;
  background: rgba(255,255,255,0.08);       /* 快捷金额按钮背景: 极淡白 */
  color: #fff;                               /* 快捷金额文字颜色: 白 */
  border: 1px solid rgba(255,255,255,0.2);  /* 快捷金额按钮边框: 半透明白 */
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;                           /* 快捷金额字号: 中 */
  transition: background 0.15s;
}

.amount-btn:hover {
  background: rgba(255,255,255,0.18);       /* 悬停背景: 稍不透明 */
}

/* === 我的投注区域表格 (模仿9tt406底部, div+flex布局, 与下注区对齐, 无水平滚动) === */
.my-bets-section {
  padding: 8px 12px 8px 12px;
  background: #317455;            /* 与投注区背景一致: 浅绿 */
  border-top: 1px solid #000;     /* 顶部分割线: 黑色, 与历史面板风格一致 */
  flex-shrink: 0;                 /* 不被压缩, 确保始终可见 */
}

.my-bets-title {
  color: #fff;                               /* 标题文字颜色: 白 */
  font-weight: 800;                          /* 标题字重: 极粗 */
  margin-bottom: 12px;
  font-size: 18px;                           /* 标题字号: 大 */
  padding: 0 0 0 4px;                          /* 与表格内容左对齐 */
}

.my-bets-table-wrap {
  border: 1px solid rgba(255,255,255,0.5);   /* 表格外框: 半透明白 */
  overflow-x: hidden;                           /* 禁用水平滚动 */
}

/* === 我的投注表: div + flex纵向布局 (与历史开奖表格一致结构) === */
.my-bets-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  color: #fff;
  font-size: 12px;                           /* 表格字号: 小, 适配手机宽度 */
  box-sizing: border-box;
  overflow-x: hidden;                        /* 禁用水平滚动 */
}

/* 表头行: flex横向布局 */
.my-bets-head-row {
  display: flex;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.5);   /* 表头底部分割线 */
  box-sizing: border-box;
}

.my-bets-head-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  color: #fff;
  font-weight: normal;
  font-size: 12px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.3);   /* 列分割线(浅) */
}

.my-bets-head-row > div:last-child {
  border-right: none;                          /* 最后一列无右分割线 */
}

/* 数据行: flex横向布局 */
.my-bets-row {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,0.1);   /* 行顶部分割线 */
}

.my-bets-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  color: #fff;
  font-size: 12px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.3);   /* 列分割线 */
}

.my-bets-row > div:last-child {
  border-right: none;                          /* 最后一列无右分割线 */
}

/* 列宽比例 (期号35 | 投注金额22 | 奖金22 | 操作21 = 100 */
/* 手机端可见, 不挤压, 无水平滚动 */
.mb-period { flex: 35; }
.mb-amount { flex: 22; }
.mb-win    { flex: 22; }
.mb-action { flex: 21; }

/* 操作列内部按钮样式 */
.mb-action button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.mb-action button:hover {
  background: rgba(255,255,255,0.15);
}

.my-bets-more {
  text-align: right;
  padding-right: 20px;
  padding-top: 8px;
}

.more-btn {
  background: none;
  border: none;
  color: #fff;                               /* "更多>>"文字颜色: 白 */
  font-size: 13px;                           /* "更多>>"字号: 小 */
  cursor: pointer;
  padding: 4px;
}

/* === 新骰子组件 (实体圆角骰,与9tt406一致) ===
   小骰子(历史表格): 20x20, 圆角5px, 柔阴影, 点径4.8px
   大骰子(最新开奖): 30x30, 圆角7px, 柔阴影, 点径7.2px
   1点/4点: 红点(饱和红), 其余: 黑点(柔黑)
*/
.new-dice {
  width: 20px;                                /* 历史骰子尺寸: 20px (与9tt406一致) */
  height: 20px;
  background: linear-gradient(145deg, #e8e8e8, #c8c8c8);   /* 渐变背景: 中灰调 */
  border: 1px solid #a0a0a0;                  /* 中灰边框 */
  border-radius: 5px;                         /* 圆角5px: 与实体骰子圆弧一致 */
  display: inline-block;
  position: relative;
  padding: 2px;                                /* 对称内边距: 四边均2px (保证内部正方形) */
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3),     /* 外阴影 */
              inset 0 -1px 1px rgba(0,0,0,0.15);   /* 内部底部阴影 */
  filter: contrast(1.15);                      /* 提高对比度(清晰锐利) */
}

.new-dice.dice-lg {
  width: 30px;                                /* 最新开奖大骰子尺寸: 30px */
  height: 30px;
  padding: 3px;                                /* 对称内边距: 四边均3px */
  border-radius: 7px;                         /* 大骰子圆角: 7px */
  box-shadow: 0 1.5px 3px rgba(0,0,0,0.35),  /* 外阴影 */
              inset 0 -1.2px 1.2px rgba(0,0,0,0.18);   /* 内部底部阴影 */
  filter: contrast(1.15);                      /* 提高对比度(清晰锐利) */
}

.new-dice-points {
  width: 100%;
  aspect-ratio: 1/1;                         /* 关键: 保证内部点区域是完美正方形 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;                                  /* 格子间隙, 防止6点贴一起 */
}

/* === Element 4: 第3个骰子点容器字体大小 === */
#numberDisplay .new-dice:nth-child(3) .new-dice-points {
  font-size: 13px;
}

.nd-point {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1;                         /* 关键: 每个格子是完美正方形,点绝对居中 */
}

.nd-point::after {
  content: "";
  width: 4.5px;                              /* 历史骰子点直径: 4.5px (加粗) */
  height: 4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3a3a3a, #0d0d0d 60%, #000);  /* 球面立体渐变 */
  display: block;
  box-shadow: inset 0 -0.5px 0.5px rgba(0,0,0,0.5),   /* 点内部下阴影(立体) */
              0 0.5px 0.5px rgba(255,255,255,0.4);     /* 外凸高光(球面感) */
}

.new-dice.dice-lg .nd-point::after {
  width: 7px;                               /* 大骰子点直径: 7px (整数像素, 渲染一致无子像素差异) */
  height: 7px;
}

/* 1点面: 单点居中, 稍大更醒目 */
.new-dice.dice-lg .new-dice-points.nd-face-1 .nd-point::after {
  width: 9px;
  height: 9px;
}

/* 历史小骰子1点面: 单点加大更醒目 */
.new-dice .new-dice-points.nd-face-1 .nd-point::after {
  width: 6px;
  height: 6px;
}

/* 1点和4点是红点 (饱和红,与9tt406真实骰一致) */
.new-dice.is-red .nd-point::after {
  background: #a8443a;                       /* 红点与大双色块完全一致 */
  box-shadow: none;                          /* 无阴影, 纯色效果 */
}

/* 6个面的点位置 */
.nd-face-1 { grid-template-areas: ". . ." ". c ." ". . ."; }
.nd-face-1 .nd-point:nth-child(1) { grid-area: c; }

.nd-face-2 { grid-template-areas: ". c ." ". . ." ". d ."; }
.nd-face-2 .nd-point:nth-child(1) { grid-area: c; }
.nd-face-2 .nd-point:nth-child(2) { grid-area: d; }

.nd-face-3 { grid-template-areas: "a . ." ". c ." ". . b"; }
.nd-face-3 .nd-point:nth-child(1) { grid-area: a; }
.nd-face-3 .nd-point:nth-child(2) { grid-area: c; }
.nd-face-3 .nd-point:nth-child(3) { grid-area: b; }

.nd-face-4 { grid-template-areas: "a . b" ". . ." "c . d"; }
.nd-face-4 .nd-point:nth-child(1) { grid-area: a; }
.nd-face-4 .nd-point:nth-child(2) { grid-area: b; }
.nd-face-4 .nd-point:nth-child(3) { grid-area: c; }
.nd-face-4 .nd-point:nth-child(4) { grid-area: d; }

.nd-face-5 { grid-template-areas: "a . b" ". c ." "d . e"; }
.nd-face-5 .nd-point:nth-child(1) { grid-area: a; }
.nd-face-5 .nd-point:nth-child(2) { grid-area: b; }
.nd-face-5 .nd-point:nth-child(3) { grid-area: c; }
.nd-face-5 .nd-point:nth-child(4) { grid-area: d; }
.nd-face-5 .nd-point:nth-child(5) { grid-area: e; }

.nd-face-6 { grid-template-areas: "a . b" "c . d" "e . f"; }
.nd-face-6 .nd-point:nth-child(1) { grid-area: a; }
.nd-face-6 .nd-point:nth-child(2) { grid-area: b; }
.nd-face-6 .nd-point:nth-child(3) { grid-area: c; }
.nd-face-6 .nd-point:nth-child(4) { grid-area: d; }
.nd-face-6 .nd-point:nth-child(5) { grid-area: e; }
.nd-face-6 .nd-point:nth-child(6) { grid-area: f; }

/* === 底部固定投注栏 (确认与9tt406对齐) === */
body.mobile-only .fixed-bet-bar {
  display: flex !important;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;                        /* 底栏最大宽度: 420px 与画布一致 */
  background: #000;
  z-index: 100;
  flex-direction: row;
  align-items: stretch;
  height: 52px;                            /* 底栏高度: 52px */
}

body.mobile-only .fixed-bet-bar-left {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  gap: 24px;
  background: #2c2c2c;                      /* 底栏左侧背景: 深灰 */
  height: 52px;
}

body.mobile-only .fixed-clear-btn {
  color: #ff9900;                            /* 清空按钮文字颜色: 橙色 */
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;                           /* 清空按钮字号: 中 */
  margin-right: 16px;
  padding: 4px;
}

body.mobile-only .fixed-bet-count {
  color: #fff;                               /* 注数文字颜色: 白 */
  font-size: 14px;
}

body.mobile-only .fixed-submit-btn {
  color: #fff;                               /* 投注按钮文字颜色: 白 */
  background: #dc3b40;                       /* 投注按钮背景色: 大红 */
  border: none;
  border-radius: 0;
  padding: 0 24px;
  font-size: 18px;                           /* 投注按钮字号: 大 */
  cursor: pointer;
  height: 52px;
  white-space: nowrap;
  font-weight: 500;
}

/* 桌面端兼容: 即使在 > 768px 也显示移动端全屏布局 */
@media (min-width: 0px) {
  body.mobile-only .fixed-bet-bar { display: flex !important; }
}

/* 当浏览器窗口比手机宽时，保证固定栏居中对齐 */
body.mobile-only {
  padding-bottom: 52px;
}

/* Toast 适配浅色文字 */
body.mobile-only .toast {
  color: #1a2332;
}

body.mobile-only .modal {
  z-index: 200;
}

body.mobile-only .modal-title {
  color: #1a2332;
}

/* === 快3游戏图片图标样式 === */
.game-icon-img {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

/* 游戏页面顶部标题栏的图标+标题容器 */
.mobile-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.mobile-title-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* 热门彩票卡片中的图标: 大尺寸 */
.card-icon .game-icon-img {
  width: 56px;
  height: 56px;
}

/* 最新开奖列表中的图标: 小尺寸 */
.history-period .game-icon-img {
  width: 22px;
  height: 22px;
  margin-right: 4px;
}

.history-period {
  display: flex;
  align-items: center;
  width: 140px;
  color: #666;
}

.history-game-name {
  display: inline-block;
  vertical-align: middle;
}

/* === 开奖动画: 3D骰子转动 (外观与原骰子一致, 同尺寸30px + 圆轨抛掷) === */
.dice3d-scene {
  display: inline-block;
  width: 30px;
  height: 30px;
  perspective: 800px;
  vertical-align: middle;
}
.dice3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  --half: 15px;
}
.dice3d .face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas: "a b c" "d e f" "g h i";
  gap: 1px;
  padding: 3px;
  box-sizing: border-box;
  background: linear-gradient(145deg, #e8e8e8, #c8c8c8);   /* 与原骰子同款灰渐变 */
  border: 1px solid #a0a0a0;
  border-radius: 7px;
  box-shadow: 0 1.5px 3px rgba(0,0,0,0.35),
              inset 0 -1.2px 1.2px rgba(0,0,0,0.18);
  backface-visibility: hidden;
}
.dice3d .face span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  justify-self: center;
  align-self: center;
  background: radial-gradient(circle at 30% 30%, #3a3a3a, #0d0d0d 60%, #000);
  box-shadow: inset 0 -0.5px 0.5px rgba(0,0,0,0.5),
              0 0.5px 0.5px rgba(255,255,255,0.4);
}
.dice3d .face-1 span {
  width: 9px;
  height: 9px;
}
.dice3d-scene.is-red .face span {
  background: #a8443a;
  box-shadow: none;
}
/* 六面朝向: 1前 2右 3后 4左 5上 6下 */
.dice3d .face-1 { transform: rotateY(0deg)    translateZ(var(--half)); }
.dice3d .face-2 { transform: rotateY(90deg)   translateZ(var(--half)); }
.dice3d .face-3 { transform: rotateY(180deg)  translateZ(var(--half)); }
.dice3d .face-4 { transform: rotateY(-90deg)  translateZ(var(--half)); }
.dice3d .face-5 { transform: rotateX(90deg)   translateZ(var(--half)); }
.dice3d .face-6 { transform: rotateX(-90deg)  translateZ(var(--half)); }
/* 圆形转动: 骰子沿小圆轨道抛掷运动(三颗错峰) */
#numberDisplay.rolling .dice3d-scene {
  animation: diceOrbit 0.9s linear infinite;
}
#numberDisplay.rolling .dice3d-scene:nth-child(2) { animation-delay: -0.3s; }
#numberDisplay.rolling .dice3d-scene:nth-child(3) { animation-delay: -0.6s; }
@keyframes diceOrbit {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(2px, -3px); }
  50%  { transform: translate(0, -4px); }
  75%  { transform: translate(-2px, -3px); }
  100% { transform: translate(0, 0); }
}


