/* pages/style.css — 全局暗色主题（登录/注册/主界面共用） */

:root {
  --bg: #0f141b;
  --bg-soft: #161d27;
  --bg-card: #1b2430;
  --bg-input: #0d1219;
  --border: #2a3543;
  --text: #e5e7eb;
  --text-dim: #9aa7b8;
  --primary: #f59e0b;
  --primary-soft: #b45309;
  --accent: #38bdf8;
  --ok: #34d399;
  --error: #f87171;
  --macau: #60a5fa;
  --hk: #f472b6;
  --topbar-box-height: 34px;

  /* 全局固定布局宽度：前台/后台最外层容器锁定此值，不随浏览器缩放变化 */
  --layout-w: 1920px;

  /* —— 本轮新增（后台通用 / 设计 Token） —— */
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-pop: 0 20px 60px rgba(0,0,0,.55);
  --dur: 150ms;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  /* 窄屏时整页横向滚动兜底：固定画布不被裁切、不压缩内容 */
  overflow-x: auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== 登录/注册 ===================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(56,189,248,.10) 0%, transparent 45%),
    radial-gradient(ellipse at 15% 25%, rgba(99,102,241,.06) 0%, transparent 35%),
    linear-gradient(180deg, #060912 0%, #0a0e1a 50%, #0d1525 100%);
  position: relative;
  overflow: hidden;
}
/* 多层视差星空漂移 */
.auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    /* 远层 — 微弱小白星，向右下漂 */
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,.6), transparent 50%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,.5), transparent 50%),
    /* 中层 — 青蓝星，向左下漂 */
    radial-gradient(1px 1px at 35% 45%, rgba(56,189,248,.6), transparent 50%),
    radial-gradient(1px 1px at 75% 25%, rgba(56,189,248,.5), transparent 50%),
    /* 近层 — 亮星，向右上漂 */
    radial-gradient(1.5px 1.5px at 25% 65%, rgba(255,255,255,.85), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 50%, rgba(96,165,250,.75), transparent 50%);
  background-size: 220px 220px, 220px 220px, 300px 300px, 300px 300px, 380px 380px, 380px 380px;
  background-repeat: repeat;
  animation: starDrift 30s linear infinite;
  z-index: 0;
  pointer-events: none;
}
@keyframes starDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 220px 220px, -220px 220px, 300px -300px, -300px -300px, 380px 380px, -380px 380px; }
}

