:root {
  --el-color-primary: #409eff;
  --sidebar-width: 200px;
  --header-height: 50px;
  --tags-height: 34px;
  /* light (default when html has no .dark) */
  --sidebar-bg: #ffffff;
  --menu-bg: #ffffff;
  --menu-hover: #f5f7fa;
  --menu-text: #303133;
  --menu-active-bg: #ecf5ff;
  --header-bg: #ffffff;
  --main-bg: #f0f2f5;
  --card-bg: #ffffff;
  --border: #e4e7ed;
  --text: #303133;
  --muted: #909399;
  --topbar-border: #e4e7ed;
  --tags-bg: #ffffff;
  --tags-border: #e4e7ed;
  --tag-bg: #f4f4f5;
  --tag-border: #e9e9eb;
  --tag-text: #606266;
  --logo-text: #303133;
  --surface-2: #f5f7fa;
  --surface-3: #ecf5ff;
  --stat-split: #e4e7ed;
  --odds-name: #303133;
  --odds-title: #303133;
}
html.dark {
  color-scheme: dark;
  --sidebar-bg: #1d1e1f;
  --menu-bg: #1d1e1f;
  --menu-hover: #171819;
  --menu-text: #bfcbd9;
  --menu-active-bg: #000000;
  --header-bg: #141414;
  --main-bg: #0a0a0a;
  --card-bg: #1d1e1f;
  --border: #2a2c2e;
  --text: #cfd3dc;
  --muted: #8b8f99;
  --topbar-border: #000000;
  --tags-bg: #1a1a1a;
  --tags-border: #2a2a2a;
  --tag-bg: #2b2b2b;
  --tag-border: #3a3a3a;
  --tag-text: #aaaaaa;
  --logo-text: #ffffff;
  --surface-2: #141414;
  --surface-3: #1a2a40;
  --stat-split: #333333;
  --odds-name: #dddddd;
  --odds-title: #eeeeee;
}
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  background: var(--main-bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }

