* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif; }
:root {
  --blue: #2d5f8b; --blue-2: #234e73; --blue-light: #c9dbea;
  --bg: #dde7f0; --border: #b8cce0; --text: #1a2a3a; --text-2: #5a6a7a;
  --accent: #2d5f8b;
  --cell-border: #94b8d8;          /* 单元格边框（中蓝） */
  --cell-odd:  #ffffff;             /* 奇行（纯白） */
  --cell-even: #e6f1fb;             /* 偶行（极浅蓝） */
  --cell-hover: #e6f1fb;            /* 悬停（与偶行同色，避免与「筛选」状态混淆） */
  --head-bg: #2d5f8b;               /* 表头深蓝 */
  --head-2: #234e73;                /* 多行表头次色 */
}
html, body { height: 100%; }
body { font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif; background: var(--bg); color: var(--text); font-size: 12px; display: flex; flex-direction: column; overflow: hidden; }
input, select, textarea, button { font-family: inherit; }
.hidden { display: none !important; }

/* ===== 顶栏（对齐参考图：左标题 + 右页签） ===== */
.topbar { background: #fff; border-bottom: 1px solid var(--cell-border); padding: 9px 18px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.topbar-left { padding-bottom: 8px; }
.topbar-left .title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 16px; color: var(--blue); font-weight: 800; letter-spacing: 1px; }

