/* ========================================
   dynamic-report-system — 优化版样式
   ======================================== */

/* --- Reset & 基础 --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f0f2f5;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  color: #1a1a2e;
}

.container {
  max-width: 1280px;
  width: 100%;
  padding: 0 24px;
  margin: 24px auto;
}

/* --- 卡片容器 --- */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e8ecf0;
}

/* --- 主卡片（无内边距，sticky 撑开） --- */
.main-card {
  padding: 0;
  overflow: hidden;
}

/* ========================================
   登录页
   ======================================== */
.login-form {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px 32px;
  text-align: center;
}

.login-form h2 {
  font-size: 1.6rem;
  margin: 0 0 24px;
  color: #1a1a2e;
  font-weight: 700;
}

.login-form select,
.login-form input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1.5px solid #d0d7de;
  border-radius: 8px;
  font-size: 15px;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form select:focus,
.login-form input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 3px rgba(24,144,255,0.12);
  background: white;
}

.login-form .btn-block {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
}

.login-form .btn-block:hover {
  transform: scale(1.01);
}

/* ========================================
   Toast 通知
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 500px;
  width: 90%;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.toast.success {
  background: #f0fff4;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.toast.error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

.toast.info {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #096dd9;
}

.toast.warning {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #ad8b00;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}

/* --- 通用隐藏 --- */
.hidden { display: none !important; }

/* ========================================
   Sticky 顶栏
   ======================================== */
.role-badge {
  background: #e8f4fd;
  color: #0369a1;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-radius: 12px 12px 0 0;
  padding: 16px 24px;
  border-bottom: 1px solid #e8ecf0;
  margin-bottom: 0;
}

.sticky-top .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.sticky-top .header h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
}

.sticky-top .user-info {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sticky-top .user-info .clickable {
  cursor: pointer;
  color: #1890ff;
  border-bottom: 1px dashed #1890ff;
  font-weight: 600;
}

/* --- Toolbar 多行布局 --- */
.sticky-top .toolbar .toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sticky-top .toolbar .toolbar-row.primary-actions {
  justify-content: space-between;
}

.sticky-top .toolbar .left-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.sticky-top .toolbar .right-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* 报表选择器 */
.report-select-label select {
  padding: 6px 10px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  min-width: 160px;
  cursor: pointer;
}

.report-select-label select:focus {
  outline: none;
  border-color: #1890ff;
}

/* --- 筛选行 --- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: white;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid #e8ecf0;
}

.filter-row label {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-row select,
.filter-row input {
  padding: 6px 10px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  transition: border-color 0.2s;
}

.filter-row select:focus,
.filter-row input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.filter-row .search-input { min-width: 150px; }

/* 重置按钮 */
.btn-reset {
  padding: 6px 14px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  background: white;
  color: #555;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.btn-reset:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* --- 分页导航栏 --- */
.pagination-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: #f8fafc;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: 6px;
  border: 1px solid #e8ecf0;
}

.pagination-nav .jump-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-nav .jump-input {
  width: 50px;
  padding: 4px 6px;
  text-align: center;
  border: 1.5px solid #d0d7de;
  border-radius: 4px;
  font-size: 13px;
}

.pagination-nav .jump-input:focus {
  outline: none;
  border-color: #1890ff;
}

.pagination-nav .page-info {
  color: #6b7280;
  font-size: 13px;
  margin-left: 4px;
}

.pagination-nav .size-label {
  color: #555;
  font-size: 13px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-nav .size-label select {
  padding: 3px 6px;
  border: 1.5px solid #d0d7de;
  border-radius: 4px;
  font-size: 13px;
}

/* --- 状态消息 --- */
.status-msg {
  padding: 10px 16px;
  border-radius: 8px;
  margin: 8px 0 0;
  display: none;
  font-size: 14px;
  font-weight: 500;
}

.status-msg.success {
  background: #f0fff4;
  border: 1px solid #b7eb8f;
  color: #389e0d;
  display: block;
}

.status-msg.error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  display: block;
}

.status-msg.info {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #096dd9;
  display: block;
}

/* ========================================
   数据表格
   ======================================== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.data-table thead th {
  background: #f8fafc;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
  color: #374151;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  word-break: break-word;
  line-height: 1.4;
  transition: background 0.15s;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table td.editable {
  color: #1890ff;
  cursor: pointer;
  font-weight: 500;
}

.data-table td.editable:hover {
  background: #e6f7ff;
}

/* 仅查看模式：表格中的可编辑字段也变为只读颜色 */
.view-only td.editable,
.view-only .editable-text {
  color: #333 !important;
  cursor: default !important;
  font-weight: 400 !important;
}

.view-only td.editable:hover,
.view-only .editable-text:hover {
  background: transparent !important;
}

/* 仅查看模式：下拉/输入框设为禁用样式并阻止点击 */
.view-only select,
.view-only input[type="number"],
.view-only .yesno-select {
  pointer-events: none !important;
  opacity: 0.65 !important;
  background: #f5f5f5 !important;
  border-color: #d9d9d9 !important;
  color: #666 !important;
}

.data-table td.non-editable {
  color: #333;
  cursor: default;
}

/* --- 列表视图容器 --- */
.list-view {
  overflow-x: auto;
}

/* --- 卡片视图 --- */
.record-card {
  background: #fafbfc;
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.record-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.record-card .field-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
}

.record-card .field-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.record-card .field-label {
  width: 130px;
  font-weight: 600;
  color: #555;
  flex-shrink: 0;
  padding-top: 6px;
  font-size: 13px;
}

.record-card .field-value {
  flex: 1;
  word-break: break-word;
  line-height: 1.6;
  min-height: 28px;
}

.record-card .field-value .readonly-text {
  padding: 4px 0;
  color: #333;
  display: block;
}

.record-card .field-value .editable-text {
  padding: 4px 0;
  color: #1890ff;
  display: inline-block;
  cursor: pointer;
  border-bottom: 1px dashed #1890ff;
}

.record-card .field-value .editable-text:hover {
  background: #e6f7ff;
}

/* --- 权限徽章 --- */
.perm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 22px;
}
.perm-badge.view {
  background: #f0f5ff;
  color: #1890ff;
  border: 1px solid #adc6ff;
}
.perm-badge.edit {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
}
.perm-badge.admin {
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffd591;
}

/* 仅查看模式：可编辑字段显示为只读颜色 */
.view-only .editable-text,
.view-only .field-value .editable-text {
  color: #333 !important;
  cursor: default !important;
  border-bottom: none !important;
}

.view-only .editable-text:hover,
.view-only .field-value .editable-text:hover {
  background: transparent !important;
}

.record-card .field-value input,
.record-card .field-value textarea,
.record-card .field-value select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #1890ff;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  transition: box-shadow 0.2s;
}

.record-card .field-value input:focus,
.record-card .field-value textarea:focus,
.record-card .field-value select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(24,144,255,0.12);
}

.record-card .field-value textarea {
  min-height: 60px;
  resize: vertical;
}

/* --- 附件区域 --- */
.attachment-area {
  margin-top: 16px;
  border-top: 1px solid #e8ecf0;
  padding-top: 12px;
}

.attachment-area h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #555;
}

.attachment-area ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attachment-area li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

/* ========================================
   记录体区域
   ======================================== */
.record-body {
  padding: 16px 24px;
  min-height: 200px;
}

/* --- 空状态引导 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #9ca3af;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 16px;
  margin: 0 0 8px;
  font-weight: 500;
  color: #6b7280;
}

.empty-state .empty-hint {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 400;
}

/* ========================================
   Sticky 底栏
   ======================================== */
.sticky-bottom {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: white;
  border-radius: 0 0 12px 12px;
  padding: 12px 24px;
  border-top: 1px solid #e8ecf0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sticky-bottom .info {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.sticky-bottom .btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- 表格滚动容器 --- */
.table-scroll {
  max-height: 400px;
  overflow: auto;
  margin-top: 12px;
}

/* ========================================
   按钮系统
   ======================================== */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  background: #1890ff;
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.4;
}