/* 透视网格地板加速 */
.auth-body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 250%;
  height: 55%;
  transform: translateX(-50%) perspective(400px) rotateX(68deg);
  transform-origin: center bottom;
  background-image:
    linear-gradient(rgba(56,189,248,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,.22) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: scifiGrid 1.2s linear infinite;
  z-index: 0;
  pointer-events: none;
}
@keyframes scifiGrid {
  0% { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

/* 动态特效容器 */
.auth-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* 水平扫描光带 */
.auth-fx::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  background: linear-gradient(180deg, transparent, rgba(56,189,248,.03) 30%, rgba(56,189,248,.07) 50%, rgba(56,189,248,.03) 70%, transparent);
  animation: scanLine 3.5s linear infinite;
  top: -140px;
}
@keyframes scanLine {
  0%   { transform: translateY(0); }
  100% { transform: translateY(calc(100vh + 140px)); }
}
/* 数字雨 Canvas */
.auth-card {
  position: relative;
  z-index: 1;
  width: 360px;
  max-width: none;
  background: rgba(27, 36, 48, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow:
    0 18px 50px rgba(0,0,0,0.5),
    0 0 40px rgba(56,189,248,.08),
    inset 0 1px 0 rgba(255,255,255,.05);
}
.auth-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: 6px;
  text-align: center;
  color: var(--primary);
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}
.auth-sub {
  margin: 6px 0 22px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 13px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: var(--primary); }
.field-hint { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; color: var(--text-dim); opacity: 0.8; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
#captchaCanvas {
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #1f2937;
}
.btn-primary {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
  background: var(--primary);
  color: #1a1206;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: #fbbf24; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-msg { min-height: 18px; margin: 10px 0 0; font-size: 13px; text-align: center; }
.auth-msg.error { color: var(--error); }
.auth-msg.ok { color: var(--ok); }
.auth-link { text-align: center; margin: 14px 0 0; color: var(--text-dim); font-size: 13px; }

/* ===================== 主界面 ===================== */
.app {
  width: var(--layout-w);
  max-width: none;
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-size: 22px; font-weight: 800; letter-spacing: 4px; color: var(--primary); }
.topbar .hyid { color: var(--text-dim); font-size: 13px; }
.topbar .lunar-clock { color: var(--text-dim); font-size: 13px; margin-right: 6px; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* 顶栏信息框 —— 两个框共用同一固定高度，确保视觉等高
   说明：仅靠 padding / font-size 无法抵消 CJK 粗体（.info-title font-weight:800）
   与常规字重（.lunar-clock）之间的字形度量差异，故用 CSS 变量统一 height，
   并设 line-height:1 + align-items:center，使渲染高度像素级一致。 */
.clock-box,
.info-box {
  box-sizing: border-box;
  height: var(--topbar-box-height);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 0 12px;
  display: flex;
  align-items: center;
  line-height: 1;
}
.clock-box { white-space: nowrap; gap: 0; flex: none; min-width: 300px; justify-content: center; overflow: hidden; }
.clock-box .lunar-clock { margin-right: 0; line-height: 1; font-variant-numeric: tabular-nums; }
.info-box {
  gap: 12px;
  padding: 0 14px;
}
.info-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  padding-right: 12px;
  line-height: 1;
}
.info-fields {
  display: flex;
  align-items: center;
  gap: 18px;
  line-height: 1;
}
.ifield {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  line-height: 1;
}
.ifield b { color: var(--text); font-weight: 700; }

/* 顶部统计栏 */
.stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: flex-end;
  padding: 12px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
/* 当期配置框 */
.config-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;   /* 推到 stat-bar 最右边 */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 16px;
  background: var(--bg-card);
}
.config-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  padding-right: 14px;
}
.config-fields {
  display: flex;
  align-items: stretch;
}
.stat-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
}
.stat-field:not(:first-child) {
  border-left: 1px solid var(--border);
}
.stat-field:first-child {
  padding-left: 14px;
}
.stat-field label { font-size: 12px; color: var(--text-dim); }
.stat-field input {
  width: 92px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
  outline: none;
}
.stat-field input:focus { border-color: var(--primary); }
/* footer 数据汇总 */
.footer-stat-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 14px;
  background: var(--bg-card);
}
.footer-stat-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.footer-stats {
  display: flex;
  align-items: stretch;
}
.fstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 18px;
}
.fstat:not(:first-child) {
  border-left: 1px solid var(--border);
}
.fstat:first-child {
  padding-left: 12px;
}
.fstat-label {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.fstat-value {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 10px;
  border-radius: 6px;
}
/* 六个数字各一色，互不重复 */
#statMacau    { color: #60a5fa; }  /* 澳门彩投注 - 蓝 */
#statHk       { color: #f472b6; }  /* 香港彩投注 - 粉 */
#statTotal    { color: #f59e0b; }  /* 投注合计   - 橙 */
#statMacauWin { color: #a855f7; }  /* 澳门彩中奖 - 紫 */
#statHkWin    { color: #ef4444; }  /* 香港彩中奖 - 红 */
#statWin      { color: #34d399; }  /* 中奖合计   - 绿 */

/* 主区域：左表格 + 右 AI */
.main {
  flex: 1;
  display: flex;
  min-height: 0;
}
.left, .right {
  padding: 14px 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.left { flex: 1.4; border-right: 1px solid var(--border); overflow: hidden; }
.right { flex: 1; overflow-y: auto; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h2 { font-size: 15px; margin: 0; }
.recognize-title { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: .5px; position: relative; padding-left: 12px; line-height: 1.2; }
.recognize-title::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; border-radius: 2px; background: var(--accent); }
.toggle { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.toggle button {
  padding: 5px 12px;
  background: var(--bg-input);
  color: var(--text-dim);
  border: none;
  cursor: pointer;
  font-size: 13px;
}
.toggle button.active { background: var(--primary); color: #1a1206; font-weight: 700; }
.sort-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.sort-hint { font-size: 11.5px; color: var(--text-dim); margin: -4px 0 10px; line-height: 1.5; }
.sort-hint b { color: var(--text); font-weight: 600; }

/* 右侧「识别与录入」面板：排序、按钮统一靠右对齐 */
.right .panel-head .sort-label { margin-left: auto; }
.right .ai-actions { justify-content: flex-end; }

/* ====== 表格（7列：序号 | 报单内容 | 金额 | 中奖金额 | 类型 | 录入时间 | 操作）====== */
.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  /* 不写死高度：自动占满 .left 内 footer 上方的剩余空间，数据超出才出滚动条 */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 8px;
}
/* 全局滚动条（与「当期统计表」表格一致，弃用经典原生滚动条） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: rgba(245,158,11,0.4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(245,158,11,0.65); background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: rgba(245,158,11,0.4) rgba(255,255,255,0.04); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

/* ---- 表头 ---- */
thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-soft);
  color: var(--text-dim);
  text-align: center;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);   /* 竖向分隔线 */
  letter-spacing: 0.5px;
}
thead th:last-child { border-right: 1px solid var(--border); } /* 操作列也画右边框，与外框对齐 */
thead th:first-child { width: 48px; }    /* 序号 */
thead th:nth-child(3) { width: 90px; }   /* 金额 */
thead th:nth-child(4) { width: 90px; }   /* 中奖金额 */
thead th:nth-child(5) { width: 60px; }   /* 类型 */
thead th:nth-child(6) { width: 160px; }  /* 录入时间 */
thead th:last-child { width: 120px; }    /* 操作（溯源 + 删除 两个按钮） */
/* 报单内容（第2列）不设固定宽度：fixed 布局下自动占满其余所有剩余空间 */

/* ---- 单元格：完整格线表格 ---- */
tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);   /* 行分隔线改为明显的外框色 */
  border-right: 1px solid var(--border);    /* 竖向分隔线改为明显的外框色 */
  vertical-align: middle;
  font-size: 13px;
  overflow: hidden;
}
/* 最后一列（操作）也画右边框，与表头对齐 */
tbody td:last-child { border-right: 1px solid var(--border); }
/* （已移除 tbody 背景网格线 — 数据行高不固定时网格线会错位，造成"每行多一条线"） */
/* 斑马纹淡化，不覆盖网格 */
tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
tbody tr:hover { background: rgba(245,158,11,0.06); }

