:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --red: #dc2626;
  --orange: #ea580c;
  --yellow: #ca8a04;
  --blue: #2563eb;
  --green: #16a34a;
  --gray: #64748b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  padding: 18px 16px; font-size: 14px; line-height: 1.5; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--sidebar-text);
  font-size: 14px; cursor: pointer; text-align: left; font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 20px; }
.module-container { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel-full { grid-column: 1 / -1; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border-top: 3px solid var(--stat-c, var(--primary));
}
.stat-red   { --stat-c: var(--red); }
.stat-orange{ --stat-c: var(--orange); }
.stat-yellow{ --stat-c: var(--yellow); }
.stat-blue  { --stat-c: var(--blue); }
.stat-green { --stat-c: var(--green); }
.stat-gray  { --stat-c: #64748b; }
.stat-value { font-size: 30px; font-weight: 800; }
.stat-label { margin-top: 2px; font-size: 14px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 工具条 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; }
.toolbar-count { color: var(--muted); font-size: 13px; }
.search-input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  width: 260px; font-size: 14px; outline: none; background: #fff;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; font-family: inherit;
  background: #e2e8f0; color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-danger-ghost { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: #f8fafc; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 600; white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
tbody tr.row-warn { background: #fef2f2; }
td.actions { white-space: nowrap; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 700px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px; max-height: 62vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 13px; color: var(--text); font-weight: 600; }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.help { font-size: 12px; color: var(--muted); }

/* 提示条 */
#toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: 8px; background: #0f172a; color: #fff;
  font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); opacity: 1; transition: opacity .3s;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
.toast.out { opacity: 0; }

/* 提醒列表 */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  text-align: left; width: 100%; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; font-family: inherit;
}
.alert-item:hover { border-color: var(--primary); }
.alert-title { font-size: 14px; font-weight: 600; }
.alert-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.empty.small { padding: 12px; font-size: 13px; }

@media (max-width: 960px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
}

/* ---------- 仪表盘 KPI 卡片 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi-card {
  position: relative; text-align: left; font-family: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--stat-c, var(--primary));
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.12); }
.kpi-red { --stat-c: var(--red); }
.kpi-orange { --stat-c: var(--orange); }
.kpi-yellow { --stat-c: var(--yellow); }
.kpi-blue { --stat-c: var(--blue); }
.kpi-green { --stat-c: var(--green); }
.kpi-icon { font-size: 18px; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi-label { font-size: 13px; margin-top: 2px; font-weight: 600; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 图表区 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-card .chart-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chart-body.bars { flex-direction: column; align-items: stretch; gap: 10px; }
.donut-wrap { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); }
.donut-seg { cursor: pointer; transition: opacity .2s; }
.donut-seg:hover { opacity: .65; }
.donut-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
}
.chart-legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-family: inherit; color: var(--text);
  padding: 5px 8px; border-radius: 6px;
}
.legend-item:hover { background: #f8fafc; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bar-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; cursor: pointer; padding: 5px 6px; border-radius: 6px;
  font-family: inherit; color: var(--text);
}
.bar-row:hover { background: #f8fafc; }
.bar-label { width: 72px; flex: 0 0 72px; font-size: 13px; }
.bar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; transition: width .4s; }
.bar-value { width: 32px; text-align: right; font-weight: 700; font-size: 13px; }

/* 表格内迷你进度条（研发项目管理） */
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 116px; }
.mini-progress .bar-track { height: 8px; }
.mini-progress .bar-value { width: 40px; font-size: 12px; }