.btn:hover {
  background: #40a9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24,144,255,0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; box-shadow: 0 2px 6px rgba(107,114,128,0.25); }

.btn-success { background: #10b981; }
.btn-success:hover { background: #059669; box-shadow: 0 2px 6px rgba(16,185,129,0.25); }

.btn-warning { background: #f59e0b; }
.btn-warning:hover { background: #d97706; box-shadow: 0 2px 6px rgba(245,158,11,0.25); }

.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 2px 6px rgba(239,68,68,0.25); }

.btn-info { background: #06b6d4; }
.btn-info:hover { background: #0891b2; box-shadow: 0 2px 6px rgba(6,182,212,0.25); }

.btn-primary { background: #1890ff; }
.btn-primary:hover { background: #1677cc; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ========================================
   模态框系统
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box {
  background: white;
  border-radius: 14px;
  padding: 28px;
  max-width: 700px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: slideUp 0.2s ease;
}

.modal-box h3 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-box label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: block;
  margin-bottom: 4px;
}

.modal-hint {
  color: #6b7280;
  font-size: 14px;
  margin: -8px 0 16px;
}

/* 模态框表单字段 */
.form-field {
  margin-bottom: 14px;
}

.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="file"],
.form-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  background: #fafbfc;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
  background: white;
}

.wide-modal {
  max-width: 800px;
}

.rule-help-box {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.rule-help-box h4 {
  margin: 16px 0 8px;
  font-size: 15px;
  color: #1a1a2e;
}

.rule-help-box code {
  background: #f0f4f8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #d63384;
  word-break: break-all;
}

.rule-help-box hr {
  border: none;
  border-top: 1px solid #e8ecf0;
  margin: 16px 0;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 8px 22px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

/* --- 用户管理 --- */
.user-add-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.user-add-row input,
.user-add-row select {
  padding: 8px 12px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
}

.user-add-row input:focus,
.user-add-row select:focus {
  outline: none;
  border-color: #1890ff;
}

.user-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* --- 用户管理表格 --- */
.user-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.user-mgmt-table th,
.user-mgmt-table td {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.user-mgmt-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
}

/* --- 统计/历史控制行 --- */
.stats-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.stats-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.stats-controls select,
.stats-controls input {
  padding: 6px 10px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.stats-controls select:focus,
.stats-controls input:focus {
  outline: none;
  border-color: #1890ff;
}

.history-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.history-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.history-controls select,
.history-controls input {
  padding: 6px 10px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

/* 复选框组（统计分组字段） */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  font-size: 14px;
}

/* --- 字段列表项（权限编辑） --- */
.field-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.field-item:last-child {
  border-bottom: none;
}

.field-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.field-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.field-item textarea {
  width: 100%;
  min-height: 40px;
  resize: vertical;
  padding: 6px 10px;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
}

.field-item textarea:focus {
  outline: none;
  border-color: #1890ff;
}

/* --- 显示设置表格 --- */
.display-table {
  width: 100%;
  border-collapse: collapse;
}

.display-table th,
.display-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.display-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
}

/* --- 历史/统计表格 --- */
/* --- 报表管理 --- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.active { background: #10b981; }
.status-dot.disabled { background: #d1d5db; }

.row-disabled td {
  opacity: 0.5;
}

.report-access-grid {
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
}

.access-batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 12px;
}

.batch-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #555;
  user-select: none;
}

.batch-check input[type="checkbox"] {
  margin: 0;
}

.batch-set-btn {
  padding: 2px 6px;
  border: 1.5px solid #d0d7de;
  border-radius: 4px;
  font-size: 12px;
  background: white;
  color: #333;
}

.access-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #f3f4f6;
}

.access-user-row:last-child {
  border-bottom: none;
}

.access-username {
  width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
}

.access-select {
  flex: 1;
  padding: 2px 4px;
  border: 1.5px solid #d0d7de;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.stats-table,
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.stats-table th,
.stats-table td,
.history-table th,
.history-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.stats-table th,
.history-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

/* ========================================
   编辑行高亮
   ======================================== */
tr.editing-row {
  background: #fefce8 !important;
}

tr.editing-row td.editable,
tr.editing-row .editable-text {
  color: #1a1a2e !important;
  font-weight: 400 !important;
}

/* ========================================
   全局滚动条美化
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a8b4;
}

/* ========================================
   响应式 — 手机端
   ======================================== */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
    margin: 12px auto;
  }

  .card {
    padding: 16px;
  }

  .login-form {
    margin: 40px auto;
    padding: 28px 20px;
  }

  .sticky-top {
    padding: 12px 16px;
  }

  .sticky-top .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sticky-top .toolbar .toolbar-row {
    flex-direction: column;
  }

  .sticky-top .toolbar .left-group,
  .sticky-top .toolbar .right-group {
    width: 100%;
  }

  .sticky-bottom {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }

  .sticky-bottom .btn-group {
    justify-content: center;
  }

  .sticky-bottom .info {
    text-align: center;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 7px 8px;
  }

  .record-body {
    padding: 12px 16px;
  }

  .record-card .field-group {
    flex-direction: column;
    gap: 4px;
  }

  .record-card .field-label {
    width: auto;
    font-size: 12px;
    padding-top: 2px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-row label {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .filter-row select,
  .filter-row input {
    flex: 1;
  }

  .filter-row .search-input {
    min-width: auto;
    flex: 1;
  }

  .stats-controls,
  .history-controls,
  .user-add-row {
    flex-direction: column;
  }

  .modal-box {
    width: 96%;
    padding: 20px;
  }
}

/* --- 打印优化 --- */
@media print {
  .sticky-top,
  .sticky-bottom,
  .btn,
  .filter-row,
  .pagination-nav {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: none;
  }

  .data-table {
    border: 1px solid #ccc;
  }
}


/* ============================================================
   ===== V3 现代化主题（侧边栏布局 + 视觉升级）=====
   ============================================================ */
:root {
    --primary: #4f6ef7;
    --primary-dark: #3d59e0;
    --primary-light: #eef1fe;
    --success: #16a34a;
    --success-light: #ecfdf3;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0891b2;
    --info-light: #ecfeff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
    --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ===== 应用外壳：侧边栏 + 主区 ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 224px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 12px rgba(15, 23, 42, .12);
    z-index: 50;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 18px 16px;
    font-size: 16px; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    letter-spacing: .3px;
}
.sidebar-brand .brand-icon { font-size: 20px; }
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px;
    background: transparent; border: none; color: #cbd5e1;
    font-size: 14px; font-family: inherit; text-align: left;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(2px); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(79, 110, 247, .9), rgba(79, 110, 247, .65));
    color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(79, 110, 247, .35);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: #fff; border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-text { flex: 1; }
.nav-badge {
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-footer {
    padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex; flex-direction: column; gap: 10px;
}
.sidebar-footer .org-badge { font-size: 12px; color: #cbd5e1; background: rgba(255,255,255,.08); padding: 4px 8px; border-radius: 6px; }
.user-line { display: flex; align-items: center; gap: 9px; }
.user-line .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #4f6ef7, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-meta b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role-badge { font-size: 11px; color: #94a3b8; background: transparent; padding: 0; }

/* ===== 主区域与视图 ===== */
.main-area { flex: 1; min-width: 0; padding: 20px 24px 24px; display: flex; flex-direction: column; }
.view { display: none; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.view.active { display: flex; animation: viewFadeIn .22s ease; }
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.view-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.view-title::before { content: ''; display: inline-block; width: 4px; height: 18px; background: linear-gradient(180deg, var(--primary), #7c3aed); border-radius: 2px; margin-right: 9px; vertical-align: -2px; }
.view-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.report-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow);
}
.report-select-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.report-select-label select {
    min-width: 220px; padding: 7px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
    color: var(--text); background: #fff; transition: var(--transition);
}
.report-select-label select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ===== 内容区（表格 + 版本边栏）===== */
.content-split { display: flex; gap: 14px; flex: 1; min-height: 0; align-items: stretch; }
.record-body {
    flex: 1; min-width: 0; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: auto;
}
.version-panel {
    width: 320px; flex-shrink: 0; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    max-height: 100%; animation: slideInRight .22s ease;
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.version-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 14px;
}
.version-panel-body { flex: 1; overflow-y: auto; padding: 10px; }
.version-item {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
    transition: var(--transition); background: #fff;
}
.version-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.version-item .v-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.version-item .v-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.version-item .v-badge { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--primary-light); color: var(--primary-dark); }
.version-detail { font-size: 12px; margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 7px; }
.version-detail .vd-row { display: flex; gap: 6px; padding: 2px 0; }
.version-detail .vd-field { color: var(--text-secondary); min-width: 64px; }
.version-detail .vd-old { color: var(--danger); text-decoration: line-through; }
.version-detail .vd-new { color: var(--success); font-weight: 600; }
.icon-btn {
    background: transparent; border: none; cursor: pointer; font-size: 14px;
    color: var(--text-secondary); padding: 3px 7px; border-radius: 6px; transition: var(--transition);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ===== 审批中心 ===== */
.approval-container { display: flex; flex-direction: column; gap: 12px; }
.approval-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 4px solid var(--warning); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 16px; transition: var(--transition);
}
.approval-card:hover { box-shadow: var(--shadow-md); }
.approval-card.approved { border-left-color: var(--success); }
.approval-card.rejected { border-left-color: var(--danger); }
.approval-card .ap-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-card .ap-title { font-weight: 700; font-size: 15px; }
.approval-card .ap-body { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.approval-card .ap-changes { margin-top: 10px; background: var(--bg); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; }
.approval-card .ap-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.status-pill.pending { background: var(--warning-light); color: #b45309; }
.status-pill.approved { background: var(--success-light); color: #15803d; }
.status-pill.rejected { background: var(--danger-light); color: #b91c1c; }

/* ===== 按钮视觉升级 ===== */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    transition: var(--transition) !important;
    border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 5px; justify-content: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important; border-color: var(--primary-dark) !important; }
.btn-success { background: linear-gradient(135deg, #22c55e, var(--success)) !important; border-color: var(--success) !important; }
.btn-warning { background: linear-gradient(135deg, #fbbf24, var(--warning)) !important; border-color: var(--warning) !important; color: #fff !important; }
.btn-secondary { background: #fff !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.btn-secondary:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.btn-secondary.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px !important; font-size: 13px !important; }

/* ===== 卡片 / 表格 / 弹窗 / 提示 升级 ===== */
.card { border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; border: 1px solid var(--border); }
table { border-collapse: separate; border-spacing: 0; }
table th {
    background: #f8fafc !important; color: var(--text-secondary) !important;
    font-weight: 600 !important; font-size: 13px; position: sticky; top: 0; z-index: 2;
    border-bottom: 2px solid var(--border) !important;
}
table td { border-bottom: 1px solid #f1f5f9 !important; font-size: 13.5px; }
table tr:hover td { background: #f8fafc !important; }
.modal-overlay { background: rgba(15, 23, 42, .45) !important; backdrop-filter: blur(3px); }
.modal-overlay.active .modal-box { animation: modalPop .2s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes modalPop { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-box { border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; }
.toast {
    border-radius: var(--radius-sm) !important; box-shadow: var(--shadow-lg) !important;
    animation: toastIn .25s ease; font-weight: 600;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.pagination-nav, .sticky-bottom {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-row { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; }
.perm-badge { border-radius: 20px; font-size: 12px; font-weight: 600; padding: 3px 10px; }
.empty-state { color: var(--text-secondary); }
.empty-state .empty-icon { font-size: 44px; opacity: .55; }
.empty-hint { color: var(--text-light); font-size: 13px; }

/* ===== 登录页美化 ===== */
#loginView {
    border-radius: 16px !important; box-shadow: var(--shadow-lg) !important;
    border: none !important; overflow: hidden; position: relative;
}
#loginView::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--primary), #7c3aed, #ec4899);
}
#loginView h2 { font-size: 24px; font-weight: 700; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .version-panel { width: 270px; }
}
@media (max-width: 860px) {
    .sidebar { width: 62px; }
    .sidebar .brand-text, .sidebar .nav-text, .sidebar-footer .org-badge, .user-meta { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px 0; }
    .nav-item { justify-content: center; padding: 11px 0; }
    .main-area { padding: 14px; }
    .content-split { flex-direction: column; }
    .version-panel { width: 100%; max-height: 320px; }
}


/* ===== 页面内嵌面板（替代弹窗，用于侧边栏页面级功能）===== */
.page-container { display: flex; flex-direction: column; gap: 14px; }
.page-panel { width: 100%; }
.page-panel .modal-box {
    max-width: none !important;
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    box-shadow: var(--shadow) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.page-panel .modal-actions { justify-content: flex-end; }
/* 页面模式下隐藏"取消/关闭"按钮（页面无需关闭） */
.page-panel .modal-actions .btn-close-page { display: none !important; }

/* ===== 侧边栏可展开子菜单 ===== */
.nav-caret { font-size: 11px; color: #94a3b8; transition: transform .18s ease; margin-left: auto; }
.nav-item.open .nav-caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 16px; }
.nav-sub.hidden { display: none; }
.nav-sub-item {
    display: block; width: 100%; text-align: left;
    padding: 8px 10px; background: transparent; border: none;
    color: #94a3b8; font-size: 13px; border-radius: 6px;
    cursor: pointer; transition: var(--transition); font-family: inherit;
}
.nav-sub-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.nav-sub-item.active {
    background: rgba(79, 110, 247, .25);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--primary);
}


/* ===== 布局修正：主界面全屏铺满（脱离原 .container 居中限制）===== */
body { display: block !important; }   /* .container 自带 margin auto 仍居中登录页 */
#mainView.app-shell {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    z-index: 40;
    background: var(--bg, #f1f5f9);
    overflow: hidden;
}
.app-shell .sidebar { position: static; height: 100%; }
.app-shell .main-area { height: 100%; overflow-y: auto; }
.app-shell .view.active { display: flex !important; visibility: visible; }


/* ===== 筛选字段拖拽排序 ===== */
.filter-drag-table tr.filter-row { cursor: default; }
.drag-handle { cursor: grab; color: #94a3b8; font-size: 16px; text-align: center; user-select: none; }
.drag-handle:active { cursor: grabbing; }
tr.filter-row.dragging { opacity: .45; background: #eef2ff; }
tr.filter-row.drag-over { background: #e0e7ff; box-shadow: inset 0 2px 0 var(--primary); }
.icon-btn { padding: 1px 6px !important; margin-left: 3px; font-size: 10px !important; line-height: 1.3; }


/* ===== 筛选字段设置：紧凑单行布局 ===== */
.filter-drag-table { table-layout: auto; }
.filter-drag-table th:nth-child(1) { width: 34px; }
.filter-drag-table th:nth-child(2) { width: auto; }
.filter-drag-table th:nth-child(3) { width: 96px; }
.filter-drag-table th:nth-child(4) { width: 108px; }
.filter-drag-table th,
.filter-drag-table td {
    padding: 3px 8px !important;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.filter-drag-table th { padding: 5px 8px !important; font-size: 12px; }
.filter-drag-table td.drag-handle { padding: 0 !important; text-align: center; font-size: 15px; }
.filter-drag-table .filter-order-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}
.filter-drag-table .filter-order-display {
    display: inline-block;
    min-width: 14px;
    text-align: right;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.filter-drag-table .filter-move-btn {
    padding: 0 5px !important;
    font-size: 10px !important;
    line-height: 16px !important;
    min-height: 0 !important;
    height: 18px;
    border-radius: 4px;
}
.filter-drag-table input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
    width: 15px;
    height: 15px;
    cursor: pointer;
}


/* ===== 筛选字段列表：每个字段一行（紧凑，元素同类对齐）===== */
.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
    transition: background .15s ease, box-shadow .15s ease;
}
.filter-item:hover { background: #f8fafc; }
.filter-item .drag-handle { cursor: grab; color: #94a3b8; font-size: 14px; user-select: none; flex: 0 0 auto; }
.filter-item .drag-handle:active { cursor: grabbing; }
.filter-item .fi-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1e293b; }
.filter-item .fi-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #475569; white-space: nowrap; cursor: pointer; flex: 0 0 auto; }
.filter-item .fi-toggle input { width: 15px; height: 15px; margin: 0; cursor: pointer; }
.filter-item .fi-order { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: 0 0 auto; }
.filter-item .filter-order-display { min-width: 14px; text-align: right; color: #64748b; font-variant-numeric: tabular-nums; font-size: 12px; }
.filter-item .filter-move-btn {
    padding: 0 5px !important;
    font-size: 10px !important;
    line-height: 16px !important;
    height: 18px;
    min-height: 0 !important;
    border-radius: 4px;
}
.filter-item.dragging { opacity: .5; background: #eef2ff; }
.filter-item.drag-over { background: #e0e7ff; box-shadow: inset 0 2px 0 var(--primary, #4f6ef7); }


/* ===== 字段显示设置：表格预览 + 拖拽列宽 ===== */
.preview-section { margin-top: 18px; border-top: 1px dashed var(--border, #e2e8f0); padding-top: 12px; }
.preview-title { margin: 0 0 8px; font-size: 13px; color: #475569; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pv-width-hint { font-size: 12px; color: var(--primary, #4f6ef7); font-weight: 500; }
.preview-wrap { overflow-x: auto; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background: #fff; }
.preview-table { table-layout: fixed; border-collapse: collapse; font-size: 12px; }  /* 宽度由 JS 按各列宽之和设置 */
.preview-table th,
.preview-table td {
    max-width: 600px;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    padding: 6px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.preview-table th { background: #f8fafc; color: #334155; font-weight: 600; position: relative; user-select: none; }
.preview-table tbody tr:hover { background: #f8fafc; }
.preview-table tr:last-child td { border-bottom: none; }
.preview-table th:last-child, .preview-table td:last-child { border-right: none; }
.preview-table .pv-hidden { opacity: .38; background: #fef3c7; }
.preview-table th.pv-hidden .pv-title::after { content: '（隐藏）'; font-size: 10px; color: #b45309; }
.pv-resizer { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.pv-resizer:hover { background: rgba(79, 110, 247, .25); }
body.col-resizing { cursor: col-resize !important; user-select: none; }


/* ===== 报表管理：搜索栏 + 精简列表 + 单表权限弹窗 ===== */
.mgmt-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.search-input {
    flex: 1;
    max-width: 420px;
    padding: 8px 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { outline: none; border-color: var(--primary, #4f6ef7); box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
.mgmt-count { font-size: 12px; color: #64748b; white-space: nowrap; }
.mgmt-table td { vertical-align: middle; }
.mgmt-table .mgmt-actions { white-space: nowrap; }
.mgmt-table .mgmt-actions .btn { margin: 1px 2px; }
.access-summary { font-size: 13px; color: #334155; white-space: nowrap; }
.access-summary small { color: #94a3b8; font-size: 11px; margin-left: 2px; }
.access-summary.muted { color: #cbd5e1; }
.access-report-name { font-size: 13px; font-weight: 500; color: var(--primary, #4f6ef7); }
.access-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; padding: 6px 10px; }


/* ===== 报表管理子功能：目标报表选择条 ===== */
.config-report-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 12px;
    margin: 0 0 14px;
    background: #f1f5ff;
    border: 1px solid #dbe4ff;
    border-radius: 9px;
    font-size: 13px;
}
.config-report-bar .crb-label { font-weight: 600; color: #3b4cca; white-space: nowrap; }
.config-report-bar .crb-select {
    min-width: 220px;
    max-width: 420px;
    padding: 6px 10px;
    border: 1px solid #c7d2fe;
    border-radius: 7px;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
}
.config-report-bar .crb-select:focus { outline: none; border-color: var(--primary, #4f6ef7); box-shadow: 0 0 0 3px rgba(79,110,247,.14); }
.config-report-bar .crb-hint { color: #64748b; font-size: 12px; }


/* ===== AI 功能样式 ===== */
.ai-cell-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 6px;
    background: #f5f7ff;
    border: 1px solid #dbe4ff;
    border-radius: 7px;
}
.ai-cell-label { font-size: 11px; font-weight: 700; color: #4f6ef7; margin-right: 2px; }
.ai-chip {
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #3b4cca;
    font-size: 11.5px;
    padding: 2px 7px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.ai-chip:hover { background: #eef2ff; }
.ai-chip:active { transform: scale(.96); }
.ai-chip:disabled { opacity: .55; cursor: wait; }
.ai-cell-result {
    flex-basis: 100%;
    margin-top: 6px;
    border-top: 1px dashed #dbe4ff;
    padding-top: 6px;
}
.ai-result-head { font-size: 11.5px; color: #4f6ef7; font-weight: 600; margin-bottom: 4px; }
.ai-result-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.65;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 8px 10px;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-result-text.ai-scroll { max-height: 52vh; overflow-y: auto; }
.ai-result-actions { display: flex; gap: 6px; margin-top: 6px; }
.ai-loading { font-size: 12.5px; color: #64748b; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.ai-spinner {
    width: 13px; height: 13px;
    border: 2px solid #c7d2fe;
    border-top-color: #4f6ef7;
    border-radius: 50%;
    animation: ai-spin .8s linear infinite;
    display: inline-block;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-error { font-size: 12.5px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 7px; padding: 7px 10px; }
.ai-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #d0d7de;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 8px;
}
.ai-textarea:focus { outline: none; border-color: #4f6ef7; }
.ai-panel-box { max-width: 780px; }
.ai-ask-result { margin-top: 4px; }
body.ai-off .ai-chip, body.ai-off [data-ai-btn] { display: none; }

/* AI 配置表单 */
.ai-config-form { display: flex; flex-direction: column; gap: 10px; }
.ai-cfg-row { display: flex; flex-direction: column; gap: 4px; }
.ai-cfg-row label { font-size: 12.5px; color: #475569; font-weight: 500; }
.ai-cfg-row input[type=text], .ai-cfg-row input[type=password], .ai-cfg-grid input {
    padding: 8px 10px; border: 1.5px solid #d0d7de; border-radius: 7px; font-size: 13px; font-family: inherit;
    width: 100%; box-sizing: border-box;
}
.ai-cfg-row input:focus, .ai-cfg-grid input:focus { outline: none; border-color: #4f6ef7; }
.ai-inline { display: flex; gap: 8px; align-items: center; }
.ai-inline input { flex: 1; }
.ai-cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ai-cfg-grid label { font-size: 12.5px; color: #475569; display: flex; flex-direction: column; gap: 4px; }
.ai-cfg-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ai-test-result { font-size: 12.5px; color: #64748b; }
.ai-test-result.ok { color: #16a34a; }
.ai-test-result.err { color: #dc2626; }
.ai-cfg-tip { font-size: 11.5px; color: #94a3b8; line-height: 1.6; }
.ai-cfg-tip code { background: #f1f5f9; padding: 1px 4px; border-radius: 4px; }
.ai-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; cursor: pointer; }
.ai-switch input { width: 16px; height: 16px; }


/* AI 生成报表入口 */
.ai-gen-entry { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.ai-gen-or { font-size: 12px; color: #94a3b8; }
.ai-smart-btn { margin-left: 6px; }


/* ================= WPS 式校对：右侧意见边栏 ================= */
.ai-proof-panel {
    position: fixed; top: 0; right: -450px; width: 450px; max-width: 94vw; height: 100vh;
    background: #fff; box-shadow: -6px 0 26px rgba(15,23,42,.15); z-index: 960;
    display: flex; flex-direction: column; transition: right .26s cubic-bezier(.4,0,.2,1);
}
.ai-proof-panel.active { right: 0; }
.proof-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #eef2f7; }
.proof-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.proof-badge { display: inline-block; min-width: 22px; padding: 0 7px; height: 21px; line-height: 21px; text-align: center; background: #ef4444; color: #fff; border-radius: 11px; font-size: 12px; margin-left: 6px; }
.proof-head-actions { display: flex; gap: 2px; }
.proof-icon-btn { border: none; background: transparent; font-size: 15px; cursor: pointer; padding: 4px 7px; border-radius: 6px; color: #475569; }
.proof-icon-btn:hover { background: #f1f5f9; }
.proof-preview-wrap { padding: 12px 16px 10px; border-bottom: 1px solid #eef2f7; max-height: 30vh; overflow-y: auto; }
.proof-section-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.proof-preview { font-size: 13.5px; line-height: 1.95; color: #334155; white-space: pre-wrap; word-break: break-word; }
.proof-mark { border-radius: 3px; padding: 0 1px; cursor: pointer; border-bottom: 2px solid #f59e0b; background: #fef3c7; }
.proof-mark.pm-error { background: #fee2e2; border-color: #ef4444; }
.proof-mark.pm-warn { background: #fef3c7; border-color: #f59e0b; }
.proof-mark.pm-applied { background: #dcfce7; border-color: #16a34a; opacity: .8; }
.proof-mark.mk-active { outline: 2px solid #4f6ef7; outline-offset: 1px; }
.proof-list-wrap { flex: 1; overflow: hidden; display: flex; flex-direction: column; padding: 10px 16px 0; }
.proof-list { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.proof-item { border: 1px solid #e8edf5; border-left: 4px solid #f59e0b; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; background: #fff; transition: box-shadow .15s, border-color .15s; }
.proof-item.sev-error { border-left-color: #ef4444; }
.proof-item.sev-info { border-left-color: #38bdf8; }
.proof-item:hover { box-shadow: 0 2px 10px rgba(15,23,42,.08); }
.proof-item.located { border-color: #4f6ef7; box-shadow: 0 0 0 2px rgba(79,110,247,.18); }
.proof-item.applied { opacity: .62; border-left-color: #16a34a; }
.proof-item.ignored { opacity: .45; }
.pi-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pi-type { font-size: 11.5px; background: #eef2ff; color: #4338ca; padding: 1px 7px; border-radius: 10px; }
.pi-sev { font-size: 11px; color: #94a3b8; }
.pi-state { font-size: 11px; margin-left: auto; color: #94a3b8; }
.pi-state.ok { color: #16a34a; }
.pi-diff { font-size: 13.5px; margin-bottom: 4px; word-break: break-word; line-height: 1.7; }
.pi-diff del { color: #dc2626; background: #fef2f2; padding: 1px 4px; border-radius: 3px; }
.pi-diff ins { color: #16a34a; background: #f0fdf4; padding: 1px 4px; border-radius: 3px; text-decoration: none; font-weight: 500; }
.pi-arrow { color: #94a3b8; margin: 0 5px; }
.pi-reason { font-size: 12px; color: #64748b; line-height: 1.6; margin-bottom: 8px; }
.pi-actions { display: flex; gap: 6px; }
.proof-foot { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid #eef2f7; }
.proof-empty { text-align: center; color: #16a34a; font-size: 13.5px; padding: 26px 0; }
.proof-empty-note { color: #94a3b8; font-size: 12px; }

/* ================= WPS 式单元格 AI 面板（右侧） ================= */
.ai-cell-panel {
    position: fixed; top: 0; right: -450px; width: 450px; max-width: 94vw; height: 100vh;
    background: #fff; box-shadow: -6px 0 26px rgba(15,23,42,.15); z-index: 955;
    display: flex; flex-direction: column; transition: right .26s cubic-bezier(.4,0,.2,1);
}
.ai-cell-panel.active { right: 0; }
.acp-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #eef2f7; }
.acp-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.acp-close { border: none; background: transparent; font-size: 15px; cursor: pointer; padding: 4px 7px; border-radius: 6px; color: #475569; }
.acp-close:hover { background: #f1f5f9; }
.acp-funcs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #eef2f7; }
.acp-func { border: 1px solid #dbe4ff; background: #fff; color: #3b4cca; font-size: 12.5px; padding: 5px 11px; border-radius: 15px; cursor: pointer; font-family: inherit; }
.acp-func:hover { background: #eef2ff; }
.acp-func.active { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.acp-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.acp-block-label { font-size: 12px; color: #64748b; margin: 0 0 6px; }
.acp-origin { font-size: 13px; color: #475569; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 9px 11px; margin-bottom: 14px; max-height: 20vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.acp-result { font-size: 13.5px; color: #1e293b; background: #fff; border: 1px solid #dbe4ff; border-radius: 8px; padding: 10px 12px; min-height: 60px; white-space: pre-wrap; word-break: break-word; line-height: 1.85; }
.acp-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid #eef2f7; }
.acp-custom { padding: 0 16px 12px; }
.acp-custom textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1.5px solid #d0d7de; border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical; }


/* AI 面板：功能限定参数区 */
.acp-params { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; }
.acp-param { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #475569; }
.acp-param-label { flex: 0 0 78px; text-align: right; color: #64748b; }
.acp-param select, .acp-param input {
    padding: 5px 8px; border: 1.5px solid #d0d7de; border-radius: 6px;
    font-size: 12.5px; font-family: inherit; color: #1e293b; background: #fff;
}
.acp-param select { flex: 1; cursor: pointer; }
.acp-param input { flex: 1; }
.acp-param input[type=number] { max-width: 118px; flex: 0 0 118px; }
.acp-param select:focus, .acp-param input:focus { outline: none; border-color: #4f6ef7; }
.acp-suffix { font-size: 12px; color: #94a3b8; }
.acp-gen-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; }
.acp-gen-hint { font-size: 12px; color: #d97706; }


/* 单元格助手面板：Tab 与历史记录 */
.acp-tabs { display: flex; gap: 4px; }
.acp-tab { border: none; background: transparent; padding: 6px 11px; font-size: 13.5px; color: #64748b; cursor: pointer; border-radius: 7px; font-family: inherit; }
.acp-tab:hover { background: #f1f5f9; }
.acp-tab.active { background: #eef2ff; color: #4f6ef7; font-weight: 600; }
.acp-cell-info { padding: 8px 16px; font-size: 12px; color: #64748b; background: #f8fafc; border-bottom: 1px solid #eef2f7; }
.acp-tab-pane { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.acp-hist-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #eef2f7; font-size: 12.5px; color: #475569; }
.acp-hist-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.hist-item { border: 1px solid #e8edf5; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.hist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.hist-badge { font-size: 11px; background: #f1f5f9; color: #475569; padding: 1px 7px; border-radius: 10px; }
.hist-badge.latest { background: #dcfce7; color: #16a34a; }
.hist-meta { font-size: 11.5px; color: #94a3b8; }
.hist-diff { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.hist-line { display: flex; gap: 6px; font-size: 12.5px; align-items: flex-start; }
.hist-tag { flex: 0 0 auto; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.hist-tag.old { background: #fee2e2; color: #b91c1c; }
.hist-tag.new { background: #dcfce7; color: #15803d; }
.hist-val { color: #334155; line-height: 1.6; word-break: break-word; }


/* 校对边栏：总述 / 分类筛选 / 上下文说明 */
.proof-overview { padding: 10px 16px 0; }
.proof-summary { font-size: 12.5px; color: #334155; background: #f0f7ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 9px 11px; line-height: 1.75; }
.proof-summary-icon { margin-right: 5px; }
.proof-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px 2px; }
.proof-filter-label { font-size: 12px; color: #94a3b8; }
.proof-type-chip { border: 1px solid #dbe4ff; background: #fff; color: #3b4cca; font-size: 12px; padding: 3px 10px; border-radius: 13px; cursor: pointer; font-family: inherit; }
.proof-type-chip:hover { background: #eef2ff; }
.proof-type-chip.active { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.pi-context { font-size: 12px; color: #6d28d9; background: #f5f3ff; border-left: 3px solid #a78bfa; border-radius: 4px; padding: 5px 8px; margin-bottom: 8px; line-height: 1.65; }
.pi-ctx-tag { font-size: 10.5px; background: #ede9fe; color: #6d28d9; padding: 0 5px; border-radius: 3px; margin-right: 5px; }


/* ============ 整改成效评估（单元格面板 tab） ============ */
.acp-assess-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #eef2f7; flex-wrap: wrap; }
.acp-assess-bar .acp-param { flex: 1; }
.acp-assess-result { flex: 1; overflow-y: auto; padding: 14px 16px; }
.as-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.as-score { width: 78px; height: 78px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: 0 0 auto; }
.as-score b { font-size: 26px; line-height: 1; }
.as-score span { font-size: 11px; opacity: .9; }
.as-score.ok, .as-verdict.ok { background: #16a34a; }
.as-score.warn, .as-verdict.warn { background: #f59e0b; }
.as-score.bad, .as-verdict.bad { background: #dc2626; }
.as-verdict { display: inline-block; color: #fff; font-size: 13px; padding: 3px 12px; border-radius: 12px; font-weight: 600; }
.as-meta { font-size: 12px; color: #64748b; margin-top: 6px; }
.as-insight { background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #f59e0b; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.75; color: #78350f; margin-bottom: 10px; }
.as-insight-title { font-weight: 600; margin-bottom: 4px; }
.as-summary { font-size: 12.5px; color: #334155; background: #f8fafc; border-radius: 8px; padding: 9px 11px; line-height: 1.7; margin-bottom: 12px; }
.as-section-title { font-size: 12.5px; font-weight: 600; color: #1e293b; margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed #e2e8f0; }
.as-dim { margin-bottom: 9px; }
.as-dim-head { display: flex; justify-content: space-between; font-size: 12.5px; color: #475569; margin-bottom: 3px; }
.as-dim-score { font-weight: 600; }
.as-dim-score.ok { color: #16a34a; } .as-dim-score.warn { color: #d97706; } .as-dim-score.bad { color: #dc2626; }
.as-dim-bar { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.as-dim-bar i { display: block; height: 100%; border-radius: 3px; }
.as-dim-bar i.ok { background: #16a34a; } .as-dim-bar i.warn { background: #f59e0b; } .as-dim-bar i.bad { background: #dc2626; }
.as-dim-comment { font-size: 11.5px; color: #94a3b8; margin-top: 3px; line-height: 1.5; }
.as-gap { border: 1px solid #eef2f7; border-left: 4px solid #f59e0b; border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; font-size: 12.5px; line-height: 1.7; }
.as-gap.sev-high { border-left-color: #dc2626; }
.as-gap.sev-low { border-left-color: #38bdf8; }
.as-gap-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.as-gap-dim { font-weight: 600; color: #1e293b; }
.as-gap-sev { font-size: 11px; color: #94a3b8; }
.as-gap-text { color: #475569; } .as-gap-advice { color: #166534; margin-top: 3px; }
.as-evidence { font-size: 12.5px; color: #334155; }
.as-ev-strength { margin-bottom: 6px; }
.as-ev-strength b.ok { color: #16a34a; } .as-ev-strength b.warn { color: #d97706; } .as-ev-strength b.bad { color: #dc2626; }
.as-ev-note { font-size: 11.5px; color: #64748b; margin-top: 3px; line-height: 1.6; }
.as-ev-block { margin-top: 6px; }
.as-ev-label { font-size: 12px; color: #64748b; }
.as-ev-block ul { margin: 3px 0 0 18px; padding: 0; }
.as-ev-block li { font-size: 12px; line-height: 1.65; color: #475569; }
.as-ev-block ul.missing li { color: #b91c1c; }
.as-highlights { margin: 0 0 0 18px; font-size: 12.5px; color: #166534; line-height: 1.7; }
.as-foot { font-size: 11.5px; color: #94a3b8; margin-top: 14px; text-align: center; }

/* ============ 整改管理页 ============ */
.rectify-tabs { display: flex; gap: 6px; }
.rt-tab { border: 1px solid #dbe4ff; background: #fff; color: #3b4cca; font-size: 13px; padding: 6px 14px; border-radius: 16px; cursor: pointer; font-family: inherit; }
.rt-tab.active { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.rectify-body { padding: 16px 4px; }
.std-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.std-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.std-card { border: 1px solid #e8edf5; border-radius: 10px; padding: 12px 14px; background: #fff; }
.std-card.is-default { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.12); }
.std-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.std-name { font-weight: 600; color: #1e293b; font-size: 14px; }
.std-cat { font-size: 11.5px; background: #eef2ff; color: #4338ca; padding: 1px 7px; border-radius: 9px; margin-left: 6px; }
.std-badge { font-size: 10.5px; background: #f1f5f9; color: #64748b; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.std-badge.custom { background: #e0f2fe; color: #0369a1; }
.std-badge.default { background: #dcfce7; color: #15803d; }
.std-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.std-meta { font-size: 12px; color: #64748b; margin: 6px 0 4px; }
.std-desc { font-size: 12px; color: #94a3b8; line-height: 1.6; }
.std-editor { margin-top: 16px; border: 1px solid #dbe4ff; border-radius: 10px; padding: 14px 16px; background: #fbfdff; }
.std-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.std-editor-head h4 { margin: 0; font-size: 14px; color: #1e293b; }
.std-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.std-form label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #475569; }
.std-form input { padding: 5px 8px; border: 1.5px solid #d0d7de; border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.std-full { display: block; font-size: 12.5px; color: #475569; margin-bottom: 10px; }
.std-full textarea { width: 100%; box-sizing: border-box; margin-top: 4px; padding: 7px 9px; border: 1.5px solid #d0d7de; border-radius: 6px; font-family: inherit; font-size: 12.5px; }
.std-dim-title { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #1e293b; font-weight: 600; margin: 8px 0; }
.std-weight-sum { font-size: 12px; font-weight: 400; }
.std-weight-sum.ok { color: #16a34a; } .std-weight-sum.bad { color: #dc2626; }
.std-dim-table input { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid #e2e8f0; border-radius: 5px; font-size: 12px; font-family: inherit; }
.std-editor-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ledger-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ledger-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ledger-upload input[type=text] { padding: 5px 9px; border: 1.5px solid #d0d7de; border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.ledger-cols { font-size: 11.5px; color: #64748b; max-width: 220px; }
.ledger-map { font-size: 11.5px; color: #64748b; }
.an-summary { font-size: 13px; color: #334155; background: #f0f7ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 10px 12px; margin: 14px 0; }
.an-section-title { font-size: 13.5px; font-weight: 600; color: #1e293b; margin: 16px 0 10px; }
.an-clusters, .an-repeated { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.an-card { border: 1px solid #e8edf5; border-radius: 10px; padding: 11px 13px; background: #fff; }
.an-card.repeated { border-color: #fca5a5; box-shadow: 0 0 0 2px rgba(220,38,38,.08); }
.an-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.an-years { font-size: 11.5px; color: #dc2626; background: #fef2f2; padding: 1px 8px; border-radius: 9px; }
.an-note { font-size: 12px; color: #64748b; margin-bottom: 6px; line-height: 1.6; }
.an-rows { display: flex; flex-direction: column; gap: 4px; }
.an-row { font-size: 12px; color: #475569; line-height: 1.55; display: flex; gap: 6px; }
.an-year { flex: 0 0 auto; font-size: 11px; color: #3b4cca; background: #eef2ff; padding: 0 5px; border-radius: 4px; height: 17px; line-height: 17px; }
.dl-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.dl-settings { border: 1px solid #e8edf5; border-radius: 10px; padding: 14px; background: #fff; }
.dl-settings h4 { margin: 0 0 10px; font-size: 14px; color: #1e293b; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #475569; margin-bottom: 9px; }
.dl-row input[type=text], .dl-row input:not([type]) { flex: 1; padding: 5px 8px; border: 1.5px solid #d0d7de; border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.dl-actions { display: flex; gap: 8px; margin: 12px 0 8px; }
.dl-preview h4 { margin: 0 0 10px; font-size: 14px; color: #1e293b; }
.dl-tag { font-size: 11.5px; padding: 1px 8px; border-radius: 9px; }
.dl-tag.overdue { background: #fee2e2; color: #b91c1c; }
.dl-tag.soon { background: #fef3c7; color: #b45309; }
.muted { color: #94a3b8; font-size: 11.5px; }


/* ============ 参考案例库 ============ */
.case-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.case-toolbar input[type=text] { flex: 1; min-width: 240px; padding: 6px 10px; border: 1.5px solid #d0d7de; border-radius: 8px; font-size: 12.5px; font-family: inherit; }
.case-toolbar select { padding: 6px 8px; border: 1.5px solid #d0d7de; border-radius: 8px; font-size: 12.5px; font-family: inherit; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; margin-top: 12px; }
.case-card { border: 1px solid #e8edf5; border-radius: 10px; padding: 11px 13px; background: #fff; }
.case-card.bad { border-color: #fca5a5; background: #fffbfb; }
.case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; font-size: 13.5px; }
.case-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.case-cat { font-size: 11px; background: #eef2ff; color: #4338ca; padding: 1px 7px; border-radius: 9px; }
.case-quality { font-size: 11px; padding: 1px 7px; border-radius: 9px; }
.case-quality.ok { background: #dcfce7; color: #15803d; }
.case-quality.warn { background: #fef3c7; color: #b45309; }
.case-quality.bad { background: #fee2e2; color: #b91c1c; }
.case-closed { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #f1f5f9; color: #64748b; }
.case-closed.ok { background: #e0f2fe; color: #0369a1; }
.case-closed.bad { background: #f3f4f6; color: #9ca3af; }
.case-problem { font-size: 12px; color: #475569; line-height: 1.6; margin-bottom: 8px; }
.case-lb { color: #94a3b8; }
.case-actions { display: flex; gap: 6px; }
.case-detail { margin-top: 14px; border: 1px solid #dbe4ff; border-radius: 10px; padding: 14px 16px; background: #fbfdff; }
.case-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.case-detail-head h4 { margin: 0; font-size: 14.5px; color: #1e293b; }
.case-detail-meta { font-size: 12px; color: #64748b; margin-bottom: 12px; }
.case-block { margin-bottom: 12px; }
.case-block-t { font-size: 12.5px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.case-block pre { margin: 0; font-family: inherit; font-size: 12.5px; color: #334155; line-height: 1.8; white-space: pre-wrap; word-break: break-word; background: #f8fafc; border-radius: 6px; padding: 8px 10px; }
.case-form { display: flex; flex-wrap: wrap; gap: 10px; }
.case-form label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #475569; }
.case-form input, .case-form select { padding: 5px 8px; border: 1.5px solid #d0d7de; border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.case-form .cf-full { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
.case-form textarea { margin-top: 4px; padding: 7px 9px; border: 1.5px solid #d0d7de; border-radius: 6px; font-family: inherit; font-size: 12.5px; }
.as-cases { display: flex; flex-direction: column; gap: 8px; }
.as-case { border: 1px solid #e8edf5; border-left: 4px solid #16a34a; border-radius: 8px; padding: 9px 11px; background: #fff; }
.as-case.bad { border-left-color: #dc2626; }
.as-case-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.as-case summary { font-size: 12px; color: #4f6ef7; cursor: pointer; margin-top: 5px; }
.as-case-pre { margin: 6px 0 0; font-family: inherit; font-size: 12px; color: #475569; line-height: 1.75; white-space: pre-wrap; background: #f8fafc; border-radius: 6px; padding: 8px 10px; }

/* ===== 整改小结（单个问题 / 全部问题） ===== */
.sum-wrap { display: flex; flex-direction: column; gap: 14px; }
.sum-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #e3e8ef; border-radius: 8px; }
.sum-kind { display: flex; gap: 6px; }
.sum-seg { padding: 8px 16px; font-size: 14px; border: 1px solid #cfd8e3; background: #fff; border-radius: 20px;
  cursor: pointer; color: #334155; transition: all .15s; }
.sum-seg:hover { border-color: #2b6cb0; color: #2b6cb0; }
.sum-seg.active { background: #2b6cb0; border-color: #2b6cb0; color: #fff; font-weight: 600; }
.sum-target { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; flex-wrap: wrap; }
.sum-target label { color: #64748b; }
.sum-target select { min-width: 190px; max-width: 320px; padding: 7px 8px; border: 1px solid #cfd8e3; border-radius: 6px;
  background: #fff; font-size: 13px; }
.sum-rowwrap.hide, .sum-target .hide { display: none; }
.sum-sec-title { font-size: 15px; font-weight: 600; color: #1e293b; margin: 6px 0 8px; display: flex;
  align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sum-hint { font-size: 12px; font-weight: 400; color: #8592a3; }
.sum-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.sum-tpl { border: 1px solid #e3e8ef; border-radius: 8px; padding: 10px 12px; background: #fff; cursor: pointer;
  transition: all .15s; }
.sum-tpl:hover { border-color: #93b4d8; box-shadow: 0 2px 8px rgba(43,108,176,.08); }
.sum-tpl.sel { border-color: #2b6cb0; background: #f2f7fd; box-shadow: 0 0 0 1px #2b6cb0 inset; }
.sum-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sum-tpl-name { font-size: 14px; font-weight: 600; color: #16233a; }
.sum-tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #e8f0fb; color: #2b6cb0; }
.sum-tag.mine { background: #eafaf1; color: #1c7f4b; }
.sum-tag.bad { background: #fdecec; color: #c53030; }
.sum-tpl-meta { font-size: 12px; color: #6b7a8f; margin-top: 3px; }
.sum-tpl-desc { font-size: 12px; color: #55637a; margin-top: 6px; line-height: 1.55; }
.sum-tpl-struct { font-size: 11px; color: #98a4b5; margin-top: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sum-std { border: 1px solid #e3e8ef; border-radius: 8px; padding: 12px; background: #fcfdfe; margin-top: 10px; }
.sum-std-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sum-std-head strong { font-size: 14px; color: #1e293b; }
.sum-std-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sum-std-label { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.sum-std-label.ok { color: #1c7f4b; }
.sum-std-label.no { color: #c53030; }
.sum-std-label.sc { color: #2b6cb0; }
.sum-std-col ul { margin: 0; padding-left: 18px; }
.sum-std-col li { font-size: 12px; color: #475569; line-height: 1.6; }
.sum-std-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sum-struct-detail { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sum-struct-item { border-left: 3px solid #bcd0e8; padding: 4px 0 4px 10px; }
.sum-struct-h { font-size: 13px; font-weight: 600; color: #16233a; }
.sum-struct-g { font-size: 12px; color: #4b5b70; line-height: 1.65; margin-top: 2px; }
.sum-struct-sample { font-size: 12px; color: #6b5b30; background: #fdfaf0; border: 1px dashed #e6d9a8;
  border-radius: 5px; padding: 6px 8px; margin-top: 4px; line-height: 1.65; }
.sum-extra { margin-top: 4px; }
.sum-extra-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.sum-extra-row input { padding: 9px 10px; border: 1px solid #cfd8e3; border-radius: 6px; font-size: 13px; }
.sum-gen-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.sum-gen-btn { padding: 11px 26px; font-size: 15px; font-weight: 600; }
.sum-draft { border: 1px solid #e3e8ef; border-radius: 8px; padding: 14px; background: #fff; }
.sum-title-input { width: 100%; font-size: 18px; font-weight: 600; text-align: center; color: #16233a;
  border: none; border-bottom: 1px dashed #cfd8e3; padding: 8px 6px; margin-bottom: 10px; background: transparent; }
.sum-title-input:focus { outline: none; border-bottom-color: #2b6cb0; }
.sum-check { font-size: 12px; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; line-height: 1.6; }
.sum-check.ok { background: #f2fbf5; border: 1px solid #cbe9d6; color: #1c7f4b; }
.sum-check.warn { background: #fffaf1; border: 1px solid #f0dcb4; color: #8a6116; }
.sum-warns { margin: 6px 0 0; padding-left: 18px; }
.sum-warns li { font-size: 12px; line-height: 1.6; }
.sum-refs { margin-top: 6px; color: #4a5a70; }
.sum-sec { margin-bottom: 12px; }
.sum-sec.missing { border-left: 3px solid #f0a0a0; padding-left: 8px; }
.sum-sec-h { font-size: 14px; font-weight: 600; color: #16233a; margin-bottom: 5px; }
.sum-sec-body { width: 100%; box-sizing: border-box; border: 1px solid #dbe3ec; border-radius: 6px; padding: 9px 10px;
  font-size: 14px; line-height: 1.85; color: #1f2937; font-family: "仿宋", FangSong, "宋体", serif; resize: vertical; }
.sum-sec-body:focus { outline: none; border-color: #2b6cb0; box-shadow: 0 0 0 2px rgba(43,108,176,.1); }
.sum-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.sum-hist { border: 1px solid #e3e8ef; border-radius: 8px; overflow: hidden; }
.sum-hist-row { display: grid; grid-template-columns: 1fr 160px 70px 130px 128px; gap: 8px; align-items: center;
  padding: 9px 12px; font-size: 13px; border-bottom: 1px solid #eef2f7; }
.sum-hist-row:last-child { border-bottom: none; }
.sum-hist-row:nth-child(even) { background: #fbfcfe; }
.sum-hist-t { color: #16233a; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-hist-m { color: #6b7a8f; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-hist-n { color: #4b5b70; font-size: 12px; }
.sum-hist-d { color: #98a4b5; font-size: 12px; }
.sum-hist-a { display: flex; gap: 6px; }
.btn-mini.danger { color: #c53030; border-color: #f0c2c2; }
@media (max-width: 720px) {
  .sum-hist-row { grid-template-columns: 1fr auto; }
  .sum-hist-m, .sum-hist-n, .sum-hist-d { display: none; }
}

/* AI 能力权限矩阵 */
.per-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.per-matrix th, .per-matrix td { border: 1px solid #e3e8ef; padding: 7px 8px; text-align: center; }
.per-matrix th { background: #f6f9fd; color: #334155; font-weight: 600; }
.per-matrix td.cap-name { text-align: left; }
.per-matrix td.cap-name b { color: #16233a; }
.per-matrix td.cap-name span { display: block; color: #8592a3; font-size: 11.5px; margin-top: 2px; }
.per-matrix tr.grp td { background: #fbfcfe; color: #2b6cb0; font-weight: 600; text-align: left; font-size: 12px; }
.per-matrix input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; }
.per-matrix td.locked { background: #f7f9fc; color: #8592a3; font-size: 11px; }
.sum-noperm { display: inline-block; padding: 9px 12px; background: #fffaf1; border: 1px solid #f0dcb4;
  border-radius: 6px; color: #8a6116; font-size: 13px; }

/* ===== 资料库 ===== */
.kb-wrap { display: flex; flex-direction: column; gap: 12px; }
.kb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kb-sub { font-size: 12px; color: #8592a3; font-weight: 400; margin-left: 8px; }
.kb-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-stats { font-size: 12px; color: #64748b; }
.kb-searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #e3e8ef; border-radius: 8px; }
.kb-input { flex: 1; min-width: 260px; padding: 10px 12px; border: 1.5px solid #cfd8e3; border-radius: 6px; font-size: 14px; }
.kb-select { padding: 9px 10px; border: 1.5px solid #cfd8e3; border-radius: 6px; background: #fff; font-size: 13px; max-width: 200px; }
.kb-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; cursor: pointer; }
.kb-switch.hide { display: none; }
.kb-result-head { font-size: 13px; color: #334155; margin: 4px 0 8px; }
.kb-results { display: flex; flex-direction: column; gap: 10px; }
.kb-hit { border: 1px solid #e3e8ef; border-radius: 8px; padding: 10px 12px; background: #fff; }
.kb-hit-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.kb-hit-title { font-size: 14px; font-weight: 600; color: #16233a; }
.kb-hit-meta { font-size: 11.5px; color: #8592a3; }
.kb-hit-snippet { font-size: 13px; color: #334155; line-height: 1.75; margin: 6px 0; }
.kb-hit-snippet mark { background: #fff3bf; color: #7a5b00; padding: 0 1px; border-radius: 2px; }
.kb-hit-actions { display: flex; gap: 8px; }
.kb-empty { padding: 26px 16px; text-align: center; color: #8592a3; font-size: 13px;
  border: 1px dashed #d7dfe9; border-radius: 8px; background: #fcfdff; line-height: 1.8; }
.kb-sec-title { font-size: 14px; font-weight: 600; color: #1e293b; margin: 10px 0 8px; }
.kb-docs { border: 1px solid #e3e8ef; border-radius: 8px; overflow: hidden; }
.kb-doc-row { display: grid; grid-template-columns: 1.6fr 60px 70px 120px 1.2fr 150px; gap: 8px; align-items: center;
  padding: 8px 12px; font-size: 12.5px; border-bottom: 1px solid #eef2f7; }
.kb-doc-row:last-child { border-bottom: none; }
.kb-doc-row:nth-child(even) { background: #fbfcfe; }
.kb-doc-name { color: #16233a; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-doc-ext { color: #64748b; font-size: 11px; }
.kb-doc-size { color: #64748b; font-size: 11.5px; }
.kb-doc-meta { color: #8592a3; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-doc-actions { display: flex; gap: 6px; }
.kb-tag { font-size: 11px; padding: 1px 7px; border-radius: 3px; }
.kb-tag.ok { background: #eafaf1; color: #1c7f4b; }
.kb-tag.warn { background: #fff7e6; color: #b26a00; }
.kb-tag.bad { background: #fdecec; color: #c53030; }
.kb-doc-meta { }
.kb-doc-text { white-space: pre-wrap; font-size: 13px; line-height: 1.8; color: #334155;
  max-height: 46vh; overflow: auto; background: #fbfcfe; border: 1px solid #eef2f7; border-radius: 6px; padding: 10px; margin: 8px 0; }
@media (max-width: 820px) {
  .kb-doc-row { grid-template-columns: 1fr auto; }
  .kb-doc-ext, .kb-doc-size, .kb-doc-meta { display: none; }
}