/* 序号列：居中 */
#dataTable tbody td:first-child { text-align: center; color: var(--text-dim); }
/* 窄列：金额 / 中奖金额 / 类型 / 录入时间 / 操作 —— 内容居中 + 禁止换行 */
#dataTable tbody td:nth-child(3),
#dataTable tbody td:nth-child(4),
#dataTable tbody td:nth-child(5),
#dataTable tbody td:nth-child(6),
#dataTable tbody td:nth-child(7) {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 报单内容列：内容左对齐（表头仍是居中），可换行 */
#dataTable tbody td:nth-child(2) {
  text-align: left;
  word-break: break-all;
  line-height: 1.5;
}
.tag { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag.macau { background: rgba(96,165,250,0.18); color: var(--macau); }
.tag.hk { background: rgba(244,114,182,0.18); color: var(--hk); }
.empty { padding: 30px; text-align: center; color: var(--text-dim); }

/* 号码属性视图 */
.freq-row td:first-child { font-weight: 700; color: var(--accent); }
/* 波色球：实心圆内写黑字 */
.ball-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  margin: 0 auto;
}
/* 号码属性视图：所有数据居中；属性列（天地/美丑/家野/男女/单双/大小/色球/生肖/号码）等宽均匀分布 */
#dataTable.freq-view th,
#dataTable.freq-view td { text-align: center; }
/* 序号：固定窄列（宽度不变） */
#dataTable.freq-view th:nth-child(1),
#dataTable.freq-view td:nth-child(1) {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}
/* 属性列（天地/美丑/家野/男女/单双/大小/生肖/色球/号码）：等宽均匀分布 */
#dataTable.freq-view th:nth-child(2),
#dataTable.freq-view td:nth-child(2),
#dataTable.freq-view th:nth-child(3),
#dataTable.freq-view td:nth-child(3),
#dataTable.freq-view th:nth-child(4),
#dataTable.freq-view td:nth-child(4),
#dataTable.freq-view th:nth-child(5),
#dataTable.freq-view td:nth-child(5),
#dataTable.freq-view th:nth-child(6),
#dataTable.freq-view td:nth-child(6),
#dataTable.freq-view th:nth-child(7),
#dataTable.freq-view td:nth-child(7),
#dataTable.freq-view th:nth-child(8),
#dataTable.freq-view td:nth-child(8),
#dataTable.freq-view th:nth-child(9),
#dataTable.freq-view td:nth-child(9),
#dataTable.freq-view th:nth-child(10),
#dataTable.freq-view td:nth-child(10) {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}
/* 下注金额（澳门彩）与（香港彩）：等宽 */
#dataTable.freq-view th:nth-child(11),
#dataTable.freq-view td:nth-child(11),
#dataTable.freq-view th:nth-child(12),
#dataTable.freq-view td:nth-child(12) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* 结算统计视图 — 三个板块（香港彩 / 澳门彩 / 合计） */
.settle-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;
  align-items: start;
}
.settle-empty {
  color: var(--text-dim);
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
}
.settle-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.settle-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.settle-card-head .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.settle-metrics { display: flex; flex-direction: column; gap: 6px; }
.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  font-size: 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.metric:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.m-label { color: var(--text-dim); }
.m-val {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.val-rebate { color: #f59e0b; }
.val-win { color: #34d399; }
.val-pay { color: #60a5fa; }
.val-net { font-size: 14px; }
/* 合计板块高亮（琥珀系） */
.settle-card-total {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.06);
}
.settle-card-total .settle-card-head {
  color: #f59e0b;
  border-bottom-color: rgba(245, 158, 11, 0.3);
}

/* 右侧 AI 区 — .preview 的样式已移到下方「AI预览区（按截图格式）」 */
textarea.paste {
  width: 100%;
  height: 110px;
  margin-top: 10px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font-size: 13px;
  outline: none;
}
textarea.paste:focus { border-color: var(--primary); }
.ai-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); color: #1a1206; border-color: var(--primary); font-weight: 700; }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(1); }
.btn.primary:hover { background: #fbbf24; color: #1a1206; }
.btn.danger { background: transparent; color: var(--error); border-color: rgba(248, 113, 113, 0.5); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--error); color: #fca5a5; }
.btn.accent { background: var(--accent); color: #06222e; border-color: var(--accent); font-weight: 700; }

/* 流光外壳按钮：非实心，渐变流光边框 */
/* 流光金边：锥形渐变绕外框转圈 */
@property --bf-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.btn-flow {
  position: relative;
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: 8px;
  background-color: transparent;
  background-image:
    linear-gradient(var(--bg-input), var(--bg-input)),
    conic-gradient(from var(--bf-angle),
      #7a5c12 0deg,
      #b8860b 70deg,
      #ffd700 130deg,
      #fff4c2 160deg,
      #ffd700 190deg,
      #b8860b 250deg,
      #7a5c12 310deg,
      #b8860b 360deg);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: btnFlow 2.6s linear infinite;
}
@keyframes btnFlow {
  to { --bf-angle: 360deg; }
}
.btn-flow:hover {
  color: #ffd700;
  animation-duration: 1.4s;
}
.btn-flow:disabled {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(1);
  animation: none;
}

/* 修正对话区已改为下方「AI 对话修正区」(.chat-area) */

/* 底部汇总栏 */
.footer {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 18px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.footer .sum { display: flex; flex-direction: column; }
.footer .sum .l { font-size: 12px; color: var(--text-dim); }
.footer .sum .v { font-size: 15px; font-weight: 700; }
.footer .spacer { flex: 1; }

/* toast */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 99; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { border-color: var(--error); color: var(--error); }
.toast.ok { border-color: var(--ok); color: var(--ok); }

/* ===================== 报单内容列 ===================== */
/* 按钮已移至操作列，这里恢复为普通单元格：
   行高完全由文字行数决定，与其他列共享同一行高，不再用 flex 容器 */
.cell-order {
  line-height: 1.5;
}
.order-text {
  word-break: break-all;
  line-height: 1.5;
}
.orig-btn {
  background: transparent;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  padding: 3px 9px;
  line-height: 1.2;
  transition: all .15s;
}
.orig-btn:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: #38bdf8;
}

/* ===================== 原始输入弹窗 ===================== */
.original-modal-box {
  width: 520px;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.original-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.original-modal-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}
.original-modal-head button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.original-modal-head button:hover {
  color: var(--error);
  background: rgba(248,113,113,0.1);
}
#originalModalContent {
  margin: 14px 18px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  max-height: 50vh;
}

/* ===================== AI 预览区（按截图格式） ===================== */
.preview {
  flex: 1;
  overflow: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.8;
  min-height: 120px;
}
.preview .ph { color: var(--text-dim); }
.preview .staged { color: var(--error); }
.preview .staged-wrap { margin-bottom: 10px; }
.preview .no-order-wrap { margin-bottom: 10px; }
.preview .no-order { color: var(--accent); font-size: 13px; }

/* 预览行：投注彩种 / 合计金额 */
.preview .prev-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 4px;
}
.preview .prev-gap { display: inline-block; width: 18px; }
.preview .prev-label {
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  min-width: 80px;
}
.preview .prev-val {
  color: var(--text);
  font-size: 14px;
}
.preview .prev-amount {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

/* 预览区分隔横线（仅「识别明细」与「生肖对照表」之间） */
.preview .prev-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 14px 0 10px;
}

/* 识别明细卡片框 */
.preview .prev-card {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 6px;
  line-height: 2;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-all;
}
/* 生肖对照表卡片框 — 蓝色系 */
.preview .prev-card-zodiac {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.25);
  border-left: 3px solid #3b82f6;
  color: var(--text-dim);
  font-size: 11px;
}
/* 金额合并表卡片框 — 绿色系（与识别明细橙色、对照表蓝色区分，突出"汇总"） */
.preview .prev-card-merge {
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.3);
  border-left: 3px solid #22c55e;
  font-size: 11px;
}
/* 空状态 */
.preview .prev-card-empty {
  color: var(--text-dim);
}
/* 识别明细异常标红 */
.preview .prev-card-error {
  color: #ff4444 !important;
  font-weight: 700;
  background: rgba(255,68,68,0.08) !important;
  border: 1px solid rgba(255,68,68,0.3) !important;
  border-left: 3px solid #ff4444 !important;
}
/* 异常提示（可点击引导到修正模式） */
.preview .prev-warning {
  color: #ff4444;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
}
.preview .prev-warning:hover {
  color: #ff6666;
}

/* ===================== 号码球色波颜色 ===================== */
.ball-red { color: #e74c3c; font-weight: 600; }
.ball-blue { color: #3498db; font-weight: 600; }
.ball-green { color: #2ecc71; font-weight: 600; }

/* 顶部标题栏右侧：识别状态容器（自身无边框，内部用 .sb-pill / .sb-pill-idle 呈现） */
.status-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: default;
}
.status-pill.sb-error { color: #ff4444; font-weight: 600; }
.status-pill.sb-loading { color: var(--accent); }
/* 识别状态标签：暗色标签风格，与界面 .btn 同源；未识别(待操作)用主色琥珀、已识别(完成)用成功绿，仅文字色区分 */
.sb-pill, .sb-pill-idle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sb-pill { color: var(--ok); }            /* 已识别：成功绿 */
.sb-pill-idle { color: var(--primary); }  /* 未识别：主色琥珀，引导点击 */
/* 按钮行左侧：无单位金额写法提醒（红标，位于识别/预览按钮左边，靠左显示） */
.no-unit-warn {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin: 0;
  margin-right: auto;
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  animation: warnBlink 1s ease-in-out infinite;
}
/* 红标描边闪烁：边框颜色加深 + 外发光脉冲交替，更醒目 */
@keyframes warnBlink {
  0%, 100% { border-color: #fca5a5; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
  50%      { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35); }
}
/* 红标右侧警示灯：脉冲扩散光圈，像警报灯 */
.no-unit-warn::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  border-radius: 50%;
  background: #dc2626;
  vertical-align: middle;
  animation: warnLight 1.1s ease-in-out infinite;
}
@keyframes warnLight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); opacity: 1; }
  50%      { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .no-unit-warn, .no-unit-warn::after { animation: none; }
}

/* 载入数据按钮（实心蓝，与清空/保存并列） */
/* 数据操作按钮：描边风格，与 .btn / .btn.danger 同源，用语义色区分（不再实心填充） */
.btn-load {
  color: var(--macau);
  border-color: rgba(96, 165, 250, 0.45);
  background: transparent;
}
.btn-load:hover { background: rgba(96, 165, 250, 0.12); border-color: var(--macau); color: #93c5fd; }

/* 清空当前数据按钮（描边红，危险操作） */
.btn-clear-all {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.45);
  background: transparent;
}
.btn-clear-all:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--error); color: #fca5a5; }

