/* ===== 全局重置与变量 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:    #0f1117;
  --bg-secondary:  #1a1d27;
  --bg-card:       #1e2130;
  --bg-card-hover: #252840;
  --border:        #2e3248;
  --border-light:  #3a3f5c;
  --accent:        #6c63ff;
  --accent-hover:  #5a52e0;
  --accent-glow:   rgba(108,99,255,0.25);
  --green:         #22c55e;
  --green-dim:     rgba(34,197,94,0.15);
  --red:           #ef4444;
  --red-dim:       rgba(239,68,68,0.15);
  --yellow:        #f59e0b;
  --yellow-dim:    rgba(245,158,11,0.15);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.15);
  --text-primary:  #e8eaf6;
  --text-secondary:#9ca3c8;
  --text-muted:    #6b7280;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --transition:    0.18s ease;
}

html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== 布局 ===== */
.app-container { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.sidebar-logo .brand-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sidebar-logo .brand-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 10px 18px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar-footer .user-info { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sidebar-footer .avatar {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.sidebar-footer .username { font-size: 12px; color: var(--text-primary); font-weight: 600; }
.sidebar-footer .logout-btn {
  width: 100%;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  transition: all var(--transition);
}
.sidebar-footer .logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ===== 主内容区 ===== */
.main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: 54px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-running { background: var(--green-dim); color: var(--green); }
.badge-stopped { background: var(--red-dim); color: var(--red); }
.badge-paused  { background: var(--yellow-dim); color: var(--yellow); }
.badge-pending { background: var(--blue-dim); color: var(--blue); }
.badge-failed  { background: var(--red-dim); color: var(--red); }

.page-body { padding: 20px 24px; flex: 1; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-title .icon { font-size: 16px; }

/* ===== 统计数字卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.stat-card .stat-value.positive { color: var(--green); }
.stat-card .stat-value.negative { color: var(--red); }
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover  { opacity: 0.85; }
.btn-warning { background: var(--yellow); color: #000; }
.btn-warning:hover { opacity: 0.85; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
.form-control {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-card); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ===== 开关 ===== */
.toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-wrap input[type=checkbox] { display: none; }
.toggle {
  width: 36px; height: 20px;
  background: var(--border-light);
  border-radius: 10px;
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }
.toggle-label { font-size: 12px; color: var(--text-secondary); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { border-bottom: 1px solid var(--border); }
thead th { padding: 8px 12px; text-align: left; color: var(--text-muted); font-weight: 600; font-size: 11px; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td { padding: 9px 12px; color: var(--text-secondary); vertical-align: middle; }
tbody td.td-main { color: var(--text-primary); font-weight: 500; }

/* ===== 日志 ===== */
.log-container {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 320px;
  overflow-y: auto;
  padding: 10px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
}
.log-line { display: flex; gap: 8px; }
.log-time { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.log-type { flex-shrink: 0; width: 42px; text-align: center; border-radius: 3px; font-size: 10px; font-weight: 600; padding: 1px 0; }
.log-type.info    { background: var(--blue-dim); color: var(--blue); }
.log-type.settle  { background: var(--green-dim); color: var(--green); }
.log-type.warn    { background: var(--yellow-dim); color: var(--yellow); }
.log-type.error   { background: var(--red-dim); color: var(--red); }
.log-type.login   { background: rgba(168,85,247,0.15); color: #a855f7; }
.log-type.bet     { background: rgba(6,182,212,0.15); color: #06b6d4; }
.log-type.config  { background: var(--accent-glow); color: var(--accent); }
.log-type.bet_ok  { background: rgba(6,182,212,0.15); color: #06b6d4; }
.log-type.win     { background: var(--green-dim); color: var(--green); }
.log-type.lose    { background: var(--red-dim); color: var(--red); }
.log-type.debug   { background: rgba(100,100,100,0.15); color: #888; }
.log-msg { color: var(--text-secondary); word-break: break-all; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
  box-shadow: var(--shadow);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { color: var(--text-primary); background: var(--border); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 标签页 ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 分页 ===== */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 14px; }
.page-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent-glow); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state .empty-text { font-size: 13px; }

/* ===== 加载动画 ===== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 进度条 ===== */
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

/* ===== 告警/提示框 ===== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-info    { background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-warning { background: var(--yellow-dim); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-danger  { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }

/* ===== 任务卡片 ===== */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.task-card:hover { border-color: var(--border-light); }
.task-card.running { border-left: 3px solid var(--green); }
.task-card.stopped { border-left: 3px solid var(--text-muted); }
.task-card.paused  { border-left: 3px solid var(--yellow); }
.task-card.failed  { border-left: 3px solid var(--red); }
.task-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.task-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.task-card-actions { display: flex; gap: 6px; }
.task-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.task-stat { text-align: center; }
.task-stat .ts-label { font-size: 10px; color: var(--text-muted); }
.task-stat .ts-value { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.task-stat .ts-value.pos { color: var(--green); }
.task-stat .ts-value.neg { color: var(--red); }
.task-info-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.task-info-row span { display: flex; align-items: center; gap: 4px; }

/* ===== 算法选择器 ===== */
.algo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.algo-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.algo-item:hover { border-color: var(--accent); }
.algo-item.selected { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }
.algo-item .algo-check { width: 14px; height: 14px; border: 1px solid var(--border); border-radius: 3px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.algo-item.selected .algo-check { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== 倍投序列输入 ===== */
.seq-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 38px;
  align-items: center;
}
.seq-tag {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== 实时指示灯 ===== */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.pulse-dot.green { background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: pulse-green 1.5s infinite; }
.pulse-dot.red   { background: var(--red); }
.pulse-dot.yellow{ background: var(--yellow); }
.pulse-dot.grey  { background: var(--text-muted); }
@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.06) 0%, transparent 50%);
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.login-btn { width: 100%; padding: 10px; font-size: 14px; margin-top: 6px; }
.login-footer { text-align: center; margin-top: 16px; font-size: 11px; color: var(--text-muted); }

/* ===== 响应式 ===== */
.hamburger { display: none; background: none; border: none; color: var(--text-primary); font-size: 20px; cursor: pointer; padding: 4px; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .task-stats { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .algo-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 14px; }
}

/* ===== 工具类 ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-yellow{ color: var(--yellow); }
.text-accent{ color: var(--accent); }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* ===== 走势图样式 ===== */
.trend-table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 320px;
}

.trend-th-period {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 6px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  width: 90px;
}

.trend-th-room {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 4px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  width: 72px;
  line-height: 1.4;
}

.room-0-th { color: #468ad9; }
.room-1-th { color: #ff4267; }
.room-2-th { color: #ff4267; }
.room-3-th { color: #468ad9; }

.trend-room-sub {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.8;
}

.trend-td {
  padding: 5px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  height: 36px;
  vertical-align: middle;
}

.trend-td-even {
  background: rgba(255,255,255,0.02);
}

.trend-td-period {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  height: 36px;
  vertical-align: middle;
}

.trend-period-link {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

/* 走势圆圈 */
.trend-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* 绿色 = 连续命中 */
.circle-green {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 0 6px rgba(34,197,94,0.4);
}

/* 红色 = 首次命中（方向切换） */
.circle-red {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 6px rgba(239,68,68,0.4);
}

/* 保留蓝色兼容旧样式 */
.circle-blue {
  background: #468ad9;
  color: #fff;
}

/* 房间标签 */
.trend-room-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.room-0-badge { background: rgba(70,138,217,0.2); color: #468ad9; }
.room-1-badge { background: rgba(255,66,103,0.2); color: #ff4267; }
.room-2-badge { background: rgba(255,66,103,0.2); color: #ff4267; }
.room-3-badge { background: rgba(70,138,217,0.2); color: #468ad9; }

/* 最新一行高亮 */
.trend-row-latest td {
  background: rgba(34,197,94,0.06) !important;
  border-top: 1px solid rgba(34,197,94,0.2);
  border-bottom: 1px solid rgba(34,197,94,0.2);
}
.trend-row-latest .trend-td-period {
  color: #22c55e;
  font-weight: 600;
}

/* 期数列直接显示文字（去掉旧的span包裹） */
.trend-td-period {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  padding: 5px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  height: 36px;
  vertical-align: middle;
}

/* 新期闪烁动画 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 走势表格容器最大高度限制 */
.trend-table-container {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: auto;
}

/* 固定表头 */
.trend-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

/* 移动端走势图适配 */
@media (max-width: 768px) {
  .trend-th-period { width: 70px; font-size: 10px; }
  .trend-th-room { width: 56px; font-size: 10px; }
  .trend-circle { width: 24px; height: 24px; font-size: 11px; }
  .trend-td-period { font-size: 10px; padding: 5px 6px; }
}