/* login — blue cube field + white card */
.login-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #0c3d73;
}
.login-cubes {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(64,158,255,.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(20,80,160,.4), transparent 45%),
    linear-gradient(135deg, #0a325e 0%, #1565c0 45%, #0b3a72 100%);
}
.login-cubes:before, .login-cubes:after {
  content: "";
  position: absolute;
  width: 220%; height: 220%;
  left: -60%; top: -60%;
  background-image:
    linear-gradient(30deg, rgba(255,255,255,.06) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.06) 87.5%),
    linear-gradient(150deg, rgba(255,255,255,.05) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.05) 87.5%),
    linear-gradient(30deg, rgba(0,0,0,.08) 12%, transparent 12.5%);
  background-size: 120px 210px;
  transform: rotate(18deg);
  animation: cubes-drift 40s linear infinite;
}
.login-cubes:after { animation-duration: 55s; opacity: .55; left: -40%; }
@keyframes cubes-drift { to { transform: rotate(18deg) translate3d(60px, 80px, 0); } }
.login-card {
  position: relative;
  z-index: 2;
  width: 400px;
  background: #fff;
  border-radius: 6px;
  padding: 25px 25px 5px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  color: #303133;
}
.login-card h3 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #303133;
  letter-spacing: 2px;
}
.login-card .el-input { height: 40px; }
.login-card .el-form-item { margin-bottom: 22px; }
.login-submit { width: 100%; height: 40px; font-size: 16px; letter-spacing: 8px; }
.login-copy {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  z-index: 2;
}
.login-remember { color: #606266; }

/* shell */
.app-wrap { display: flex; height: 100%; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--menu-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.sidebar.collapsed { width: 54px; }
.logo-bar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--menu-bg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.logo-bar img { width: 32px; height: 32px; margin-right: 10px; }
.logo-bar span { font-size: 16px; font-weight: 700; color: var(--logo-text); white-space: nowrap; }
.sidebar .el-menu { border-right: none; background: var(--menu-bg) !important; }
.sidebar .el-menu--inline { background: var(--menu-bg) !important; }
.sidebar .el-menu-item,
.sidebar .el-sub-menu__title {
  color: var(--menu-text) !important;
  height: 56px;
  line-height: 56px;
  display: flex !important;
  align-items: center;
  background: var(--menu-bg) !important;
}
.sidebar .el-sub-menu .el-menu-item {
  height: 50px;
  line-height: 50px;
  padding-left: 50px !important;
}
.sidebar .el-menu-item:hover,
.sidebar .el-sub-menu__title:hover {
  background: var(--menu-hover) !important;
  color: var(--el-color-primary) !important;
}
html.dark .sidebar .el-menu-item:hover,
html.dark .sidebar .el-sub-menu__title:hover {
  color: #fff !important;
}
.sidebar .el-menu-item.is-active {
  background: var(--menu-active-bg) !important;
  color: #409eff !important;
}
.sidebar .el-menu-item.is-active .svg-icon { color: #409eff; }
.sidebar .el-sub-menu__icon-arrow { color: var(--menu-text); }
.svg-icon {
  width: 22px;
  height: 22px;
  margin-right: 16px;
  fill: currentColor;
  color: inherit;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  overflow: hidden;
}
.side-scroll { flex: 1; overflow: auto; }
.side-scroll::-webkit-scrollbar { width: 0; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--main-bg); }
.topbar {
  height: var(--header-height);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--topbar-border);
  color: var(--text);
}
.topbar .hamburger { font-size: 20px; cursor: pointer; margin-right: 12px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .right .ico { cursor: pointer; font-size: 18px; opacity: .9; }
.topbar .right .theme-toggle {
  font-size: 16px;
  line-height: 1;
  user-select: none;
  padding: 4px 6px;
  border-radius: 4px;
}
.topbar .right .theme-toggle:hover { background: var(--menu-hover); }
.topbar .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.tagsview {
  height: var(--tags-height);
  background: var(--tags-bg);
  border-bottom: 1px solid var(--tags-border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: auto;
  gap: 6px;
}
.tag-item {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 2px;
  color: var(--tag-text);
  cursor: pointer;
  white-space: nowrap;
}
.tag-item.active { background: #409eff; border-color: #409eff; color: #fff; }
.tag-item .x { margin-left: 6px; font-size: 12px; }
.app-main { flex: 1; overflow: auto; padding: 16px; background: var(--main-bg); }
.app-main .el-card { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); }
.page-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 4px; padding: 16px; }
.odds-board-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.odds-board-label { color: var(--muted); font-size: 13px; }
.odds-board-tip { color: var(--muted); font-size: 12px; }
.odds-batch { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; flex-wrap: wrap; }
.odds-head, .odds-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.odds-row-wrap { flex-wrap: wrap; align-items: flex-start; }
.odds-name { width: 72px; flex-shrink: 0; color: var(--odds-name); font-weight: 600; }
.odds-hcell { width: 132px; text-align: center; color: var(--muted); font-size: 12px; }
.odds-cell {
  width: 132px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.odds-cell-sm { width: 108px; }
.odds-cell.off { opacity: .42; }
.odds-cell.custom { border-color: #e6a23c; }
.odds-cell .odds-reset { font-size: 12px; color: #e6a23c; cursor: pointer; }
.odds-group-layout { display: flex; gap: 16px; min-height: calc(100vh - 180px); }
.odds-group-side { width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); padding-right: 12px; }
.odds-group-item { padding: 10px 12px; border-radius: 6px; cursor: pointer; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.odds-group-item.active { border-color: #409eff; background: var(--surface-3); }
.odds-group-item-name { color: var(--odds-title); font-weight: 600; }
.odds-group-item .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.odds-group-main { flex: 1; min-width: 0; }
.odds-cell-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.odds-cell-top b { font-size: 13px; color: var(--odds-title); }
.query-form .el-form-item { margin-bottom: 12px; }
.toolbar { margin: 8px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); }

/* home stats */
.home-title { font-size: 22px; font-weight: 500; margin: 8px 0 20px; color: var(--odds-title); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 8px;
  text-align: center;
}
.stat-card .lbl { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.stat-card .nums { display: flex; justify-content: space-around; align-items: baseline; }
.stat-card .n { font-size: 28px; font-weight: 600; color: var(--odds-title); }
.stat-card .split { width: 1px; background: var(--stat-split); }
.online-on { color: #67c23a; }
.online-off { color: #909399; }
.pwd-cell { color: #e6a23c; font-family: Menlo, Consolas, monospace; }
.op-link { color: #409eff; cursor: pointer; margin-right: 8px; font-size: 13px; }
.withdraw-ops { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; line-height: 1.4; }
.withdraw-ops .op-link { margin-right: 0; }
.op-muted { color: #c0c4cc; font-size: 13px; }
.layout-set { padding: 4px 0; }
.layout-set-label { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.layout-set-tip { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.theme-radios { display: flex; width: 100%; }
.theme-radios .el-radio-button { flex: 1; }
.theme-radios .el-radio-button__inner { width: 100%; }
.menu-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 16px;
  margin-left: 6px;
  flex-shrink: 0;
  opacity: .7;
}
.sb-ico { display: none; }
.hidden-xs { }
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: 1fr; }
  .sidebar { position: absolute; z-index: 20; height: 100%; }
}