/* 保存本次记录按钮（描边绿，正向操作） */
.btn-save {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.45);
  background: transparent;
}
.btn-save:hover { background: rgba(52, 211, 153, 0.12); border-color: var(--ok); color: #6ee7b7; }

/* 反馈投诉按钮（描边金/琥珀色，与载入/清空/保存同款描边风格，仅换色） */
.btn-feedback {
  color: var(--primary);
  border-color: rgba(245, 158, 11, 0.45);
  background: transparent;
}
.btn-feedback:hover { background: rgba(245, 158, 11, 0.12); border-color: var(--primary); color: #fcd34d; }

/* 删除行按钮（表格操作列） */
/* 操作列：📋 与 🗑 并排 */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* 删除按钮：与「查看原始输入」同款无边框图标风格 */
.btn-del-row {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  padding: 3px 9px;
  line-height: 1.2;
  transition: all .15s;
}
.btn-del-row:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: #f87171;
}

/* AI 对话修正入口（预览区下方链接） */
.correct-link-wrap { margin-top: 12px; text-align: center; }
.correct-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
}
.correct-link:hover { color: #7dd3fc; }

/* ====== AI 对话修正区 ====== */
.chat-area {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden;
  max-height: 320px;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(56,189,248,0.08);
  border-bottom: 1px solid var(--border);
}
.chat-title { font-size: 13px; font-weight: 700; color: var(--accent); }
.chat-close-btn {
  background: none; border: none; color: var(--text-dim); font-size: 20px;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.chat-close-btn:hover { color: var(--error); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  max-height: 180px;
}
.chat-msg { display: flex; flex-direction: column; gap: 2px; max-width: 85%; }
.chat-msg-user { align-self: flex-end; }
.chat-msg-assistant, .chat-msg-system { align-self: flex-start; }
.chat-msg-label { font-size: 11px; color: var(--text-dim); }
.chat-msg-user .chat-msg-label { text-align: right; }
.chat-msg-text {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.chat-msg-user .chat-msg-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.chat-msg-assistant .chat-msg-text {
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.2);
  color: var(--text);
}
.chat-msg-system .chat-msg-text {
  background: transparent;
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.chat-input {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn { padding: 8px 16px; }

/* ===================== 载入弹窗内批次列表 ===================== */
.batch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  margin-bottom: 8px;
}
.batch-item:last-child { margin-bottom: 0; }

/* ====== 温馨提示弹窗（替代浏览器 alert） ====== */
.alert-modal-box {
  width: 360px;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
}
.alert-modal-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.alert-modal-msg {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  text-align: left;
  white-space: pre-wrap;
}
.alert-modal-actions {
  display: flex;
  justify-content: center;
}
.alert-modal-actions .btn-accent {
  padding: 8px 28px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #06222e;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.alert-modal-actions .btn-accent:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
}

.name-modal-box {
  width: 400px;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.name-modal-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.name-modal-note {
  margin: -10px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
}
.load-modal-box {
  width: 460px;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.load-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0 0 8px;
}
.load-modal-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.5;
}
.load-modal-count {
  font-size: 12px;
  color: var(--text-dim);
  text-align: left;
  margin-top: 8px;
}
.load-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}
/* ====== 年末存档关闭窗口红色标注 ====== */
.archive-warn {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #ef4444;
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 8px;
}

.save-list-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 10px;
  background: var(--bg-soft);}
.save-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.sys-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 6px;
}
.sys-config-row .name-modal-field { margin-bottom: 0; }
.sys-config-row input {
  padding: 6px 8px;
  font-size: 13px;
}
.name-modal-field {
  position: relative;
  margin-bottom: 10px;
}
.name-modal-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.name-modal-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.name-modal-field input:focus { border-color: var(--accent); }
.name-modal-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
}
.name-modal-error {
  margin: 0 0 12px;
  color: var(--error);
  font-size: 12px;
  min-height: 18px;
}
.name-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.name-modal-actions .btn-ghost {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.name-modal-actions .btn-ghost:hover {
  border-color: var(--text);
}
.name-modal-actions .btn-accent {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #06222e;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.name-modal-actions .btn-accent:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
}
.batch-item .batch-info { font-size: 13px; color: var(--text); }
.batch-item .batch-actions { display: flex; gap: 8px; }
.batch-item .btn-load-batch {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #06222e;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}
.batch-item .btn-load-batch:hover { background: #7dd3fc; border-color: #7dd3fc; }
.batch-item .btn-del-batch {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 6px;
  cursor: pointer;
}
.batch-item .btn-del-batch:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: var(--error);
}

/* ===================== 盘选择器（计算盘顶栏） ===================== */
.board-select {
  padding: 6px 10px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  max-width: 200px;
}
.board-select:focus { border-color: var(--primary); }

/* ===================== 开关（role=switch） ===================== */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  flex: none;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--border);
  transition: background var(--dur), border-color var(--dur);
}
.switch .thumb {
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--dur), background var(--dur);
}
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked ~ .thumb { transform: translateX(18px); background: #1a1206; }

/* ===================== 管理后台布局 ===================== */
.admin-app { width: var(--layout-w); max-width: none; margin: 0 auto; height: 100vh; display: flex; overflow: hidden; }
.admin-sidebar {
  width: 200px; flex: none;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding-top: 6px;
}
.admin-brand {
  font-size: 16px; font-weight: 800; letter-spacing: 1px;
  color: var(--primary); padding: 14px 18px; white-space: nowrap;
}
.admin-nav { display: flex; flex-direction: column; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 11px 18px;
  background: transparent; border: none;
  border-left: 3px solid transparent;
  color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-item.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: rgba(245,158,11,0.08);
}
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-content { flex: 1; overflow-y: auto; padding: 18px; }
.admin-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-page-head h2 { font-size: 18px; margin: 0; }
.admin-page-head .spacer { flex: 1; }
.admin-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--accent);
  border: 1px solid rgba(56,189,248,0.4); border-radius: var(--radius-md);
}
.admin-back:hover { background: rgba(56,189,248,0.12); border-color: var(--accent); }
.admin-back svg { width: 16px; height: 16px; }

