/* ===== 全局变量 ===== */
:root {
  --bg: #0d0f17;
  --bg2: #161a26;
  --bg3: #1f2536;
  --surface: #1a1f2e;
  --ink: #e6e9f2;
  --ink2: #b8bdcd;
  --muted: #7c8398;
  --rule: #2a3045;

  --primary: #e63977;       /* 玫红 - 主色 */
  --primary-2: #ff4d8d;
  --gold: #d4a25a;          /* 金色 */
  --green: #2dd4bf;         /* 青绿 - 游戏 */
  --green-2: #14b8a6;
  --red: #ef4444;           /* 红 - 出款 */
  --red-2: #dc2626;
  --blue: #38bdf8;
  --yellow: #facc15;
  --pink: #ec4899;

  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* ===== 白色 / 浅色主题 ===== */
:root[data-theme="light"] {
  --bg: #f0f2f5;
  --bg2: #e8ecf1;
  --bg3: #dde3ec;
  --surface: #ffffff;
  --ink: #1a1d29;
  --ink2: #4a5063;
  --muted: #8a92a6;
  --rule: #d0d7e2;

  --primary: #e63977;
  --primary-2: #ff4d8d;
  --gold: #b8860b;
  --green: #0d9488;
  --green-2: #0f766e;
  --red: #dc2626;
  --red-2: #b91c1c;
  --blue: #0284c7;
  --yellow: #ca8a04;
  --pink: #db2777;

  --shadow: 0 4px 20px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== 登录页(校园网风格) ===== */
.login-page {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}
.login-page.campus {
  background: linear-gradient(180deg, #7db8ef 0%, #a8d0f5 45%, #dceafb 100%);
}
.campus-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.campus-sun {
  position: absolute; top: 8%; right: 12%;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, #fff7d6 0%, #ffe9a8 55%, rgba(255,233,168,0) 72%);
  box-shadow: 0 0 60px 30px rgba(255,240,190,0.5);
}
.campus-cloud {
  position: absolute; background: rgba(255,255,255,0.9); border-radius: 40px;
  animation: cloudMove 40s linear infinite;
}
.campus-cloud::before, .campus-cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.campus-cloud.c1 { top: 12%; left: -140px; width: 130px; height: 34px; }
.campus-cloud.c1::before { width: 50px; height: 50px; top: -22px; left: 22px; }
.campus-cloud.c1::after { width: 36px; height: 36px; top: -14px; left: 66px; }
.campus-cloud.c2 { top: 24%; left: -220px; width: 100px; height: 28px; animation-duration: 55s; animation-delay: -18s; opacity: 0.8; }
.campus-cloud.c2::before { width: 40px; height: 40px; top: -18px; left: 16px; }
.campus-cloud.c2::after { width: 28px; height: 28px; top: -10px; left: 52px; }
.campus-cloud.c3 { top: 6%; left: -180px; width: 90px; height: 26px; animation-duration: 70s; animation-delay: -35s; opacity: 0.7; }
.campus-cloud.c3::before { width: 36px; height: 36px; top: -16px; left: 14px; }
.campus-cloud.c3::after { width: 26px; height: 26px; top: -9px; left: 46px; }
@keyframes cloudMove {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 400px)); }
}
.campus-buildings {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 34vh; min-height: 180px;
}
.login-card {
  position: relative;
  width: 380px; max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px 32px 28px;
  box-shadow: var(--shadow);
}
.login-card.campus-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(47,93,160,0.15);
  border-top: 4px solid #2f5da0;
  box-shadow: 0 16px 44px rgba(36,80,143,0.28);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
  width: 60px; height: 60px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; font-weight: 800; font-size: 22px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(230,57,119,0.3);
}
.campus-card .login-logo .logo-icon {
  background: linear-gradient(135deg, #2f5da0, #5a8fd6);
  font-size: 30px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(47,93,160,0.35);
}
.login-logo h1 { font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.login-logo p { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.campus-card .login-logo h1 { color: #1d3f6f; font-size: 20px; }
.campus-card .login-logo p { color: #7d93b2; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 12px; color: var(--ink2); margin-top: 8px; }
.campus-card .login-form label { color: #41608c; font-weight: 600; }
.login-form input, .login-form select {
  width: 100%; padding: 11px 14px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.login-form input:focus, .login-form select:focus { border-color: var(--primary); }
.campus-card .login-form input {
  background: #f4f8fd; border: 1px solid #c9d9ee; color: #1d3f6f;
}
.campus-card .login-form input:focus {
  border-color: #2f5da0; box-shadow: 0 0 0 3px rgba(47,93,160,0.15);
}
.campus-card .login-form input::placeholder { color: #9db2cd; }
/* 记住登录 */
.login-remember {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 12px;
}
.remember-check {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; color: var(--ink2); user-select: none;
}
.campus-card .remember-check { color: #41608c; font-weight: 600; }
.remember-check input { width: 15px; height: 15px; accent-color: #2f5da0; cursor: pointer; }
.remember-tip { color: var(--muted); font-size: 11px; }
.campus-card .remember-tip { color: #8fa6c4; }
.login-btn { width: 100%; }
.campus-card .login-btn {
  background: linear-gradient(135deg, #2f5da0, #4a86d8);
  letter-spacing: 6px; font-size: 15px;
}
.campus-card .login-btn:hover { box-shadow: 0 8px 22px rgba(47,93,160,0.4); }
/* 切换代理账号 */
.login-switch { text-align: center; margin-top: 14px; }
.login-switch button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px;
}
.campus-card .login-switch button { color: #2f5da0; }
.login-switch button:hover { opacity: 0.75; }
.login-tip { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.campus-card .login-tip { color: #8fa6c4; font-size: 11px; }
@media (max-width: 640px) {
  .login-card.campus-card { padding: 30px 22px 22px; }
  .campus-buildings { height: 24vh; }
}

/* ===== 按钮 ===== */
.btn-primary {
  margin-top: 18px;
  padding: 12px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 600; cursor: pointer; font-size: 14px;
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(230,57,119,0.4); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink2); cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--bg2); color: var(--ink); }

.btn-sm {
  padding: 5px 10px; font-size: 12px;
  border: none; border-radius: 4px; cursor: pointer;
  background: var(--bg3); color: var(--ink2);
  transition: all 0.2s;
}
.btn-sm:hover { background: var(--rule); color: var(--ink); }
.btn-sm.success { background: var(--green-2); color: #fff; }
.btn-sm.success:hover { background: var(--green); }
.btn-sm.danger { background: var(--red-2); color: #fff; }
.btn-sm.danger:hover { background: var(--red); }
.btn-sm.warn { background: #b45309; color: #fff; }
.btn-sm.warn:hover { background: #d97706; }

/* ===== 主后台布局 ===== */
.admin-app {
  display: flex; height: 100vh; width: 100vw;
  position: relative;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  z-index: 200;
  transform: translateX(0);
  transition: transform 0.3s ease;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
}
.logo-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.logo-text { font-size: 15px; font-weight: 700; flex: 1; }
.sidebar-close {
  width: 28px; height: 28px;
  background: transparent; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; border-radius: 4px;
}
.sidebar-close:hover { background: var(--bg2); color: var(--ink); }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.play-switch {
  display: flex; gap: 6px; padding: 0 14px 14px;
  border-bottom: 1px solid var(--rule); margin-bottom: 12px;
}
.play-btn {
  flex: 1; padding: 8px 4px;
  background: var(--bg2); border: 1px solid var(--rule);
  color: var(--ink2); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.2s;
}
.play-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--primary); color: #fff;
}
.play-btn:hover:not(.active) { background: var(--bg3); }

.menu { list-style: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: var(--ink2);
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.menu-item:hover { background: var(--bg2); color: var(--ink); }
.menu-item.active {
  background: linear-gradient(90deg, rgba(230,57,119,0.15), transparent);
  border-left-color: var(--primary);
  color: var(--ink);
  font-weight: 600;
}
.menu-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { padding: 12px 18px; border-top: 1px solid var(--rule); }
.sidebar-footer .btn-ghost { width: 100%; }

/* 侧边栏触发器 */
.sidebar-trigger {
  position: fixed; top: 14px; left: 14px;
  width: 40px; height: 40px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; z-index: 90;
  box-shadow: var(--shadow);
}
.sidebar-trigger span {
  display: block; width: 18px; height: 2px;
  background: var(--ink); border-radius: 1px;
}
.sidebar-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-mask.show { opacity: 1; pointer-events: auto; }

/* ===== 顶部栏 ===== */
.main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}
.main.full { margin-left: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-center {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  margin: 0 8px;
}
.topbar-avatar {
  height: 32px; width: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 1px solid var(--rule);
}
.menu-toggle {
  width: 36px; height: 36px;
  background: transparent; border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--bg2); }
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--ink); border-radius: 1px;
}
#pageTitle { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 36px; height: 36px; border: 1px solid var(--rule);
  border-radius: 50%; background: var(--bg2); color: var(--ink);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg3); transform: scale(1.08); }
.period-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.period-label { font-size: 11px; color: var(--muted); }
.period-no { font-size: 13px; font-weight: 700; color: var(--gold); }
.countdown {
  font-size: 12px; padding: 6px 10px;
  background: var(--bg2); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); color: var(--ink2);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.play-mode-pill {
  font-size: 12px; padding: 6px 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-radius: 20px; font-weight: 600;
}

/* ===== 页面容器 ===== */
.page-container {
  flex: 1; padding: 20px;
  overflow-y: auto;
  background: var(--bg);
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink);
}
.card-title::before {
  content: ''; display: block;
  width: 3px; height: 16px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
  border-radius: 2px;
}
.card-row { display: flex; gap: 16px; flex-wrap: wrap; }
.card-row .card { flex: 1; min-width: 300px; }

/* ===== 走势图(双系列) ===== */
.chart-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.chart-card .chart-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.chart-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink2);
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.legend-dot.pink { background: var(--pink); }
.legend-dot.green { background: var(--green); }
.legend-dot.green2 { background: var(--green-2); }
.legend-dot.red { background: var(--red); }
.legend-dot.red2 { background: var(--red-2); }
.legend-dot.gold { background: var(--gold); }
.legend-dot.blue { background: var(--blue); }
.legend-dot.yellow { background: var(--yellow); }

.chart-canvas { width: 100%; height: 280px; }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto; overflow-y: auto;
  max-height: 600px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
thead { background: var(--bg2); position: sticky; top: 0; z-index: 1; }
th {
  text-align: left; padding: 11px 14px;
  font-weight: 600; color: var(--ink2);
  font-size: 12px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(42,48,69,0.5);
  color: var(--ink);
}
tbody tr:hover { background: var(--bg2); }
tbody tr:last-child td { border-bottom: none; }
td .num { font-family: ui-monospace, monospace; color: var(--gold); font-weight: 600; }
td.pos { color: var(--green); }
td.neg { color: var(--red); }

.badge {
  display: inline-block;
  padding: 2px 8px; font-size: 11px;
  border-radius: 4px; font-weight: 600;
}
.badge.success { background: rgba(45,212,191,0.15); color: var(--green); }
.badge.danger { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.warn { background: rgba(250,204,21,0.15); color: var(--yellow); }
.badge.info { background: rgba(56,189,248,0.15); color: var(--blue); }
.badge.muted { background: var(--bg2); color: var(--muted); }

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-bar input, .search-bar select {
  padding: 9px 14px;
  background: var(--bg2); border: 1px solid var(--rule);
  color: var(--ink); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
  min-width: 200px;
}
.search-bar input:focus, .search-bar select:focus { border-color: var(--primary); }
.search-bar .btn-primary { margin-top: 0; padding: 9px 18px; }

/* ===== 玩法统计网格 ===== */
.game-stat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.game-stat-item {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all 0.2s;
}
.game-stat-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.game-stat-item .label { font-size: 12px; color: var(--muted); }
.game-stat-item .value { font-size: 20px; font-weight: 700; color: var(--gold); font-family: ui-monospace, monospace; }
.game-stat-item .meta { font-size: 11px; color: var(--ink2); }

/* ===== 赔率设置表 ===== */
.odds-table .play-cell {
  font-weight: 600; color: var(--ink);
  min-width: 180px;
}
.odds-input {
  width: 90px; padding: 6px 10px;
  background: var(--bg2); border: 1px solid var(--rule);
  color: var(--gold); border-radius: 4px;
  font-size: 13px; font-weight: 700;
  text-align: center; font-family: ui-monospace, monospace;
  outline: none;
}
.odds-input:focus { border-color: var(--primary); }
.odds-table .sub-text { color: var(--muted); font-size: 11px; }

/* ===== 充值/提现请求列表 ===== */
.request-list { display: flex; flex-direction: column; gap: 10px; }
.request-item {
  background: var(--bg2); border: 1px solid var(--rule);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.request-item.withdraw { border-left-color: var(--red); }
.req-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.req-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.req-user .info .name { font-size: 13px; font-weight: 600; }
.req-user .info .id { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.req-amount { font-size: 18px; font-weight: 800; color: var(--gold); min-width: 120px; }
.req-amount.withdraw { color: var(--red); }
.req-balance { font-size: 12px; color: var(--ink2); }
.req-balance.key-balance {
  background: var(--bg3); border: 1px solid var(--rule);
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.req-balance.key-balance b { color: var(--gold); font-size: 13px; }
.req-balance.key-balance .sub { color: var(--muted); font-size: 11px; margin-left: 4px; }
.req-time { font-size: 11px; color: var(--muted); flex: 1; min-width: 140px; }
.req-actions { display: flex; gap: 6px; }
.avatar.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.avatar.clickable:hover { transform: scale(1.1); box-shadow: 0 0 0 2px var(--primary); }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: 460px; max-width: 92vw; max-height: 86vh;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}
.modal-card.large { width: 720px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer; border-radius: 4px;
}
.modal-close:hover { background: var(--bg2); color: var(--ink); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--ink2); }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  background: var(--bg2); border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink); font-size: 13px;
  outline: none; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.action-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.action-tab {
  flex: 1; padding: 10px;
  background: var(--bg2); border: 1px solid var(--rule);
  color: var(--ink2); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; font-size: 13px;
}
.action-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-color: var(--primary);
}

/* ===== 会员详情 ===== */
.member-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--bg2); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: 14px;
}
.stat-tile .stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-tile .stat-value { font-size: 22px; font-weight: 800; color: var(--gold); font-family: ui-monospace, monospace; }
.stat-tile.green .stat-value { color: var(--green); }
.stat-tile.red .stat-value { color: var(--red); }
.stat-tile.blue .stat-value { color: var(--blue); }

/* ===== 开奖设置 ===== */
.lottery-balls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 14px 0;
}
.ball {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  background: var(--bg3); border: 2px solid var(--rule);
}
.ball.red { background: linear-gradient(135deg, var(--red), var(--red-2)); border-color: var(--red); }
.ball.blue { background: linear-gradient(135deg, var(--blue), #0284c7); border-color: var(--blue); }
.ball.green { background: linear-gradient(135deg, var(--green), var(--green-2)); border-color: var(--green); }
.ball.special {
  background: linear-gradient(135deg, var(--gold), #b45309);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212,162,90,0.5);
}
.ball.empty { color: var(--muted); font-size: 20px; }

.zodiac-display {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--bg2); border: 1px solid var(--rule);
  border-radius: 20px; font-size: 13px;
}
.zodiac-display .zodiac-name { font-weight: 700; color: var(--gold); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--green);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 0.2s;
  /* 弹窗提示不拦截任何点击,显示期间仍可点其他 通过/驳回 按钮 */
  pointer-events: none;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.danger { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--yellow); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .chart-grid { grid-template-columns: 1fr; }
  .member-detail { grid-template-columns: 1fr; }
  .period-info { display: none; }
  .topbar-center { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  #pageTitle { font-size: 14px; }
  .countdown { display: none; }
  .page-container { padding: 12px; }
  .play-mode-pill { font-size: 11px; padding: 4px 8px; }
  .card { padding: 14px; }
  .request-item { flex-direction: column; align-items: flex-start; }
  .req-actions { width: 100%; }
  .req-actions button { flex: 1; }
  .chart-canvas { height: 220px; }
  .topbar-right { gap: 6px; }
}

@media (max-width: 480px) {
  .field-row { flex-direction: column; gap: 0; }
  .game-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 走势图时间范围切换(15日/30日) ===== */
.range-toggle {
  display: inline-flex;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-left: 12px;
}
.range-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--ink2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.range-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.range-btn:hover:not(.active) { color: var(--ink); }

/* ===== 紧凑统计行(顶部缩小) ===== */
.compact-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink2);
  align-items: center;
}
.compact-stats .item { display: flex; align-items: center; gap: 6px; }
.compact-stats .label { color: var(--muted); font-size: 11px; }
.compact-stats .value {
  font-weight: 700;
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 14px;
}
.compact-stats .value.green { color: var(--green); }
.compact-stats .value.red { color: var(--red); }
.compact-stats .sep { width: 1px; height: 14px; background: var(--rule); }

/* ===== 小型可点击玩法卡片 ===== */
.game-stat-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.game-stat-grid.small .game-stat-item {
  padding: 9px 11px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.game-stat-grid.small .game-stat-item .label { font-size: 11px; }
.game-stat-grid.small .game-stat-item .value { font-size: 14px; }
.game-stat-grid.small .game-stat-item .meta { font-size: 10px; }
.game-stat-grid.small .game-stat-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.game-stat-grid.small .game-stat-item.selected {
  background: linear-gradient(135deg, rgba(230,57,119,0.18), rgba(212,162,90,0.08));
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.game-stat-grid.small .game-stat-item.selected::after {
  content: '✓';
  position: absolute;
  top: 4px; right: 6px;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
}

/* ===== 下注明细表(按号码排序) ===== */
.bet-detail-table { font-size: 13px; }
.bet-detail-table .play-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg3);
  color: var(--gold);
  font-weight: 700;
  font-family: ui-monospace, monospace;
  border-radius: 4px;
  font-size: 12px;
}
.bet-detail-table .num-cell {
  font-family: ui-monospace, monospace;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.bet-detail-table tbody tr.top-rank td.num-cell { color: var(--primary); }
.bet-detail-table .rank {
  display: inline-block;
  width: 18px; text-align: center;
  color: var(--muted); font-size: 11px;
  font-family: ui-monospace, monospace;
}
.bet-detail-table .rank.gold { color: var(--gold); font-weight: 700; }

/* ===== 机器人下注模拟器 ===== */

/* ===== 用户列表面 ===== */
.user-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 460px;
  overflow-y: auto;
}
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.user-row .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.user-row .info { flex: 1; min-width: 0; }
.user-row .info .name { font-size: 13px; font-weight: 600; }
.user-row .info .id {
  font-size: 11px; color: var(--muted);
  font-family: ui-monospace, monospace;
}
.user-row .bet-amount {
  font-weight: 700;
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 14px;
}
.user-row .bet-time {
  font-size: 11px;
  color: var(--muted);
  min-width: 90px;
  text-align: right;
}

/* ========== 赔率设置页(基于 GAME_RULES) ========== */
.odds-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.odds-tab {
  padding: 7px 14px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.odds-tab:hover { color: var(--gold); }
.odds-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: var(--primary);
}
.odds-tab .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  font-size: 10px;
}
.odds-search {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.odds-search input {
  flex: 1; max-width: 320px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.odds-search input:focus { border-color: var(--primary); }
.odds-table { width: 100%; font-size: 12px; }
.odds-table th {
  background: var(--bg3);
  color: var(--ink2);
  font-weight: 600;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0;
}
.odds-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: ui-monospace, monospace;
}
.odds-table .name-cell { font-family: inherit; color: var(--ink); }
.odds-table .alias-cell { color: var(--muted); font-size: 11px; }
.odds-table input.odds-inp {
  width: 76px; padding: 4px 8px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--gold);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  text-align: center;
  outline: none;
}
.odds-table input.odds-inp:focus { border-color: var(--primary); background: var(--bg3); }
.odds-table input.odds-inp.modified { border-color: var(--gold); color: var(--green); }
.odds-table .minmax { color: var(--muted); font-size: 10px; }
.odds-table tbody tr:hover { background: var(--bg2); }
.odds-table-wrap { max-height: 540px; overflow: auto; }
.odds-toolbar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ========== 设置开奖页 - 号码球选择 + 合成图 ========== */
.balls-49 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 12px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
.ball-49-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ball-49 {
  position: relative;
  width: 100%; aspect-ratio: 1;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  font-family: ui-monospace, monospace;
}
.ball-49-zodiac {
  font-size: 10px; color: var(--muted); font-weight: 600;
  text-align: center; line-height: 1;
}
.ball-49.red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.ball-49.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.ball-49.green { background: linear-gradient(135deg, #10b981, #047857); }
.ball-49:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.ball-49.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,162,90,0.4), 0 4px 12px rgba(0,0,0,0.5); }
.ball-49.selected::after {
  content: attr(data-pos);
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: var(--gold); color: #000;
  border-radius: 50%; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.ball-49.special.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,57,119,0.5), 0 4px 12px rgba(0,0,0,0.5); }
.ball-49.special.selected::after { background: var(--primary); color: #fff; }

.draw-selected {
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  min-height: 60px;
}
.draw-selected .lbl { color: var(--muted); font-size: 12px; margin-right: 4px; }
.draw-balls-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.draw-mini-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.draw-mini-zodiac { font-size: 11px; color: var(--gold); font-weight: 700; }
.draw-mini-sep { font-size: 18px; color: var(--muted); align-self: center; padding: 0 2px; }
.draw-mini-ball {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  font-family: ui-monospace, monospace;
  position: relative;
}
.draw-mini-ball.special { border: 2px solid var(--gold); box-shadow: 0 0 8px rgba(212,162,90,0.4); }
.draw-mini-ball .pos {
  position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px;
  background: var(--gold); color: #000;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.draw-mini-ball.special .pos { background: var(--primary); color: #fff; }

/* 合成图预览 */
.draw-preview {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.draw-preview canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  background: #000;
}
.draw-preview .preview-actions {
  display: flex; gap: 8px; justify-content: center; margin-top: 12px;
}
.draw-preview .preview-actions button {
  padding: 8px 16px; font-size: 12px;
}

/* 期号/日期输入 */
.draw-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 12px;
}
.draw-form .field { margin: 0; }

/* 充提时间设置 */
.halt-config {
  margin-bottom: 15px;
}
.halt-periods {
  margin-bottom: 10px;
}
.halt-period-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.halt-period-row input[type="time"] {
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.halt-period-row span {
  color: var(--muted);
}
.halt-period-row .btn-sm {
  margin-left: auto;
}

/* 订单号显示 */
.req-order {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg3);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}
.req-order b {
  color: var(--gold);
}

/* 模拟机器人模态框 */
#botSimUser, #botSimType, #botSimChannel {
  width: 100%;
}

/* 扫码区域 */
textarea#botAddress {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 4px;
  font-family: monospace;
  text-align: center;
  resize: none;
  height: 60px;
}