/* 项目录入管理 —— Web 版样式（兼容性优先：无 flexbox 高级特性外的现代语法） */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

/* 整体左对齐并充分利用宽度：录入表单限宽保持整洁，记录表占满剩余宽度 */
.container { max-width: none; margin: 0; padding: 16px 24px; }

/* ---------- 头部 ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 0 2px; flex-wrap: wrap;
}
.app-header h1 { font-size: 20px; color: #1f3a5f; }
#statusBar { color: #888; font-size: 12px; }

/* ---------- 面板 ---------- */
.panel {
  border: 1px solid #d5dae2; border-radius: 6px; background: #fff;
  margin-bottom: 12px; padding: 14px 14px 16px;
}
.panel legend { padding: 0 8px; font-weight: 600; color: #1f3a5f; }
/* 录入表单限宽：避免超宽屏下字段被拉得过长；记录表不限宽，随窗口铺满 */
.form-panel { max-width: 1120px; }

/* ---------- 表单网格 ---------- */
/* 每行是一个 .form-row，行内字段横向排布；new_line 标记在字段间强制换行 */
.form-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.form-row {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
}
.field {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  flex: 1 1 180px;                     /* 行内字段按比例平分宽度，过窄时自动换行 */
}
.field label { white-space: nowrap; color: #444; flex-shrink: 0; }
.field label.required::after { content: " *"; color: #d32f2f; }

.field input[type="text"],
.field input[type="number"],
.field input[type="date"] {
  flex: 1; min-width: 0; width: 100%; height: 30px; padding: 0 8px;
  border: 1px solid #c4ccd6; border-radius: 4px; font-size: 13px; color: #333;
}
.field input:focus {
  outline: none; border-color: #4a7ebb; box-shadow: 0 0 0 2px rgba(74, 126, 187, 0.2);
}
.field input[type="number"] { text-align: right; }
.field input[disabled] { background: #f5f6f8; color: #666; }

/* ---------- 非工作日提示（仅提示，不阻断） ---------- */
.date-hints { margin-top: 10px; }
.date-hint { font-size: 12px; line-height: 1.6; }
.date-hint.warn {
  color: #b45309; background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 4px; padding: 5px 10px; margin-top: 4px;
}

/* ---------- 记录表格 ---------- */
.table-panel .table-wrap { max-height: 60vh; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
#recordTable { border-collapse: collapse; font-size: 12px; table-layout: fixed; }
#recordTable th, #recordTable td { border: 1px solid #e3e7ec; padding: 4px 6px; text-align: left; }
#recordTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#recordTable th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recordTable thead tr:first-child th {
  position: sticky; top: 0; height: 32px; background: #eef2f7; color: #333;
  font-weight: 600; z-index: 3;
}
#recordTable thead tr.filter-row th {
  position: sticky; top: 32px; height: 28px; padding: 2px 4px; background: #f7f9fb; z-index: 2;
}
#recordTable tbody tr:nth-child(even) { background: #f7f9fb; }
#recordTable tbody tr:hover { background: #eaf1f8 !important; }

/* 框选高亮（!important 以覆盖批次底色） */
#recordTable tbody tr.row-selected,
#recordTable tbody tr.row-selected:nth-child(even) { background: #dbeafe !important; }
#recordTable td.cell-selected {
  background: #bfdbfe !important;
  box-shadow: inset 0 0 0 1px #3b82f6;
}
#recordTable tbody { user-select: none; -webkit-user-select: none; -ms-user-select: none; }
#recordTable tbody input, #recordTable tbody textarea {
  user-select: text; -webkit-user-select: text; -ms-user-select: text;
}

/* 已完成项目：整行删除线（触发字段见 review/settings.py 的 ROW_COMPLETE_STYLE） */
#recordTable tbody tr.row-done td { text-decoration: line-through; color: #999; }
#recordTable tbody tr.row-done td input,
#recordTable tbody tr.row-done td button,
#recordTable tbody tr.row-done td select { text-decoration: none; }

/* 列宽拖拽手柄 */
.col-resizer {
  position: absolute; top: 0; right: 0; width: 6px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 4;
}
.col-resizer:hover { background: rgba(46, 109, 164, 0.3); }

/* 表头筛选输入 */
.col-filter {
  width: 100%; height: 22px; padding: 0 4px;
  border: 1px solid #d5dae2; border-radius: 3px; font-size: 11px;
}

/* ---------- 批次工具栏 ---------- */
/* 记录表上方的批次页签（全部 / 未分批 / 各批次名称） */
.batch-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px dashed #e3e7ec;
}
.batch-tab {
  height: 24px; padding: 0 10px; font-size: 12px; cursor: pointer;
  border: 1px solid #cdd6e0; border-radius: 12px; background: #fff; color: #33506f;
}
.batch-tab:hover { background: #eef4ff; }
.batch-tab.batch-tab-active {
  background: #2e6da4; border-color: #2e6da4; color: #fff; font-weight: 600;
}
.table-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.tool-input {
  height: 28px; width: 160px; padding: 0 8px;
  border: 1px solid #c4ccd6; border-radius: 4px; font-size: 13px;
}
.tool-label { font-size: 13px; color: #444; }
.tool-label select { height: 28px; border: 1px solid #c4ccd6; border-radius: 4px; font-size: 13px; }
.tool-hint { font-size: 12px; color: #888; }
.tool-count { font-size: 12px; color: #2e6da4; margin-left: auto; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 13px; }

/* ---------- 编辑提示条 ---------- */
.edit-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 10px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 4px; color: #b45309; font-size: 13px;
}

/* ---------- 表单操作行（清空 / 录入，放在录入面板内） ---------- */
.form-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e3e7ec;
}

/* ---------- 选择 / 拖动 / 操作列 ---------- */
#recordTable th.col-select, #recordTable td.col-select { text-align: center; }
#recordTable th.col-drag, #recordTable td.col-drag {
  text-align: center; color: #aaa; cursor: grab; user-select: none;
}
#recordTable th.col-drag:active, #recordTable td.col-drag:active { cursor: grabbing; }
#recordTable tr.dragging { opacity: 0.45; }
#recordTable th.th-tracking { background: #f3f7ee; }

/* ---------- 跟进单元格 ---------- */
.track-input {
  width: 100%; min-width: 0; height: 26px; padding: 0 6px;
  border: 1px solid #d5dae2; border-radius: 4px; font-size: 12px;
}
#recordTable td.col-bool { text-align: center; }
#recordTable td.col-todo { vertical-align: top; white-space: normal; overflow: hidden; }
.todo-cell { width: 100%; }
/* 跟进条目列表：固定高度内上下滚动，避免流程很长时把整行撑得过高、不便浏览 */
.todo-list { max-height: 96px; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px; line-height: 1.5; padding: 1px 0;
}
.todo-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.todo-text { word-break: break-word; overflow-wrap: anywhere; }
.todo-item.done .todo-text { text-decoration: line-through; color: #999; }
.todo-meta { font-size: 10px; color: #999; line-height: 1.3; }
.todo-item input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }
/* 删除该条跟进：默认淡显，鼠标移到该条上才明显 */
.todo-del {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; padding: 0;
  border: 1px solid transparent; border-radius: 3px; background: transparent;
  color: #b6bec9; font-size: 13px; line-height: 1; cursor: pointer;
}
.todo-item:hover .todo-del { color: #c0392b; border-color: #f0c8c2; background: #fdf0ee; }
.todo-del:hover { color: #fff; background: #c0392b; border-color: #c0392b; }
.todo-add { display: flex; gap: 4px; margin-top: 4px; }
.todo-input {
  flex: 1; min-width: 0; height: 24px; padding: 0 6px;
  border: 1px solid #d5dae2; border-radius: 4px; font-size: 12px;
}
.todo-btn {
  height: 24px; width: 26px; border: 1px solid #c4ccd6; border-radius: 4px;
  background: #fff; cursor: pointer;
}
.todo-btn:hover { background: #f0f3f7; }

/* ---------- 按钮 ---------- */
.btn {
  height: 32px; padding: 0 22px; border: 1px solid #c4ccd6; border-radius: 4px;
  background: #fff; color: #333; cursor: pointer; font-size: 14px;
}
.btn:hover { background: #f0f3f7; }
.btn:active { background: #e4e9f0; }
.btn-primary { background: #2e6da4; border-color: #2e6da4; color: #fff; }
.btn-primary:hover { background: #265a8c; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- 自动补全弹层 ---------- */
.ac-popup {
  position: absolute; z-index: 1000; background: #fff;
  border: 1px solid #c4ccd6; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-height: 240px; overflow-y: auto; display: none;
}
.ac-popup .ac-item { padding: 6px 10px; cursor: pointer; font-size: 13px; }
.ac-popup .ac-item:hover,
.ac-popup .ac-item.active { background: #eaf1f8; }
.ac-popup .ac-empty { padding: 6px 10px; color: #999; font-size: 12px; }

/* ---------- 右键菜单 ---------- */
.context-menu {
  position: fixed; z-index: 2000; min-width: 150px; padding: 4px 0;
  background: #fff; border: 1px solid #c4ccd6; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.context-menu .ctx-item {
  padding: 7px 14px; font-size: 13px; color: #333; cursor: pointer;
  white-space: nowrap;
}
.context-menu .ctx-item:hover { background: #eaf1f8; }
.context-menu .ctx-item.disabled { color: #aaa; cursor: not-allowed; }
.context-menu .ctx-item.disabled:hover { background: #fff; }
.context-menu .ctx-sep { height: 1px; background: #eee; margin: 4px 0; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35); z-index: 2100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 340px; max-width: 90%; padding: 18px 20px; background: #fff;
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.modal h3 { font-size: 16px; margin-bottom: 10px; color: #1f3a5f; }
.modal-tip { font-size: 13px; color: #555; margin-bottom: 10px; }
#modalBatchName, #todoText {
  width: 100%; height: 30px; padding: 0 8px; margin-bottom: 14px;
  border: 1px solid #c4ccd6; border-radius: 4px; font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 公司银行信息台账（页签页） */
.bank-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bank-table-wrap { max-height: 60vh; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
#bankTable { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
#bankTable th, #bankTable td { border: 1px solid #e3e7ec; padding: 4px 6px; text-align: left; }
#bankTable th { background: #eef2f7; position: sticky; top: 0; z-index: 1; }
#bankTable th:first-child, #bankTable td:first-child { width: 150px; }
.bank-input {
  width: 100%; height: 26px; padding: 0 6px;
  border: 1px solid #d5dae2; border-radius: 4px; font-size: 12px;
}
.bank-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pager-info { font-size: 12px; color: #666; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 900px) {
  .field { flex: 1 1 150px; }
}
@media (max-width: 640px) {
  .field { flex: 1 1 100%; }           /* 极窄屏下每个字段独占一行 */
}

/* ==========================================================================
 * 服务器模式：登录页、会话区、管理员控制台
 * ========================================================================== */

/* ---------- 头部（标题 + 页签 + 右侧会话/状态） ---------- */
.header-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-user { font-size: 12px; color: #1f3a5f; }

/* 右上角状态槽：编辑中 / 已框选（行，列）/ 已选 N 条。
   文案由 static/status.js 的纯函数推导，长度不可控，故截断并保留 title 全文。 */
.header-state {
  font-size: 12px; color: #1f3a5f; background: #eef2f7;
  border: 1px solid #d5dae2; border-radius: 10px; padding: 2px 8px;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-state:empty { display: none; }
.header-state-editing { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-test { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.btn-danger { color: #b91c1c; border-color: #f3b6b6; background: #fff5f5; }
.btn-danger:hover { background: #fee2e2; }
.tool-input-sm { width: 72px; }

/* ---------- 登录页 ---------- */
.auth-body { background: #eef1f6; min-height: 100vh; }
.auth-card {
  max-width: 380px; margin: 8vh auto 0; padding: 26px 26px 18px;
  background: #fff; border: 1px solid #d5dae2; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(31, 58, 95, 0.08);
}
.auth-title { font-size: 20px; color: #1f3a5f; text-align: center; margin-bottom: 6px; }
.auth-sub { font-size: 12px; color: #777; text-align: center; margin-bottom: 18px; line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #444; }
.auth-field input {
  height: 34px; padding: 0 10px; border: 1px solid #c4ccd6;
  border-radius: 4px; font-size: 14px; color: #333;
}
.auth-field input:focus { outline: none; border-color: #4a7ebb; box-shadow: 0 0 0 2px rgba(74, 126, 187, 0.2); }
.auth-submit { margin-top: 4px; height: 36px; }
.auth-error {
  font-size: 12px; color: #b91c1c; background: #fff5f5;
  border: 1px solid #f3b6b6; border-radius: 4px; padding: 6px 10px;
}
.auth-foot { font-size: 12px; color: #888; text-align: center; margin-top: 14px; }

/* ---------- 页签 ---------- */
.tab-bar { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #d5dae2; }
.tab-btn {
  border: 1px solid transparent; border-bottom: none; background: transparent;
  padding: 8px 16px; font-size: 13px; color: #555; cursor: pointer;
  border-radius: 6px 6px 0 0; margin-bottom: -1px;
}
.tab-btn:hover { background: #eef2f7; }
.tab-active {
  background: #fff; border-color: #d5dae2; color: #1f3a5f; font-weight: 600;
}
.tab-panel { display: block; }
/* 页签放在标题旁：去掉下边框与外边距，压缩高度以与 h1 同行 */
.tab-bar-inline {
  border-bottom: none; margin-bottom: 0; align-items: center;
}
.tab-bar-inline .tab-btn {
  padding: 4px 12px; font-size: 13px; border-radius: 6px; margin-bottom: 0;
}
.tab-bar-inline .tab-active { border-color: #d5dae2; }

/* ---------- 统计页 ---------- */
.stats-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.stats-palette {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  border: 1px solid #e3e7ec; border-radius: 4px; background: #fafbfd;
  max-height: 132px; overflow: auto;
}
.stats-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #c4ccd6; border-radius: 12px; background: #fff;
  padding: 2px 6px 2px 10px; font-size: 12px; color: #333; cursor: grab;
}
.stats-chip:active { cursor: grabbing; }
.stats-chip-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-chip-kind {
  font-size: 10px; color: #5b6b7c; background: #eef2f7; border-radius: 8px; padding: 1px 6px;
}
.stats-mini {
  height: 20px; padding: 0 6px; font-size: 11px; line-height: 18px;
  border: 1px solid #c4ccd6; border-radius: 4px; background: #fff; color: #2e6da4; cursor: pointer;
}
.stats-mini:hover { background: #eef2f7; }
.stats-mini-del { color: #b91c1c; }
.stats-zone-title { font-size: 12px; color: #444; margin: 12px 0 4px; }
.stats-zone {
  min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px; border: 1px dashed #c4ccd6; border-radius: 4px; background: #fff;
}
.stats-zone-over { border-color: #2e6da4; background: #f2f7fd; }
.stats-zone-metrics { flex-direction: column; align-items: stretch; }
.stats-placeholder { font-size: 12px; color: #999; }
.stats-item {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #c4ccd6; border-radius: 4px; background: #f7f9fc;
  padding: 3px 6px; font-size: 12px; color: #1f3a5f;
}
.stats-metric-row { display: flex; align-items: center; gap: 6px; }
.stats-select {
  height: 28px; min-width: 140px; max-width: 260px; padding: 0 6px;
  border: 1px solid #c4ccd6; border-radius: 4px; font-size: 12px; background: #fff;
}
.stats-select-inline { height: 28px; border: 1px solid #c4ccd6; border-radius: 4px; font-size: 13px; }
.stats-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e3e7ec;
}
.stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stats-table th, .stats-table td {
  border: 1px solid #e3e7ec; padding: 5px 8px; text-align: left; white-space: nowrap;
}
.stats-table th { background: #eef2f7; position: sticky; top: 0; z-index: 1; }
.stats-table tr.stats-margin td { font-weight: 600; background: #f7f9fc; }
.stats-empty { text-align: center; color: #999; }

/* ---------- 管理员控制台 ---------- */
.admin-warn {
  margin-bottom: 12px; padding: 8px 12px; font-size: 12px;
  color: #1f3a5f; background: #eef4ff; border: 1px solid #cddcf5; border-radius: 4px;
}
.admin-warn-error { color: #b91c1c; background: #fff5f5; border-color: #f3b6b6; }
.admin-form-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 13px; color: #444;
}
.admin-form-row label { display: flex; align-items: center; gap: 6px; }
.admin-form-row input[type="text"],
.admin-form-row input[type="password"],
.admin-form-row input[type="number"],
.admin-form-row select {
  height: 28px; padding: 0 8px; border: 1px solid #c4ccd6;
  border-radius: 4px; font-size: 13px; color: #333;
}
.admin-tip { font-size: 12px; color: #888; line-height: 1.7; margin-top: 4px; }
.admin-info { font-size: 12px; color: #444; line-height: 1.9; word-break: break-all; }
.table-wrap-tall { max-height: 60vh; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
.admin-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.admin-table th, .admin-table td { border: 1px solid #e3e7ec; padding: 4px 8px; text-align: left; }
.admin-table th { background: #eef2f7; position: sticky; top: 0; z-index: 1; }
.admin-table td { vertical-align: top; word-break: break-all; }
.admin-actions { white-space: nowrap; }
.admin-actions .btn { margin-right: 4px; }
.admin-edit-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.admin-edit-field { display: flex; align-items: center; gap: 6px; font-size: 12px; flex: 1 1 260px; }
.admin-edit-field span { color: #555; white-space: nowrap; min-width: 88px; }
.admin-edit-field input {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px;
  border: 1px solid #c4ccd6; border-radius: 4px; font-size: 12px;
}

/* ---------- 表单下载（按需生成，不落盘） ---------- */
.sheet-download-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0;
}
.sheet-type-list { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-type-item {
  font-size: 13px; color: #1f3a5f; background: #eef4ff;
  border: 1px solid #cddcf5; border-radius: 4px; padding: 4px 10px; cursor: pointer;
}
.sheet-type-item input { margin-right: 4px; vertical-align: middle; }
.tool-label code, #testPanel code, .admin-tip code {
  font-family: Consolas, monospace; font-size: 11px;
  background: #f0f2f5; padding: 1px 4px; border-radius: 3px;
}


/* ==========================================================================
 * 批量导入（录入页签）
 * ========================================================================== */
.import-panel { max-width: 1120px; }
.import-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.import-bar input[type="file"] { max-width: 320px; }
.import-report { margin-top: 12px; }
.import-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  background: #eef2f7; color: #35455c; font-size: 12px;
}
.chip-good { background: #e6f6ea; color: #1f7a3d; }
.chip-bad { background: #fdeaea; color: #b3261e; }
.chip-custom { background: #fff3d6; color: #8a5b00; }
.import-section-title,
.cfg-section-title {
  margin: 12px 0 6px; font-weight: 600; color: #1f3a5f; font-size: 13px;
}
.import-issues { max-height: 240px; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
.import-issues table,
.import-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-issues th, .import-issues td,
.import-preview th, .import-preview td {
  border-bottom: 1px solid #eef1f5; padding: 5px 8px; text-align: left; white-space: nowrap;
}
.import-issues thead th, .import-preview thead th { background: #f7f9fc; position: sticky; top: 0; }
.level-error { color: #b3261e; font-weight: 600; }
.level-warning { color: #8a5b00; }
.import-preview { max-height: 320px; overflow: auto; }
.import-skip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }

/* ==========================================================================
 * 导出设置页签
 * ========================================================================== */
.cfg-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px;
}
.cfg-toolbar .tool-input { max-width: 280px; }
.cfg-split { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cfg-col { flex: 1 1 420px; min-width: 320px; }
.cfg-list { display: flex; flex-direction: column; gap: 6px; }
.cfg-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 6px; border: 1px solid #e3e7ec; border-radius: 4px; background: #fbfcfe;
}
.cfg-row-name { font-size: 13px; color: #24384f; }
.cfg-row-gap { flex: 1 1 auto; }
.cfg-addbar { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; }
.cfg-card {
  border: 1px solid #dfe4ea; border-radius: 5px; padding: 8px 10px; margin-bottom: 8px;
  background: #fbfcfe;
}
.cfg-card-nested { background: #f6f8fb; border-style: dashed; }
.cfg-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg-card-index { color: #7a8798; font-size: 12px; }
.cfg-card-doc { font-size: 12px; color: #7a8798; margin-top: 6px; }
.cfg-example { font-size: 12px; color: #4a7ebb; margin-top: 4px; word-break: break-all; }
.cfg-args { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.cfg-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #444; }
.cfg-field-label { white-space: nowrap; }
.cfg-input, .cfg-select, .cfg-textarea {
  height: 28px; padding: 0 6px; border: 1px solid #c4ccd6; border-radius: 4px;
  font-size: 12px; color: #333; background: #fff;
}
.cfg-input-name { width: 140px; }
.cfg-input-wide { width: 220px; }
.cfg-input-sm { width: 80px; }
.cfg-input-cell { width: 70px; text-transform: uppercase; }
.cfg-textarea { width: 220px; height: 52px; padding: 4px 6px; }
.cfg-check { width: 14px; height: 14px; }
.cfg-preview { margin-top: 6px; }
.cfg-preview .table-wrap { max-height: 320px; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
.cfg-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cfg-preview th, .cfg-preview td {
  border: 1px solid #eef1f5; padding: 4px 8px; text-align: left; white-space: nowrap;
}
.cfg-preview thead th { background: #f7f9fc; position: sticky; top: 0; }
.cfg-error { color: #b3261e; font-size: 12px; }
.cfg-mono { font-family: Consolas, Menlo, monospace; font-size: 12px; color: #4a5a70; word-break: break-all; }
.cfg-template-info { margin: 6px 0 4px; }
.cfg-editor { margin-top: 6px; }
.cfg-grid { border-collapse: collapse; font-size: 12px; }
.cfg-grid th, .cfg-grid td {
  border: 1px solid #e6eaef; padding: 3px 6px; min-width: 44px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.cfg-grid thead th { background: #f7f9fc; color: #7a8798; cursor: default; text-align: center; }
.cfg-grid .cfg-grid-rownum { background: #f7f9fc; color: #7a8798; cursor: default; text-align: center; }
.cfg-grid td:hover { background: #eef4ff; }
.cfg-grid td.cfg-cell-picked { background: #d8e8ff; outline: 2px solid #4a7ebb; }
.cfg-grid td.cfg-cell-changed { background: #e6f6ea; font-weight: 600; }
.cfg-grid-wrap { max-height: 420px; overflow: auto; border: 1px solid #e3e7ec; border-radius: 4px; }
.cfg-warn {
  margin-top: 6px; font-size: 12px; color: #8a5b00;
  background: #fff8e6; border: 1px solid #f0dfae; border-radius: 4px; padding: 4px 8px;
}
/* 导出设置页里的按钮更紧凑：.btn 的 32px 高度与 22px 内边距在密集的规则行里太占地方 */
.cfg-row .btn,
.cfg-card-head .btn,
.cfg-addbar .btn {
  height: 24px; padding: 0 8px; font-size: 12px; border-radius: 3px;
}
.cfg-input, .cfg-select { height: 26px; }