/* 分区卡片（规则表单 / 区块） */
.section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.section-card > .panel-head { margin-bottom: 12px; }
.section-desc { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin: 0 0 12px; }
.rules-grid .section-desc { font-size: 11.5px; margin-bottom: 10px; }
.section-card .field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.section-card .field-row .modal-field { flex: 1; min-width: 160px; }

/* 规则配置：三个板块一行（响应式 3 / 2 / 1 栏） */
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rules-grid > .section-card { margin: 0; padding: 14px 14px; }
.rules-grid .panel-head h2 { font-size: 14px; }
.rules-grid .modal-field { margin-bottom: 10px; }
.rules-grid .modal-field > label { font-size: 12px; margin-bottom: 4px; }
.rules-grid .modal-field input { padding: 7px 9px; font-size: 13px; }
.rules-grid .modal-field textarea { height: 84px; font-size: 12px; line-height: 1.5; }
.rules-grid .field-row .modal-field { min-width: 120px; }
.hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
/* 布局已锁定固定宽度（--layout-w），不再随浏览器断点重排 */



/* 弹窗（通用，复用现有 Token） */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-box {
  width: 480px; max-width: none; max-height: 86vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  padding: 22px;
}
.modal-title { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.modal-body { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 18px; }
.modal-field { margin-bottom: 12px; }
.modal-field > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-dim); }
.modal-field input,
.modal-field select {
  width: 100%; padding: 9px 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-size: 14px; outline: none;
}
.modal-field input:focus,
.modal-field select:focus { border-color: var(--primary); }
.modal-field textarea {
  width: 100%; height: 140px; resize: vertical;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  padding: 10px; font-size: 13px; outline: none; font-family: inherit;
}
.modal-field textarea:focus { border-color: var(--primary); }
.modal-field textarea:disabled,
.modal-field input:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-field .err { color: var(--error); font-size: 12px; margin-top: 4px; min-height: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
/* 修改密码弹窗收窄 */
#changePwdModal .modal-box { width: 340px; max-width: 92vw; padding: 20px; }
#changePwdModal .modal-title { margin: 0 0 14px; font-size: 15px; }
.bind-device-info { white-space: pre-line; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px; color: var(--text); line-height: 1.6; word-break: break-all; }
.muted { color: var(--text-dim); font-size: 12px; }

/* 绑定管理页：顶部统计条 */
.bind-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.bind-stat {
  flex: 1 1 0; min-width: 150px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.bind-stat .l { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.bind-stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bind-stat .v small { font-size: 13px; color: var(--text-dim); font-weight: 400; margin-left: 2px; }

/* 绑定管理页：数字输入行 */
.bind-num-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.bind-num-row label { font-size: 13px; color: var(--text); }
.bind-num-row input {
  width: 96px; padding: 7px 9px; text-align: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 13px; outline: none;
}
.bind-num-row input:focus { border-color: var(--primary); }

/* 绑定管理页：全局设置卡片内开关行的分隔线 */
.bind-card .switch-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row > .switch-label { font-size: 13px; color: var(--text); }
.switch-desc { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--text-dim); max-width: 260px; }

/* 绑定管理页：全局设置 */
.bind-config-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; }
.bind-switch-top { padding: 4px 2px 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.bind-groups { display: flex; flex-direction: column; gap: 16px; }
.bind-groups.disabled { opacity: .4; pointer-events: none; filter: grayscale(1); transition: opacity .15s; }
.bind-groups.disabled .bind-group-title { color: var(--text-dim); }
/* 全局设置可折叠 */
.collapse-chevron { margin-left: auto; color: var(--text-dim); transition: transform .2s ease; }
.bind-collapse-head.collapsed .collapse-chevron { transform: rotate(-90deg); }
.bind-collapse-head { user-select: none; }
.bind-group { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--bg-input); }
.bind-group-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.bind-save-row { display: flex; justify-content: flex-end; margin-top: 6px; }

/* 用户管理列表：内容居中 */
#content .center-table th, #content .center-table td { text-align: center; vertical-align: middle; }
#content .center-table .vip-expire { text-align: center; }
.center-table .row-actions { justify-content: center; }
.bind-config-row .switch-row { flex-direction: column; align-items: flex-start; gap: 8px; border-bottom: none; padding: 0; }
.bind-field { display: flex; flex-direction: column; gap: 8px; min-width: 230px; }
.bind-field-label { font-size: 12px; color: var(--text-dim); }
.bind-field-desc { font-size: 11px; line-height: 1.5; color: var(--text-dim); max-width: 300px; }
.bind-field-action { justify-content: flex-end; margin-left: auto; }
.bind-num-input { width: 110px; padding: 7px 9px; text-align: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: 13px; outline: none; }
.bind-num-input:focus { border-color: var(--primary); }

/* 设备明细 / 列表（管理页 + 前台弹窗共用） */
.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.dev-row > div:first-child { min-width: 0; flex: 1; }
.dev-name { font-size: 13px; color: var(--text); font-weight: 600; white-space: normal; word-break: break-all; line-height: 1.5; }
.dev-info { font-size: 13px; color: var(--text); white-space: normal; word-break: break-all; line-height: 1.5; }
.dev-item { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.dev-item:last-child { border-bottom: none; }
.dev-meta { font-size: 12px; color: var(--text-dim); margin: 2px 0 6px; white-space: normal; word-break: break-all; }

/* 特征码组成复选框（后台全局设置） */
.fp-checks { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 8px; }
.fp-check { display: flex; flex-direction: column; gap: 3px; width: 240px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.fp-check .fp-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.fp-check .fp-desc { font-size: 11px; line-height: 1.45; color: var(--text-dim); padding-left: 20px; }
.fp-check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }

/* 可疑行为告警 */
.alert-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); font-size: 13px; color: var(--text); }
.alert-item i { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-item.warn { background: rgba(224,169,59,0.12); border: 1px solid rgba(224,169,59,0.4); }
.alert-item b { color: var(--text); }

/* 用户管理表：按账号绑定策略下拉 */
.ov-select { padding: 5px 8px; font-size: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); outline: none; }
.ov-select:focus { border-color: var(--primary); }

