/* ========== 全局重置与变量 ========== */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --primary:#1e5ad7;
  --primary-dark:#1644a8;
  --primary-light:#e8f0fe;
  --success:#10b981;
  --warning:#f59e0b;
  --danger:#ef4444;
  --info:#6366f1;
  --bg:#f5f7fb;
  --card:#ffffff;
  --border:#e5e7eb;
  --text:#1f2937;
  --text-sub:#6b7280;
  --text-mute:#9ca3af;
  --radius:8px;
  --shadow:0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg:0 8px 24px rgba(0,0,0,0.08);
}
body { font-family:"Microsoft YaHei","PingFang SC",-apple-system,BlinkMacSystemFont,sans-serif; background:var(--bg); color:var(--text); font-size:14px; line-height:1.6; }
.hidden { display:none !important; }
button { font-family:inherit; cursor:pointer; }
input,select,textarea { font-family:inherit; font-size:14px; }
a { color:inherit; text-decoration:none; }

/* ========== 登录页 ========== */
.login-wrap { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; }
.login-bg { position:absolute; inset:0; background:linear-gradient(135deg,#1e5ad7 0%,#3b82f6 50%,#06b6d4 100%); }
.login-bg::before { content:""; position:absolute; inset:0; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M0 30h60M30 0v60'/%3E%3C/g%3E%3C/svg%3E"); }
.login-card { position:relative; width:420px; background:#fff; border-radius:16px; padding:40px; box-shadow:var(--shadow-lg); }
.brand { display:flex; align-items:center; gap:12px; margin-bottom:24px; padding-bottom:20px; border-bottom:1px solid var(--border); }
.brand-logo { width:48px; height:48px; border-radius:12px; background:linear-gradient(135deg,var(--primary),#06b6d4); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; }
.brand-title { font-weight:700; font-size:16px; }
.brand-sub { font-size:12px; color:var(--text-sub); }
.login-card h2 { font-size:22px; margin-bottom:4px; }
.login-tip { color:var(--text-sub); font-size:13px; margin-bottom:20px; }
.form-row { margin-bottom:14px; }
.form-row label { display:block; font-size:13px; color:var(--text-sub); margin-bottom:6px; }
.form-row input,.form-row select,.form-row textarea { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius); transition:border-color .2s; }
.form-row input:focus,.form-row select:focus,.form-row textarea:focus { outline:none; border-color:var(--primary); }
.btn-primary { background:var(--primary); color:#fff; border:none; padding:10px 20px; border-radius:var(--radius); font-weight:500; transition:all .2s; }
.btn-primary:hover { background:var(--primary-dark); }
.btn-block { width:100%; padding:12px; font-size:15px; margin-top:8px; }
.btn-default { background:#fff; color:var(--text); border:1px solid var(--border); padding:8px 16px; border-radius:var(--radius); }
.btn-default:hover { border-color:var(--primary); color:var(--primary); }
.btn-danger { background:var(--danger); color:#fff; border:none; padding:8px 16px; border-radius:var(--radius); }
.btn-danger:hover { background:#dc2626; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-link { background:none; border:none; color:var(--primary); cursor:pointer; padding:0; font-size:13px; }
.btn-link:hover { text-decoration:underline; }
.btn-link.danger { color:var(--danger); }
.login-foot { text-align:center; color:var(--text-mute); font-size:12px; margin-top:16px; }
.beian-footer { text-align:center; margin-top:10px; padding-bottom:12px; }
.beian-footer a { color:var(--text-mute); font-size:11px; text-decoration:none; }
.beian-footer a:hover { color:var(--primary); text-decoration:underline; }

/* ========== 主框架 ========== */
.app-beian-footer { text-align:center; padding:16px 0; color:var(--text-mute); font-size:11px; border-top:1px solid #f0f0f0; margin-top:20px; }
.app-beian-footer a { color:var(--text-mute); text-decoration:none; }
.app-beian-footer a:hover { color:var(--primary); text-decoration:underline; }
.app { display:flex; min-height:100vh; }
.sidebar { width:220px; background:#001529; color:rgba(255,255,255,.85); display:flex; flex-direction:column; }
.sidebar-brand { display:flex; align-items:center; gap:10px; padding:18px 16px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-brand .brand-logo { width:36px; height:36px; font-size:14px; border-radius:8px; }
.sidebar-brand .brand-title { color:#fff; font-size:14px; }
.sidebar-brand .brand-sub { color:rgba(255,255,255,.5); font-size:11px; }
.nav { flex:1; overflow-y:auto; padding:12px 0; }
.nav-group { margin-bottom:8px; }
.nav-title { padding:6px 16px; font-size:11px; color:rgba(255,255,255,.4); letter-spacing:1px; }
.nav-item { display:flex; align-items:center; gap:8px; padding:9px 16px; color:rgba(255,255,255,.7); cursor:pointer; font-size:14px; transition:all .15s; }
.nav-item:hover { background:rgba(255,255,255,.05); color:#fff; }
.nav-item.active { background:var(--primary); color:#fff; }
.nav-item span { font-size:16px; }

.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { height:60px; background:#fff; border-bottom:1px solid var(--border); display:flex; align-items:center; padding:0 24px; justify-content:space-between; }
.crumbs { color:var(--text-sub); font-size:14px; }
.topbar-right { display:flex; align-items:center; gap:18px; position:relative; }
.search-box { display:flex; align-items:center; gap:6px; background:var(--bg); border-radius:20px; padding:4px 4px 4px 14px; }
.search-box input { border:none; background:none; outline:none; width:240px; padding:4px 0; }
.search-box button { background:var(--primary); color:#fff; border:none; padding:5px 14px; border-radius:16px; font-size:12px; }
.user-chip { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:24px; cursor:pointer; }
.user-chip:hover { background:var(--bg); }
.avatar { width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,var(--primary),#06b6d4); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; }
.user-name { font-size:13px; line-height:1.2; }
.user-role { font-size:11px; color:var(--text-sub); }
.caret { color:var(--text-sub); font-size:10px; }
.user-menu { position:absolute; top:54px; right:0; background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); min-width:160px; padding:6px 0; z-index:100; }
.user-menu a { display:block; padding:8px 16px; font-size:13px; cursor:pointer; }
.user-menu a:hover { background:var(--bg); }

.content { flex:1; padding:24px; overflow-y:auto; }

/* ========== 通用组件 ========== */
.page-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.page-title { font-size:20px; font-weight:600; }
.page-desc { color:var(--text-sub); font-size:13px; margin-top:4px; }
.toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#fff; padding:14px 16px; border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow); }
.toolbar input,.toolbar select { padding:7px 12px; border:1px solid var(--border); border-radius:var(--radius); }
.toolbar input { min-width:200px; }
.card { background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; margin-bottom:16px; }
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:20px; }
.stat-card { background:#fff; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); position:relative; overflow:hidden; }
.stat-card::before { content:""; position:absolute; right:-20px; top:-20px; width:80px; height:80px; border-radius:50%; background:var(--primary-light); opacity:.5; }
.stat-card .stat-icon { position:absolute; right:16px; top:16px; font-size:24px; opacity:.8; }
.stat-card .stat-label { color:var(--text-sub); font-size:13px; }
.stat-card .stat-num { font-size:28px; font-weight:600; margin-top:6px; color:var(--text); }
.stat-card .stat-trend { font-size:12px; color:var(--success); margin-top:6px; }
.stat-card .stat-trend.down { color:var(--danger); }

table { width:100%; border-collapse:collapse; background:#fff; table-layout:auto; }
th,td { padding:12px 14px; text-align:left; border-bottom:1px solid var(--border); font-size:13px; vertical-align:middle; word-break:break-word; }
th { background:#fafbfc; color:var(--text-sub); font-weight:500; font-size:12px; white-space:nowrap; }
tr:hover td { background:#fafbfc; }
/* ========== 2026-08-10 安全台账：表格自适应宽度 ========== */
.safety-table { table-layout:auto !important; }
.safety-table th, .safety-table td { white-space:normal; word-break:break-all; }
.safety-table th { white-space:nowrap; }
.safety-table td.td-name { font-weight:500; }
.safety-table td.td-num { white-space:nowrap; }

/* ========== 2026-08-10 安全台账：视图切换 + 考核折叠树 ========== */
.view-switch { display:inline-flex; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.view-switch button { background:#fff; border:none; padding:8px 14px; font-size:13px; cursor:pointer; color:var(--text-sub); transition:all .15s; }
.view-switch button:not(:last-child) { border-right:1px solid var(--border); }
.view-switch button.active { background:var(--primary); color:#fff; }
.view-switch button:hover:not(.active) { background:var(--bg); color:var(--primary); }

.kaohe-tree { padding:0 !important; }
.tree-month { border-bottom:1px solid var(--border); }
.tree-month:last-child { border-bottom:none; }
.tree-month-head, .tree-sub-head {
  display:flex; align-items:center; gap:10px; padding:12px 16px; cursor:pointer;
  user-select:none; transition:background .15s;
}
.tree-month-head { background:#f8fafc; font-weight:600; }
.tree-month-head:hover, .tree-sub-head:hover { background:var(--primary-light); }
.tree-arrow { display:inline-block; transition:transform .2s; color:var(--text-sub); font-size:11px; width:12px; }
.tree-arrow.open { transform:rotate(90deg); color:var(--primary); }
.tree-icon { font-size:16px; }
.tree-label { flex:1; }
.tree-count { font-size:12px; color:var(--text-sub); background:var(--bg); padding:2px 8px; border-radius:10px; }
.tree-month-body { padding:8px 16px 12px 36px; background:#fff; }
.tree-sub { margin-bottom:6px; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.tree-sub-head { background:#fafbfc; font-weight:500; padding:10px 14px; }
.tree-sub-body { padding:0; background:#fff; }
.tag { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:var(--primary-light); color:var(--primary); }
.tag.success { background:#d1fae5; color:#065f46; }
.tag.warning { background:#fef3c7; color:#92400e; }
.tag.danger { background:#fee2e2; color:#991b1b; }
.tag.info { background:#e0e7ff; color:#3730a3; }
.tag.gray { background:#f3f4f6; color:#4b5563; }
.empty { padding:60px 20px; text-align:center; color:var(--text-mute); }
.empty .icon { font-size:48px; margin-bottom:8px; }
.row { display:flex; gap:10px; align-items:center; }
.row-spread { display:flex; gap:10px; align-items:center; justify-content:space-between; }

/* ========== 文件管理 ========== */
.cat-tree { display:flex; gap:6px; flex-wrap:wrap; }
.cat-pill { padding:6px 14px; border-radius:18px; background:#fff; border:1px solid var(--border); cursor:pointer; font-size:13px; }
.cat-pill:hover { border-color:var(--primary); color:var(--primary); }
.cat-pill.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* 树状分类菜单：一级 sub + 二级 sub */
.cat-group { display:inline-flex; flex-direction:column; margin-right:6px; vertical-align:top; }
.cat-pill-group { font-weight:600; background:#f8fafc; }
.cat-children { display:flex; gap:4px; flex-wrap:wrap; margin-top:4px; padding-left:12px; border-left:2px solid #e2e8f0; }
.cat-sub { padding:4px 10px; border-radius:14px; background:#f1f5f9; border:1px solid #e2e8f0; cursor:pointer; font-size:12px; color:#475569; }
.cat-sub:hover { border-color:var(--primary); color:var(--primary); background:#eef2ff; }
.cat-sub.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.cat-sub-count { display:inline-block; min-width:18px; padding:0 4px; margin-left:4px; border-radius:9px; background:rgba(0,0,0,0.06); color:inherit; font-size:11px; line-height:16px; text-align:center; }
.cat-sub.active .cat-sub-count { background:rgba(255,255,255,0.25); }
.file-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.file-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:16px; cursor:pointer; transition:all .2s; }
.file-card:hover { border-color:var(--primary); box-shadow:var(--shadow); transform:translateY(-2px); }
.file-icon { font-size:32px; margin-bottom:8px; }
.file-name { font-weight:500; margin-bottom:4px; word-break:break-all; }
.file-meta { font-size:12px; color:var(--text-sub); }
.view-toggle { display:flex; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.view-toggle button { background:#fff; border:none; padding:6px 10px; }
.view-toggle button.active { background:var(--primary); color:#fff; }

/* 2026-08-05 新增：Sub 标签页（人员信息用工形式） */
.sub-tabs { display:inline-flex; gap:4px; }
.sub-tab { background:#fff; border:1px solid var(--border); border-radius:6px; padding:6px 12px; font-size:13px; cursor:pointer; transition:all .15s; }
.sub-tab:hover { background:var(--primary-light); border-color:var(--primary); }
.sub-tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* ========== 人员卡片 ========== */
.staff-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; }
.staff-card { background:#fff; border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); text-align:center; }
.staff-avatar { width:64px; height:64px; border-radius:50%; margin:0 auto 10px; background:linear-gradient(135deg,var(--primary),#06b6d4); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:600; }
.staff-name { font-weight:600; margin-bottom:2px; }
.staff-pos { color:var(--text-sub); font-size:12px; margin-bottom:8px; }
.staff-tags { display:flex; justify-content:center; gap:4px; flex-wrap:wrap; }

/* ========== 通知公告 ========== */
.notice-item { background:#fff; border-radius:var(--radius); padding:16px 20px; margin-bottom:10px; box-shadow:var(--shadow); display:flex; gap:14px; cursor:pointer; transition:all .2s; border-left:4px solid transparent; }
.notice-item:hover { border-left-color:var(--primary); }
.notice-item.urgent { border-left-color:var(--danger); }
.notice-title { font-weight:600; margin-bottom:4px; }
.notice-meta { font-size:12px; color:var(--text-sub); }
.notice-content { color:var(--text); margin-top:8px; padding-top:8px; border-top:1px dashed var(--border); }

/* ========== 模态框 ========== */
.modal-mask { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; z-index:1000; }
.modal { background:#fff; border-radius:10px; width:900px; max-width:95vw; max-height:92vh; display:flex; flex-direction:column; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); font-weight:600; }
.modal-close { cursor:pointer; font-size:22px; color:var(--text-sub); }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-foot { padding:12px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }

/* ========== Toast ========== */
.toast { position:fixed; top:80px; left:50%; transform:translateX(-50%); background:rgba(0,0,0,.82); color:#fff; padding:10px 22px; border-radius:24px; font-size:13px; z-index:2000; box-shadow:var(--shadow-lg); }

/* ========== 进度条 ========== */
.progress { height:6px; background:#f3f4f6; border-radius:3px; overflow:hidden; }
.progress-bar { height:100%; background:linear-gradient(90deg,var(--primary),#06b6d4); transition:width .3s; }

/* ========== 时间线 ========== */
.timeline { position:relative; padding-left:24px; }
.timeline::before { content:""; position:absolute; left:8px; top:4px; bottom:4px; width:2px; background:var(--border); }
.tl-item { position:relative; padding-bottom:16px; }
.tl-item::before { content:""; position:absolute; left:-20px; top:6px; width:10px; height:10px; border-radius:50%; background:var(--primary); border:2px solid #fff; box-shadow:0 0 0 1px var(--primary); }
.tl-time { color:var(--text-sub); font-size:12px; }
.tl-title { font-weight:500; margin-top:2px; }
.tl-desc { color:var(--text-sub); font-size:12px; margin-top:2px; }

/* ========== 图表占位 ========== */
.chart { width:100%; height:240px; }
.legend { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--text-sub); margin-top:8px; }
.legend .dot { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; vertical-align:middle; }

/* ========== 响应式 ========== */
@media (max-width:900px) {
  .sidebar { width:60px; }
  .sidebar-brand .brand-title,.sidebar-brand .brand-sub,.nav-item span:last-child,.nav-title,.nav-group { display:none; }
  .nav-item { justify-content:center; padding:12px; }
  .stat-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:600px) {
  .stat-grid { grid-template-columns:1fr; }
  .topbar { padding:0 12px; }
  .search-box input { width:120px; }
}

/* ========== 补齐：详情页/表单小细节 ========== */
.card table td, .card table th { vertical-align: middle; }
input[disabled], select[disabled] { background:#f3f4f6; color:var(--text-sub); cursor:not-allowed; }

/* 让顶部用户菜单在响应式下不被挤压 */
.user-menu a { white-space: nowrap; }

/* 看板双列自适应 */
@media (min-width:1200px) {
  .content > div[style*="grid-template-columns:2fr"] { gap:20px; }
}

/* 文件卡片 hover 提示 */
.file-card .file-name { color: var(--text); }
.file-card:hover .file-name { color: var(--primary); }

/* mark 标签 */
mark { background:#fef08a; padding:0 2px; border-radius:2px; }

/* select 多选高度自适应 */
select[multiple] { min-height:120px; }

/* 进度条细节 */
.progress { position:relative; }
.progress-bar { transition: width .5s ease; }

/* 分页控件 */
.pagination {
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:16px; margin-top:8px; border-top:1px solid var(--border);
}
.pagination .page-info { color:var(--text-sub); font-size:13px; padding:0 8px; }
.pagination button { padding:6px 12px; font-size:13px; }
.pagination button:disabled { opacity:.4; cursor:not-allowed; }


/* ============== 文件检索模块样式 ============== */
.fs-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all .2s;
}
.fs-search-input:focus {
  box-shadow: 0 0 0 3px rgba(22,68,168,0.15);
}
.fs-keywords {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  border-left: 3px solid #0ea5e9;
}
.fs-stats {
  margin-left: auto;
  color: var(--text-sub);
  font-size: 13px;
}
.fs-filter-block {
  margin-bottom: 12px;
}
.fs-filter-block .filter-title {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
  font-weight: 500;
}
.cat-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-pill {
  padding: 4px 12px;
  border-radius: 16px;
  background: #f3f4f6;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cat-pill:hover {
  background: #e5e7eb;
}
.cat-pill.active {
  background: var(--primary);
  color: #fff;
}
.cat-pill .badge {
  background: rgba(0,0,0,0.08);
  padding: 0 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}
.cat-pill.active .badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* 文件检索结果条目 */
.fs-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
}
.fs-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(22,68,168,0.08);
  transform: translateY(-1px);
}
.fs-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fs-icon { font-size: 18px; }
.fs-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  word-break: break-all;
}
.fs-docno {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Courier New', monospace;
}
.fs-score {
  background: #ecfdf5;
  color: #059669;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.fs-item-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.fs-path {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #6b7280;
}
.fs-snippet {
  background: #f9fafb;
  border-left: 3px solid #fbbf24;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 0 4px 4px 0;
  color: #374151;
  margin: 6px 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.fs-snippet .hit-count {
  color: var(--primary);
  font-weight: 600;
}
.fs-snippet mark {
  background: #fef08a;
  color: #92400e;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 600;
}
.fs-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
}
.fs-actions .btn-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.fs-actions .btn-link:hover {
  text-decoration: underline;
}
.fs-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  padding: 20px 0;
}

/* 预览弹框 */
.preview-meta {
  background: #f9fafb;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.preview-row {
  display: flex;
  padding: 4px 0;
  font-size: 13px;
  gap: 12px;
}
.preview-row .lbl {
  color: var(--text-sub);
  min-width: 70px;
  font-weight: 500;
}
.preview-row .path {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #6b7280;
  word-break: break-all;
}
.preview-divider {
  font-weight: 600;
  margin: 14px 0 8px;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.preview-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  color: #1f2937;
  font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', sans-serif;
}
.preview-body p {
  margin: 4px 0;
  text-indent: 2em;
}
.preview-body mark,
mark.hl-kw {
  background: #fef08a;
  color: #92400e;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 600;
}

.file-card mark.hl-kw,
a.btn-link mark.hl-kw {
  background: #fef08a;
  color: #92400e;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* Word 真实格式预览 iframe */
.preview-iframe {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  margin-top: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* WPS 风格元素 */
.wps-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 12px 0;
  color: #000;
  font-family: '方正小标宋简体', 'SimSun', serif;
  letter-spacing: 0.5px;
}
.wps-h1 {
  font-weight: 700;
  color: #000;
  margin-right: 4px;
}
.wps-h2 {
  font-weight: 600;
  color: #1f2937;
  margin-right: 4px;
}
.wps-h3 {
  font-weight: 500;
  color: #374151;
  margin-right: 4px;
}
.wps-table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
.wps-table th,
.wps-table td {
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.wps-table th {
  background: #f3f4f6;
  font-weight: 600;
}
.wps-table tr:nth-child(even) td {
  background: #fafafa;
}

/* 分页导航 */
.page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-top: 12px;
}
.page-nav button {
  padding: 6px 14px;
  font-size: 13px;
}
.page-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-info {
  font-size: 13px;
  color: var(--text-sub);
}

/* 统计页表格 */
.stats-summary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.9;
  font-size: 13px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 13px;
}
.stats-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.stats-table td:nth-child(2) {
  text-align: right;
  color: var(--primary);
}

/* 帮助说明 */
kbd {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  box-shadow: 0 1px 0 #d1d5db;
}

/* 列表 */
ul li, ol li {
  margin: 6px 0;
  line-height: 1.8;
}

/* ============================================================
   工作总结页面（按文件名分类排序）
   ============================================================ */
.sum-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 14px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.sum-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-sub, #6b7280);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.18s ease;
  border-radius: 8px 8px 0 0;
}
.sum-tab:hover {
  background: var(--bg-soft, #f3f4f6);
  color: var(--primary, #1e5ad7);
}
.sum-tab.active {
  color: var(--primary, #1e5ad7);
  border-bottom-color: var(--primary, #1e5ad7);
  font-weight: 600;
  background: var(--primary-light, rgba(30,90,215,0.06));
}
.sum-tab-icon {
  font-size: 16px;
}
.sum-tab-cnt {
  display: inline-block;
  padding: 1px 8px;
  background: var(--bg-soft, #f3f4f6);
  color: var(--text-sub, #6b7280);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.sum-tab.active .sum-tab-cnt {
  background: var(--primary, #1e5ad7);
  color: #fff;
}

table.sum-table {
  width: 100%;
  border-collapse: collapse;
}
table.sum-table thead th {
  background: var(--bg-soft, #f3f4f6);
  color: var(--text, #111827);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border, #e5e7eb);
  white-space: nowrap;
}
table.sum-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
  font-size: 13px;
}
table.sum-table tbody tr.sum-group-head td {
  background: var(--primary-light, rgba(30,90,215,0.06));
  color: var(--primary, #1e5ad7);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-left: 3px solid var(--primary, #1e5ad7);
}
table.sum-table tbody tr.sum-item:hover {
  background: var(--bg-soft, #f9fafb);
}
.sum-name {
  font-weight: 500;
  color: var(--text, #111827);
  word-break: break-all;
  line-height: 1.5;
}

/* ===== 工作总结：折叠分组 ===== */
.summary-group { border-bottom: 1px solid var(--border); }
.summary-group:last-child { border-bottom: none; }
.summary-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.summary-group-head:hover { background: var(--hover, rgba(0,0,0,.03)); }
.summary-arrow { color: var(--text-mute); font-size: 11px; width: 12px; }
.summary-folder { font-size: 17px; }
.summary-label { font-weight: 600; color: var(--text); flex: 1; }
.summary-count {
  font-size: 12px; color: var(--text-sub);
  background: var(--bg-soft, rgba(0,0,0,.05));
  padding: 2px 9px; border-radius: 10px;
}

.ai-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #4f7cff 0%, #2755e6 100%);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(79, 124, 255, 0.5); }
.ai-fab-icon { font-size: 26px; line-height: 1; }
.ai-fab-text { font-size: 10px; margin-top: 2px; }

.ai-panel {
  position: fixed; right: 24px; bottom: 100px;
  width: 440px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  z-index: 9998;
  display: flex; flex-direction: column;
  overflow: hidden;
  font-size: 14px;
  border: 1px solid #e3e6ee;
}
.ai-panel.hidden { display: none; }

.ai-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, #4f7cff 0%, #2755e6 100%);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.ai-title { font-weight: 600; font-size: 15px; }
.ai-head-actions { display: flex; gap: 8px; }
.ai-icon-btn {
  background: rgba(255,255,255,0.18);
  color: #fff; border: none; padding: 4px 10px;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.ai-icon-btn:hover { background: rgba(255,255,255,0.3); }

.ai-status {
  padding: 6px 14px;
  background: #f6f7fb;
  font-size: 12px;
  color: #666;
  border-bottom: 1px solid #e8eaf2;
}
.ai-status.error { background: #fff0f0; color: #c92a2a; }
.ai-status.ok { background: #f0fbf2; color: #2b8a3e; }

.ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fafbfd;
}

.ai-msg {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
}
.ai-msg-user { flex-direction: row-reverse; }
.ai-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: #e3e6ee;
}
.ai-msg-user .ai-avatar { background: #d3e0ff; }
.ai-msg-assistant .ai-avatar { background: #4f7cff; color: #fff; }
.ai-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
.ai-msg-user .ai-bubble {
  background: #4f7cff;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-bubble {
  background: #fff;
  border: 1px solid #e3e6ee;
  border-bottom-left-radius: 4px;
}
.ai-bubble.thinking {
  color: #999;
  font-style: italic;
}
.ai-bubble a { color: #2755e6; text-decoration: underline; }

.ai-references {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e3e6ee;
  font-size: 12px;
  color: #666;
}
.ai-ref-item {
  padding: 4px 0;
  cursor: pointer;
  color: #2755e6;
}
.ai-ref-item:hover { text-decoration: underline; }
/* 2026-08-13：人员/安全台账卡片样式（无 cursor，因为不可点击） */
.ai-ref-person, .ai-ref-safety {
  cursor: default;
  background: #f8fafc;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
  color: #334155;
  font-size: 12px;
  line-height: 1.6;
}
.ai-ref-person { border-left-color: #3b82f6; }
.ai-ref-safety { border-left-color: #ef4444; }
.ai-ref-person:hover, .ai-ref-safety:hover { text-decoration: none; }
.ai-ref-person strong, .ai-ref-safety strong { color: #0f172a; font-size: 13px; }

.ai-input-row {
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e8eaf2;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-input-row textarea {
  flex: 1;
  border: 1px solid #e3e6ee;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
.ai-input-row textarea:focus { border-color: #4f7cff; }
.ai-send-btn {
  background: #4f7cff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  height: 38px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.ai-send-btn:hover { background: #2755e6; }
.ai-send-btn:disabled { background: #b0bcd9; cursor: not-allowed; }

.ai-foot {
  padding: 6px 14px;
  background: #f6f7fb;
  font-size: 11px;
  color: #888;
  text-align: center;
  border-top: 1px solid #e8eaf2;
}

.ai-error { color: #c92a2a; }

/* ============================================================
   档案案卷（2026-09-28 任哥要求：3 级树 + 通知+附件分组）
   ============================================================ */
.archive-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}
.archive-sidebar {
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.archive-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: background 0.12s;
  margin-bottom: 1px;
}
.archive-cat:hover { background: #f0f0f0; }
.archive-cat.active {
  background: #e8effa;
  color: #4078FB;
  font-weight: 500;
}
.archive-count {
  background: transparent;
  color: #999;
  border-radius: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 400;
}
.archive-cat.active .archive-count {
  background: transparent;
  color: #4078FB;
}
.archive-content { min-width: 0; padding-top: 4px; }
.archive-list { display: flex; flex-direction: column; }
.archive-group {
  /* 语雀风格：无卡片背景、无边框、无阴影 */
  padding: 2px 0;
}
.archive-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  border-bottom: none;
  color: #333;
  line-height: 1.5;
}
.archive-group-head:hover { background: #f5f7fa; border-radius: 4px; }
.archive-toggle {
  display: inline-block;
  width: 12px;
  color: #aaa;
  font-size: 9px;
  transition: transform 0.15s;
}
.archive-group-icon { font-size: 13px; opacity: 0.7; }
.archive-group-title {
  flex: 1;
  color: #4078FB;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-group-meta { font-size: 11px; color: #aaa; font-weight: 400; }
.archive-group-body {
  background: transparent;
  padding: 0;
}
.archive-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 70px 90px;
  gap: 10px;
  align-items: center;
  padding: 5px 8px 5px 24px;
  cursor: pointer;
  border-bottom: none;
  font-size: 13px;
  transition: background 0.1s;
  line-height: 1.5;
  color: #333;
  min-height: 28px;
}
.archive-row:hover { background: #f5f7fa; border-radius: 4px; }
.archive-row:last-child { border-bottom: none; }
.archive-row-main {
  background: transparent;
  font-weight: 500;
  padding-left: 24px;
  color: #222;
}
.archive-row-main:hover { background: #f5f7fa; border-radius: 4px; }
.archive-row-attach {
  padding-left: 36px;
  color: #666;
  font-size: 12px;
  position: relative;
}
.archive-row-attach::before {
  content: '└';
  color: #ccc;
  position: absolute;
  left: 22px;
  font-weight: 400;
}

/* 2026-10-09 排除名单 🚫 按钮（任哥拍板：只 admin 可见） */
.row-exclude {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 4px;
}
.archive-row:hover .row-exclude,
.file-row:hover .row-exclude { opacity: .85; }
.row-exclude:hover { opacity: 1; background: rgba(255,80,80,.12); }

/* 文件卡片里的 🚫 按钮（绝对定位到图标右上角） */
.file-card { position: relative; }
.file-card-exclude {
  position: absolute;
  top: 4px;
  right: 4px;
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s;
  padding: 2px 4px;
  border-radius: 4px;
  z-index: 3;
  background: transparent;
  border: none;
}
.file-card:hover .file-card-exclude { opacity: .85; }
.file-card-exclude:hover { opacity: 1; background: rgba(255,80,80,.12); }

/* 2026-11-10 任哥：操作日志 / 登录日志 列宽自适应
   短列（时间/账号/姓名/类型/IP）按内容收缩，长列（操作对象/详情）占满剩余宽度并自动换行 */
.oplog-table, .loginlog-table { table-layout: auto !important; }
.oplog-table th, .oplog-table td,
.loginlog-table th, .loginlog-table td { white-space: nowrap; }
/* 操作日志：前 4 列按内容收缩，操作对象列吃掉剩余宽度 */
.oplog-table th:nth-child(1), .oplog-table td:nth-child(1),
.oplog-table th:nth-child(2), .oplog-table td:nth-child(2),
.oplog-table th:nth-child(3), .oplog-table td:nth-child(3),
.oplog-table th:nth-child(4), .oplog-table td:nth-child(4) { width: 1%; }
.oplog-table th:nth-child(5), .oplog-table td:nth-child(5) { width: auto; white-space: normal; word-break: break-word; }
/* 登录日志：时间/账号/结果/IP 按内容收缩，详情列吃掉剩余宽度 */
.loginlog-table th:nth-child(1), .loginlog-table td:nth-child(1),
.loginlog-table th:nth-child(2), .loginlog-table td:nth-child(2),
.loginlog-table th:nth-child(3), .loginlog-table td:nth-child(3),
.loginlog-table th:nth-child(5), .loginlog-table td:nth-child(5) { width: 1%; }
.loginlog-table th:nth-child(4), .loginlog-table td:nth-child(4) { width: auto; white-space: normal; word-break: break-word; }

