/* 巡夜质检系统 - 高上大风格(对齐原 React 版:深色渐变侧栏/紫色渐变登录/白卡柔阴影) */

/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1e40af;
  --blue-2: #2563eb;
  --blue-light: #dbeafe;
  --grad-side: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  --grad-login: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --sub: #6b7280;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --orange: #ea580c;
  --orange-bg: #fff7ed;
  --green: #16a34a;
  --green-bg: #bbf7d0;
  --shadow: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18);
  --radius: 14px;
  /* 控件统一尺寸：筛选框、下拉、输入框全部按这套走，保证视觉一致 */
  --ctl-h: 36px;
  --ctl-fs: 14px;
  --ctl-radius: 9px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* 移动端兜底：任何元素想撑破横向都不给页面加滚动条 */
}
a { color: var(--blue-2); text-decoration: none; }
.layout { display: flex; min-height: 100vh; }

/* ============ 侧边栏(深色渐变) ============ */
.sidebar {
  width: 260px; background: var(--grad-side); color: #fff;
  display: flex; flex-direction: column; padding: 24px 0;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  overflow: hidden; /* 内部 .nav 自行滚动,避免底部"当前登录"被裁掉 */
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 6px; padding: 24px 16px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
/* 侧边栏滚动条:半透明白细条,融入深色渐变,避免默认白条突兀 */
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.nav-section { font-size: 12px; color: rgba(255,255,255,.5); margin: 14px 8px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-size: 15px; font-weight: 500; transition: all .2s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.14); color: #fff; border-left-color: #fff; }
.nav-ico {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: rgba(255,255,255,.16);
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 20px; font-size: 13px; color: rgba(255,255,255,.7); flex-shrink: 0; }
.sidebar-foot .user { margin-bottom: 10px; }
.sidebar-foot a { color: rgba(255,255,255,.85); display: inline-flex; align-items: center; gap: 6px; }
.sidebar-foot a:hover { color: #fff; }

/* ============ 主区 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* 大屏自适应：不再用 1440px 上限居中，内容随屏幕铺满，只保留随宽度生长的留白 */
.content { padding: 22px clamp(16px, 2.2vw, 40px) 40px; flex: 1; max-width: none; width: 100%; margin: 0; }
.mb-nav { display: none; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 统计卡 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin-bottom: 20px; }
.cards > * { min-width: 0; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(30,64,175,.12); }
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: var(--blue-light); color: var(--blue-2); }
.stat-icon.orange { background: #fed7aa; color: var(--orange); }
.stat-icon.red { background: #fecaca; color: var(--red); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-info .num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-info .lbl { color: var(--sub); font-size: 13px; margin-top: 2px; }

/* ============ 表格 ============ */
/* overflow-x 让窄屏可横向滚动，而不是把内容裁掉 */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
/* 固定表格布局：列宽由 colgroup 决定，渲染更快、列宽不再被长文本挤爆 */
table.fixed { table-layout: fixed; }
/* 列太多时给表格一个最小宽度，窄屏改为横向滑动，绝不把「操作」列挤到换行 */
.t-wide { min-width: 880px; }
.t-mid { min-width: 860px; }
/* 质检记录比规则管理多一列「处罚」，单独给它一个更大的最小宽度，
   免得 9 列挤在一起把「操作」列压到换行（.t-rec 权重更高，能覆盖上面的 .t-wide） */
.t-wide.t-rec { min-width: 1010px; }

/* 各表列宽（放在 CSS 里而不是模板内联，才能按屏宽收紧：
   宽屏把富余空间全给「描述」这类长文本列，中等屏收窄固定列，避免描述被挤成豆腐块） */
.rc-id { width: 52px; }
.rc-l1 { width: 188px; }
.rc-l2 { width: 114px; }
.rc-pen { width: 190px; }
.rc-ops { width: 132px; }
.rd-id { width: 56px; }
.rd-st { width: 92px; }
.rd-vc { width: 84px; }
.rd-pn { width: 154px; }
.rd-rv { width: 108px; }
.rd-tm { width: 152px; }
.rd-ops { width: 196px; }
.ru-id { width: 56px; }
.ru-nm { width: 140px; }
.ru-rl { width: 92px; }
.ru-st { width: 84px; }
.ru-ct { width: 156px; }
.ru-ops { width: 140px; }
/* 班主任管理表(7 列) */
.tc-id { width: 52px; }
.tc-name { width: 128px; }
.tc-nick { width: 132px; }
.tc-sup { width: 120px; }
.tc-st { width: 84px; }
.tc-time { width: 152px; }
.tc-ops { width: 236px; }
.db-id { width: 56px; }
.db-st { width: 92px; }
.db-tm { width: 156px; }
/* 备份恢复页 */
.bp-tm { width: 178px; }
.bp-tag { width: 96px; }
.bp-sz { width: 104px; }
.bp-ops { width: 168px; }

@media (max-width: 1400px) {
  .rc-l1 { width: 162px; }
  .rc-l2 { width: 100px; }
  .rc-pen { width: 150px; }
  .rd-ops { width: 176px; }
  /* 质检记录在 1280 这一档要把 9 列塞进 ~900px：固定列一起收窄，
     最小宽度降到 880（和加处罚列之前一致），这一档就不再触发横向滑动 */
  .rd-id { width: 52px; }
  .rd-st { width: 84px; }
  .rd-vc { width: 72px; }
  .rd-pn { width: 120px; }
  .rd-rv { width: 92px; }
  .rd-tm { width: 128px; }
  .t-wide.t-rec { min-width: 880px; }
  .bp-tm { width: 156px; }
  .bp-ops { width: 150px; }
}
@media (max-width: 1100px) {
  .rc-l1 { width: 146px; }
  .rc-pen { width: 124px; }
  .rc-ops { width: 124px; }
  .ru-nm { width: 124px; }
  .bp-tag { width: 76px; }
  .bp-sz { width: 86px; }
  .ru-ct { width: 140px; }
  .tc-name { width: 110px; }
  .tc-nick { width: 112px; }
  .tc-sup { width: 104px; }
  .tc-time { width: 130px; }
  .tc-ops { width: 214px; }
}
/* 981~1180px：侧栏还占着 260px，内容区只剩 700~800px。
   把固定列一并收窄并取消表格最小宽度，让表格刚好铺满而不必横滑。 */
@media (min-width: 981px) and (max-width: 1180px) {
  .t-wide, .t-mid { min-width: 0; }
  /* .t-wide.t-rec 权重比 .t-wide 高，这里要显式再覆盖一次，否则最小宽度会留着不放 */
  .t-wide.t-rec { min-width: 0; }
  .rc-id { width: 48px; }
  .rc-l1 { width: 132px; }
  .rc-l2 { width: 88px; }
  .rc-pen { width: 112px; }
  .rc-ops { width: 120px; }
  .rd-id { width: 48px; }
  .rd-nm { width: 100px; }
  .rd-st { width: 84px; }
  .rd-vc { width: 76px; }
  .rd-pn { width: 104px; }
  .rd-in { width: 100px; }
  .rd-rv { width: 86px; }
  .rd-tm { width: 122px; }
  .rd-ops { width: 180px; }
  .ru-nm { width: 116px; }
  .ru-ct { width: 140px; }
  .tc-id { width: 46px; }
  .tc-name { width: 100px; }
  .tc-nick { width: 104px; }
  .tc-sup { width: 96px; }
  .tc-st { width: 74px; }
  .tc-time { width: 122px; }
  .tc-ops { width: 196px; }
}
thead th {
  background: #f8fafc; text-align: left; padding: 11px 14px;
  font-size: 12.5px; font-weight: 600; color: #64748b; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; line-height: 1.55; color: #4b5563; vertical-align: top; word-break: break-word; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafbfc; }
td .sub { color: var(--sub); font-size: 13px; }
/* 卡片下方的说明文字（aiconfig / 备份恢复 都在用；不给样式的话会按默认 16px 黑字渲染） */
.sub { color: var(--sub); font-size: 13.5px; line-height: 1.7; }
td.nowrap, th.nowrap { white-space: nowrap; }
/* 操作列：两个按钮必须并排，单元格本身不允许换行 */
td.ops { white-space: nowrap; }
td.ops .btn + .btn { margin-left: 6px; }
td.ops .btn { padding: 5px 11px; font-size: 12.5px; }
/* 处罚是模板化短句，超长截断，鼠标悬停看全文（完整内容在编辑弹窗里） */
td.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 一级分类做成小标签，避免长文本把列撑成三行 */
.tag-l1 {
  display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 500;
  background: #eef2f7; color: #475569; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-money {
  display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 12px; line-height: 1.5; font-weight: 600;
  background: #fff7e6; color: #b9770e; border: 1px solid #f3d99a; vertical-align: middle;
}
.field-check { margin-bottom: 18px; }
.field-check label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #374151; cursor: pointer; }
.field-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--ctl-radius);
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .18s; font-family: inherit; white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #1e3a8a; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* 加载中旋转动画：开始质检后放在按钮里,提示 AI 正在处理、没有卡死 */
.spin { display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid rgba(120,120,120,.3); border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 筛选区 ============ */
/* 筛选条做成浅色面板，间距收紧；控件高度/字号统一走 --ctl-* 变量 */
.toolbar {
  display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 14px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 11px;
}
.filter-group { display: inline-flex; align-items: center; gap: 7px; }
.filter-label { font-size: 13.5px; font-weight: 500; color: #64748b; white-space: nowrap; flex: none; }
/* 注意：选择器要写成 .toolbar .filter-xxx，才能压过 `select.input`（优先级 0,1,1）——
   之前下拉框和输入框样式不一致，就是因为 select 输给了 select.input */
.toolbar .filter-select,
.toolbar .filter-input {
  height: var(--ctl-h); padding: 0 12px; font-size: var(--ctl-fs); font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--ctl-radius); background: #fff; color: var(--text);
  transition: border-color .18s, box-shadow .18s; outline: none;
}
.toolbar .filter-select:focus,
.toolbar .filter-input:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.toolbar .filter-input { width: 150px; }
.toolbar .filter-input.narrow { width: 84px; }
.toolbar .filter-select { min-width: 138px; padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.toolbar .filter-select option { font-size: var(--ctl-fs); }
/* 日期输入在 Chrome 里默认偏窄偏高，统一一下 */
.toolbar .filter-input[type="date"] { width: 156px; }
.filter-count { font-size: 13.5px; color: #94a3b8; margin-left: auto; white-space: nowrap; }
/* 列表分页控件 */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px;
         border-top: 1px solid #eef1f6; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager-info { font-size: 13.5px; color: #64748b; }

/* ============ 数据看板图表 ============ */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 20px; }
.charts-grid > * { min-width: 0; } /* 关键：1fr 轨道能缩到比子元素 min-content 更小，避免窄屏被撑破 */
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; min-width: 0; }
.chart-head h3 { font-size: 15.5px; font-weight: 700; color: #1e293b; letter-spacing: .2px; }
.chart-sub { font-size: 12.5px; color: var(--sub); }
.chart-box { position: relative; height: 300px; flex: none; overflow: hidden; min-width: 0; }
.chart-box.wide { height: 320px; }

/* ============ 首页日期筛选条 ============ */
/* 现在放在「年月日」头部正下方，统一控制下面所有统计卡与图表的统计区间（选日期全部联动）。
   用 .range-bar 后代选择器（权重 0,2,0）压过 .input，避免又踩一次特异性打架。 */
.range-bar {
  grid-column: 1 / -1;                 /* 在图表网格里独占一整行（现在已移到头部，这行无害） */
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 11px 14px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 11px; min-width: 0; margin: 16px 0;
}
.range-presets, .range-dates { min-width: 0; }
.range-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.range-bar .rng-btn {
  height: var(--ctl-h); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--ctl-radius);
  background: #fff; color: #475569;
  font-size: var(--ctl-fs); font-family: inherit; line-height: 1;
  cursor: pointer; transition: background .16s, border-color .16s, color .16s;
}
.range-bar .rng-btn:hover { border-color: #c7d2fe; color: var(--blue); }
.range-bar .rng-btn.active {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}
.range-dates { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.range-bar .rng-date {
  height: var(--ctl-h); padding: 0 10px; width: 152px;
  font-size: var(--ctl-fs); font-family: inherit;
}
.range-dash { color: var(--sub); }
.range-note { flex-basis: 100%; font-size: 12.5px; color: var(--sub); line-height: 1.5; }

/* ============ 表单 ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 7px; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .2s, box-shadow .2s;
}
select.input { padding-right: 34px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
textarea.input { min-height: 170px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,64,175,.12); }

/* ============ 徽标 ============ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-red { background: #fecaca; color: var(--red); }
.badge-orange { background: #fed7aa; color: var(--orange); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-gray { background: #f3f4f6; color: var(--sub); }
.badge-blue { background: var(--blue-light); color: var(--blue-2); }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 19px; margin-bottom: 18px; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }

/* ============ 提示 ============ */
.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 14px; z-index: 99; box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
}
.empty { text-align: center; color: var(--sub); padding: 44px 20px; font-size: 15px; }

/* ============ 质检结果卡 ============ */
.violation-card { padding: 10px 12px; border-radius: 10px; border-left: 4px solid; margin-bottom: 6px; }
.violation-card.red { background: var(--red-bg); border-color: var(--red); }
.violation-card.orange { background: var(--orange-bg); border-color: var(--orange); }
.violation-card .v-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; font-weight: 700; color: #1f2937; }
.violation-card.red .v-head { color: var(--red); }
.violation-card.orange .v-head { color: var(--orange); }
.violation-card .v-reason { color: #4b5563; font-size: 14px; line-height: 1.6; }
.violation-card .v-text { margin-top: 6px; padding: 10px 12px; background: #fff; border-radius: 8px; border: 1px solid #fcd34d; font-size: 13px; color: #78350f; word-break: break-word; }
/* 每条命中都把自己的处罚列出来（处罚文本来自「质检规则」里的 penalty 字段） */
.violation-card .v-pen { margin-top: 4px; padding-top: 5px; border-top: 1px dashed #fca5a5; font-size: 13.5px; color: #991b1b; font-weight: 600; }
.match-count { background: var(--red); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* 逐条处理:每一条命中后面都带「通过 / 不通过 + 保存」,规则还能单独改 */
.v-ops { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.v-ops .state-group { grid-template-columns: repeat(2, minmax(0, 128px)); gap: 8px; }
.v-ops .state-btn { padding: 0 12px; }
.v-save-msg { font-size: 13px; color: var(--sub); }
.v-rulebox { margin-top: 12px; }
.v-rulebox .input { font-size: 14px; margin-bottom: 10px; }
.v-rulebox .rule-list { max-height: 260px; }
/* 逐条卡片：一级/二级级联选择 + 命中文本 + 规则描述 */
.violation-card .v-rule-edit { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.violation-card .v-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 180px; }
.violation-card .v-field > label { font-size: 13px; color: var(--sub); font-weight: 600; }
.violation-card .v-field .input { width: 100%; }
.violation-card .v-match { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.violation-card .v-match > label { font-size: 13px; color: var(--sub); font-weight: 600; }
.violation-card .v-match-input { width: 100%; min-height: 36px; resize: vertical; line-height: 1.5; }
.violation-card .v-desc { margin-top: 4px; padding: 8px 10px; background: #fff; border-radius: 8px;
  border: 1px solid #e5e7eb; font-size: 13.5px; color: #374151; line-height: 1.55; word-break: break-word; }
.violation-card.gray .v-desc { background: #f1f5f9; }
.violation-card .v-desc > span:first-child { color: #6b7280; margin-right: 2px; }
.violation-card .add-violation { margin-top: 12px; }
/* 没选结论时，保存按钮置灰（按需才高亮） */
.btn.disabled, .btn:disabled { opacity: .55; cursor: not-allowed; background: #cbd5e1; border-color: #cbd5e1; color: #64748b; }
.btn.disabled:hover, .btn:disabled:hover { background: #cbd5e1; border-color: #cbd5e1; color: #64748b; }
.btn-primary.disabled, .btn-primary:disabled,
.btn-primary.disabled:hover, .btn-primary:disabled:hover { background: #cbd5e1; border-color: #cbd5e1; color: #64748b; }
/* 人工判「通过」的条目:变灰但保留在页面上(看得出放行过什么) */
.violation-card.gray { background: #f8fafc; border-color: #cbd5e1; }
.violation-card.gray .v-head { color: #64748b; }
.violation-card.gray .v-pen { border-top-color: #cbd5e1; color: #475569; }
.violation-card.done .v-reason,
.violation-card.done .v-text { opacity: .72; }
.item-summary {
  display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
  margin-bottom: 8px; padding: 8px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; color: #475569; line-height: 1.7;
}
.item-summary b { color: var(--text); }

/* 状态 / 处罚 两栏（质检结果卡顶部） */
.verdict-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 14px; margin-top: 14px; }
.verdict-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.vb-label { font-size: 12.5px; font-weight: 600; color: #64748b; margin-bottom: 7px; letter-spacing: .3px; }
.vb-value { font-size: 14px; line-height: 1.7; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; word-break: break-word; }
.penalty-chip {
  display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
}

/* ============ 人工复核面板 ============ */
/* 通过 / 不通过 两个按钮：0,2,0 权重，压过全局 .btn 的默认外观 */
.state-group { display: grid; grid-template-columns: repeat(2, minmax(0, 168px)); gap: 10px; }
.state-group .state-btn {
  height: var(--ctl-h); padding: 0 16px; font-size: var(--ctl-fs); font-family: inherit; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--ctl-radius); background: #fff; color: #475569;
  cursor: pointer; transition: background .16s, border-color .16s, color .16s;
}
.state-group .state-btn:hover { border-color: #c7d2fe; color: var(--blue); }
.state-group .state-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.state-group .state-btn[data-state="approved"].active { background: var(--green); border-color: var(--green); }
.state-group .state-btn[data-state="rejected"].active { background: var(--red); border-color: var(--red); }

.picker-label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.picker-search { margin-bottom: 10px; }
.picker-search .input { font-size: 14px; }
/* 规则列表：固定高度内滚动，56 条规则也不会把页面拉得很长 */
.rule-list { max-height: 328px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; padding: 6px; }
.rule-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent; transition: background .14s, border-color .14s;
}
.rule-item:hover { background: #f1f5f9; }
.rule-item.on { background: #eef2ff; border-color: #c7d2fe; }
.rule-item input { width: auto; margin: 3px 0 0; flex: none; cursor: pointer; }
.ri-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ri-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); flex-wrap: wrap; }
.ri-desc { font-size: 13px; color: #64748b; line-height: 1.55; word-break: break-word; }
.ri-pen { font-size: 13px; color: #991b1b; font-weight: 600; }
.picker-picked { margin-top: 10px; font-size: 13.5px; color: #475569; line-height: 1.7; }
/* 销售人员(班主任)下拉选择器 */
.picker-box { position: relative; }
.picker-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .10); padding: 6px;
}
.picker-item { padding: 9px 12px; border-radius: 9px; cursor: pointer; line-height: 1.5; }
.picker-item:hover { background: var(--blue-light); }
.picker-item.on { background: var(--blue-light); }
.picker-item b { font-size: 14.5px; color: var(--text); }
.picker-item .pi-sub { display: block; font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.picker-empty { padding: 14px 12px; text-align: center; color: var(--sub); font-size: 13.5px; }
.picked-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--blue-light); color: var(--blue-2); font-size: 13px; font-weight: 600;
}
.picked-x { margin-left: 6px; cursor: pointer; font-weight: 700; opacity: .7; }
.picked-x:hover { opacity: 1; }
.warn-text { color: var(--orange); font-weight: 600; }
.review-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
/* 结果卡底部的统一操作条（通过 / 不通过 / 保存 / 新增违规），有问题和无问题共用同一套样式 */
/* 结果卡底部统一操作条：竖向三段——「+ 新增违规」一行、「通过/不通过」一行、「保存」一行 */
.insp-actions {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
/* 操作条里的按钮各自占整行（宽度拉满，与卡片等宽），新增违规与保存都是单独一行 */
.insp-actions .btn { width: 100%; }
/* 「通过 / 不通过」作为一组占一行，两个按钮平分宽度 */
.insp-actions .state-group { grid-template-columns: 1fr 1fr; }

/* ============ 登录页(企业风分栏) ============ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #eef2f7; }
.login-wrap {
  display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; max-width: 960px; min-height: 560px;
  background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
}
/* 左侧品牌/卖点面板 */
.login-aside {
  position: relative; overflow: hidden; padding: 40px 38px; color: #fff; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #1e3a8a 0%, #3730a3 55%, #4f46e5 100%);
}
.aside-glow { position: absolute; border-radius: 50%; filter: blur(8px); }
.aside-glow-1 { width: 240px; height: 240px; right: -80px; top: -80px; background: rgba(99,102,241,.45); }
.aside-glow-2 { width: 200px; height: 200px; left: -70px; bottom: -70px; background: rgba(56,189,248,.30); }
.aside-top, .aside-mid, .aside-foot { position: relative; z-index: 1; }
.aside-brand { display: flex; align-items: center; gap: 12px; }
.aside-logo { width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.aside-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.aside-en { font-size: 12px; color: rgba(255,255,255,.6); letter-spacing: 1px; margin-top: 2px; }
.aside-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 0; }
.aside-slogan { font-size: 28px; font-weight: 800; line-height: 1.35; letter-spacing: .3px; }
.aside-desc { margin-top: 14px; font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.82); max-width: 360px; }
.aside-feats { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.aside-feats li { display: flex; gap: 12px; align-items: flex-start; }
.aside-feats .fi { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.aside-feats b { display: block; font-size: 15px; font-weight: 700; }
.aside-feats span { font-size: 13px; color: rgba(255,255,255,.72); }
.aside-foot { font-size: 12px; color: rgba(255,255,255,.55); }
/* 右侧表单 */
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 44px; }
.login-card { width: 100%; max-width: 360px; }
.login-card-head { margin-bottom: 26px; }
.login-card h2 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-sub { margin-top: 6px; font-size: 14px; color: var(--sub); }
.login-form .field { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13.5px; font-weight: 600; color: #475569; margin-bottom: 7px; }
.input-ico { position: relative; }
.input-ico svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.input-ico .input { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 11px; font-size: 14.5px; font-family: inherit; color: var(--text); background: #fff; transition: border-color .16s, box-shadow .16s; }
.input-ico .input:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-error { background: var(--red-bg); border: 1px solid #fecaca; color: var(--red); padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.btn-login {
  width: 100%; justify-content: center; padding: 13px; background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; border: none;
  border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all .25s; box-shadow: 0 8px 20px rgba(79,70,229,.32);
  font-family: inherit; margin-top: 4px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(79,70,229,.42); }
.login-foot { margin-top: 18px; font-size: 12px; color: #94a3b8; text-align: center; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 440px; min-height: auto; }
  .login-aside { padding: 30px 26px; }
  .aside-mid { padding: 22px 0; }
  .aside-slogan { font-size: 23px; }
  .login-main { padding: 32px 28px; }
}

/* 提示语 */
.hint {
  font-size: 13px;
  color: var(--sub);
  background: rgba(0,113,227,0.07);
  border-left: 3px solid var(--blue);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 4px 0 14px;
}
/* 空的状态提示位（<span class="hint" id="..."></span>）不渲染：
   否则 border-left + padding 会显示成一个小蓝竖条，看起来像页面上的杂质 */
.hint:empty { display: none; }
/* 复核人预览(不可改) */
.review-preview { font-size: 15px; font-weight: 600; color: var(--text); padding: 9px 0; }

/* 质检记录页复核弹窗里的「修改记录」(modify_log) */
.modlog { max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.modlog-item { padding: 9px 12px; border-bottom: 1px dashed var(--border); }
.modlog-item:last-child { border-bottom: none; }
.modlog-head { font-size: 13px; }
.modlog-note { margin-top: 4px; font-size: 13px; color: var(--text); }
.modlog-changes { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: #475569; }
.modlog-changes li { margin: 2px 0; }

/* 菜单权限勾选项 */
.chk-group { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 10px 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; color: var(--text); }
.chk input { width: auto; margin: 0; cursor: pointer; }

/* 图表区提示条(接口失败/无数据/渲染报错,失败必须可见) */
.chart-note {
  grid-column: 1 / -1;
  font-size: 14px;
  line-height: 1.6;
  color: #92400e;
  background: #fffbeb;
  border-left: 3px solid var(--orange);
  padding: 10px 14px;
  border-radius: 8px;
  word-break: break-all;
}
/* 图表库没加载时的简版图表：纯 HTML/CSS，字号是固定像素，不会被缩放变小。
   注意 svg 用 height:100% 而不是 auto——兜底折线图的 viewBox 是 1000x300，
   宽屏下 height:auto 会算出 600px 以上、撑破固定高度的 .chart-box 并盖住下一排卡片。 */
.chart-box svg { display: block; width: 100%; height: 100%; }
.hb-wrap { display: flex; flex-direction: column; justify-content: center; height: 100%; gap: 8px; }
.hb-row { display: flex; align-items: center; gap: 10px; }
.hb-label { width: 78px; flex: none; font-size: 13px; font-weight: 600; color: #475569; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { flex: 1; height: 13px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.hb-fill { height: 100%; border-radius: 7px; transform-origin: left center;
  animation: barGrow .7s cubic-bezier(.22,1,.36,1) both; }
.hb-val { width: 30px; flex: none; font-size: 13px; font-weight: 700; color: #64748b; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dn-wrap { display: flex; align-items: center; gap: 14px; height: 100%; }
.dn-ring { position: relative; width: 136px; height: 136px; border-radius: 50%; flex: none; }
.dn-hole { position: absolute; inset: 25px; background: #fff; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dn-total { font-size: 24px; font-weight: 700; color: #1e293b; line-height: 1.1; }
.dn-cap { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.dn-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.dn-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.dn-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dn-name { flex: 1; min-width: 0; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-num { color: #334155; font-weight: 700; flex: none; }
.dn-pct { width: 42px; text-align: right; color: #94a3b8; font-size: 12px; flex: none; }
/* 折线数据点悬停放大 */
.chart-box .pt circle { transition: r .15s ease; }
.chart-box .pt:hover circle { r: 6; }

/* 提示词预览（AI配置页「预览最终请求」） */
.prompt-box { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fbfcfe; }
.prompt-box > summary { cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: #334155; user-select: none; }
.prompt-box[open] > summary { border-bottom: 1px solid var(--line); }
.prompt-pre { margin: 0; padding: 14px; font-size: 12.5px; line-height: 1.75; color: #374151;
  white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }

/* ============ 平板 / 窄屏 ============ */
/* 断点定在 980px：再窄的话 260px 侧边栏会把内容区压到 600px 出头，表格只能一直横滑，
   不如直接切成顶部导航、让内容铺满。 */
@media (max-width: 1100px) {
  /* 中等屏：把筛选控件放宽，少留空隙 */
  .toolbar .filter-input { width: 132px; }
}
@media (max-width: 980px) {
  .sidebar { display: none; }
  .mb-nav {
    display: flex; position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line);
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mb-nav::-webkit-scrollbar { display: none; }
  .mb-nav a { padding: 13px 16px; white-space: nowrap; color: var(--text); font-size: 14.5px; }
  .mb-nav a.active { color: var(--blue); font-weight: 700; border-bottom: 2px solid var(--blue); }
  .content { padding: 14px 12px 32px; }
  .card { padding: 15px; border-radius: 12px; }
  .card-title { font-size: 16px; margin-bottom: 12px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
  .stat-card { padding: 14px; gap: 11px; }
  .stat-icon { width: 42px; height: 42px; font-size: 19px; border-radius: 11px; }
  .stat-info .num { font-size: 23px; }
  .stat-info .lbl { font-size: 12.5px; }

  /* 手机上筛选区改成上下堆叠，每个控件独占一行、占满宽度 */
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; padding: 12px; }
  .filter-group { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
  .filter-group > :last-child { width: 100% !important; min-width: 0 !important; }
  .filter-count { grid-column: 1 / -1; margin-left: 0; text-align: right; font-size: 13px; }

  /* 表格：列宽仍由 colgroup 决定（fixed 布局），靠表格最小宽度触发横向滑动，
     描述列给足宽度并允许换行，其余列按需 nowrap，不再把内容压扁 */
  thead th { padding: 10px 12px; font-size: 12px; }
  tbody td { padding: 10px 12px; font-size: 13px; }
  .table-wrap { border-radius: 12px; }
  /* 手机上把固定列一并收窄，表格整体从 880 降到 720 左右，
     这样横向滑动的距离短一些，描述列也还有 230px 左右可用 */
  .t-wide { min-width: 720px; }
  .t-mid { min-width: 700px; }
  .t-wide.t-rec { min-width: 820px; }
  .rc-id { width: 44px; }
  .rc-l1 { width: 130px; }
  .rc-l2 { width: 88px; }
  .rc-pen { width: 110px; }
  .rc-ops { width: 118px; }
  .rd-id { width: 44px; }
  .rd-nm { width: 100px; }
  .rd-st { width: 80px; }
  .rd-vc { width: 72px; }
  .rd-pn { width: 118px; }
  .rd-in { width: 100px; }
  .rd-rv { width: 86px; }
  .rd-tm { width: 118px; }
  .rd-ops { width: 172px; }
  .ru-id { width: 48px; }
  .ru-nm { width: 116px; }
  .ru-rl { width: 84px; }
  .ru-st { width: 76px; }
  .ru-ct { width: 132px; }
  .ru-ops { width: 128px; }
  .db-id { width: 48px; }
  .db-st { width: 84px; }
  .db-tm { width: 140px; }
  .bp-tm { width: 132px; }
  .bp-tag { width: 70px; }
  .bp-sz { width: 80px; }
  .bp-ops { width: 158px; }

  /* 触控目标不小于 40px */
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn-sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
  td.ops .btn { min-height: 32px; }

  .charts-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-card { padding: 14px; border-radius: 12px; }
  .chart-box { height: 250px; }
  .chart-box.wide { height: 270px; }
  .chart-head { margin-bottom: 10px; }
  .chart-head h3 { font-size: 15px; }
  /* 日期筛选条：预设按钮按自然宽度排，放不下自己换行；日期输入与按钮占满整行 */
  .range-bar { padding: 12px; gap: 10px; }
  .range-presets { width: 100%; }
  .range-bar .rng-btn { min-height: 40px; padding: 0 12px; }
  .range-dates { margin-left: 0; width: 100%; }
  .range-bar .rng-date { flex: 1; width: auto; min-width: 0; height: 40px; }
  .dn-wrap { gap: 12px; }
  .dn-ring { width: 110px; height: 110px; }
  .dn-hole { inset: 20px; }
  .dn-total { font-size: 20px; }
  .hb-label { width: 64px; font-size: 12.5px; }

  /* 状态/处罚两栏并排会太挤，窄屏改成上下两行；规则列表也给矮一点 */
  .verdict-row { grid-template-columns: 1fr; gap: 10px; }
  .rule-list { max-height: 300px; }
  .rule-item { padding: 10px; }
  .state-group { grid-template-columns: 1fr 1fr; }
  .state-group .state-btn { height: 42px; }

  /* 弹窗：手机上贴边、内部滚动 */
  .modal-mask { padding: 12px; align-items: flex-end; }
  .modal { padding: 18px; border-radius: 18px 18px 14px 14px; max-height: 88vh; }
  .modal h3 { font-size: 17px; margin-bottom: 14px; }
  .modal-actions { gap: 10px; }
  .modal-actions .btn { flex: 1; }
  .field { margin-bottom: 14px; }
  textarea.input { min-height: 140px; }
}

/* ============ 手机竖屏 ============ */
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  /* 日期筛选条：预设按三列排齐，日期与「应用」按钮各占一行，方便点按 */
  .range-presets { display: grid; grid-template-columns: repeat(3, 1fr); }
  .range-bar .rng-btn { padding: 0 6px; }
  .range-dates { flex-wrap: wrap; }
  .range-bar .rng-date { flex: 1 1 40%; }
  .range-dates .btn { flex: 1 1 100%; }
  .login-card { padding: 26px 20px; border-radius: 20px; }
  .login-logo { width: 60px; height: 60px; font-size: 26px; border-radius: 17px; }
  .login-card h2 { font-size: 22px; }
  .violation-card { padding: 10px 12px; }
  /* 逐条处理的按钮行:窄屏一行放不下,按钮各占一半、提示单独一行 */
  .v-ops { gap: 8px; }
  .v-ops .btn { flex: 0 0 auto; }
  .v-ops .state-group { flex: 1 1 100%; grid-template-columns: 1fr 1fr; }
  .v-save-msg { flex: 1 1 100%; }
  .item-summary { font-size: 13px; }
  .penalty-chip { font-size: 12.5px; }
  .review-actions .btn { flex: 1 1 100%; }
  .review-actions .sub { flex: 1 1 100%; }
}

/* 大屏：内容已经铺满，适当放大图表让留白更均衡 */
@media (min-width: 1800px) {
  .chart-box { height: 340px; }
  .chart-box.wide { height: 380px; }
  .charts-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
}

/* ============ 首页企业风头部（年月日 + 问候 + 实时钟） ============ */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #1e3a8a 0%, #3730a3 55%, #4f46e5 100%);
  border-radius: 18px; padding: 22px 28px; margin-bottom: 20px;
  color: #fff; box-shadow: 0 14px 40px rgba(30,58,138,.22); position: relative; overflow: hidden;
}
.dash-hero::after { content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.dash-hero::before { content: ''; position: absolute; left: -40px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero-left { position: relative; z-index: 1; }
.hero-date { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.hero-sub { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-dot { opacity: .6; }
.hero-user { font-weight: 600; color: #fff; }
.hero-right { position: relative; z-index: 1; text-align: right; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.82); background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; }
.hc-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.3); }
.hero-clock { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: 1px; }

/* KPI 统计卡左侧色条 + 图标配色 */
#stat-cards .stat-card.kpi { border-left: 4px solid var(--blue-2); }
#stat-cards .stat-card.kpi:nth-child(1) { border-left-color: #3b82f6; }
#stat-cards .stat-card.kpi:nth-child(2) { border-left-color: #ef4444; }
#stat-cards .stat-card.kpi:nth-child(3) { border-left-color: #6366f1; }
#stat-cards .stat-card.kpi:nth-child(4) { border-left-color: #f59e0b; }
#stat-cards .stat-card.kpi:nth-child(5) { border-left-color: #e11d48; }
#stat-cards .stat-card.kpi:nth-child(6) { border-left-color: #10b981; }
.stat-icon.indigo { background: #e0e7ff; color: #4f46e5; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.rose { background: #ffe4e6; color: #e11d48; }

/* 班主任质检概览表 */
.teacher-board { width: 100%; }
.tb-scroll { overflow-x: auto; }
.tb-teacher { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tb-teacher th { text-align: left; color: #64748b; font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; background: #f8fafc; }
.tb-teacher td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.tb-teacher tbody tr:hover { background: #f8fafc; }
.tb-name { font-weight: 600; color: #1e293b; white-space: nowrap; }
.tb-sup { color: #64748b; white-space: nowrap; }
.tb-num { text-align: center; font-variant-numeric: tabular-nums; }
.tb-num.tb-bad { color: #dc2626; font-weight: 700; }
.tb-amt { font-weight: 600; color: #b45309; }
.tb-amt.tb-zero { color: #94a3b8; font-weight: 500; }
.tb-types { white-space: nowrap; }
.tb-tag { display: inline-block; background: #eef2ff; color: #4f46e5; border-radius: 6px; padding: 2px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.tb-tag.tb-none { background: #f1f5f9; color: #94a3b8; }
.tb-tag.tb-more { background: #fff7ed; color: #ea580c; }

/* 班主任情绪看板 */
.emotion-board { width: 100%; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.emo-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; transition: box-shadow .2s, transform .2s; }
.emo-card:hover { box-shadow: 0 8px 24px rgba(30,64,175,.10); transform: translateY(-2px); }
.emo-head { display: flex; align-items: center; gap: 10px; }
.emo-avatar { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.emo-who { flex: 1; min-width: 0; }
.emo-name { font-weight: 700; color: #1e293b; font-size: 15px; }
.emo-sup { font-size: 12px; color: #94a3b8; margin-top: 1px; }
.emo-score { font-weight: 800; font-size: 15px; white-space: nowrap; }
.emo-score.good { color: #16a34a; }
.emo-score.mid { color: #64748b; }
.emo-score.bad { color: #dc2626; }
.emo-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.emo-mood, .emo-tone { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.emo-mood.m-暴躁 { background: #fee2e2; color: #dc2626; }
.emo-mood.m-耐心 { background: #dcfce7; color: #16a34a; }
.emo-mood.m-热情 { background: #ffedd5; color: #ea580c; }
.emo-mood.m-敷衍 { background: #f1f5f9; color: #64748b; }
.emo-mood.m-中性 { background: #e0e7ff; color: #4f46e5; }
.emo-tone.t-压迫 { background: #fae8ff; color: #a21caf; }
.emo-tone.t-安抚 { background: #dcfce7; color: #16a34a; }
.emo-tone.t-鼓励 { background: #e0f2fe; color: #0284c7; }
.emo-tone.t-平淡 { background: #f1f5f9; color: #64748b; }
.emo-tone.t-急躁 { background: #fee2e2; color: #dc2626; }
.emo-summary { margin-top: 10px; font-size: 13px; color: #475569; line-height: 1.6; background: #f8fafc; border-radius: 9px; padding: 9px 11px; }
.emo-counts { margin-top: 8px; font-size: 12px; color: #94a3b8; }

/* 情绪看板分块：情绪对比 / 扣款金额 / 违规条数（个人维度，各自一张表） */
.emo-section { margin-top: 20px; }
.emo-section:first-child { margin-top: 0; }
.emo-sec-title { font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--blue); line-height: 1.3; }
.emo-mini { width: 100%; overflow-x: auto; }
.emo-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.emo-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.emo-tbl tr:last-child td { border-bottom: none; }
.emo-nm { font-weight: 700; color: #1e293b; white-space: nowrap; }
.emo-sp { color: #94a3b8; font-size: 12.5px; white-space: nowrap; }
.emo-val { text-align: right; position: relative; min-width: 160px; font-weight: 600; color: #1e293b; }
.emo-val.emo-bad { color: #dc2626; }
.emo-bar { display: block; height: 7px; border-radius: 999px; background: #e0e7ff; margin-top: 6px; overflow: hidden; }
.emo-bar i { display: block; height: 100%; background: #4f46e5; border-radius: 999px; }
.emo-bar-red { background: #fee2e2; }
.emo-bar-red i { background: #ef4444; }

/* 主管多折线降级（无 ECharts 时） */
.fb-line { margin-bottom: 14px; }
.fb-cap { font-size: 12.5px; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.fb-line svg { display: block; width: 100%; height: 180px; }

/* 移动端：头部堆叠、时钟缩小、情绪卡单列 */
@media (max-width: 640px) {
  .dash-hero { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
  .hero-right { text-align: left; }
  .hero-date { font-size: 22px; }
  .hero-clock { font-size: 24px; }
  .emo-grid { grid-template-columns: 1fr; }
  .tb-tag { font-size: 11px; padding: 2px 6px; }
}