/* 盘列表（基础配置一级） */
.board-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.board-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.board-card .bc-num {
  width: 42px; height: 42px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #d97706);
  color: #fff;
  font-size: 20px; font-weight: 800;
  font-family: 'Inter', sans-serif;
}
.board-card .bc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.board-card .bc-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .bc-meta {
  font-size: 12.5px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-card .bc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  flex: none; white-space: nowrap;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.board-card .bc-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(245,158,11,0.08);
}
.board-card .bc-btn svg { width: 14px; height: 14px; }

.empty-box { text-align: center; color: var(--text-dim); padding: 40px 0; }
.empty-box .btn { margin-top: 12px; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 表格内 pill 复用 .tag；角色/状态色系补充 */
.tag.admin { background: rgba(245,158,11,0.16); color: var(--primary); }
.tag.user  { background: rgba(56,189,248,0.16); color: var(--accent); }
.tag.on    { background: rgba(52,211,153,0.16); color: var(--ok); }
.tag.off   { background: rgba(248,113,113,0.16); color: var(--error); }
.tag.vip   { background: linear-gradient(135deg, rgba(247,215,116,0.22), rgba(240,180,41,0.22)); color: #f0b429; border: 1px solid rgba(240,180,41,0.35); }

/* 会员类型：高级会员高贵金色样式（前台 + 后台共用） */
.vip-gold {
  background: linear-gradient(90deg, #f7d774, #f0b429, #e8a317);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(240,180,41,0.35);
}
/* 后台表格内会员类型下的到期小字 */
.vip-expire {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.5;
}
/* 前台到期时间：已过期的红色标注 */
.vip-expired {
  color: var(--error);
  font-weight: 600;
  margin-left: 4px;
}

/* VIP 开通/续费弹窗 */
.vip-current {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.vip-current b { color: var(--text); font-weight: 700; }
.vip-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.vip-plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
  font-family: inherit;
}
.vip-plan b { font-size: 15px; font-weight: 700; }
.vip-plan span { font-size: 12px; color: var(--text-dim); }
.vip-plan:hover { border-color: rgba(240,180,41,0.4); }
.vip-plan.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(247,215,116,0.14), rgba(240,180,41,0.10));
  box-shadow: 0 0 0 1px rgba(240,180,41,0.35), 0 2px 10px rgba(240,180,41,0.12);
}
.vip-plan.active b { color: #f0b429; }

/* ===================== 全局可访问性：focus-visible 琥珀金 ring ===================== */
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ===================== 知识库首页 / 生肖配置页 ===================== */
.kb-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 6px; }
.kb-card {
  cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kb-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
.kb-card .bc-icon {
  width: 52px; height: 52px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--primary);
}
.kb-card .bc-icon svg { width: 26px; height: 26px; }
.kb-card .bc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kb-card .bc-name { font-size: 15px; font-weight: 600; }
.kb-card .bc-remark { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.kb-card .bc-arrow { flex: none; color: var(--text-dim); transition: color .15s ease, transform .15s ease; }
.kb-card .bc-arrow svg { width: 18px; height: 18px; }
.kb-card:hover .bc-arrow { color: var(--primary); transform: translateX(3px); }

/* 生肖配置：顶部双标题（国历 / 农历） */
.zd-title-label { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }
.zd-zodiac-pill .dot, .zd-card-head .dot, .dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #888888; flex: 0 0 auto;
}

/* 控制条 */
.zd-ctrl { margin-top: 12px; }
.zd-ctrl-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
.zd-ctrl-row .field-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.zd-year-sel {
  min-width: 110px; width: auto;
  padding: 6px 10px; height: 34px;
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  box-sizing: border-box;
}
.zd-ctrl-hint { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* 12 生肖网格 */
.zd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; margin-top: 14px; }
.zd-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.zd-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.zd-zodiac-name {
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  color: #0d1219; background: var(--accent);
  padding: 4px 16px; border-radius: 9px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.zd-numbers { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.zd-numbers .ball-dot { width: 28px; height: 28px; font-size: 12.5px; }
.zd-num {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; color: var(--text);
}
.zd-tags { display: flex; gap: 0; margin-bottom: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.zd-tags .tag { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; font-size: 11px; padding: 5px 2px; border-radius: 0; background: transparent; border-right: 1px solid var(--border); }
.zd-tags .tag:last-child { border-right: none; }
.zd-details { margin-top: 8px; }
.zd-details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); user-select: none; }
.zd-num-attrs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; flex: 1; min-width: 0; margin-top: 2px; }
.zd-num-attr {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 3px; font-variant-numeric: tabular-nums;
  text-align: center; white-space: nowrap;
}

.skeleton-block { height: 56px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); animation: skeleton-pulse 1.1s ease-in-out infinite; }
@keyframes skeleton-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* 生肖配置：顶部左右两栏（当前年份日期 / 当前年份配置） */
/* 顶部参考信息栏：当前日期 / 年份日期 / 年份配置 合并占一整列 */
.zd-info-bar { display: flex; flex-wrap: wrap; gap: 22px; align-items: stretch; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 14px; }
.zd-info-clock { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 210px; }
.zd-info-clock-label { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }
.zd-info-clock-time { font-size: 24px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.zd-info-dates { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 210px; }
.zd-info-date { display: grid; grid-template-columns: 34px 1fr 40px; gap: 10px; align-items: baseline; }
.zd-info-sub { font-size: 12px; color: var(--text-dim); }
.zd-info-val { font-size: 17px; font-weight: 700; }
.zd-info-zodic { font-size: 13px; color: var(--accent); }
.zd-info-config { flex: 1 1 320px; min-width: 260px; display: flex; flex-direction: column; justify-content: center; }
.zd-info-config .zd-title-label { margin-bottom: 10px; }
.zd-config-row { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.zd-config-row .switch-row { margin: 0; }
/* 布局已锁定固定宽度（--layout-w），zd-info-bar 不再随浏览器断点变列 */

/* 玩法开关卡片：8 组横排为 2 列（每列 4 个），占满整行不再撑长 */
.rules-grid .play-card { grid-column: 1 / -1; }
.play-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.pg-cell { min-width: 0; }
.pg-words { display: flex; gap: 10px; flex-wrap: wrap; }
.pg-words .modal-field { margin: 0; }
.hint { font-size: 11px; color: #7e8aa0; margin-top: 4px; line-height: 1.4; }
.err { font-size: 12px; color: var(--error); min-height: 14px; margin-top: 4px; }
.pg-cell .section-desc {
  margin: 4px 0 10px;
  font-size: 11.5px;
}


/* ===================== 保存弹窗：禁用态 / 名称抖动 / 即将删除 ===================== */
/* 确认保存按钮——名称无效时置灰禁用（由 JS 切 .btn-disabled 类） */

/* 设备未授权弹窗（设备解绑/换绑提示） */
#deviceMismatchModal .modal-box {
  width: 500px;
  max-width: 94vw;
  padding: 0;
  overflow: hidden;
}
#deviceMismatchModal .device-mismatch-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
#deviceMismatchModal .device-mismatch-icon {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
#deviceMismatchModal .device-mismatch-icon svg {
  width: 22px; height: 22px;
}
#deviceMismatchModal .device-mismatch-title {
  flex: 1;
  min-width: 0;
}
#deviceMismatchModal .device-mismatch-title .modal-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}
#deviceMismatchModal .device-mismatch-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}
#deviceMismatchModal .device-mismatch-body {
  padding: 18px 22px;
}
#deviceMismatchModal .device-mismatch-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
}
#deviceMismatchModal .device-mismatch-count strong {
  color: var(--primary);
  font-weight: 700;
}
#deviceMismatchModal .device-mismatch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
#deviceMismatchModal .device-mismatch-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#deviceMismatchModal .device-mismatch-item:hover {
  border-color: var(--primary-soft);
}
#deviceMismatchModal .device-mismatch-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}
#deviceMismatchModal .device-mismatch-item-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
#deviceMismatchModal .device-mismatch-item-meta::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}
#deviceMismatchModal .device-mismatch-notice {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
#deviceMismatchModal .device-mismatch-notice strong {
  color: var(--text);
  font-weight: 600;
}
#deviceMismatchModal .device-mismatch-notice .notice-line + .notice-line {
  margin-top: 6px;
}
#deviceMismatchModal .device-mismatch-notice.limit-reached {
  border-color: var(--error);
  background: rgba(248, 113, 113, 0.08);
}
#deviceMismatchModal .modal-actions {
  padding: 14px 22px 22px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