/* 标题右侧「保存中 / 已保存」内联状态指示器 */
.save-status { font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .28s; white-space: nowrap; line-height: 1; }
.save-status.saving { color: #b45309; opacity: 1; }
.save-status.saved  { color: #059669; opacity: 1; }
.save-status.error  { color: #dc2626; opacity: 1; }
.save-status .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 2px; animation: savePulse 1s ease-in-out infinite; }
@keyframes savePulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
.topbar .meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.topbar .meta b { color: var(--accent); }
.topbar-right { display: flex; align-items: flex-end; gap: 10px; }
.btn-export-top { padding: 5px 14px; border: 1.5px solid var(--accent); color: var(--accent); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit; margin-bottom: 4px; }
.btn-export-top:hover { background: var(--accent); color: #fff; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { padding: 5px 16px; font-size: 12px; color: var(--blue-2); border: 1px solid transparent; border-bottom: none; border-radius: 7px 7px 0 0; cursor: pointer; background: transparent; font-family: inherit; white-space: nowrap; }
.tab:hover { background: var(--blue-light); }
.tab.active { background: var(--blue); color: #fff; font-weight: 600; }
.tab .cnt { font-size: 10px; opacity: .75; margin-left: 4px; }

/* ===== 子工具栏 ===== */
.subbar { background: #eef4fa; border-bottom: 1px solid var(--cell-border); padding: 6px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.unit { font-size: 11px; color: var(--text-2); }
.dim { font-size: 11px; color: var(--text-2); }
.subbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; width: 190px; outline: none; font-family: inherit; }
.search:focus { border-color: var(--accent); }
.search-col { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; color: var(--text-2); max-width: 220px; outline: none; font-family: inherit; }
.search-empty { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); margin-left: 2px; user-select: none; cursor: pointer; }
.search-empty input { margin: 0; cursor: pointer; }
.pagesize { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-2); font-family: inherit; }
.date { font-size: 12px; color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; background: #f8fafc; }
.admin-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); cursor: pointer; padding: 4px 8px; border-radius: 6px; user-select: none; }
.admin-toggle input { margin: 0; cursor: pointer; }
.admin-toggle:has(input:checked) { color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; }
.btn-export { padding: 7px 20px; border: 1.5px solid var(--accent); color: var(--accent); background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; }
.btn-export:hover { background: var(--accent); color: #fff; }
.btn-refresh { padding: 7px 16px; border: 1.5px solid #94a3b8; color: #475569; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; font-family: inherit; }
.btn-refresh:hover { border-color: var(--accent); color: var(--accent); }
/* btn-import 已迁到 .btn-ic，去掉旧规则避免遗留 */

/* ===== 图标按钮（导入 / 导出 / 全部删除） ===== */
.btn-ic {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; color: #fff;
  border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 700; font-family: inherit; letter-spacing: .3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.18);
  transition: filter .15s, transform .15s, box-shadow .15s;
}
.btn-ic .ic { width: 15px; height: 15px; flex: 0 0 15px; fill: currentColor; display: inline-block; vertical-align: -2px; }
.btn-ic:hover { filter: brightness(1.08); box-shadow: 0 3px 7px rgba(0,0,0,.22); }
.btn-ic:active { filter: brightness(.92); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
/* 绿：导入 / 导出 */
.btn-ic-success { background: #43a047; box-shadow: 0 2px 4px rgba(67,160,71,.35); }
.btn-ic-success:hover { box-shadow: 0 3px 7px rgba(67,160,71,.5); }
.btn-ic-success:active { box-shadow: 0 1px 2px rgba(67,160,71,.4); }
/* 红：全部删除 */
.btn-ic-danger { background: #ef5350; box-shadow: 0 2px 4px rgba(239,83,80,.35); }
.btn-ic-danger:hover { box-shadow: 0 3px 7px rgba(239,83,80,.5); }
.btn-ic-danger:active { box-shadow: 0 1px 2px rgba(239,83,80,.4); }
.import-hint { font-size: 12px; color: var(--warn, #b45309); }
.import-dot { display: inline-block; margin-left: 4px; font-size: 11px; opacity: .8; }
.tab.active .import-dot { color: #ffd966; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.tag-g { background: #ecfdf5; color: #059669; }
.tag-r { background: #fef2f2; color: #dc2626; }
.tr-total td { background: var(--head-bg) !important; color: #fff !important; font-weight: 700; border-color: rgba(255,255,255,.35); }
.tr-total:hover td { background: var(--head-2) !important; }
.empty-cell { text-align: center; color: #94a3b8; padding: 40px; }

/* ===== 表格区 ===== */
.grid-area { flex: 1; overflow: hidden; display: flex; flex-direction: column; padding: 10px 18px; }
.table-scroll { flex: 1; overflow: auto; background: #fff; border: 1px solid var(--cell-border); border-radius: 10px; }
/* table-layout: fixed 必须配合 <colgroup width>，才能保证列宽被浏览器精确使用，从而让 sticky.left 累计与实际列位置一致。
   改回 auto 会让 Chrome 把表格列压缩到内容宽度，sticky 第 1 列的 left 算错，第 2 列往后整体被压成 ~35px，左侧出现大片"空白列"假象（v=56 修复）。 */
table.grid { border-collapse: collapse; font-size: 11px; width: max-content; table-layout: fixed; }
table.grid th, table.grid td { border: 1px solid #c5d8ec; padding: 2px 6px; white-space: nowrap; line-height: 1.25; vertical-align: top; }
/* 标题栏（thead）整体冻结：整个表头作为一个块 sticky 在顶部。
   之前是每个 th 各自 sticky top:0，多行表头需要 JS 硬编码 top:r*22px，行高不准则错位。
   改成 thead 整体 sticky 后，无论 1 行还是多行表头都自动堆叠冻结，无需计算行高。 */
table.grid thead { position: sticky; top: 0; z-index: 30; }
table.grid thead th { background: var(--head-bg); color: #fff; font-weight: 600; text-align: center; padding: 0; border-color: rgba(255,255,255,.35); }
table.grid thead tr.pre-head th { background: var(--head-2); font-weight: 500; }
/* 所有数据行用统一极浅蓝（--cell-even），无斑马纹，避免第 2 行紧贴深色表头产生"冷对比"错觉 */
table.grid tbody td { background: var(--cell-even); }
table.grid tbody tr:hover td { background: var(--cell-hover); }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; padding: 2px 6px 2px 14px; }
table.grid td.hl { background: #fff3bf !important; }
table.grid td.hl-empty { background: #ffd9d6 !important; color: #b42318; }
/* 合计行（v=105）：明细数据页签底部固定，金额列合计 */
table.grid tfoot td { position: sticky; bottom: 0; z-index: 25; background: #e8eef7; font-weight: bold; border-top: 2px solid #4472c4; text-align: right; padding: 3px 8px; }
table.grid tfoot td.total-label { text-align: center; color: #1f4e79; letter-spacing: 2px; }
table.grid td.rowno { background: var(--cell-even); color: #5a6a7a; text-align: center; font-size: 10px; position: sticky; left: 0; z-index: 11; }
table.grid th.rowno { background: var(--head-bg); position: sticky; left: 0; top: 0; z-index: 23; }

/* AIG 表前 5 列横向滚动时冻结（原生 position:sticky，浏览器合成、无闪烁） */
table.grid th.sticky-col,
table.grid td.sticky-col { position: sticky; z-index: 10; background: var(--cell-even); }
table.grid thead th.sticky-col { background: var(--head-bg); color: #fff; top: 0; z-index: 22; border-color: rgba(255,255,255,.35); }
table.grid tbody tr.tr-total td.sticky-col { background: var(--head-bg) !important; color: #fff !important; font-weight: 700; }
table.grid tbody tr:hover td.sticky-col { background: var(--cell-hover); }

/* AIG 表（第二个 sheet）所有单元格内容靠底部对齐（参考样张：内容贴单元格底边） */
table.grid[data-tab="1"] th, table.grid[data-tab="1"] td { vertical-align: bottom; }

/* ===== 原始页签（项目合同关系 / 项目明细数据）Excel 式删列 / 右键菜单 ===== */
/* 表头悬停显示的"✕"删除列按钮——移到表头左下角，与右上角的筛选 ▾ 完全分开（v=73） */
table.grid thead th { position: relative; }
table.grid thead th .col-del {
  position: absolute; bottom: 1px; left: 2px; z-index: 30;
  width: 15px; height: 15px; line-height: 13px; text-align: center;
  border: none; border-radius: 3px; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font-size: 11px; padding: 0;
  opacity: 0; transition: opacity .1s;
}
table.grid thead th:hover .col-del { opacity: 1; }
table.grid thead th .col-del:hover { background: #e53935; color: #fff; }
/* 右键上下文菜单 */
.ctx-menu {
  position: absolute; z-index: 200; min-width: 124px;
  background: #fff; border: 1px solid #c5d8ec; border-radius: 8px;
  box-shadow: 0 6px 22px rgba(20,50,80,.22); padding: 4px; font-size: 13px;
}
.ctx-menu .ctx-item {
  padding: 7px 12px; border-radius: 6px; cursor: pointer; color: #243b53; white-space: nowrap;
}
.ctx-menu .ctx-item:hover { background: #e6f1fb; }
.ctx-menu .ctx-item.is-disabled { color: #9aa7b4; cursor: not-allowed; }
.ctx-menu .ctx-item.is-disabled:hover { background: transparent; }
.ctx-menu .ctx-item[data-act="col"],
.ctx-menu .ctx-item[data-act="row"] { color: #c62828; }

/* ===== 格式刷相关样式已删除（v=55 用户取消此功能） ===== */

/* 表头内部结构（标题 + 筛选按钮 + 拖宽手柄） */
.th-title { display: block; padding: 3px 6px; overflow: visible; white-space: nowrap; }
.th-filter { position: absolute; right: 1px; top: 2px; width: 16px; height: 16px; line-height: 14px; border: none; border-radius: 3px; background: transparent; color: #c7d6ea; cursor: pointer; font-size: 10px; padding: 0; font-family: inherit; }
.th-filter:hover { background: rgba(255,255,255,.25); color: #fff; }
.th-filter.on { background: #ffd966; color: #7c4a03; }
.th-resize { position: absolute; right: -4px; top: 0; width: 10px; height: 100%; cursor: col-resize; z-index: 5; }
.th-resize::after { content: ''; position: absolute; right: 4px; top: 2px; width: 2px; height: calc(100% - 4px); border-radius: 1px; background: transparent; transition: background .12s; }
th:hover .th-resize::after { background: rgba(255, 255, 255, .6); }
thead th { position: relative; }

/* 汇总表可编辑单元格（分类重命名 / 手动列 / 行·列删除） */
.sum-cat { white-space: nowrap; }
.sum-cat-name, .sum-manual, .sum-col-name { outline: none; cursor: text; }
.sum-cat-name:hover, .sum-manual:hover, .sum-col-name:hover { background: rgba(91, 143, 196, .12); box-shadow: inset 0 0 0 1px #5b8fc4; }
.sum-cat-name:focus, .sum-manual:focus, .sum-col-name:focus { background: #fff7e6; box-shadow: inset 0 0 0 2px #2d6cdf; }
.sum-manual { text-align: right; font-variant-numeric: tabular-nums; }
.sum-del-row { border: none; background: transparent; color: #c0392b; cursor: pointer; font-size: 11px; line-height: 1; padding: 0 4px; border-radius: 3px; opacity: 0; transition: opacity .12s; }
.sum-del-row:hover { background: #fde2e0; opacity: 1; }
.sum-del-col { border: none; background: transparent; color: #c0392b; cursor: pointer; font-size: 11px; line-height: 1; padding: 0 4px; border-radius: 3px; opacity: 0; transition: opacity .12s; position: absolute; right: 1px; top: 2px; }
.sum-del-col:hover { background: #fde2e0; opacity: 1; }
/* 行/列悬停或聚焦时显示对应删除按钮 */
tbody tr:hover .sum-del-row, thead th:hover .sum-del-col { opacity: .6; }
tbody tr:hover .sum-del-row:hover, thead th:hover .sum-del-col:hover { opacity: 1; }
tbody tr:focus-within .sum-del-row, thead th:focus-within .sum-del-col { opacity: .6; }
thead th { position: relative; }

/* 筛选面板 */
.filter-panel { position: fixed; width: 240px; max-height: 320px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px rgba(15,23,42,.18); z-index: 150; display: flex; flex-direction: column; font-size: 12px; }
.fp-head { padding: 9px 12px; font-weight: 700; color: var(--blue); border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-search { margin: 8px 10px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; outline: none; font-family: inherit; }
.fp-search:focus { border-color: var(--accent); }
.fp-list { flex: 1; overflow-y: auto; padding: 0 6px 6px; max-height: 190px; }
.fp-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.fp-item:hover { background: #f1f5f9; }
.fp-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-empty { padding: 12px; text-align: center; color: #9ca3af; }
.fp-foot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); }
.fp-btn { flex: 1; padding: 5px 0; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; }
.fp-btn:hover { border-color: var(--accent); color: var(--accent); }
.fp-ok { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.fp-ok:hover { background: var(--blue-2); color: #fff; }
.btn-sm { padding: 4px 12px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; }
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0; font-size: 12px; color: var(--text-2); }
.pager button { padding: 4px 14px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 12px; }
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 空状态 */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; border: 2px dashed var(--border); border-radius: 14px; color: var(--text-2); }
.empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty-state h2 { font-size: 18px; color: var(--blue); margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 1.9; text-align: center; margin-bottom: 20px; }
.btn-primary-lg { padding: 11px 34px; background: var(--blue); color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-primary-lg:hover { background: var(--blue-2); }

/* 拖拽遮罩 */
.drop-mask { position: fixed; inset: 0; background: rgba(31, 78, 121, .35); z-index: 99; display: flex; align-items: center; justify-content: center; }
.drop-tip { background: #fff; color: var(--blue); font-size: 18px; font-weight: 700; padding: 34px 60px; border-radius: 16px; border: 3px dashed var(--blue); }

/* toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 9px 22px; border-radius: 8px; z-index: 200; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.err { background: #dc2626; }

/* 页面最左侧「已保存」徽章 */
/* 编辑按钮（行内） */
.btn-edit-row { padding: 3px 10px; border: none; background: var(--blue); color: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; font-family: inherit; font-weight: 600; }
.btn-edit-row:hover { background: var(--blue-2); }
.btn-op { margin: 0 2px; padding: 3px 8px; font-size: 11px; }
.op-cell { text-align: center; white-space: nowrap; }
.btn-imp-row { background: #2e9e5b; }
.btn-imp-row:hover { background: #237a46; }
.btn-del-row { background: #dc2626; }
.btn-del-row:hover { background: #b91c1c; }

/* 编辑弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 900px; max-width: 100%; padding: 22px 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 18px; color: var(--blue); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.form-item { display: flex; flex-direction: column; }
.form-item.span2 { grid-column: span 2; }
.form-item label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.form-item input, .form-item select, .form-item textarea { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; background: #fff; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--accent); }
.form-item input:disabled, .form-item select:disabled, .form-item textarea:disabled { background: #f5f7fa; color: #6b7280; cursor: not-allowed; }
.auto-badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #eef2ff; color: #4f46e5; font-weight: 600; }
.ok-badge { background: #ecfdf5; color: #059669; }
.form-warn { display: block; margin-top: 4px; color: #d93025; font-size: 11px; line-height: 1.35; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); align-items: center; }
.modal-hint { font-size: 12px; color: var(--text-2); margin-right: auto; }
.modal-narrow { width: 520px; }
.modal-close { position: absolute; top: 10px; right: 14px; width: 30px; height: 30px; border: none; background: transparent; color: #94a3b8; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px; font-family: inherit; padding: 0; }
.modal-close:hover { background: #f1f5f9; color: #1f2937; }
.modal { position: relative; }
.form-item .req { color: #dc2626; font-weight: 700; }
.result-body { font-size: 13px; line-height: 1.8; max-height: 50vh; overflow-y: auto; }
.result-body .ok { color: #059669; }
.result-body .err { color: #dc2626; }
.result-body .err-list { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; max-height: 240px; overflow: auto; }
.result-body .err-list li { padding: 2px 0; }
.btn-save { padding: 8px 28px; background: var(--blue); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit; }
.btn-save:hover { background: var(--blue-2); }
.btn-cancel { padding: 8px 22px; background: #fff; color: #475569; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit; }
.btn-cancel:hover { border-color: var(--accent); color: var(--accent); }
.muted { color: #9ca3af; font-weight: 400; font-size: 13px; }

/* NOPO 顶部操作条（始终置顶，只在 AIG-不包含交通页签显示） */
.nopo-top { display: flex; align-items: center; background: #f6f9fc; border-bottom: 1px solid var(--border); padding: 7px 14px; gap: 10px; }
.nopo-top-left { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.nopo-unit { color: var(--text-2); font-size: 11px; }
.modifier-input { font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.modifier-input input { padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; width: 100px; outline: none; font-family: inherit; background: #fff; }
.modifier-input input:focus { border-color: var(--accent); }
.nopo-top-right { display: flex; gap: 8px; }
.btn-aig-primary { padding: 6px 12px; border: none; color: #fff; border-radius: 6px; cursor: pointer; font-size: 11px; font-family: inherit; font-weight: 700; letter-spacing: .5px; box-shadow: 0 2px 6px rgba(24,95,165,.35); transition: all .18s; background: linear-gradient(180deg, #5a8fc0 0%, #185fa5 100%); }
.btn-aig-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(24,95,165,.45); }
.btn-aig-primary:active { filter: brightness(.95); transform: translateY(0); box-shadow: 0 1px 3px rgba(24,95,165,.3); }
.btn-aig-export { padding: 6px 12px; border: none; color: #fff; border-radius: 6px; cursor: pointer; font-size: 11px; font-family: inherit; font-weight: 700; letter-spacing: .5px; box-shadow: 0 2px 6px rgba(55,138,221,.35); transition: all .18s; background: linear-gradient(180deg, #6ba0d8 0%, #378add 100%); }
.btn-aig-export:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(55,138,221,.45); }
.btn-aig-export:active { filter: brightness(.95); transform: translateY(0); box-shadow: 0 1px 3px rgba(55,138,221,.3); }
.btn-aig-secondary { padding: 6px 12px; border: 1.5px solid var(--head-bg); background: #fff; color: var(--head-bg); border-radius: 6px; cursor: pointer; font-size: 11px; font-family: inherit; font-weight: 700; letter-spacing: .5px; transition: all .15s; }
.btn-aig-secondary:hover { background: var(--head-bg); color: #fff; }

/* ===== 邮件配置弹窗（仅管理员） ===== */
.modal-mailcfg { width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; }
.mailcfg-tip { font-size: 12px; color: #64748b; margin: 4px 0 12px; line-height: 1.6; }
.mailcfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.mailcfg-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.mailcfg-grid label.span2 { grid-column: span 2; }
.mailcfg-grid label.mc-enable { grid-column: span 3; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: #1e293b; }
.mailcfg-grid input, .mailcfg-grid select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; background: #fff; }
.mailcfg-grid input:focus, .mailcfg-grid select:focus { border-color: var(--accent); }
.mailcfg-grid code { background: #f1f5f9; padding: 0 4px; border-radius: 4px; font-size: 11px; }
.mail-state { font-size: 11px; font-weight: 700; }
.mail-state.st-none { color: #dc2626; }
.mail-state.st-off { color: #d97706; }
.mail-state.st-on { color: #059669; }

/* ===== 邮件正文预览（tab 5） ===== */
#mailView { padding: 12px 16px 16px; height: calc(100% - 24px); display: flex; flex-direction: column; }
.mail-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mail-toolbar .mail-stats { font-size: 12px; color: #475569; font-weight: 600; }
.mail-toolbar .mail-spacer { flex: 1; }
.mail-frame {
  flex: 1; width: 100%; border: 1px solid #d4dae0; border-radius: 8px;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
