/* ============================================================
   FLOW 待办事件系统 · 基础设计系统
   设计令牌与通用组件样式(后续 flow.css / app.css / responsive.css 增量叠加)
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  /* 语义色:蓝=信息 / 橙=警示 / 绿=成功 / 紫=标签 / 红=错误 */
  --blue: #2563eb;   --blue-bg: #eff6ff;
  --orange: #f59e0b; --orange-bg: #fffbeb;
  --green: #10b981;  --green-bg: #ecfdf5;
  --purple: #8b5cf6; --purple-bg: #f5f3ff;

  --red: #ef4444;   --red-bg: #fef2f2;
  --gray: #6b7280;  --gray-bg: #f3f4f6;
  --amber: #d97706;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 图标(SVG 线性图标,全站禁用 emoji) ---------- */
.ico { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; display: inline-block; }
.ico-sm { width: 13px; height: 13px; vertical-align: -2px; }
.ico-lg { width: 20px; height: 20px; vertical-align: -4px; }
.ico-xl { width: 24px; height: 24px; }
.icon-btn .ico { width: 18px; height: 18px; }
.searchbox .ico { width: 15px; height: 15px; color: var(--text-3); }
.ticon .ico { width: 22px; height: 22px; }
.m-ico .ico { width: 18px; height: 18px; }
.attach-card .thumb .ico { width: 22px; height: 22px; color: var(--text-3); }
.empty .ico { width: 36px; height: 36px; color: var(--text-3); }

