html, body { height: 100%; margin: 0; }

/* 主题变量：头部背景 + 选中/强调色，个人管理→主题切换即时改写。 */
:root { --x8-header-bg: #23262e; --x8-accent: #1e9fff; }

.x8-header {
  height: 50px;
  background: var(--x8-header-bg);
  color: #c2c6cc;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.x8-header .x8-logo {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #1f3a5f;
  font-size: 15px; font-weight: 700; line-height: 1;
  padding: 6px 14px; border-radius: 16px;
  margin-right: 28px; white-space: nowrap; cursor: default;
}
.x8-header .x8-logo .layui-icon { font-size: 16px; }
.x8-header .x8-logo img { width: 36px; height: 36px; display: block; object-fit: contain; flex: none; }
.x8-header .x8-user { font-size: 14px; margin-left: 16px; white-space: nowrap; }
.x8-header .x8-user a { color: #c2c6cc; margin-left: 12px; }

/* 个人管理下拉 */
.x8-usermenu { position: relative; display: inline-block; }
.x8-usermenu-trigger i { font-size: 12px; margin-left: 2px; }
.x8-usermenu-drop {
  display: none; position: absolute; right: 0; top: 100%; min-width: 120px;
  background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.15); border-radius: 4px;
  padding: 4px 0; z-index: 200;
}
.x8-usermenu.open .x8-usermenu-drop { display: block; }
.x8-usermenu-drop a { display: block; color: #333 !important; margin-left: 0 !important; padding: 8px 16px; white-space: nowrap; font-size: 14px; }
.x8-usermenu-drop a:hover { background: #f2f4f7; }

/* 主题切换 */
.x8-tset-row { display: flex; align-items: center; gap: 12px; }
.x8-tset-row > label { width: 72px; flex: none; color: #555; }
/* 弹层按钮跟随当前主题色：实心=恢复默认，描边=保存/暂不保存 */
.x8-tbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px;
  border: 1px solid var(--x8-header-bg); border-radius: 2px; background: #fff; color: var(--x8-header-bg);
  font-size: 14px; cursor: pointer; transition: opacity .2s; }
.x8-tbtn:hover { opacity: .85; }
.x8-tbtn .layui-icon { font-size: 14px; }
.x8-tbtn-solid { background: var(--x8-header-bg); color: #fff; }
/* 主题弹层每行：拉开间距 + 行间浅分隔线 */
.x8-trow { padding: 18px 0; border-bottom: 1px solid #f0f0f0; }
.x8-trow:last-child { border-bottom: none; }

.x8-body { position: absolute; top: 50px; bottom: 0; left: 0; right: 0; }

/* 顶部横向菜单：与 logo 同处 header 一行，一级横排，有子菜单的点击展开下拉面板 */
.x8-topnav {
  flex: 1; height: 100%;
  display: flex; align-items: stretch;
}
.x8-nav-item {
  position: relative; display: flex; align-items: center; height: 50px;
  color: #c2c6cc; padding: 0 16px; cursor: pointer; user-select: none; font-size: 14px;
}
.x8-nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.x8-nav-item.active { color: #fff; background: var(--x8-accent); }
.x8-nav-label { display: flex; align-items: center; gap: 5px; height: 100%; }
.x8-nav-label i { font-size: 12px; transition: transform .15s; }
.x8-nav-item.open .x8-nav-label i { transform: rotate(180deg); }
.x8-nav-drop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 168px;
  background: var(--x8-header-bg); box-shadow: 0 6px 16px rgba(0,0,0,.3); z-index: 100;
  border-top: 2px solid var(--x8-accent); padding: 4px 0;
}
.x8-nav-item.open .x8-nav-drop { display: block; }
.x8-nav-sub { display: block; color: #c2c6cc; padding: 10px 18px; white-space: nowrap; }
.x8-nav-sub:hover { color: #fff; background: rgba(255,255,255,.08); }
.x8-nav-sub.active { color: #fff; background: var(--x8-accent); }

.x8-main { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
.x8-main #content { width: 100%; height: 100%; border: 0; display: none; }

/* 登录页 */
.x8-login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: #1e2129;
}
.x8-login-box { width: 300px; background: #fff; border-radius: 6px; padding: 32px 28px; }
.x8-login-box .x8-login-title { text-align: center; font-size: 18px; font-weight: 600; margin-bottom: 24px; }
/* 输入框吃掉剩余宽度 整行才跟上面几个框一样宽；高度跟 .layui-input 同值 差 2px 都看得出来 */
.x8-captcha-item { display: flex; gap: 8px; align-items: stretch; }
.x8-captcha-item .x8-captcha-input { flex: 1 1 auto; width: auto; min-width: 0; height: 32px; line-height: 32px; }
/* 边框与圆角照抄 .layui-input（#eee / 2px）：并排放着 差一点色号就看出来是两个东西。
   object-fit:fill 让 SVG 撑满整格 用 contain 的话上下会空出两条白边 */
.x8-captcha-img { box-sizing: border-box; width: 100px; height: 32px; border: 1px solid #eee; border-radius: 2px; cursor: pointer; flex: none; object-fit: fill; }
/* 同一行里那个存 captchaId 的隐藏 input 也算 flex 项 白占一个 gap 图就右边差 8px 收不齐 */
.x8-captcha-item input[type="hidden"] { display: none; }

/* 业务页（iframe 内） */
.x8-page { padding: 18px 18px; box-sizing: border-box; }
.x8-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.x8-toolbar-right { display: flex; align-items: center; gap: 8px; }
.x8-toolbar-right .layui-inline { margin-right: 0; }
.x8-json {
  background: #f7f7f7; border: 1px solid #eee; padding: 8px; margin: 4px 0 12px;
  max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

/* 查询筛选栏（卡片式，控件规整对齐） */
.x8-filter {
  background: #fff; border: 1px solid #e6e6e6; border-radius: 4px;
  padding: 15px 16px 1px; margin: 6px 0 18px;
}
.x8-filter .layui-inline { margin-bottom: 14px; margin-right: 18px; vertical-align: middle; }
.x8-filter .layui-form-label { width: auto; padding: 9px 10px 9px 0; text-align: left; color: #555; }
.x8-filter .x8-filter-btns .layui-btn { margin-right: 8px; }

/* 角色多选（账号绑角色 / 建号） */
.x8-role-picker {
  display: flex; flex-wrap: wrap; align-content: flex-start;
  border: 1px solid #e6e6e6; border-radius: 4px; background: #fafafa;
  padding: 8px 10px; max-height: 240px; overflow: auto;
}
.x8-role-picker .layui-form-checkbox { margin: 5px 8px 5px 0 !important; }
.x8-role-picker.x8-role-empty { display: block; color: #999; padding: 14px; text-align: center; }

/* 密码框可视切换 */
.x8-pwd { position: relative; }
.x8-pwd .layui-input { padding-right: 40px; }
.x8-pwd-toggle {
  position: absolute; right: 10px; top: 0; height: 38px;
  display: flex; align-items: center;
  color: #8a9099; cursor: pointer; user-select: none;
}
.x8-pwd-toggle:hover { color: #1e9fff; }
.x8-pwd-toggle svg { display: block; }

/* 角色配菜单权限表 */
.x8-menu-grant { border: 1px solid #e6e6e6; border-radius: 4px; overflow: hidden; }
.x8-menu-head, .x8-menu-row { display: flex; align-items: center; }
.x8-menu-head { background: #f2f4f7; font-weight: 600; color: #555; border-bottom: 1px solid #e6e6e6; }
.x8-menu-body { max-height: 440px; overflow: auto; }
.x8-menu-row { border-bottom: 1px solid #f0f0f0; }
.x8-menu-row:last-child { border-bottom: 0; }
.x8-menu-row:hover { background: #f5faff; }
.x8-menu-row.x8-mg-top { background: #fafafa; font-weight: 600; }
.x8-mg-name { flex: 1; padding: 9px 12px; }
.x8-mg-col { width: 90px; flex-shrink: 0; text-align: center; padding: 9px 0; }
.x8-menu-head .x8-mg-name { padding-left: 12px; }

/* 监控台概览统计卡片 */
.x8-stat-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.x8-stat-card {
  flex: 1; min-width: 150px; background: #fff; border: 1px solid #e6e6e6;
  border-radius: 4px; padding: 16px 18px;
}
.x8-stat-num { font-size: 24px; font-weight: 600; color: #23262e; }
.x8-stat-label { color: #888; font-size: 13px; margin-top: 6px; }
.x8-section-title { font-size: 15px; font-weight: 600; margin: 20px 0 12px; color: #333; }

/* ── 内容卡片 ──────────────────────────────────────────────
   一页有几块内容就用几张卡。页内不要再另写一套边框圆角
   之前各页各写各的 四种边框色三种圆角 摆在一起就露馅 */
.x8-card { background: #fff; border: 1px solid #e7ebf0; border-radius: 8px; margin-bottom: 14px; }
.x8-card-hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid #f0f2f5;
}
.x8-card-hd b { font-size: 14px; color: #333; }
.x8-card-hd .x8-card-ops { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.x8-card-bd { padding: 14px 16px; }
/* 表格直接贴着卡片边 不要再套一层内边距 */
.x8-card-bd.x8-flush { padding: 0; }

/* ── 数据表 ────────────────────────────────────────────────
   一屏几十行的密排表格 盘口 赔率 排期 开奖都用它 */
table.x8-grid { border-collapse: collapse; width: 100%; }
.x8-grid th, .x8-grid td {
  border-bottom: 1px solid #f0f0f0; padding: 5px 8px;
  text-align: center; font-size: 13px; white-space: nowrap;
}
.x8-grid th { background: #fafafa; color: #666; font-weight: 500; }
/* 表头钉住 长表往下滚还看得见列名 */
.x8-grid thead th { position: sticky; top: 0; z-index: 2; }
/* 名称列左对齐并钉在最左 横向滚动时不跟着跑 */
.x8-grid td.x8-grid-nm {
  text-align: left; background: #fcfcfc; color: #555; font-weight: 500;
  position: sticky; left: 0; z-index: 1;
}
/* 格内填写的框 勾选与单选不算 它们套上尺寸会被撑成大方块 */
.x8-grid input:not([type="checkbox"]):not([type="radio"]) { height: 28px; width: 80px; text-align: center; }
.x8-grid select { height: 28px; width: 84px; }
.x8-grid th.x8-ck, .x8-grid td.x8-ck { width: 34px; padding-left: 4px; padding-right: 4px; }
.x8-grid tr.x8-void td { opacity: .5; text-decoration: line-through; }
.x8-grid tbody tr:hover td { background: #fafcff; }

/* ── 设置表单 ──────────────────────────────────────────────
   两列的 label 控件表格 标签右对齐带浅底 控件左对齐
   一行摆两组字段 屏幕宽的时候不至于左边一列右边一大片空 */
/* 圆角靠 border-radius 加首末行单元格自己切 不能用 overflow:hidden——
   那会把下拉展开的面板一起裁掉 最后几行的选项就看不全了 */
table.x8-formgrid {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e7ebf0; border-radius: 8px;
}
.x8-formgrid tr:first-child td:first-child, .x8-formgrid tr:first-child th:first-child { border-top-left-radius: 7px; }
.x8-formgrid tr:first-child td:last-child { border-top-right-radius: 7px; }
.x8-formgrid tr:last-child td:first-child, .x8-formgrid tr:last-child th:first-child { border-bottom-left-radius: 7px; }
.x8-formgrid tr:last-child td:last-child { border-bottom-right-radius: 7px; }
/* 展开的那个下拉要压在后面的行之上 */
.x8-formgrid td .layui-form-select.layui-form-selected { position: relative; z-index: 30; }
.x8-formgrid td .layui-form-select dl { z-index: 31; }
.x8-formgrid caption, .x8-formgrid .x8-fg-title td {
  background: #eef4f8; color: #333; font-weight: 600; text-align: center;
  padding: 10px; font-size: 14px; border-bottom: 1px solid #e3ebf2;
}
/* 分节：字段多的页面靠它断开 不然二十几个框糊成一片 */
.x8-formgrid .x8-fg-sec td {
  background: #f7f9fa; color: #555; font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-bottom: 1px solid #f0f2f5;
}
/* 标签与控件按比例分 照 AC 那套：标签 15% 右对齐紧挨着控件 控件 35%
   固定宽度的话屏幕一宽 标签就被甩到左边 中间空一大条 */
.x8-formgrid th {
  width: 15%; background: #f7f9fa; color: #666; font-weight: 400;
  text-align: right; padding: 10px 12px; border-bottom: 1px solid #f0f2f5;
  font-size: 13px; white-space: nowrap;
}
.x8-formgrid td { width: 35%; padding: 8px 12px; border-bottom: 1px solid #f0f2f5; }
.x8-formgrid tr:last-child th, .x8-formgrid tr:last-child td { border-bottom: none; }
/* 控件在格里排成一行：输入框 + 单位 + 说明 */
.x8-fg-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.x8-fg-ctl .layui-input { height: 32px; }
.x8-fg-unit { color: #98a2ae; font-size: 12px; }
/* 底部居中的保存条 */
.x8-formbar { text-align: center; padding: 18px 0 4px; }

/* 键值对比表：审计与日志里「改前 / 改后」那种 */
table.x8-change-tb { border-collapse: collapse; width: 100%; }
.x8-change-tb th, .x8-change-tb td {
  border: 1px solid #e6e6e6; padding: 6px 10px; text-align: left; word-break: break-all;
}
.x8-change-tb th { background: #fafafa; color: #666; font-weight: 600; }
.x8-change-tb th:first-child, .x8-change-tb td:first-child { width: 130px; color: #555; }
.x8-change-tb td.x8-new { color: #c0392b; font-weight: 600; }

/* 提示条（桩数据 / 依赖未就绪等一句话说明） */
.x8-tip {
  background: #fffbe8; border: 1px solid #ffe58f; color: #8a6d3b;
  border-radius: 4px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px;
}

/* 首页概览：可点卡片跳转、告警数着色 */
.x8-stat-card.x8-clickable { cursor: pointer; transition: box-shadow .15s; }
.x8-stat-card.x8-clickable:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.x8-num-warn { color: #e6a23c; }
.x8-num-crit { color: #e64545; }

/* 表单必填标记（label 前的红色星号） */
.x8-req { color: #e64545; font-weight: 700; margin-right: 2px; }

/* 无查询权限占位：账号无某页 *.query 权限时替代数据表显示 */
.x8-noperm { padding: 60px 20px; text-align: center; color: #999; font-size: 14px; }

/* 弱化文本（未绑定/未下发等占位） */
.x8-muted { color: #b0b0b0; }

/* 高危操作提示（开奖纠正等触发不可逆后果的操作） */
.x8-danger-note { margin: 6px 22px 0 0; padding: 10px 14px; background: #fdf0ef; border: 1px solid #f5c6c2; border-radius: 4px; color: #a93226; font-size: 13px; line-height: 1.6; }

/* 无操作权限：置灰只读，不隐藏。藏了操作人既不知道有这功能、也不知道该找谁要权限。 */
.x8-ro,
.layui-btn.x8-ro { opacity: .45; cursor: not-allowed; pointer-events: none; filter: grayscale(1); }

/* 详情弹层键值行 */
.x8-kv { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px dashed #eee; font-size: 13px; }
.x8-kv b { display: inline-block; width: 84px; flex-shrink: 0; color: #888; font-weight: 400; }

/* 详情弹层操作按钮区 */
.x8-detail-ops .layui-btn { margin-right: 8px; }

/* 全站按钮尺寸对标参考站：layui 默认 38px/14px 偏大，统一收到 32/30/26px、字号 12px */
.layui-btn { height: 32px; line-height: 32px; font-size: 12px; padding: 0 14px; }
.layui-btn-sm { height: 30px; line-height: 30px; font-size: 12px; padding: 0 12px; }
.layui-btn-xs { height: 26px; line-height: 26px; font-size: 12px; padding: 0 8px; }
.layui-btn-lg { height: 42px; line-height: 42px; font-size: 14px; padding: 0 25px; }
/* 表格行内操作按钮之间留空隙 */
.layui-table .layui-btn-xs + .layui-btn-xs { margin-left: 6px; }

/* 全站输入框/下拉统一高度 32px（对标参考站），表单标签随之居中对齐 */
.layui-input { height: 32px; line-height: 32px; }
.layui-form-select .layui-input, .layui-input-inline > .layui-input { height: 32px; line-height: 32px; }
.layui-form-label { padding-top: 6px; padding-bottom: 6px; line-height: 20px; }
.layui-input-block { min-height: 32px; }
.x8-filter .layui-form-label { padding-top: 6px; padding-bottom: 6px; }

/* 字体与字色对标参考站（微软雅黑 / rgba(0,0,0,.85)） */
body { color: rgba(0, 0, 0, 0.85); }
body, .layui-layer, .layui-table, .layui-form, .layui-input, .layui-btn, .layui-table-view { font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif; }