/* ---------- 记录定位高亮 ---------- */
.row-highlight { animation: rowFlash 2.4s ease; }
@keyframes rowFlash { 0% { background: #fef9c3; } 100% { background: transparent; } }
/* ==================== 研发项目管理（进度管理模板） ==================== */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.project-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.project-card-title { font-size: 15px; line-height: 1.4; }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.project-card-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-card-progress .mini-progress { flex: 1; min-width: 0; }
.project-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.project-card-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
.detail-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-title { font-size: 18px; font-weight: 700; flex: 1; min-width: 220px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; font-size: 13px; }
.kv-grid .kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-grid .kv b { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv-note { margin-top: 12px; font-size: 13px; color: var(--text); line-height: 1.6; }
.kv-note b { color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
.big-progress { display: flex; align-items: center; gap: 14px; }
.big-progress .big-value { font-size: 40px; font-weight: 800; color: var(--primary); min-width: 84px; }
.big-progress .progress-wrap { flex: 1; }
.big-progress .bar-track { height: 14px; }
.stat-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat-mini { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; }
.stat-mini .v { font-size: 18px; font-weight: 700; }
.stat-mini .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.text-red { color: var(--red); }
.float-right { float: right; }
.card-title .float-right { margin-top: -3px; }
/* 甘特图 */
.gantt-table-scroll { overflow-x: auto; }
.gantt { min-width: 620px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 180px 1fr 52px; gap: 8px; align-items: center; }
.gantt-head { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 4px; }
.gantt-row { height: 32px; font-size: 12px; }
.gantt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.gantt-track { position: relative; height: 100%; }
.gantt-row:nth-child(odd) .gantt-track { background: #f8fafc; }
.gantt-tick { position: absolute; top: -2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-bar { position: absolute; top: 8px; height: 14px; border-radius: 999px; min-width: 4px; }
.gantt-gray { background: #94a3b8; }
.gantt-blue { background: #2563eb; }
.gantt-green { background: #16a34a; }
.gantt-red { background: #dc2626; }
.gantt-milestone { position: absolute; top: 6px; width: 12px; height: 12px; background: #7c3aed; transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 0 1px #7c3aed; }
.gantt-milestone.inline { position: static; display: inline-block; transform: none; box-shadow: none; background: #7c3aed; margin-right: 4px; vertical-align: -1px; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; opacity: .7; z-index: 2; }
.gantt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.gantt-legend-item .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
/* ==================== 登录页（多人在线） ==================== */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(9, 16, 32, .55), rgba(9, 16, 32, .55)), url('../assets/cover.jpg') center/cover no-repeat fixed;
}
.login-card {
  width: 360px; max-width: 92vw; background: var(--card);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  padding: 34px 32px 26px; text-align: center;
}
.login-icon { font-size: 40px; }
.login-title { font-size: 19px; font-weight: 700; margin-top: 10px; color: var(--text); }
.login-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-input {
  width: 100%; margin-top: 14px; padding: 11px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; outline: none;
}
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-btn { width: 100%; margin-top: 14px; padding: 11px; font-size: 15px; }
.login-error { min-height: 18px; font-size: 13px; color: var(--red); margin-top: 8px; }
.login-hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
/* 账号权限管理 - 模块权限勾选 */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; margin-top: 6px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.perm-item input { accent-color: var(--primary); }

/* ==================== 手机端适配 ==================== */
.menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: 18px; cursor: pointer;
  margin-right: 10px; padding: 0;
}
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .app { position: relative; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 248px; height: 100vh; z-index: 300;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(15,23,42,.35);
  }
  .sidebar-nav { flex-direction: column; }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open::after {
    content: ''; position: fixed; inset: 0;
    background: rgba(15,23,42,.45); z-index: 290;
  }
  .main { width: 100%; }
  .topbar { padding: 10px 14px; position: sticky; top: 0; }
  .topbar h1 { font-size: 16px; }
  .topbar .muted { font-size: 11px; }
  .module-container { padding: 12px; gap: 12px; }
  .card { padding: 14px; }
  .card-title { font-size: 14px; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar-left { flex-wrap: wrap; }
  .search-input { width: 100%; }
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 8px 10px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-body { max-height: 62vh; padding: 16px; }
  .modal-header { padding: 12px 14px; }
  .modal-footer { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .login-card { padding: 26px 20px 22px; }
  .login-title { font-size: 17px; }
  .stat-value { font-size: 24px; }
  .stat-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-card { padding: 12px 14px; }
  .chart-grid { grid-template-columns: 1fr; }
  .donut-wrap { width: 120px; height: 120px; flex: 0 0 120px; }
  .donut { width: 120px; height: 120px; }
  .chart-card .chart-body { justify-content: center; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .detail-title { font-size: 16px; min-width: 0; }
  .detail-actions { width: 100%; }
  .big-progress .big-value { font-size: 30px; min-width: 70px; }
  .big-progress { flex-wrap: wrap; }
  .gantt { min-width: 520px; }
  #toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { font-size: 13px; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  input, select, textarea { font-size: 16px; }
  .empty { padding: 18px; }
}
@media (max-width: 420px) {
  .kv-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}

/* ==================== 视频监控 ==================== */
.tab-bar { display: flex; gap: 4px; background: #f1f5f9; border-radius: 8px; padding: 3px; }
.tab { border: 0; background: transparent; padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--muted); font-family: inherit; white-space: nowrap; }
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cam-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cam-thumb { position: relative; background: #0f172a; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam-thumb img, .cam-thumb video { width: 100%; height: 100%; object-fit: contain; }
.cam-offline { color: #94a3b8; font-size: 13px; text-align: center; padding: 8px; }
.cam-info { padding: 10px 12px; }
.cam-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cam-loc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cam-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }
.dot-on { background: #16a34a; }
.dot-off { background: #dc2626; }
.dot-unknown { background: #94a3b8; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb-item { cursor: pointer; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0f172a; }
.thumb-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.thumb-time { font-size: 11px; color: var(--muted); text-align: center; padding: 4px; background: #fff; }
.cam-big-img { max-width: 100%; max-height: 68vh; border-radius: 8px; display: block; margin: 0 auto; background: #000; }

/* ============ top user area & logout ============ */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.user-chip .user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: 0 0 28px; }
.logout-btn { padding: 6px 12px; font-size: 13px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap; }
.logout-btn:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }
@media (max-width: 820px) {
  .topbar-right { gap: 8px; }
  .topbar .muted { display: none; }
  .user-chip .user-avatar { width: 24px; height: 24px; font-size: 11px; flex-basis: 24px; }
  .user-chip .user-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .logout-btn { padding: 5px 9px; font-size: 12px; }
}

/* ==================== 日程管理 ==================== */
.sched-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-cell { position: relative; min-height: 62px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); padding: 4px; cursor: pointer; text-align: left; }
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-cell.selected { background: #eff6ff; }
.cal-num { font-size: 12px; color: var(--text); font-weight: 600; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; align-items: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray); }
.cal-dot.on { background: var(--primary); }
.cal-dot.off { background: #bbf7d0; }
.cal-more { font-size: 10px; color: var(--muted); }
.sched-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.sched-item:last-child { border-bottom: none; }
.sched-item.row-highlight { background: #fef9c3; border-radius: 8px; padding: 10px 8px; }
.sched-time-col { flex: 0 0 108px; }
.sched-time { display: inline-block; font-weight: 700; color: var(--primary); background: #eff6ff; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.sched-main { flex: 1; min-width: 0; }
.sched-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sched-note { font-size: 12px; color: var(--muted); margin-top: 3px; background: #f8fafc; border-radius: 6px; padding: 4px 8px; }
.sched-acts { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.up-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.up-item:last-child { border-bottom: none; }
.up-date { flex: 0 0 88px; font-size: 12px; color: var(--muted); }
.up-time { flex: 0 0 62px; font-weight: 700; font-size: 13px; color: var(--primary); }
.up-main { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .sched-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cal-cell { min-height: 44px; }
  .sched-item { flex-wrap: wrap; }
  .sched-time-col { flex: none; }
  .sched-acts { width: 100%; justify-content: flex-start; }
}


/* ==================== 文件库 ==================== */
.doc-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.doc-head { padding: 12px 14px; }
.doc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.doc-note { font-size: 12px; color: var(--muted); margin-top: 4px; background: #f8fafc; border-radius: 6px; padding: 4px 8px; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.doc-vers { border-top: 1px dashed var(--border); background: #f8fafc; padding: 8px 14px; }
.doc-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.doc-ver:last-child { border-bottom: none; }
.doc-ver.current { font-weight: 600; }
@media (max-width: 640px) { .doc-actions { flex-direction: column; align-items: stretch; } .doc-actions .btn { width: 100%; } }


/* ==================== 通知中心 ==================== */
.notif-wrap { position: relative; }
.notif-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.notif-btn:hover { border-color: var(--primary); }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 340px; max-width: 88vw; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); z-index: 400; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px 0; }
.notif-item { padding: 10px 14px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item .notif-title { font-size: 13px; font-weight: 600; }
.notif-item .notif-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-item[data-level="red"] .notif-title { color: var(--red); }
@media (max-width: 820px) { .notif-panel { right: -10px; } }

/* ==================== 重点事项跟踪 ==================== */
.matter-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.matter-summary .stat-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.matter-summary .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.12); }
.matter-filters { margin-bottom: 14px; width: fit-content; }
.matter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.matter-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.matter-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.matter-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--matter-pri, #ea580c); }
.matter-pri-high { --matter-pri: #dc2626; }
.matter-pri-mid { --matter-pri: #ea580c; }
.matter-pri-low { --matter-pri: #16a34a; }
.matter-card.done { opacity: .75; }
.matter-card.done::before { background: #94a3b8; }
.matter-card.overdue { border-color: #fecaca; background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%); }
.matter-card.overdue::before { background: #dc2626; }
.matter-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.matter-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.matter-card-title.done-title { color: var(--muted); text-decoration: line-through; }
.matter-people { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.matter-person { display: inline-flex; align-items: center; gap: 6px; }
.matter-person b { color: var(--text); font-weight: 600; }
.matter-avatar { width: 24px; height: 24px; border-radius: 50%; background: #e0e7ff; color: #3730a3; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.matter-date { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.matter-date .arrow { color: #cbd5e1; }
.matter-timeline { position: relative; height: 8px; background: #eef2f7; border-radius: 999px; margin: 4px 0 2px; }
.matter-timeline .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.matter-timeline .today { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #2563eb; transform: translateX(-50%); box-shadow: 0 1px 3px rgba(15,23,42,.25); }
.matter-timeline .today.over { border-color: #ea580c; }
.matter-result { font-size: 13px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.6; }
.matter-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .matter-grid { grid-template-columns: 1fr; }
  .matter-filters { width: 100%; overflow-x: auto; }
}

/* ==================== 安全培训（卡片式） ==================== */
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.train-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.train-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.train-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.train-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.train-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.train-person { display: inline-flex; align-items: center; gap: 6px; }
.train-person b { color: var(--text); font-weight: 600; }
.train-avatar { width: 24px; height: 24px; border-radius: 50%; background: #dcfce7; color: #15803d; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.train-content { font-size: 13px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.7; white-space: pre-wrap; }
.train-content.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.train-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
.detail-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { flex: 0 0 110px; font-size: 13px; color: var(--muted); font-weight: 600; }
.detail-value { flex: 1; font-size: 13px; line-height: 1.7; word-break: break-word; }
@media (max-width: 820px) {
  .train-grid { grid-template-columns: 1fr; }
  .detail-label { flex-basis: 84px; }
}
/* ==================== 三废处置 ==================== */
.waste-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.waste-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.waste-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.waste-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #16a34a; }
.waste-card.over::before { background: #dc2626; }
.waste-card.done { opacity: .78; }
.waste-card.done::before { background: #94a3b8; }
.waste-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.waste-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.waste-components { font-size: 13px; color: var(--text); line-height: 1.6; }
.waste-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.waste-person { display: inline-flex; align-items: center; gap: 6px; }
.waste-person b { color: var(--text); font-weight: 600; }
.waste-avatar { width: 24px; height: 24px; border-radius: 50%; background: #fef3c7; color: #b45309; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.waste-stock { font-size: 12px; color: var(--text); }
.waste-stock b { font-size: 14px; }
.waste-records { font-size: 12px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.6; white-space: pre-wrap; }
.waste-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .waste-grid { grid-template-columns: 1fr; }
}
/* ==================== 分析数据管理 ==================== */
.ana-list { overflow-x: auto; }
.ana-list table { min-width: 980px; }
.ana-list th { white-space: nowrap; }
.ana-no { font-family: ui-monospace, Consolas, 'Courier New', monospace; font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }
.ana-items { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ana-file { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .ana-list table { min-width: 860px; }
}

/* ===== ELN 样式（覆盖/补充） ===== */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --red: #dc2626;
  --orange: #ea580c;
  --yellow: #ca8a04;
  --blue: #2563eb;
  --green: #16a34a;
  --gray: #64748b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  padding: 18px 16px; font-size: 14px; line-height: 1.5; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--sidebar-text);
  font-size: 14px; cursor: pointer; text-align: left; font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 20px; }
.module-container { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel-full { grid-column: 1 / -1; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border-top: 3px solid var(--stat-c, var(--primary));
}
.stat-red   { --stat-c: var(--red); }
.stat-orange{ --stat-c: var(--orange); }
.stat-yellow{ --stat-c: var(--yellow); }
.stat-blue  { --stat-c: var(--blue); }
.stat-green { --stat-c: var(--green); }
.stat-gray  { --stat-c: #64748b; }
.stat-value { font-size: 30px; font-weight: 800; }
.stat-label { margin-top: 2px; font-size: 14px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 工具条 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; }
.toolbar-count { color: var(--muted); font-size: 13px; }
.search-input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  width: 260px; font-size: 14px; outline: none; background: #fff;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; font-family: inherit;
  background: #e2e8f0; color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-danger-ghost { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: #f8fafc; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 600; white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
tbody tr.row-warn { background: #fef2f2; }
td.actions { white-space: nowrap; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 700px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px; max-height: 62vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 13px; color: var(--text); font-weight: 600; }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.help { font-size: 12px; color: var(--muted); }

/* 提示条 */
#toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: 8px; background: #0f172a; color: #fff;
  font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); opacity: 1; transition: opacity .3s;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
.toast.out { opacity: 0; }

/* 提醒列表 */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  text-align: left; width: 100%; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; font-family: inherit;
}
.alert-item:hover { border-color: var(--primary); }
.alert-title { font-size: 14px; font-weight: 600; }
.alert-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.empty.small { padding: 12px; font-size: 13px; }

@media (max-width: 960px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
}

/* ---------- 仪表盘 KPI 卡片 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi-card {
  position: relative; text-align: left; font-family: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--stat-c, var(--primary));
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.12); }
.kpi-red { --stat-c: var(--red); }
.kpi-orange { --stat-c: var(--orange); }
.kpi-yellow { --stat-c: var(--yellow); }
.kpi-blue { --stat-c: var(--blue); }
.kpi-green { --stat-c: var(--green); }
.kpi-icon { font-size: 18px; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi-label { font-size: 13px; margin-top: 2px; font-weight: 600; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 图表区 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-card .chart-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chart-body.bars { flex-direction: column; align-items: stretch; gap: 10px; }
.donut-wrap { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); }
.donut-seg { cursor: pointer; transition: opacity .2s; }
.donut-seg:hover { opacity: .65; }
.donut-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
}
.chart-legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-family: inherit; color: var(--text);
  padding: 5px 8px; border-radius: 6px;
}
.legend-item:hover { background: #f8fafc; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bar-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; cursor: pointer; padding: 5px 6px; border-radius: 6px;
  font-family: inherit; color: var(--text);
}
.bar-row:hover { background: #f8fafc; }
.bar-label { width: 72px; flex: 0 0 72px; font-size: 13px; }
.bar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; transition: width .4s; }
.bar-value { width: 32px; text-align: right; font-weight: 700; font-size: 13px; }

/* 表格内迷你进度条（研发项目管理） */
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 116px; }
.mini-progress .bar-track { height: 8px; }
.mini-progress .bar-value { width: 40px; font-size: 12px; }

/* ---------- 记录定位高亮 ---------- */
.row-highlight { animation: rowFlash 2.4s ease; }
@keyframes rowFlash { 0% { background: #fef9c3; } 100% { background: transparent; } }
/* ==================== 研发项目管理（进度管理模板） ==================== */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.project-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.project-card-title { font-size: 15px; line-height: 1.4; }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.project-card-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-card-progress .mini-progress { flex: 1; min-width: 0; }
.project-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.project-card-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
.detail-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-title { font-size: 18px; font-weight: 700; flex: 1; min-width: 220px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; font-size: 13px; }
.kv-grid .kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-grid .kv b { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv-note { margin-top: 12px; font-size: 13px; color: var(--text); line-height: 1.6; }
.kv-note b { color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
.big-progress { display: flex; align-items: center; gap: 14px; }
.big-progress .big-value { font-size: 40px; font-weight: 800; color: var(--primary); min-width: 84px; }
.big-progress .progress-wrap { flex: 1; }
.big-progress .bar-track { height: 14px; }
.stat-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat-mini { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; }
.stat-mini .v { font-size: 18px; font-weight: 700; }
.stat-mini .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.text-red { color: var(--red); }
.float-right { float: right; }
.card-title .float-right { margin-top: -3px; }
/* 甘特图 */
.gantt-table-scroll { overflow-x: auto; }
.gantt { min-width: 620px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 180px 1fr 52px; gap: 8px; align-items: center; }
.gantt-head { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 4px; }
.gantt-row { height: 32px; font-size: 12px; }
.gantt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.gantt-track { position: relative; height: 100%; }
.gantt-row:nth-child(odd) .gantt-track { background: #f8fafc; }
.gantt-tick { position: absolute; top: -2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-bar { position: absolute; top: 8px; height: 14px; border-radius: 999px; min-width: 4px; }
.gantt-gray { background: #94a3b8; }
.gantt-blue { background: #2563eb; }
.gantt-green { background: #16a34a; }
.gantt-red { background: #dc2626; }
.gantt-milestone { position: absolute; top: 6px; width: 12px; height: 12px; background: #7c3aed; transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 0 1px #7c3aed; }
.gantt-milestone.inline { position: static; display: inline-block; transform: none; box-shadow: none; background: #7c3aed; margin-right: 4px; vertical-align: -1px; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; opacity: .7; z-index: 2; }
.gantt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.gantt-legend-item .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
/* ==================== 登录页（多人在线） ==================== */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(9, 16, 32, .55), rgba(9, 16, 32, .55)), url('../assets/cover.jpg') center/cover no-repeat fixed;
}
.login-card {
  width: 360px; max-width: 92vw; background: var(--card);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  padding: 34px 32px 26px; text-align: center;
}
.login-icon { font-size: 40px; }
.login-title { font-size: 19px; font-weight: 700; margin-top: 10px; color: var(--text); }
.login-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-input {
  width: 100%; margin-top: 14px; padding: 11px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; outline: none;
}
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-btn { width: 100%; margin-top: 14px; padding: 11px; font-size: 15px; }
.login-error { min-height: 18px; font-size: 13px; color: var(--red); margin-top: 8px; }
.login-hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
/* 账号权限管理 - 模块权限勾选 */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; margin-top: 6px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.perm-item input { accent-color: var(--primary); }

/* ==================== 手机端适配 ==================== */
.menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: 18px; cursor: pointer;
  margin-right: 10px; padding: 0;
}
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .app { position: relative; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 248px; height: 100vh; z-index: 300;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(15,23,42,.35);
  }
  .sidebar-nav { flex-direction: column; }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open::after {
    content: ''; position: fixed; inset: 0;
    background: rgba(15,23,42,.45); z-index: 290;
  }
  .main { width: 100%; }
  .topbar { padding: 10px 14px; position: sticky; top: 0; }
  .topbar h1 { font-size: 16px; }
  .topbar .muted { font-size: 11px; }
  .module-container { padding: 12px; gap: 12px; }
  .card { padding: 14px; }
  .card-title { font-size: 14px; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar-left { flex-wrap: wrap; }
  .search-input { width: 100%; }
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 8px 10px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-body { max-height: 62vh; padding: 16px; }
  .modal-header { padding: 12px 14px; }
  .modal-footer { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .login-card { padding: 26px 20px 22px; }
  .login-title { font-size: 17px; }
  .stat-value { font-size: 24px; }
  .stat-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-card { padding: 12px 14px; }
  .chart-grid { grid-template-columns: 1fr; }
  .donut-wrap { width: 120px; height: 120px; flex: 0 0 120px; }
  .donut { width: 120px; height: 120px; }
  .chart-card .chart-body { justify-content: center; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .detail-title { font-size: 16px; min-width: 0; }
  .detail-actions { width: 100%; }
  .big-progress .big-value { font-size: 30px; min-width: 70px; }
  .big-progress { flex-wrap: wrap; }
  .gantt { min-width: 520px; }
  #toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { font-size: 13px; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  input, select, textarea { font-size: 16px; }
  .empty { padding: 18px; }
}
@media (max-width: 420px) {
  .kv-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}

/* ==================== 视频监控 ==================== */
.tab-bar { display: flex; gap: 4px; background: #f1f5f9; border-radius: 8px; padding: 3px; }
.tab { border: 0; background: transparent; padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--muted); font-family: inherit; white-space: nowrap; }
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cam-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cam-thumb { position: relative; background: #0f172a; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam-thumb img, .cam-thumb video { width: 100%; height: 100%; object-fit: contain; }
.cam-offline { color: #94a3b8; font-size: 13px; text-align: center; padding: 8px; }
.cam-info { padding: 10px 12px; }
.cam-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cam-loc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cam-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }
.dot-on { background: #16a34a; }
.dot-off { background: #dc2626; }
.dot-unknown { background: #94a3b8; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb-item { cursor: pointer; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0f172a; }
.thumb-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.thumb-time { font-size: 11px; color: var(--muted); text-align: center; padding: 4px; background: #fff; }
.cam-big-img { max-width: 100%; max-height: 68vh; border-radius: 8px; display: block; margin: 0 auto; background: #000; }

/* ============ top user area & logout ============ */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.user-chip .user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: 0 0 28px; }
.logout-btn { padding: 6px 12px; font-size: 13px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap; }
.logout-btn:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }
@media (max-width: 820px) {
  .topbar-right { gap: 8px; }
  .topbar .muted { display: none; }
  .user-chip .user-avatar { width: 24px; height: 24px; font-size: 11px; flex-basis: 24px; }
  .user-chip .user-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .logout-btn { padding: 5px 9px; font-size: 12px; }
}

/* ==================== 日程管理 ==================== */
.sched-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-cell { position: relative; min-height: 62px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); padding: 4px; cursor: pointer; text-align: left; }
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-cell.selected { background: #eff6ff; }
.cal-num { font-size: 12px; color: var(--text); font-weight: 600; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; align-items: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray); }
.cal-dot.on { background: var(--primary); }
.cal-dot.off { background: #bbf7d0; }
.cal-more { font-size: 10px; color: var(--muted); }
.sched-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.sched-item:last-child { border-bottom: none; }
.sched-item.row-highlight { background: #fef9c3; border-radius: 8px; padding: 10px 8px; }
.sched-time-col { flex: 0 0 108px; }
.sched-time { display: inline-block; font-weight: 700; color: var(--primary); background: #eff6ff; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.sched-main { flex: 1; min-width: 0; }
.sched-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sched-note { font-size: 12px; color: var(--muted); margin-top: 3px; background: #f8fafc; border-radius: 6px; padding: 4px 8px; }
.sched-acts { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.up-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.up-item:last-child { border-bottom: none; }
.up-date { flex: 0 0 88px; font-size: 12px; color: var(--muted); }
.up-time { flex: 0 0 62px; font-weight: 700; font-size: 13px; color: var(--primary); }
.up-main { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .sched-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cal-cell { min-height: 44px; }
  .sched-item { flex-wrap: wrap; }
  .sched-time-col { flex: none; }
  .sched-acts { width: 100%; justify-content: flex-start; }
}


/* ==================== 文件库 ==================== */
.doc-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.doc-head { padding: 12px 14px; }
.doc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.doc-note { font-size: 12px; color: var(--muted); margin-top: 4px; background: #f8fafc; border-radius: 6px; padding: 4px 8px; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.doc-vers { border-top: 1px dashed var(--border); background: #f8fafc; padding: 8px 14px; }
.doc-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.doc-ver:last-child { border-bottom: none; }
.doc-ver.current { font-weight: 600; }
@media (max-width: 640px) { .doc-actions { flex-direction: column; align-items: stretch; } .doc-actions .btn { width: 100%; } }


/* ==================== 通知中心 ==================== */
.notif-wrap { position: relative; }
.notif-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.notif-btn:hover { border-color: var(--primary); }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 340px; max-width: 88vw; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); z-index: 400; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px 0; }
.notif-item { padding: 10px 14px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item .notif-title { font-size: 13px; font-weight: 600; }
.notif-item .notif-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-item[data-level="red"] .notif-title { color: var(--red); }
@media (max-width: 820px) { .notif-panel { right: -10px; } }

/* ==================== 重点事项跟踪 ==================== */
.matter-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.matter-summary .stat-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.matter-summary .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.12); }
.matter-filters { margin-bottom: 14px; width: fit-content; }
.matter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.matter-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.matter-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.matter-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--matter-pri, #ea580c); }
.matter-pri-high { --matter-pri: #dc2626; }
.matter-pri-mid { --matter-pri: #ea580c; }
.matter-pri-low { --matter-pri: #16a34a; }
.matter-card.done { opacity: .75; }
.matter-card.done::before { background: #94a3b8; }
.matter-card.overdue { border-color: #fecaca; background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%); }
.matter-card.overdue::before { background: #dc2626; }
.matter-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.matter-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.matter-card-title.done-title { color: var(--muted); text-decoration: line-through; }
.matter-people { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.matter-person { display: inline-flex; align-items: center; gap: 6px; }
.matter-person b { color: var(--text); font-weight: 600; }
.matter-avatar { width: 24px; height: 24px; border-radius: 50%; background: #e0e7ff; color: #3730a3; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.matter-date { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.matter-date .arrow { color: #cbd5e1; }
.matter-timeline { position: relative; height: 8px; background: #eef2f7; border-radius: 999px; margin: 4px 0 2px; }
.matter-timeline .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.matter-timeline .today { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #2563eb; transform: translateX(-50%); box-shadow: 0 1px 3px rgba(15,23,42,.25); }
.matter-timeline .today.over { border-color: #ea580c; }
.matter-result { font-size: 13px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.6; }
.matter-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .matter-grid { grid-template-columns: 1fr; }
  .matter-filters { width: 100%; overflow-x: auto; }
}

/* ==================== 安全培训（卡片式） ==================== */
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.train-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.train-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.train-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.train-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.train-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.train-person { display: inline-flex; align-items: center; gap: 6px; }
.train-person b { color: var(--text); font-weight: 600; }
.train-avatar { width: 24px; height: 24px; border-radius: 50%; background: #dcfce7; color: #15803d; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.train-content { font-size: 13px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.7; white-space: pre-wrap; }
.train-content.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.train-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
.detail-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { flex: 0 0 110px; font-size: 13px; color: var(--muted); font-weight: 600; }
.detail-value { flex: 1; font-size: 13px; line-height: 1.7; word-break: break-word; }
@media (max-width: 820px) {
  .train-grid { grid-template-columns: 1fr; }
  .detail-label { flex-basis: 84px; }
}
/* ==================== 三废处置 ==================== */
.waste-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.waste-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.waste-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.waste-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #16a34a; }
.waste-card.over::before { background: #dc2626; }
.waste-card.done { opacity: .78; }
.waste-card.done::before { background: #94a3b8; }
.waste-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.waste-card-title { font-size: 15px; font-weight: 700; line-height: 1.45; flex: 1; min-width: 0; word-break: break-word; }
.waste-components { font-size: 13px; color: var(--text); line-height: 1.6; }
.waste-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.waste-person { display: inline-flex; align-items: center; gap: 6px; }
.waste-person b { color: var(--text); font-weight: 600; }
.waste-avatar { width: 24px; height: 24px; border-radius: 50%; background: #fef3c7; color: #b45309; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.waste-stock { font-size: 12px; color: var(--text); }
.waste-stock b { font-size: 14px; }
.waste-records { font-size: 12px; color: var(--text); background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; line-height: 1.6; white-space: pre-wrap; }
.waste-actions { display: flex; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .waste-grid { grid-template-columns: 1fr; }
}
/* ==================== 分析数据管理 ==================== */
.ana-list { overflow-x: auto; }
.ana-list table { min-width: 980px; }
.ana-list th { white-space: nowrap; }
.ana-no { font-family: ui-monospace, Consolas, 'Courier New', monospace; font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }
.ana-items { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ana-file { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .ana-list table { min-width: 860px; }
}


/* ============================================================
 * 研发实验记录电子记录本系统 - 扩展样式
 * ============================================================ */
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.small { font-size: 12px; }
.toolbar-title { font-weight: 700; font-size: 15px; }

/* ---------- 总览 ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.dash-grid .stat-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.dash-grid .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.dash-cols.single { grid-template-columns: 1fr; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.panel-head { font-weight: 700; font-size: 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.chart-box { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 6px; overflow-x: auto; }
.chart-col { flex: 1; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.chart-bar { width: 100%; min-width: 6px; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .85; }
.chart-label { font-size: 9px; color: var(--muted); transform: rotate(-45deg); white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.hbar-name { width: 30%; flex: 0 0 30%; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.hfill-red { background: #dc2626; } .hfill-orange { background: #ea580c; } .hfill-green { background: #16a34a; } .hfill-blue { background: #2563eb; } .hfill-gray { background: #94a3b8; } .hfill-purple { background: #7c3aed; }
.hbar-val { width: 28px; text-align: right; font-size: 12px; font-weight: 700; }
.due-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.due-item:hover { background: #f8fafc; }
.due-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.dot-red { background: #dc2626; } .dot-orange { background: #ea580c; } .dot-blue { background: #2563eb; }
.due-txt { flex: 1; font-size: 13px; }
.due-sub { font-size: 12px; color: var(--muted); }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- 项目中心 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.proj-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.proj-card:hover { box-shadow: 0 6px 18px rgba(15,23,42,.12); transform: translateY(-2px); }
.proj-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.proj-code { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: var(--muted); }
.proj-card-name { font-weight: 700; font-size: 15px; margin-bottom: 8px; line-height: 1.45; }
.proj-card-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.proj-card-exp { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.detail-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.detail-card h2 { font-size: 18px; margin: 6px 0 12px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; margin-bottom: 14px; }
.info-grid .span-2 { grid-column: span 2; }
.info-grid label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.proj-progress { margin-top: 6px; font-size: 13px; color: var(--muted); }
.proj-progress .mini-progress { margin-top: 6px; }
.mini-progress.big { min-width: 260px; }
.mini-progress.big .bar-track { height: 12px; }

/* ---------- 实验记录 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.filter-bar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; font-family: inherit; max-width: 260px; }
.exp-detail h2 { margin-top: 4px; }
.exp-section { margin-top: 18px; }
.exp-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); color: #1e40af; }
.exp-text { line-height: 1.8; white-space: normal; }
.conclusion-text { font-weight: 600; color: #15803d; }
.exp-section textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; line-height: 1.7; }
.exp-section textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.step-row { display: flex; gap: 10px; margin-bottom: 8px; }
.step-no { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step-body { flex: 1; font-size: 13px; line-height: 1.7; }
.row-highlight { background: #fef9c3 !important; transition: background .6s; }

/* ---------- 动态表格编辑 ---------- */
.dyn-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; }
.dyn-fields { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.dyn-label { width: 100%; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dyn-fields input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
.dyn-fields textarea { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; width: 100%; box-sizing: border-box; }
.w70 { width: 70px; } .w80 { width: 80px; } .w90 { width: 90px; } .w100 { width: 100px; } .w110 { width: 110px; } .w120 { width: 120px; } .w140 { width: 140px; }
.dyn-fields select.dyn-pick { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; min-width: 220px; max-width: 100%; background: #fff; }
.dyn-table { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.dyn-table-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f1f5f9; }
.tbl-title { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
.dyn-table-cols { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.dyn-col { display: flex; gap: 4px; align-items: center; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 4px; }
.dyn-col input { width: 90px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; font-family: inherit; }
.dyn-col select { padding: 4px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; }
.dyn-table-rows { padding: 8px 10px; }
.dyn-tbl-row { display: flex; gap: 4px; margin-bottom: 4px; align-items: center; }
.dyn-tbl-row input { flex: 1; min-width: 60px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; font-family: inherit; }
.dyn-table-btns { padding: 0 10px 10px; display: flex; gap: 8px; }

/* ---------- 附件 ---------- */
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; background: #f8fafc; }
.file-item.flat { border: 0; padding: 0; background: transparent; margin-bottom: 0; }
.file-thumb-wrap { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.file-thumb { width: 100%; height: 100%; object-fit: cover; }
.file-icon { font-size: 24px; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 4px; flex: 0 0 auto; }

/* ---------- 检索 ---------- */
.search-hero { text-align: center; padding: 30px 20px 20px; }
.search-hero-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.search-big { width: 100%; max-width: 640px; padding: 12px 16px; font-size: 15px; border: 2px solid var(--border); border-radius: 12px; font-family: inherit; }
.search-big:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.search-results { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.search-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.search-item:hover { background: #f8fafc; border-color: #bfdbfe; }
.search-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }

/* ---------- 账号/通用 ---------- */
.chk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400 !important; }
.help-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.audit-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.audit-detail { flex: 1; font-size: 13px; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .proj-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .chk-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
 * 数据优化模块（贝叶斯工艺优化）
 * ============================================================ */
.opt-card .help { margin: -6px 0 12px; }
.opt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.opt-col-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.opt-col-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.opt-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.opt-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; color: var(--text); }
.opt-check input { accent-color: var(--primary); }
.opt-param { max-width: 320px; margin-top: 10px; }
.opt-bounds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.opt-bound-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.opt-bound-name { min-width: 150px; font-weight: 600; color: var(--text); }
.opt-bound-row input { width: 110px; }
.opt-plot { margin-bottom: 0; }
.opt-svg { width: 100%; height: auto; display: block; }
.opt-advice { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text); line-height: 1.6; }
.opt-advice li::marker { color: var(--primary); }
@media (max-width: 860px) {
  .opt-cols { grid-template-columns: 1fr; }
}

/* ============ 在线预览（preview.js） ============ */
.preview-overlay { padding: 24px 16px; align-items: center; }
.preview-modal { max-width: 1180px; width: 96%; height: 92vh; display: flex; flex-direction: column; }
.preview-modal .modal-header { flex: 0 0 auto; }
.preview-modal .pv-body { flex: 1 1 auto; max-height: none; overflow: auto; display: flex; flex-direction: column; background: #f1f5f9; }
.preview-overlay .pv-header h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pv-icon { font-size: 18px; }
.pv-kind { flex: 0 0 auto; }
.pv-head-actions { display: flex; align-items: center; gap: 8px; }
.pv-footer { flex: 0 0 auto; justify-content: flex-start; }
.pv-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 60px 0; }
.pv-loading span { width: 18px; height: 18px; border: 3px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: pv-spin .8s linear infinite; }
 @keyframes pv-spin { to { transform: rotate(360deg); } }
.pv-media { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 200px; padding: 12px; }
.pv-img img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; box-shadow: 0 6px 20px rgba(15,23,42,.15); background: #fff; }
.pv-iframe { flex: 1 1 auto; width: 100%; height: 100%; min-height: 60vh; border: 0; border-radius: 8px; background: #fff; }
.pv-audio { align-items: center; padding: 40px 0; }
.pv-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.pv-office { padding: 4px 6px; }
.pv-text { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; font-size: 14px; line-height: 1.8; overflow: auto; }
.pv-row { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.pv-blank { height: 10px; }
.pv-sheet { margin: 14px 0 8px; color: #2563eb; font-size: 14px; }
.pv-table { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.pv-table table { border-collapse: collapse; width: 100%; min-width: 480px; }
.pv-table th, .pv-table td { border: 1px solid #e2e8f0; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.pv-table th { background: #f8fafc; }
.pv-more { margin: 8px 2px; }
 @media (max-width: 720px) {
  .preview-overlay { padding: 0; align-items: flex-end; }
  .preview-modal { height: 96vh; }
}

/* ==================== 个人工作汇报 ==================== */
.report-list { margin-top: 12px; }
.report-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.report-card.row-highlight { box-shadow: 0 0 0 2px #2563eb; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-avatar { width: 36px; height: 36px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.report-main { flex: 1 1 auto; min-width: 0; }
.report-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.report-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.report-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.report-body { margin-top: 8px; font-size: 13px; line-height: 1.8; color: #334155; white-space: pre-wrap; word-break: break-word; }
.report-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.report-thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #f1f5f9; padding: 0; cursor: pointer; }
.report-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-thumb-edit { cursor: pointer; }
.report-thumb-edit em { position: absolute; top: 2px; right: 2px; background: rgba(220,38,38,.88); color: #fff; font-style: normal; font-size: 10px; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; }
.report-img-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 18px; color: var(--muted); }
.report-detail .detail-head { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.report-text { white-space: pre-wrap; word-break: break-word; }
.search-select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; max-width: 280px; }

/* ==================== 个人工作汇报：审核 / 周报汇总 / 打印归档 ==================== */
.report-review { margin-top: 8px; font-size: 12px; color: #475569; background: #f8fafc; border-radius: 6px; padding: 6px 10px; line-height: 1.7; }
.weekly-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.weekly-toolbar input[type="date"] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.weekly-toolbar .flex-spacer { flex: 1 1 auto; }
.weekly-text { max-width: 280px; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: #475569; }
.print-preview { max-height: 56vh; overflow: auto; font-size: 13px; line-height: 1.8; }
.print-preview .report-thumb { pointer-events: none; }
.print-preview .print-img, .print-preview .report-thumb img { max-width: 160px; max-height: 160px; object-fit: cover; border-radius: 6px; margin: 0 8px 8px 0; }
.print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; padding: 10px 24px; }
  #print-area .print-head { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 8px; }
  #print-area .print-meta { font-size: 12px; color: #555; text-align: center; margin-bottom: 14px; }
  #print-area .print-block { margin-bottom: 12px; page-break-inside: avoid; }
  #print-area .print-block h4 { font-size: 13px; color: #1e40af; border-bottom: 1px solid #cbd5e1; padding-bottom: 4px; margin: 0 0 6px; }
  #print-area .print-text { font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
  #print-area table { border-collapse: collapse; width: 100%; font-size: 12px; }
  #print-area th, #print-area td { border: 1px solid #94a3b8; padding: 5px 8px; text-align: left; vertical-align: top; word-break: break-word; }
  #print-area th { background: #f1f5f9; }
  #print-area .print-img { max-width: 150px; max-height: 150px; object-fit: cover; margin: 0 8px 8px 0; }
}
