:root {
  --primary: #c62828;
  --primary-light: #ef5350;
  --primary-dark: #8b1a1a;
  --blue: #1565c0;
  --blue-light: #42a5f5;
  --gold: #f9a825;
  --gold-light: #ffca28;
  --bg: #f0f2f5;
  --card: #fff;
  --text: #1a1a2e;
  --text2: #6b7280;
  --border: #e5e7eb;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --glass: rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  color: var(--text); background: var(--bg); min-height: 100vh; padding-bottom: 60px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; width: 100%; max-width: 100vw;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: 14px; outline: none; max-width: 100%; }
.page { min-height: 100vh; padding-bottom: calc(56px + var(--safe-bottom)); overflow-x: hidden; }

/* ========== 3D 号码球 (高级版) ========== */
.num-ball-3d {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.35);
  box-shadow:
    inset 0 -5px 8px rgba(0,0,0,.25),
    inset 0 5px 8px rgba(255,255,255,.4),
    0 4px 12px rgba(0,0,0,.2),
    0 1px 3px rgba(0,0,0,.1);
  transform: perspective(200px) rotateX(5deg);
  transition: transform .2s, box-shadow .2s;
}
.num-ball-3d:hover {
  transform: perspective(200px) rotateX(5deg) scale(1.08);
  box-shadow:
    inset 0 -5px 8px rgba(0,0,0,.25),
    inset 0 5px 8px rgba(255,255,255,.4),
    0 6px 20px rgba(0,0,0,.25),
    0 2px 6px rgba(0,0,0,.1);
}
.num-ball-3d.red {
  background: radial-gradient(circle at 30% 25%, #ff6b6b, #e53935 45%, #b71c1c 85%, #7f0000);
}
.num-ball-3d.blue {
  background: radial-gradient(circle at 30% 25%, #64b5f6, #1e88e5 45%, #0d47a1 85%, #002171);
}
.num-ball-3d.gold {
  background: radial-gradient(circle at 30% 25%, #fff176, #fdd835 45%, #f9a825 85%, #c17900);
  color: #5d3800;
  text-shadow: 0 1px 2px rgba(255,255,255,.5);
}
.num-ball-3d::before {
  content: ''; position: absolute; top: 3px; left: 25%; width: 50%; height: 35%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.65), rgba(255,255,255,.15) 60%, transparent 80%);
  border-radius: 50%; pointer-events: none;
}
.num-ball-3d::after {
  content: ''; position: absolute; bottom: 4px; right: 20%; width: 25%; height: 15%;
  background: radial-gradient(ellipse, rgba(255,255,255,.12), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.num-ball-3d.sm { width: 30px; height: 30px; font-size: 13px; }
.num-ball-3d.lg { width: 48px; height: 48px; font-size: 20px; }

/* ========== 顶部导航 ========== */
.nav-bar {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 14px 16px; display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(139,26,26,.25);
}
.nav-bar .back { font-size: 22px; cursor: pointer; margin-right: 12px; text-decoration: none; color: #fff; line-height: 1; }
.nav-bar .title { font-size: 17px; font-weight: 700; flex: 1; text-align: center; letter-spacing: 1px; }

/* ========== 底部Tab导航 ========== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; border-top: 1px solid rgba(0,0,0,.05); z-index: 200;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; font-size: 10px; color: #9ca3af; text-decoration: none; transition: color 0.2s; }
.tabbar a.active { color: var(--primary); }
.tabbar a .tab-icon { font-size: 22px; margin-bottom: 2px; }
.tabbar a .tab-svg { width: 22px; height: 22px; margin-bottom: 2px; }
.tabbar a span { font-size: 10px; font-weight: 600; }

/* ========== 卡片区块 ========== */
.section {
  background: var(--card); border-radius: var(--radius); margin: 12px;
  padding: 18px 16px; box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.03);
}
.section-title {
  font-size: 16px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; color: var(--text);
}
.section-title::before {
  content: ''; display: inline-block; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 2px; margin-right: 10px;
}

/* ========== 磨砂卡片 ========== */
.glass-card {
  background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ========== 滚动公告 ========== */
.notice-bar {
  background: linear-gradient(90deg, #fff8e1, #fff3e0);
  color: #e65100; padding: 10px 14px; font-size: 13px;
  overflow: hidden; white-space: nowrap; border-radius: 12px; margin: 10px 12px;
  border: 1px solid rgba(230,81,0,.08);
}
.notice-bar { position: relative; }
.notice-bar .notice-scroll { display: block; overflow: hidden; height: 20px; position: relative; }
.notice-bar .notice-scroll .scroll-item { display: block; height: 20px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: absolute; width: 100%; transition: transform .5s ease, opacity .5s ease; }
.notice-bar .notice-scroll .scroll-item.active { transform: translateY(0); opacity: 1; }
.notice-bar .notice-scroll .scroll-item.next { transform: translateY(100%); opacity: 0; }

/* ========== Banner轮播 ========== */
.banner-wrap { position: relative; overflow: hidden; border-radius: 0 0 12px 12px; }
.banner-track { display: flex; transition: transform 0.5s ease; }
.banner-track img { min-width: 100%; height: 220px; object-fit: cover; }
.banner-default {
  background: linear-gradient(135deg, #7f0000 0%, #b71c1c 30%, #e53935 60%, #ff6659 100%);
  height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
}
.banner-default::before {
  content: ''; position: absolute; top: -80px; right: -80px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.banner-default::after {
  content: ''; position: absolute; bottom: -50px; left: -50px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255,255,255,.04);
}
.banner-default h2 {
  font-size: 28px; letter-spacing: 8px;
  text-shadow: 0 3px 12px rgba(0,0,0,.2); position: relative; z-index: 1;
}
.banner-default p {
  font-size: 12px; opacity: 0.85; margin-top: 6px; letter-spacing: 3px; position: relative; z-index: 1;
}
.banner-dots { position: absolute; bottom: 14px; right: 16px; display: flex; gap: 6px; }
.banner-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: all 0.3s; }
.banner-dots span.active { background: #fff; width: 24px; border-radius: 4px; }

/* ========== 旧号码球（兼容） ========== */
.num-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; padding: 4px 0; }
.num-ball {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; cursor: pointer; transition: all 0.2s;
  user-select: none; background: #fff;
}
.num-ball.active, .num-ball.red-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(198,40,40,.35);
}
.num-ball.blue-active {
  background: var(--blue); color: #fff; border-color: var(--blue);
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(21,101,192,.35);
}
.num-ball-sm {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}
.num-ball-sm.red { background: var(--primary); }
.num-ball-sm.blue { background: var(--blue); }

/* ========== 倒计时 ========== */
.countdown-box {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 16px; display: flex; justify-content: space-between;
  align-items: center; border-radius: 14px; margin: 10px 12px;
  box-shadow: 0 4px 20px rgba(198,40,40,.25);
}
.countdown-box .issue { font-size: 15px; font-weight: 600; }
.countdown-box .cd-nums { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 700; }
.countdown-box .cd-num { background: rgba(0,0,0,0.3); padding: 4px 8px; border-radius: 6px; }

/* ========== 标签 ========== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.tag-danger { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.tag-success { background: linear-gradient(135deg, #2e7d32, #4caf50); color: #fff; }
.tag-warn { background: linear-gradient(135deg, #e65100, #ff9800); color: #fff; }

/* ========== 按钮 ========== */
.btn {
  display: inline-block; padding: 12px 28px; border: none; border-radius: 28px;
  font-size: 15px; font-weight: 700; cursor: pointer; text-align: center;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.btn:active { opacity: 0.85; transform: scale(0.97); }
.btn-danger {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(198,40,40,.3);
}
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #374151; }
.form-input {
  width: 100%; padding: 13px 16px; border: 1.5px solid #d1d5db; border-radius: 14px;
  font-size: 15px; transition: all 0.2s; background: #fafbfc;
}
.form-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(198,40,40,0.08); }

/* ========== 方式选择 ========== */
.method-list { display: flex; flex-direction: column; gap: 10px; }
.method-item {
  display: flex; align-items: center; gap: 14px;
  background: #f9fafb; padding: 16px 18px; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
}
.method-item.active {
  border-color: var(--primary); background: #fef2f2;
  box-shadow: 0 2px 16px rgba(198,40,40,.1);
}
.method-item .m-icon { font-size: 30px; }
.method-item .m-name { flex: 1; font-size: 16px; font-weight: 600; }

/* ========== 快捷金额 ========== */
.amount-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.amt-chip {
  padding: 10px 20px; border-radius: 22px; background: #f3f4f6;
  font-size: 14px; cursor: pointer; transition: all 0.2s; font-weight: 700;
}
.amt-chip.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 3px 12px rgba(198,40,40,.25);
}

/* ========== 聊天 ========== */
.chat-body { flex: 1; overflow-y: auto; padding: 14px; }
.msg-row { display: flex; gap: 10px; margin-bottom: 18px; }
.msg-row.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; font-weight: 700;
}
.msg-row.admin .msg-avatar { background: var(--primary); color: #fff; }
.msg-bubble {
  max-width: 70%; padding: 12px 16px; border-radius: 18px;
  font-size: 15px; line-height: 1.6; word-break: break-all;
}
.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-bottom-right-radius: 4px;
}
.msg-row.admin .msg-bubble { background: #fff; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.msg-time { font-size: 11px; color: #9ca3af; margin-top: 3px; }
.chat-input-bar { display: flex; gap: 10px; padding: 14px; background: #fff; border-top: 1px solid #f3f4f6; }
.chat-input-bar input { flex: 1; }

/* ========== 视频区域 ========== */
.video-placeholder {
  background: #111; border-radius: var(--radius); height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #6b7280; cursor: pointer;
}

/* ========== 新闻列表 ========== */
.news-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #f3f4f6; font-size: 14px;
}
.news-item:last-child { border-bottom: none; }
.news-tag {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 3px 10px; border-radius: 8px; font-size: 11px;
  white-space: nowrap; font-weight: 700;
}

/* ========== 登录 ========== */
.auth-links { display: flex; justify-content: space-between; padding: 0 4px; margin-top: 10px; }
.auth-links a { font-size: 13px; color: var(--primary); }

/* ========== 余额卡片 ========== */
.balance-card {
  background: linear-gradient(135deg, #7f0000, var(--primary-dark), var(--primary), var(--primary-light));
  border-radius: 20px; padding: 32px; color: #fff; text-align: center;
  box-shadow: 0 8px 32px rgba(198,40,40,0.3);
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: ''; position: absolute; top: -50px; right: -50px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.balance-card::after {
  content: ''; position: absolute; bottom: -30px; left: -20px; width: 100px; height: 100px;
  border-radius: 50%; background: rgba(255,255,255,.05);
}
.balance-card .label { font-size: 13px; opacity: 0.85; letter-spacing: 1px; }
.balance-card .amount {
  font-size: 36px; font-weight: 800; margin-top: 10px;
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}

/* ========== 记录列表 ========== */
.record-item {
  padding: 14px 0; border-bottom: 1px solid #f3f4f6;
  display: flex; justify-content: space-between; align-items: center;
}
.record-item:last-child { border-bottom: none; }
.record-status { font-size: 12px; padding: 4px 12px; border-radius: 8px; font-weight: 700; }
.record-status.pending { background: #FFF3E0; color: #E65100; }
.record-status.approved { background: #E8F5E9; color: #2E7D32; }
.record-status.rejected { background: #FFEBEE; color: #C62828; }

/* ========== 倍数选择器 ========== */
.stepper {
  display: inline-flex; align-items: center; border-radius: 10px;
  overflow: hidden; border: 1.5px solid #d1d5db;
}
.stepper button {
  width: 36px; height: 36px; border: none; background: #f3f4f6;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.stepper input {
  width: 48px; height: 36px; border: none; border-left: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db; text-align: center; font-size: 14px; font-weight: 700;
}

/* ========== 弹窗遮罩 ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ========== 空状态 ========== */
.empty { text-align: center; padding: 64px 0; color: #d1d5db; }
.empty .empty-icon { font-size: 64px; }
.empty p { margin-top: 14px; font-size: 14px; }

/* ========== 全站移动端适配 ========== */
@media (max-width: 480px) {
  .balance-card { padding: 20px 16px; }
  .balance-card .amount { font-size: 28px; }
  .num-ball { width: 36px; height: 36px; font-size: 15px; }
  .num-ball-3d { width: 34px; height: 34px; font-size: 14px; }
  .num-ball-3d.lg { width: 40px; height: 40px; font-size: 18px; }
  .countdown-box { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .countdown-box .issue { font-size: 13px; }
  .countdown-box .cd-nums { font-size: 18px; }
  .btn { padding: 10px 20px; font-size: 14px; }
  .section { margin: 10px 8px; padding: 14px 12px; }
  .notice-bar { margin: 8px; padding: 8px 12px; font-size: 12px; }
  .msg-bubble { max-width: 80%; }
  .chat-input-bar input, .chat-input-area input { min-width: 0; }
}

@media (max-width: 360px) {
  .num-ball { width: 32px; height: 32px; font-size: 14px; }
  .num-ball-3d { width: 30px; height: 30px; font-size: 13px; }
  .countdown-box .cd-nums { font-size: 16px; }
  .countdown-box .cd-num { padding: 3px 6px; }
  .amt-chip { padding: 6px 12px; font-size: 12px; }
  .balance-card .amount { font-size: 24px; }
  .section { margin: 8px 6px; padding: 12px 10px; }
}