/* 类型图标色块(替代内联 style 的推荐写法) */
.ticon.blue { background: var(--blue-bg); color: var(--blue); }
.ticon.orange { background: var(--orange-bg); color: var(--amber); }
.ticon.green { background: var(--green-bg); color: #059669; }
.ticon.purple { background: var(--purple-bg); color: var(--purple); }
.ticon.gray { background: var(--gray-bg); color: var(--text-2); }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 24px; height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
.brand small { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 2px; }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; white-space: nowrap;
}
.topnav a:hover { background: var(--gray-bg); text-decoration: none; color: var(--text); }
.topnav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.searchbox {
  display: flex; align-items: center; background: var(--gray-bg);
  border: 1px solid transparent; border-radius: 8px; padding: 0 10px; height: 34px; width: 240px;
}
.searchbox input { border: none; background: none; outline: none; flex: 1; font-size: 13px; }
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
  color: var(--text-2); background: none; border: none; cursor: pointer;
}
.icon-btn:hover { background: var(--gray-bg); }
.dot {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 8px; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #6366f1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}

/* ---------- 页面容器 ---------- */
.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 700; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.breadcrumb { color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.breadcrumb a { color: var(--text-3); }

/* ---------- 概况卡片 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: block; color: var(--text);
}
.stat-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.stat-card .label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.stat-card .hint { color: var(--text-3); font-size: 12px; }
.stat-card.danger .value { color: var(--red); }
.stat-card.warn .value { color: var(--amber); }
.stat-card.primary .value { color: var(--primary); }

/* ---------- 筛选栏 ---------- */
.filters {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.filters .fgroup { display: flex; align-items: center; gap: 8px; }
.filters .flabel { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.filters select, .filters input[type="text"] {
  height: 32px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 0 8px; font-size: 13px; background: var(--card); color: var(--text); outline: none;
}
.filters .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--gray-bg); border-radius: 8px; padding: 2px; }
.seg a { padding: 4px 12px; border-radius: 6px; color: var(--text-2); font-size: 13px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.active { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--card); color: var(--text-2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #059669; color: #fff; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 10px;
  border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.blue    { background: var(--blue-bg);   color: var(--blue); }
.badge.orange  { background: var(--orange-bg); color: var(--amber); }
.badge.green   { background: var(--green-bg);  color: #059669; }
.badge.purple  { background: var(--purple-bg); color: var(--purple); }
.badge.red     { background: var(--red-bg);    color: var(--red); }
.badge.gray    { background: var(--gray-bg);   color: var(--text-2); }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 待办卡片 ---------- */
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start;
}
.todo-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.todo-card .ticon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.todo-card .tmain { flex: 1; min-width: 0; }
.todo-card .ttitle { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-card .ttitle .no { color: var(--text-3); font-weight: 400; font-size: 12.5px; }
.todo-card .tmeta { display: flex; gap: 16px; color: var(--text-3); font-size: 12.5px; margin-top: 4px; flex-wrap: wrap; }
.todo-card .tmeta .due-red { color: var(--red); font-weight: 600; }
.todo-card .tmeta .due-warn { color: var(--amber); font-weight: 600; }
.todo-card .tfoot { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.todo-card .tlast { color: var(--text-3); font-size: 12.5px; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-card .tacts { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.todo-card:hover .tacts { opacity: 1; }

/* 完成度 */
.progress-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 200px; }
.progress { flex: 1; height: 6px; background: var(--gray-bg); border-radius: 3px; overflow: hidden; max-width: 160px; }
.progress .bar { height: 100%; border-radius: 3px; background: var(--primary); }
.progress .bar.green { background: var(--green); }
.progress .bar.orange { background: var(--orange); }
.progress .bar.red { background: var(--red); }
.progress-num { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* ---------- 详情布局 ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.detail-layout > div { min-width: 0; }
.detail-layout > .main { min-width: 0; }
@media (max-width: 1100px) { .detail-layout { grid-template-columns: 1fr; } }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h3 .hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.side-panel .panel { padding: 16px; }

/* 信息描述列表 */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; }
.info-item .k { color: var(--text-3); font-size: 12.5px; }
.info-item .v { font-size: 14px; margin-top: 2px; word-break: break-all; }

/* ---------- 进度时间线 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--primary);
}
.tl-item.kind-note::before { border-color: var(--gray); }
.tl-item.kind-status::before { border-color: var(--green); }
.tl-item.kind-warn::before { border-color: var(--red); }
.tl-item .tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-item .tl-author { font-weight: 600; font-size: 13px; }
.tl-item .tl-time { color: var(--text-3); font-size: 12px; }
.tl-item .tl-body { margin-top: 4px; color: var(--text-2); font-size: 13.5px; }
.tl-item .tl-extra { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 评论 ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; }
.comment .c-author { font-weight: 600; font-size: 13px; }
.comment .c-time { color: var(--text-3); font-size: 12px; }
.comment .c-text { margin-top: 3px; color: var(--text-2); font-size: 13.5px; }
.comment .c-acts { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.comment.reply { margin-left: 44px; background: var(--gray-bg); border-radius: 8px; padding: 10px 12px; border-bottom: none; margin-top: 8px; }
.comment-input { display: flex; gap: 10px; margin-top: 12px; }
.comment-input textarea {
  flex: 1; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13.5px; resize: vertical; font-family: inherit; outline: none; min-height: 64px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px; background: #fafafa; color: var(--text-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafafa; }
.table .row-danger td { background: var(--red-bg); }

/* ---------- 表单 ---------- */
.form { max-width: 860px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.form-item label .req { color: var(--red); margin-left: 2px; }
.form-item input[type="text"], .form-item input[type="date"], .form-item input[type="number"],
.form-item input[type="password"],
.form-item select, .form-item textarea {
  width: 100%; height: 34px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13.5px; font-family: inherit; outline: none; background: var(--card); color: var(--text);
}
.form-item textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 72px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-item .help { color: var(--text-3); font-size: 12px; margin-top: 4px; }

/* 不可修改输入框(如用户名/部门):灰色禁用态 */
.form-item input:disabled, .form-item select:disabled, .form-item input[readonly] {
  background: var(--gray-bg); color: var(--text-3); cursor: not-allowed;
}
.form-item input:disabled:focus, .form-item select:disabled:focus, .form-item input[readonly]:focus {
  border-color: var(--border-2); box-shadow: none;
}

/* 密码输入框:眼睛切换显示/隐藏 */
.pw-wrap { position: relative; }
.pw-wrap input[type="password"] { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; background: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer; border-radius: 6px;
}
.pw-toggle:hover { color: var(--text-2); background: var(--gray-bg); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .ico-eye-off { display: none; }
.pw-toggle.is-visible .ico-eye-on { display: none; }
.pw-toggle.is-visible .ico-eye-off { display: block; }
.form-section { font-size: 14px; font-weight: 700; margin: 22px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; }
.check-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); font-weight: 400; cursor: pointer; }
.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 400; cursor: pointer; }

/* 清单编辑(静态展示) */
.checklist { list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.checklist li:hover { background: #fafafa; }
.checklist .ck { width: 16px; height: 16px; border: 1.5px solid var(--border-2); border-radius: 4px; flex-shrink: 0; }
.checklist .ck.checked { background: var(--primary); border-color: var(--primary); position: relative; }
.checklist .ck.checked::after {
  content: "✓"; color: #fff; font-size: 11px; position: absolute; top: -1px; left: 2px; font-weight: 700;
}
.checklist .cktxt { flex: 1; }
.checklist .cktxt.done { color: var(--text-3); text-decoration: line-through; }
.checklist .grp { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin: 10px 0 4px; display: flex; align-items: center; gap: 6px; }
.checklist .grp::before { content: "▾"; }
.checklist .act { color: var(--text-3); font-size: 12px; visibility: hidden; }
.checklist li:hover .act { visibility: visible; }
.checklist .who { color: var(--text-3); font-size: 12px; }
/* 来自事件的待办:整行可点击跳转事件详情 */
.checklist[data-item-id] li { cursor: pointer; }
.checklist .todo-link { color: var(--text); text-decoration: none; }
.checklist .todo-link:hover { color: var(--primary); text-decoration: underline; }
.checklist .todo-link.done { color: var(--text-3); text-decoration: line-through; }
.checklist .todo-link.done:hover { color: var(--primary); text-decoration: underline; }
.checklist[data-item-id] li:hover .todo-link { color: var(--primary); }

/* ---------- 附件 ---------- */
.attach-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.attach-card {
  width: 96px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card);
}
.attach-card .thumb { height: 64px; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.attach-card .name { font-size: 11px; padding: 4px 6px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12.5px; background: var(--card);
}

/* ---------- 看板 ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.kanban-col { background: #eef0f3; border-radius: var(--radius); padding: 10px; }
.kanban-col .kc-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 13.5px; }
.kanban-col .kc-count { background: var(--border); border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.kanban-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.kanban-card:hover { box-shadow: var(--shadow-lg); }
.kanban-card .kc-title { font-weight: 600; font-size: 13.5px; margin: 6px 0 4px; }
.kanban-card .kc-meta { color: var(--text-3); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.kanban-card .kc-meta .due-red { color: var(--red); font-weight: 600; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cal-dow { background: #fafafa; text-align: center; padding: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; font-size: 12.5px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell .date { color: var(--text-3); font-size: 12px; }
.cal-cell.today { background: var(--primary-light); }
.cal-cell.today .date { color: var(--primary); font-weight: 700; }
.cal-item {
  display: block; border-radius: 5px; padding: 2px 6px; margin-top: 4px; font-size: 12px;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item:hover { text-decoration: none; filter: brightness(.95); }
.cal-item.blue { background: var(--blue-bg); border-left: 3px solid var(--blue); color: var(--blue); }
.cal-item.orange { background: var(--orange-bg); border-left: 3px solid var(--orange); color: var(--amber); }
.cal-item.green { background: var(--green-bg); border-left: 3px solid var(--green); color: #059669; }
.cal-item.purple { background: var(--purple-bg); border-left: 3px solid var(--purple); color: var(--purple); }
.cal-item.overdue { background: var(--red-bg); border-left: 3px solid var(--red); color: var(--red); }

/* ---------- 消息中心 ---------- */
.msg-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.msg-nav { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.msg-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; }
.msg-nav a:hover { background: var(--gray-bg); text-decoration: none; }
.msg-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.msg-nav .cnt { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; height: 18px; display: inline-flex; align-items: center; }
.msg-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.msg-item:last-child { border-bottom: none; }
.msg-item.unread { background: var(--primary-light); }
.msg-item .m-ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.msg-item .m-body { flex: 1; min-width: 0; }
.msg-item .m-text { font-size: 13.5px; }
.msg-item .m-text b { font-weight: 600; }
.msg-item .m-src { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.msg-item .m-time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.msg-item .m-acts { margin-top: 6px; display: flex; gap: 12px; font-size: 12px; color: var(--text-3); }

/* ---------- 弹层(静态展示) ---------- */
.modal-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(17,24,39,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px;
}
.modal {
  background: var(--card); border-radius: 12px; width: 640px; max-width: 100%;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.modal .m-body { padding: 18px 20px; max-height: 65vh; overflow-y: auto; }
.modal .m-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 标签 / 小工具 ---------- */
.tag { display: inline-block; background: var(--gray-bg); color: var(--text-2); border-radius: 4px; padding: 1px 8px; font-size: 12px; }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.green { background: var(--green-bg); color: #059669; }
.tag.orange { background: var(--orange-bg); color: var(--amber); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.red { background: var(--red-bg); color: var(--red); }
.empty { text-align: center; color: var(--text-3); padding: 48px 0; }
.empty .e-ico { font-size: 40px; margin-bottom: 8px; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination a { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; background: var(--card); }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.pagination a.active:hover { color: #fff; }

/* ---------- 统计 ---------- */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k-label { color: var(--text-3); font-size: 12.5px; }
.kpi .k-value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.kpi .k-value small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.kpi .k-trend { font-size: 12px; margin-top: 2px; }
.kpi .k-trend.up { color: var(--red); }
.kpi .k-trend.down { color: var(--green); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-row .b-label { width: 120px; color: var(--text-2); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .b-track { flex: 1; height: 16px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; }
.bar-row .b-fill { height: 100%; border-radius: 4px; }
.bar-row .b-val { width: 64px; text-align: right; color: var(--text-2); flex-shrink: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }

/* ---------- 管理侧栏布局 ---------- */
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-nav { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.side-nav a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; }
.side-nav a:hover { background: var(--gray-bg); text-decoration: none; }
.side-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.side-nav .sn-group { font-size: 12px; color: var(--text-3); padding: 10px 12px 4px; font-weight: 600; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 60%, #4f46e5 100%);
}
.login-card { background: var(--card); border-radius: 14px; width: 380px; padding: 36px 32px; box-shadow: var(--shadow-lg); }
.login-card .brand { justify-content: center; margin-bottom: 6px; font-size: 18px; }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 24px; }
.login-field { margin-bottom: 14px; }
.login-field label { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 5px; }
.login-field input {
  width: 100%; height: 38px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 14px; outline: none;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.login-tip { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 16px; }

/* ---------- 其他 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--text-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.alert { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.alert.red { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.alert.amber { background: var(--orange-bg); color: var(--amber); border: 1px solid #fde68a; }
.alert.green { background: var(--green-bg); color: #059669; border: 1px solid #a7f3d0; }
.alert.blue { background: var(--blue-bg); color: var(--blue); border: 1px solid #bfdbfe; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; gap: 8px; align-items: center; } .flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.footer-tip { text-align: center; color: var(--text-3); font-size: 12px; padding: 24px 0 8px; }
