:root {
  --bg-main: #0b0f19;
  --bg-card: #151e32;
  --bg-card-sub: #1b2640;
  --bg-input: #0e1526;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-active: #3b82f6;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --info: #06b6d4;
  --purple: #8b5cf6;
  --purple-hover: #7c3aed;

  --ball-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --ball-red: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-body {
  background: radial-gradient(circle at top right, #1e1b4b, #0b0f19);
}

.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden { display: none !important; }

/* 登录弹窗 (Modal) */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.auth-modal-card {
  background: #151e32;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.modal-header-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.auth-modal-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-error-tip {
  color: #f87171;
  font-size: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 12px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.modal-header-row h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.btn-close:hover { color: var(--text-primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.quick-days-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* 顶部状态栏 */
.top-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-header {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(30, 27, 75, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.logo-icon.admin-logo {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.brand-text .subtitle code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a78bfa;
}

.client-account-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
}

.user-badge {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.expire-badge {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-text-logout {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-text-logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

.url-bar-container {
  flex: 1;
  max-width: 820px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.icon-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.input-wrapper input {
  width: 100%;
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 12px 9px 38px !important;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}
.status-badge.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

.status-badge.demo {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c084fc;
}
.status-badge.demo .status-dot {
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  animation: pulse 1.5s infinite;
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.status-badge.error .status-dot {
  background: var(--danger);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.status-badge.warning .status-dot {
  background: var(--warning);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* 核心大屏看板 */
.live-dashboard {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.3fr 1.4fr 1.8fr;
  gap: 12px;
}

.admin-stats-dashboard {
  grid-template-columns: repeat(4, 1fr);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.card-period .card-icon { color: #8b5cf6; background: rgba(139, 92, 246, 0.15); }
.card-countdown .card-icon { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.card-balance .card-icon { color: #10b981; background: rgba(16, 185, 129, 0.15); }
.card-profit .card-icon { color: #06b6d4; background: rgba(6, 182, 212, 0.15); }

.metric-info {
  flex: 1;
  min-width: 0;
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-label {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.metric-value.highlight { color: #a78bfa; }
.metric-value.countdown { color: #fbbf24; font-variant-numeric: tabular-nums; }
.metric-value.countdown.urgent { color: #ef4444; animation: pulse 1s infinite; }
.metric-value.countdown.closed {
  color: #60a5fa;
  font-size: 16px;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}
.metric-value.money { color: #34d399; }

.profit-val { color: var(--text-secondary); }
.profit-val.positive { color: #10b981; }
.profit-val.negative { color: #ef4444; }

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: rotate(45deg);
}

/* 开奖球卡片 */
.card-lottery {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.lottery-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lottery-time {
  font-size: 11px;
  color: var(--text-muted);
}

.balls-container {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ball-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.ball-red {
  background: var(--ball-red);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.ball.placeholder {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  box-shadow: none;
}

/* 下注回执状态条 */
.receipt-bar-wrapper {
  width: 100%;
}

.receipt-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.receipt-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.receipt-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.receipt-status-card.success .receipt-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.receipt-status-card.failed .receipt-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.receipt-status-card.waiting .receipt-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  animation: pulse 1.5s infinite;
}

.receipt-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.receipt-status-tag.idle { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.receipt-status-tag.waiting { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.receipt-status-tag.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.receipt-status-tag.failed { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.receipt-status-tag.timeout { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.receipt-time { font-size: 11px; color: var(--text-muted); font-weight: normal; }
.receipt-content { font-size: 12px; color: var(--text-secondary); word-break: break-word; }

.predict-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.predict-label { font-size: 12px; color: var(--text-secondary); }
.predict-val { font-size: 13px; font-weight: 700; color: #38bdf8; }

/* 主布局 */
.main-layout {
  display: grid;
  grid-template-columns: 600px 1fr;
  gap: 16px;
  flex: 1;
}

/* 面板通用样式 */
.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.box-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.box-header h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.box-header h3 i {
  color: var(--primary);
}

.box-body {
  padding: 16px;
}

.box-body.no-padding {
  padding: 0;
}

/* 自动化配置子模块 */
.strategy-section {
  background: #0e1526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title i {
  color: var(--info);
  font-size: 13px;
}

.ref-site-section {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.2);
}

.ref-badge {
  font-size: 11px;
  font-weight: normal;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
}

.ref-badge b { color: #38bdf8; }

.ref-input-row { display: flex; gap: 8px; }
.ref-input-row input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 7px 10px; color: var(--text-primary); font-size: 12px; outline: none;
}

/* 玩法模式与金额策略卡片按钮切换 */
.play-mode-tabs, .mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.play-mode-tab, .mode-tab {
  background: #151e32;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.play-mode-tab input[type="radio"], .mode-tab input[type="radio"] {
  display: none !important;
}

.tab-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-desc { font-size: 10px; color: var(--text-muted); }
.tab-icon { font-size: 16px; color: var(--text-muted); }
.tab-text { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.play-mode-tab:hover, .mode-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.play-mode-tab.active {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}
.play-mode-tab.active .tab-title { color: #c084fc; }

.mode-tab.active {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.mode-tab.active .tab-icon { color: #3b82f6; }
.mode-tab.active .tab-text { color: #fff; }

.play-mode-detail, .mode-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 6px;
}

.select-styled, select {
  background-color: #0e1526 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  outline: none !important;
  width: 100%;
}

.select-styled option, select option {
  background-color: #0e1526;
  color: #fff;
}

.input-styled, input[type="text"], input[type="password"], input[type="number"], input[type="time"] {
  background-color: #0e1526;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.input-styled:focus, input:focus, select:focus {
  border-color: var(--primary);
}

.random-setting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.input-group-item label { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.input-group-item input {
  width: 100%;
}

.preview-badge {
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.preview-badge span { color: #60a5fa; font-weight: 600; }

.martingale-status-row {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seq-preview-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seq-pill {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.seq-pill.current {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-group-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}

.group-header { margin-bottom: 6px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.title-text { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-primary { color: #3b82f6; }
.text-info { color: #06b6d4; }

.hint { font-size: 11px; color: var(--text-muted); display: block; margin-top: 4px; }
.hint code { background: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 4px; color: #93c5fd; }

.input-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input-inline input {
  text-align: center;
  width: 76px;
}

.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.inline-row { display: flex; align-items: center; justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.auto-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.btn-lg { padding: 10px 24px; font-size: 14px; }
.btn-sm { padding: 5px 10px; font-size: 11px; }

.auto-status-indicator {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-status-indicator.active { color: var(--success); }

/* 开关 Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2); transition: .3s; border-radius: 22px;
}
.slider:before {
  position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(18px); }

/* 发送输入组与快捷键盘 */
.send-input-group { display: flex; gap: 8px; margin-bottom: 12px; }
.send-input-group input {
  flex: 1; padding: 9px 12px; font-size: 13px; font-weight: 500;
}

.quick-keyboard { display: flex; flex-direction: column; gap: 6px; }
.quick-row { display: flex; gap: 6px; }
.key-btn {
  flex: 1; padding: 8px 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-color);
  border-radius: 6px; color: var(--text-primary); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.key-btn:hover { background: rgba(255, 255, 255, 0.12); }
.key-btn:active { transform: scale(0.96); }
.key-btn.action { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.key-btn.tag { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.3); color: #c084fc; }
.key-btn.clear { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }

/* 日志框 */
.logs-box { margin-bottom: 0; }
.logs-container {
  height: 140px; padding: 10px 14px; overflow-y: auto; font-family: Consolas, monospace; font-size: 11px; line-height: 1.5; background: #0b0f19;
}
.log-item { margin-bottom: 3px; word-break: break-all; }
.log-time { color: var(--text-muted); margin-right: 6px; }
.log-item.info { color: #94a3b8; }
.log-item.success { color: #34d399; }
.log-item.warn { color: #fbbf24; }
.log-item.error { color: #f87171; }

/* 聊天面板 */
.chat-panel { display: flex; flex-direction: column; }
.chat-box-wrapper { flex: 1; display: flex; flex-direction: column; margin-bottom: 0; height: 100%; min-height: 620px; }
.chat-messages {
  flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: #0b0f19; max-height: 680px;
}
.chat-empty { text-align: center; color: var(--text-muted); margin: auto; font-size: 13px; }
.chat-bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.chat-bubble-row.self { flex-direction: row-reverse; }

.chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #334155; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; flex-shrink: 0; border: 1px solid var(--border-color);
}
.chat-avatar.robot { background: linear-gradient(135deg, #10b981, #059669); }
.chat-avatar.self { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

.chat-content-wrap { max-width: 78%; display: flex; flex-direction: column; gap: 3px; }
.chat-bubble-row.self .chat-content-wrap { align-items: flex-end; }
.chat-sender-name { font-size: 11px; color: var(--text-secondary); }
.chat-bubble {
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; color: var(--text-primary); word-break: break-word;
}
.chat-bubble-row.self .chat-bubble { background: #2563eb; border-color: #3b82f6; color: #fff; }
.chat-bubble-row.robot .chat-bubble { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }

/* 表格与大屏通用 */
.styled-table {
  width: 100%; border-collapse: collapse; font-size: 12px; text-align: left;
}
.styled-table th, .styled-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-color);
}
.styled-table th {
  background: rgba(255, 255, 255, 0.03); color: var(--text-secondary); font-weight: 600; white-space: nowrap;
}
.styled-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600;
}
.badge-running { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-online { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-offline { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); border: 1px solid var(--border-color); }
.badge-frozen { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-expired { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.profit-tag { font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.profit-tag.positive { color: #10b981; background: rgba(16, 185, 129, 0.15); }
.profit-tag.negative { color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.profit-tag.zero { color: var(--text-muted); }

.table-actions { display: inline-flex; gap: 6px; align-items: center; }
.btn-action {
  padding: 4px 8px; border-radius: 5px; border: 1px solid var(--border-color); font-size: 11px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.btn-edit { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.btn-edit:hover { background: #3b82f6; color: #fff; }
.btn-freeze { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.btn-freeze:hover { background: #f59e0b; color: #fff; }
.btn-unfreeze { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.btn-unfreeze:hover { background: #10b981; color: #fff; }
.btn-delete { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.btn-delete:hover { background: #ef4444; color: #fff; }

/* 模拟大屏浮窗 */
.sim-modal-container {
  background: #151e32;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 18px;
  width: 90%;
  max-width: 1080px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  padding: 20px;
  overflow: hidden;
}

.sim-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-color); padding-bottom: 12px; margin-bottom: 14px;
}

.sim-title-group { display: flex; align-items: center; gap: 10px; }
.sim-title-group h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sim-header-actions { display: flex; align-items: center; gap: 10px; }
.sim-toggle-wrap {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border-color);
}
.sim-switch-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.sim-stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px;
}
.sim-stat-card {
  background: #0e1526; border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 10px;
}
.sim-stat-highlight {
  border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08);
}
.sim-stat-icon {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.sim-stat-body { flex: 1; min-width: 0; }
.sim-stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.sim-stat-val { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.sim-stat-val.winrate { color: #fbbf24; font-size: 18px; }

.sim-table-wrap {
  flex: 1; display: flex; flex-direction: column; background: #0e1526;
  border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; overflow: hidden;
}
.sim-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sim-table-header h4 { font-size: 13px; font-weight: 600; color: #c084fc; display: flex; align-items: center; gap: 6px; }
.sim-table-scroll { flex: 1; max-height: 260px; overflow-y: auto; }

/* 按钮通用 */
.btn {
  padding: 8px 14px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-hover); }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.btn-text { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 8px; }
.btn-text:hover { color: var(--text-secondary); }

.msg-count-badge { font-size: 11px; color: var(--text-muted); background: rgba(255, 255, 255, 0.05); padding: 2px 7px; border-radius: 10px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* 响应式 */
@media (max-width: 1400px) {
  .live-dashboard { grid-template-columns: repeat(3, 1fr); }
  .card-lottery { grid-column: span 2; }
  .admin-stats-dashboard { grid-template-columns: repeat(2, 1fr); }
  .sim-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1200px) {
  .live-dashboard { grid-template-columns: repeat(2, 1fr); }
  .card-lottery { grid-column: span 2; }
  .main-layout { grid-template-columns: 1fr; }
  .sim-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .top-header { flex-direction: column; align-items: stretch; }
  .live-dashboard { grid-template-columns: 1fr; }
  .admin-stats-dashboard { grid-template-columns: 1fr; }
  .card-lottery { grid-column: span 1; }
  .grid-2-col { grid-template-columns: 1fr; }
  .mode-tabs { grid-template-columns: 1fr; }
  .play-mode-tabs { grid-template-columns: 1fr; }
  .receipt-status-card { flex-direction: column; align-items: flex-start; }
  .sim-stats-grid { grid-template-columns: 1fr; }
}