#deviceMismatchModal .modal-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 9px 16px;
  font-size: 13px;
}
#deviceMismatchModal .modal-actions .btn.primary {
  font-weight: 700;
}

  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* 名称输入框校验失败时的抖动动画 */
@keyframes lz-name-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake {
  animation: lz-name-shake 0.4s ease;
  border-color: var(--error) !important;
}

/* 满 5（或已超 5）时，列表里最老那一条标红 + 「即将删除」 */
.batch-item.will-delete {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 4px 0;
}
.wd-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #2a0d0d;
  background: var(--error);
  border-radius: 999px;
  vertical-align: middle;
}

/* ===================== 反馈投诉弹窗 ===================== */
.fb-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.fb-tab {
  flex: 1;
  padding: 9px 10px;
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
}
.fb-tab:hover { color: var(--text); border-color: var(--primary); }
.fb-tab.active { color: var(--primary); border-color: var(--primary); background: rgba(245,158,11,0.08); }
.fb-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  color: #1a1206;
  background: var(--primary);
  border-radius: 999px;
}
.fb-count { text-align: right; font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.fb-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.fb-img-item {
  position: relative;
  width: 72px; height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.fb-img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-img-del {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  line-height: 16px; text-align: center;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  cursor: pointer; font-size: 14px; padding: 0;
}
.fb-img-del:hover { background: var(--error); }
.fb-list { display: flex; flex-direction: column; gap: 12px; max-height: 56vh; overflow-y: auto; }
.fb-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.fb-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fb-item-head .muted { font-size: 12px; }
.fb-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.fb-status.pending { color: #fbbf24; background: rgba(251,191,36,0.14); }
.fb-status.replied { color: var(--ok); background: rgba(52,211,153,0.14); }
.fb-del {
  margin-left: auto;
  background: transparent; border: 1px solid rgba(248,113,113,0.5);
  color: var(--error); border-radius: var(--radius-sm);
  padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.fb-del:hover { background: rgba(248,113,113,0.12); border-color: var(--error); }
.fb-content { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.fb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-thumb {
  width: 64px; height: 64px;
  object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
}
.fb-thumb:hover { border-color: var(--primary); }
.fb-reply {
  margin-top: 10px; padding: 8px 10px;
  background: rgba(52,211,153,0.08);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6;
}
.fb-reply b { color: var(--ok); }

/* ===================== 后台反馈管理页 ===================== */
.fb-admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.fb-filter {
  padding: 6px 12px; font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-dim); cursor: pointer;
}
.fb-filter:hover { color: var(--text); border-color: var(--primary); }
.fb-filter.active { color: var(--primary); border-color: var(--primary); background: rgba(245,158,11,0.08); }
.fb-admin-list { display: flex; flex-direction: column; gap: 14px; }
.fb-admin-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.fb-admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.fb-admin-user { font-weight: 700; }
.fb-admin-user .muted { font-weight: 400; margin-left: 6px; }
.fb-admin-meta { font-size: 12px; color: var(--text-dim); }
.fb-admin-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.fb-admin-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fb-admin-thumbs img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer;
}
.fb-admin-thumbs img:hover { border-color: var(--primary); }
.fb-admin-reply {
  margin: 10px 0;
  background: rgba(52,211,153,0.08);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 13px; line-height: 1.6;
}
.fb-admin-reply b { color: var(--ok); }
.fb-admin-actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.fb-admin-actions textarea {
  flex: 1; min-width: 220px; min-height: 60px; resize: vertical;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); padding: 8px 10px; font-size: 13px; outline: none;
}
.fb-admin-actions textarea:focus { border-color: var(--primary); }
