:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --bg: #f5f7fb;
  --sidebar-bg: #1e2a3a;
  --sidebar-text: #cbd5e1;
  --card-bg: #ffffff;
  --surface: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

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

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

.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
.muted { color: var(--text-light); font-size: 13px; line-height: 1.7; }
.sub-title { font-size: 14px; margin-bottom: 12px; font-weight: 600; }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 48px 40px; width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.logo-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
}
.logo-mark.small { width: 34px; height: 34px; font-size: 18px; border-radius: 8px; }
.logo-img { height: 56px; width: auto; display: block; }
.sidebar-logo-img { height: 36px; width: auto; }
.login-title h1 { font-size: 22px; margin-bottom: 4px; }
.login-title p { font-size: 12px; color: var(--text-light); }
.form-item { margin-bottom: 20px; }
.form-item label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-item input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none; transition: border .2s;
}
.form-item input:focus { border-color: var(--primary); }
.btn-primary {
  background: var(--primary); color: #fff; border: none; padding: 12px;
  border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-block { width: 100%; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-light); text-align: center; }
.login-links { margin-top: 12px; text-align: right; }
.login-links a { font-size: 13px; color: var(--primary); text-decoration: none; cursor: pointer; }
.login-links a:hover { text-decoration: underline; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; min-width: 0; width: auto; }
.captcha-row img { height: 46px; width: 112px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; background: #f5f7fa; object-fit: cover; }

/* ===== 主界面布局 ===== */
/* 侧边栏固定：整页 100vh、隐藏溢出，右侧内容在 .view-container 内独立滚动，侧边栏不随之滚动 */
.main-page { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 224px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; flex-shrink: 0; height: 100vh;
  transition: width .25s ease; overflow: hidden;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; color: #fff; font-weight: 600; font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-group { }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px 7px; font-size: 11px; color: #64748b; letter-spacing: 1px;
  cursor: pointer; user-select: none; transition: color .15s;
}
.nav-group-title:hover { color: #a5b4c8; }
.nav-group-arrow { font-size: 10px; line-height: 1; transition: transform .2s ease; }
.nav-group-title.collapsed .nav-group-arrow { transform: rotate(-90deg); }
/* 常驻分组（工作台）：始终展开、不可折叠 */
.nav-group.pinned .nav-group-title { cursor: default; }
.nav-group.pinned .nav-group-title:hover { color: #64748b; }
.nav-group.pinned .nav-group-arrow { display: none; }
.nav-group-items { overflow: hidden; }
.nav-group-items.hidden { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer; font-size: 14px; transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item i { font-style: normal; width: 18px; text-align: center; }
.nav-item .nav-label { flex: 1; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #e5484d; color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
  flex-shrink: 0;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(37,99,235,0.28); color: #fff; border-left-color: var(--primary-light); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-trigger {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: -4px -6px;
  transition: background .15s;
}
.profile-trigger:hover { background: rgba(255,255,255,0.07); }
.user-info { flex: 1; min-width: 0; }
.user-info div:first-child { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info div:last-child { font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: none; border: 1px solid rgba(255,255,255,0.2); color: #cbd5e1;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
  flex-shrink: 0; white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===== 内容区 ===== */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.date { color: var(--text-light); }
.badge { background: #fef3c7; color: var(--warning); padding: 6px 12px; border-radius: 20px; font-size: 12px; }
.view-container { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== 卡片 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--card-bg); border-radius: 12px; padding: 20px; border: 1px solid var(--border); }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-delta { font-size: 12px; margin-top: 6px; color: var(--text-light); }
/* 考勤页统计卡：一行四卡 + 可点击下钻 */
.cards.att-cards { grid-template-columns: repeat(4, 1fr); }
.cards.att-cards .stat-card { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.cards.att-cards .stat-card:hover { box-shadow: 0 4px 14px rgba(31,78,160,.14); transform: translateY(-1px); }
.stat-card .stat-more { font-size: 11px; margin-top: 8px; color: #2f6fed; }
@media (max-width: 1024px) { .cards.att-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .cards.att-cards { grid-template-columns: 1fr 1fr; gap: 10px; } .stat-card .stat-more { display: none; } }
.up { color: #dc2626; }
.down { color: #16a34a; }

.panel { background: #fff; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 16px; }
.panel-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between;
}
.panel-extra { font-weight: 400; font-size: 13px; color: var(--text-light); }
.panel-body { padding: 20px; }
.highlight {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  border-radius: 10px; padding: 14px 18px; font-size: 13px; line-height: 1.8; margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f9fafb; font-weight: 600; color: var(--text-light); }
tr:hover { background: #f8fafc; }
.empty { text-align: center; color: #9ca3af; padding: 32px 0; font-size: 13px; }
.loading { text-align: center; color: var(--text-light); padding: 60px 0; }
/* 合同列表：锁定表头（sticky，滚动时列名固定在顶部） */
.ct-table { border-collapse: separate; border-spacing: 0; }
.ct-table thead th { position: sticky; top: 0; z-index: 3; background: #f9fafb; box-shadow: 0 1px 0 var(--border); }

/* ===== 分页控件 ===== */
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 2px 2px; flex-wrap: wrap; }
.pager-info { color: var(--text-light); font-size: 13px; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn {
  min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--border);
  background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text);
  transition: all .15s;
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-ellipsis { color: var(--text-light); padding: 0 2px; }
.pager-size { margin-left: auto; color: var(--text-light); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.page-size-select { height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-size: 13px; background: #fff; color: var(--text); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-yellow { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-purple { background: #f3e8ff; color: #7c3aed; }

/* 阶段173：员工档案提示条 */
.notice-warn { background: #fff7e6; border: 1px solid #ffd591; color: #b45309; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }
.notice-ok { background: #f6ffed; border: 1px solid #b7eb8f; color: #166534; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }

.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { color: #d9534f; border-color: #f5c6cb; }
.btn.danger:hover { background: #fdecea; border-color: #d9534f; color: #d9534f; }
.btn-primary-sm { background: var(--primary); color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-primary-sm:hover { background: #1d4ed8; }
.btn-row { margin-top: 16px; text-align: right; }
.link { color: var(--primary); cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== 待办列表 ===== */
.todo-list { list-style: none; }
.todo-list li { padding: 10px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.todo-list li:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-red { background: #dc2626; }
.dot-yellow { background: #d97706; }
.dot-blue { background: #2563eb; }
.dot-green { background: #16a34a; }

/* ===== 个人成长 ===== */
.growth-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.growth-row:last-child { border-bottom: none; }
.growth-row b { font-size: 18px; }

/* ===== 打卡卡片 ===== */
.punch-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .punch-card { grid-template-columns: 1fr; } }
.punch-item { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: #fafbfc; }
.punch-label { font-weight: 600; margin-bottom: 8px; }
.punch-desc { font-size: 12px; color: var(--text-light); margin-bottom: 14px; line-height: 1.6; }

/* ===== 读书卡片 ===== */
.reading-card { border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 10px; padding: 20px; }
.reading-type { font-size: 13px; color: var(--primary); margin-bottom: 8px; }
.reading-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }

/* ===== 组织树 ===== */
.org-tree { list-style: none; }
.org-tree .org-tree { margin-left: 24px; border-left: 1px dashed #cbd5e1; padding-left: 16px; }
.org-node {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin: 6px 0; border: 1px solid var(--border);
  border-radius: 8px; background: #fafbfc;
}
.org-node.org-root { background: #eff6ff; border-color: #bfdbfe; }
.org-node-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.org-node-title { display: flex; align-items: center; gap: 6px; }
.org-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px; cursor: pointer;
  background: #eef2f6; color: #475569; font-size: 12px; line-height: 1;
  flex-shrink: 0; user-select: none; transition: background .15s;
}
.org-toggle:hover { background: #dbe4ee; }
.org-node-ops { display: flex; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.org-meta { font-size: 12px; color: var(--text-light); }
.org-func-desc {
  font-size: 12px; line-height: 1.55; color: var(--text-light);
  margin-top: 4px; padding: 5px 10px 5px 12px;
  border-left: 3px solid var(--primary); background: #f1f5f9;
  border-radius: 0 4px 4px 0; max-width: 640px;
}
.org-roster {
  display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 6px;
  padding: 6px 10px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 6px;
}
.org-roster-item { font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 3px; }
.org-roster-item.roster-leader { font-weight: 600; color: var(--primary); }
.org-hit { background: #fff3cd; color: #92400e; border-radius: 3px; padding: 0 3px; box-shadow: 0 0 0 1px #f59e0b inset; }
.pt-tag {
  font-style: normal; font-size: 10px; line-height: 1; padding: 1px 4px; border-radius: 4px;
  background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; margin-left: 2px;
}

/* ===== 角色编辑弹窗：菜单权限树 ===== */
.perm-section { margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 320px; overflow: auto; background: #fafbfc; }
.perm-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.perm-head .muted { font-weight: 400; }
.perm-all { display: flex; align-items: center; gap: 4px; font-weight: 500; cursor: pointer; }
.perm-tree { list-style: none; }
.perm-tree .perm-tree { margin-left: 16px; border-left: 1px dashed #cbd5e1; padding-left: 10px; }
.perm-node { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 14px; cursor: pointer; }
.perm-node input { cursor: pointer; flex-shrink: 0; }

/* ===== 部门编辑弹窗：成员管理 ===== */
.modal-hr { border: none; border-top: 1px solid var(--border); margin: 18px 0 14px; }
.member-section { margin-top: 4px; }
.member-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.member-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.member-add-row select { flex: 1; min-width: 0; }
.member-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; background: #fafbfc;
}
.member-row .muted { font-size: 12px; }
.member-order { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; line-height: 1; }
.member-order .link { font-size: 13px; padding: 0 3px; }
.review-action { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.review-action:last-child { border-bottom: none; }
.review-action .muted { font-size: 12px; }
.review-action input { font-size: 12px; padding: 4px 8px; }
.member-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-tags { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.member-add-panel { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafbfc; margin-bottom: 12px; }
.member-add-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.member-add-head .link { font-weight: 500; }
.org-candidate-list { max-height: 220px; overflow: auto; margin-bottom: 10px; }
.cand-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.cand-row:hover { background: #eef2f6; }
.cand-row input { cursor: pointer; flex-shrink: 0; }
.cand-row .muted { font-size: 12px; }
.cand-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-sels { display: flex; gap: 6px; flex-shrink: 0; }
.cand-sels select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); max-width: 128px; }
.member-sels { display: flex; gap: 6px; flex-shrink: 0; }
.member-sels select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); max-width: 132px; }
.member-sels select:disabled { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }
.primary-toggle { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-light); white-space: nowrap; cursor: pointer; }
.primary-toggle input { cursor: pointer; margin: 0; }

/* ===== 阶段152：窄屏（手机竖屏）部门编辑弹窗——名字永远可见，控件组整体换行 =====
   此前 .member-sels（全职+职级+岗位 ≈310px, flex-shrink:0）在窄屏把 .member-name 挤成 0 宽，
   用户竖屏看不到成员名字。修法：窄屏允许换行——第一行=排序箭头+名字+移除，第二行=控件组占满。 */
@media (max-width: 640px) {
  .member-row { flex-wrap: wrap; gap: 6px 10px; }
  .member-name { flex: 1 1 auto; }
  .member-sels { flex: 1 1 100%; }
  .member-sels select { flex: 1 1 0; min-width: 0; max-width: none; }
  .cand-row { flex-wrap: wrap; }
  .cand-name { flex: 1 1 calc(100% - 32px); }
  .cand-sels { flex: 1 1 100%; padding-left: 24px; }
  .cand-sels select { flex: 1 1 0; min-width: 0; max-width: none; }
}

/* ===== 多任职行（用户管理 / 花名册 / 通讯录） ===== */
.asg-line { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 13px; line-height: 1.5; flex-wrap: wrap; }
.asg-dept { font-weight: 500; color: var(--text); }
.asg-post { color: var(--text-light); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; z-index: 9999; opacity: 0; pointer-events: none; transition: all .3s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2); max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.warn { background: #d97706; }

/* ===== 流程中心 ===== */
.flow-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px; background: #fafbfc; transition: border-color .2s;
}
.flow-item:hover { border-color: #bfdbfe; background: #f8faff; }
.flow-item:last-child { margin-bottom: 0; }
.flow-type {
  flex-shrink: 0; min-width: 44px; text-align: center;
  background: #eff6ff; color: var(--primary); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; font-weight: 600;
}
.flow-body { flex: 1; }
.flow-title { font-weight: 600; margin-bottom: 4px; }

/* ===== 标签组（chips） ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; color: var(--text); background: #fff;
  cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }

/* ===== 日程时间轴 ===== */
.timeline { position: relative; padding-left: 8px; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: 63px; top: 16px; bottom: 0;
  width: 2px; background: #e5e7eb;
}
.tl-item:last-child::before { display: none; }
.tl-time { flex-shrink: 0; width: 52px; font-size: 13px; font-weight: 600; color: var(--primary); padding-top: 2px; }
.tl-dot {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); margin-top: 5px; border: 2px solid #fff; box-shadow: 0 0 0 2px #bfdbfe;
}
.tl-body { flex: 1; padding-top: 1px; line-height: 1.5; }

/* ===== 知识中心 ===== */
.knowledge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
@media (max-width: 700px) { .knowledge-list { grid-template-columns: 1fr; } }
.knowledge-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fafbfc;
}
.knowledge-title { font-weight: 600; margin-bottom: 6px; }
.knowledge-card .muted { margin-bottom: 10px; }

/* ===== 标签页 Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* sheet 切换（弹窗/面板内嵌的小标签组） */
.sheet-tabs { display: inline-flex; gap: 4px; margin: 0 0 10px 0; padding: 3px;
  background: var(--bg, #f7f8fa); border-radius: 8px; }
.sheet-tabs-mini { margin-bottom: 10px; }
.sheet-tab {
  padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-light); border-radius: 6px; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.sheet-tab:hover { background: rgba(64,158,255,.08); color: var(--primary); }
.sheet-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.sheet-count {
  display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px;
  font-size: 11px; font-weight: 600; background: rgba(0,0,0,.06); color: var(--text-light);
}
.sheet-count.active { background: rgba(255,255,255,.25); color: #fff; }

/* 字段实时校验提示 */
.field-tip { font-size: 12px; color: var(--text-light); margin-top: 4px; min-height: 16px; }
.field-tip-warn { color: #e6a23c; }

/* ===== 表单输入（modal 内） ===== */
.form-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 56px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check label { margin: 0; font-weight: 400; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input { width: auto; }
.check-group { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 2px 0; }
.check-inline { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; cursor: pointer; }
.check-inline input { width: auto; margin: 0; cursor: pointer; }
.req { color: var(--danger); font-weight: 600; margin-left: 2px; }

/* ===== 统一表单校验错误高亮 ===== */
.form-item.has-error .form-input { border-color: var(--danger) !important; }
.form-item.has-error .form-input:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.form-item.has-error { animation: field-shake .2s; }
.field-err { color: var(--danger); font-size: 12px; margin-top: 5px; line-height: 1.4; }
@keyframes field-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ===== 配置中心：流程节点拖拽配置 ===== */
.flow-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.flow-step { background: var(--primary-light, #eef4ff); color: var(--text); padding: 4px 10px; border-radius: 16px; font-size: 13px; }
.flow-node { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 8px; border: 1px dashed var(--border); border-radius: 8px; background: #fff; }
.flow-node:hover { border-color: var(--primary); }
.flow-node-handle { cursor: grab; color: var(--text-light); font-size: 18px; user-select: none; padding: 0 2px; }
.flow-node-order { min-width: 20px; height: 20px; line-height: 20px; text-align: center; background: var(--primary); color: #fff; border-radius: 50%; font-size: 12px; }
.link.danger { color: var(--danger); }

/* ===== 搜索栏（CRM 列表视图） ===== */
.search-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 16px;
}
.search-bar .form-input { width: auto; }
.search-bar .btn-primary-sm, .search-bar .btn { white-space: nowrap; }

/* ===== 弹窗 Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn .15s;
}
.modal-box {
  position: relative; background: #fff; border-radius: 12px; width: 460px; max-width: calc(100vw - 32px);
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-box-lg { width: 880px; max-height: 92vh; }
.modal-box-xl { width: 1080px; max-height: 94vh; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; color: var(--text-light); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: #f3f4f6; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-body .form-item { margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }
.modal-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 5; }
.modal-resize::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px;
  border-right: 2px solid #cbd5e1; border-bottom: 2px solid #cbd5e1; border-radius: 0 0 2px 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ 角色调整弹窗：卡片网格 ============ */
.role-subtitle { font-size: 13px; color: var(--text-light); padding: 12px 20px 0; }
.role-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.role-toolbar-info { color: var(--text-light); font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 0 20px 20px; }
.role-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  background: #fafbfc; transition: all .15s; position: relative;
  display: flex; flex-direction: column; gap: 8px; min-height: 120px;
}
.role-card:hover { border-color: #3b82f6; background: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.12); transform: translateY(-1px); }
.role-card.disabled { opacity: .55; background: #f5f5f5; }
.role-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.role-card-name { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }
.role-card-code { font-family: 'Consolas', 'Monaco', monospace; font-size: 11px; color: var(--text-light); background: #eef2f7; padding: 1px 6px; border-radius: 4px; }
.role-card-desc { font-size: 12px; color: var(--text-light); line-height: 1.5; flex: 1; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.role-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-light); border-top: 1px dashed var(--border); padding-top: 8px; }
.role-card-ops { display: flex; gap: 10px; }
.role-card-ops .link { font-size: 12px; }
.role-empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.role-empty-icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.role-form-tip { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.role-color-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ============ 移动端 / PAD 响应式适配 ============ */
/* 汉堡按钮 & 遮罩（默认隐藏，仅在窄屏启用） */
.menu-toggle {
  display: inline-block; background: none; border: none; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--text); padding: 4px 8px; margin-right: 6px;
  border-radius: 6px; flex-shrink: 0;
}
.menu-toggle:hover { background: #f3f4f6; }
/* ===== 桌面/横屏（>768px）：三杠折叠侧栏（全局通用），释放横向空间给数据表格 ===== */
@media (min-width: 769px) {
  .main-page.sidebar-collapsed .sidebar { width: 0; }
  .main-page.sidebar-collapsed .sidebar > * { display: none; }
}
.sidebar-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 1090; opacity: 0; transition: opacity .28s ease; pointer-events: none;
}
.sidebar-mask.show { opacity: 1; pointer-events: auto; }

/* 触屏优化 */
* { -webkit-tap-highlight-color: transparent; }

/* ===== PAD 横屏 / 小桌面 (≤1024px) ===== */
@media (max-width: 1024px) {
  .sidebar { width: 200px; }
  .view-container { padding: 16px; }
  .topbar { padding: 0 16px; }
  .role-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* ===== 手机横屏 / PAD 竖屏 (≤768px)：侧边栏变抽屉 ===== */
@media (max-width: 768px) {
  .menu-toggle { display: inline-block; }
  input, select, textarea { font-size: 16px; } /* 避免 iOS 聚焦自动放大 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1100;
    width: 260px; transform: translateX(-100%); transition: transform .28s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 32px rgba(0,0,0,.35); }
  .sidebar-mask { display: block; }
  .topbar { height: 52px; padding: 0 12px; }
  .topbar-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .view-container { padding: 12px; }
  /* 表格横向滚动 */
  .panel-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-body table { min-width: 660px; }
  /* 搜索栏：输入项占满整行 */
  .search-bar { padding: 10px 12px; gap: 8px; }
  .search-bar .form-input { flex: 1 1 100%; width: auto !important; max-width: none !important; }
  /* 卡片网格 2 列 */
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .role-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 0 12px 12px; gap: 10px; }
  /* 弹窗近全屏 */
  .modal-box, .modal-box-lg, .modal-box-xl { width: 100%; max-width: calc(100vw - 24px); max-height: 92vh; }
  .modal-resize { display: none; }
  /* 工作台 hero：移动端改为垂直紧凑布局，避免 greeting 被压成竖排单字 */
  .workbench-hero { flex-direction: column; align-items: stretch; padding: 14px 14px; gap: 10px; margin-bottom: 12px; }
  .hero-left { width: 100%; }
  .hero-greet { font-size: 16px; white-space: normal; }
  .hero-date { font-size: 12px; line-height: 1.4; }
  .hero-search { width: 100%; min-width: 0; }
  .hero-search input { font-size: 14px; padding: 7px 10px; }
  .hero-search .btn-primary-sm { padding: 6px 12px; font-size: 13px; }
  /* 工作台卡片紧凑化 */
  .wb-cards { grid-template-columns: 1fr; gap: 10px; }
  .wb-card { padding: 12px 14px; }
  .wb-card-head { font-size: 13px; margin-bottom: 8px; }
  .wb-mini { font-size: 12px; }
  .wb-mini b { font-size: 15px; }
  /* 工作台快捷入口 */
  .wb-quick-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .wb-quick { padding: 10px 6px; }
  .wb-quick-icon { font-size: 22px; }
  .wb-quick-name { font-size: 11px; }
  /* 百日奋战：移动端隐藏页头副标题（超长说明文字，桌面端保留） */
  .bf-sub { display: none; }
}

/* ===== 手机竖屏 (≤480px) ===== */
@media (max-width: 480px) {
  .login-box { width: 100%; max-width: 340px; padding: 32px 24px; margin: 14px; }
  .login-logo { margin-bottom: 24px; }
  .login-title h1 { font-size: 20px; }
  .panel-header { padding: 12px 14px; font-size: 14px; }
  .panel-body { padding: 12px; }
  th, td { padding: 9px 10px; font-size: 12px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card .stat-value { font-size: 22px; }
  .role-grid { grid-template-columns: 1fr; }
  .topbar-right .date { display: none; }
  .badge { padding: 4px 10px; font-size: 11px; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px; }
  .org-tree .org-tree { margin-left: 12px; padding-left: 10px; }
  .org-node-ops { flex-direction: column; gap: 4px; }
  /* 工作台 hero：更紧凑 */
  .workbench-hero { padding: 12px 12px; gap: 8px; border-radius: 8px; }
  .hero-greet { font-size: 15px; }
  .hero-greet b { font-weight: 600; }
  .hero-date { font-size: 11px; line-height: 1.5; }
  .hero-search input { font-size: 13px; padding: 6px 10px; }
  .hero-search .btn-primary-sm { padding: 6px 10px; font-size: 12px; }
  /* 统计卡：缩字 */
  .stat-card .stat-label { font-size: 11px; }
  /* 表单按钮：更紧凑 */
  .btn, .btn-primary, .btn-primary-sm { padding: 6px 12px; font-size: 13px; }
}

/* ===== 手机横屏（高度受限） ===== */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { height: 44px; }
  .view-container { padding: 8px 12px; }
  .login-box { padding: 18px 28px; max-width: 400px; }
  .login-logo { margin-bottom: 14px; }
  .form-item { margin-bottom: 10px; }
  .login-title h1 { font-size: 18px; }
  .login-tip { margin-top: 10px; }
}

/* ===== 工作台（workbench） ===== */
.workbench-hero { display:flex; align-items:center; gap:16px; padding:18px 22px;
  background: linear-gradient(135deg,#1677ff 0%,#722ed1 100%); color:#fff;
  border-radius:10px; margin-bottom:16px; box-shadow:0 4px 14px rgba(22,119,255,.18); }
.hero-left { flex:1; min-width:0; }
.hero-greet { font-size:18px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hero-date { font-size:13px; opacity:.85; margin-top:2px; }
.hero-search { position:relative; min-width:280px; display:flex; align-items:center; gap:8px; }
.hero-search input { background:rgba(255,255,255,.95); border:none; flex:1; min-width:0; }
.hero-search .btn-primary-sm { flex-shrink:0; white-space:nowrap; padding:7px 14px; }
.wb-search-result { position:absolute; top:100%; left:0; right:0; background:#fff; color:#333;
  border-radius:6px; box-shadow:0 6px 18px rgba(0,0,0,.18); max-height:280px; overflow:auto; z-index:50; margin-top:4px; }
.wb-search-item { padding:8px 12px; cursor:pointer; border-bottom:1px solid #f0f0f0; }
.wb-search-item:hover { background:#f5f5f5; }
.wb-search-group { padding:6px 12px; font-size:12px; font-weight:600; color:#888; background:#fafafa; border-bottom:1px solid #f0f0f0; position:sticky; top:0; }
.wb-search-item .muted { font-size:12px; color:#999; }
.wb-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.wb-card { background:#fff; border-radius:10px; padding:14px 16px; box-shadow:0 2px 8px rgba(0,0,0,.06); border-left:4px solid #1677ff; }
.wb-card-crm { border-left-color:#1677ff; }
.wb-card-hr  { border-left-color:#722ed1; }
.wb-card-amo { border-left-color:#fa541c; }
.wb-card-mine{ border-left-color:#52c41a; }
.wb-card-head { font-size:14px; font-weight:600; margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; }
.wb-card-head .wb-more { font-size:12px; color:#888; font-weight:normal; cursor:pointer; }
.wb-card-head .wb-more:hover { color:#1677ff; }
.wb-card-body { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.wb-mini { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:#666; padding:4px 0; border-bottom:1px dashed #f0f0f0; }
.wb-mini b { font-size:16px; color:#222; font-weight:600; }
.wb-mini-strong b { color:#1677ff; }
/* #3 仪表盘数字穿透：可点击卡片/漏斗项 */
.wb-mini[data-go] { cursor:pointer; border-radius:4px; transition:background .15s; }
.wb-mini[data-go]:hover { background:#f0f6ff; }
.wb-mini[data-go]:hover b { color:#1677ff; }
div[data-go] { cursor:pointer; }
.wb-rmd-section { font-size:13px; color:#444; margin-bottom:6px; }
.wb-rmd-item { font-size:13px; color:#666; padding:3px 0; border-bottom:1px dashed #f5f5f5; }
.wb-quick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:14px; }
.wb-quick { display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 8px;
  border-radius:8px; cursor:pointer; transition:all .2s; background:#fafafa; }
.wb-quick:hover { background:#fff; box-shadow:0 4px 14px rgba(0,0,0,.08); transform:translateY(-2px); }
.wb-quick-icon { font-size:26px; line-height:1; color:var(--c); }
.wb-quick-name { font-size:13px; color:#444; }

/* ===== 工作台经营仪表带（KPI strip，阶段179） ===== */
.wb-kpi-strip { background:#fff; border-radius:10px; padding:14px 22px 16px;
  box-shadow:0 3px 12px rgba(0,0,0,.07); margin:-14px 0 16px; position:relative; z-index:2; }
.wb-kpi-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.wb-kpi-title { font-size:14px; font-weight:600; color:#333; }
.wb-kpi-ref { font-size:12px; color:#999; }
.wb-kpi-ref b { color:#fa8c16; font-weight:600; margin-left:2px; }
.wb-kpi-groups { display:flex; align-items:stretch; flex-wrap:wrap; }
.wb-kpi-group { display:grid; grid-template-columns:repeat(4,minmax(110px,1fr)); flex:1; min-width:0; }
.wb-kpi-group-bar { grid-template-columns:repeat(3,minmax(110px,1fr)); }
.wb-kpi-cell { padding:2px 18px; border-left:1px solid #f5f5f5; min-width:0; }
.wb-kpi-group .wb-kpi-cell:first-child { padding-left:0; border-left:none; }
.wb-kpi-label { font-size:12px; color:#999; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wb-kpi-value { font-size:19px; font-weight:700; color:#262626; font-variant-numeric:tabular-nums; white-space:nowrap; }
.wb-kpi-value.c-green { color:#52c41a; }
.wb-kpi-value.c-blue  { color:#1677ff; }
.wb-kpi-bar { margin-top:6px; height:5px; background:#f0f2f5; border-radius:3px; overflow:hidden; max-width:120px; }
.wb-kpi-bar i { display:block; height:100%; min-width:0; background:linear-gradient(90deg,#1677ff,#13c2c2); border-radius:3px; transition:width .4s; }
.wb-kpi-divider { width:1px; background:#f0f0f0; margin:2px 20px; }
@media (max-width:900px) {
  .wb-kpi-groups { flex-direction:column; }
  .wb-kpi-divider { display:none; }
  .wb-kpi-strip { margin:-8px 0 12px; padding:12px 14px; }
}
@media (max-width:611px) {
  .wb-kpi-group, .wb-kpi-group-bar { grid-template-columns:repeat(2,1fr); gap:8px 0; }
  .wb-kpi-cell { padding:2px 10px; }
}

/* ===== 进度条 ===== */
.progress-bar { display:inline-block; width:120px; height:10px; background:#f0f0f0; border-radius:5px; overflow:hidden; vertical-align:middle; margin-right:6px; }
.progress-fill { height:100%; background:linear-gradient(90deg,#1677ff,#13c2c2); transition:width .3s; }

/* ===== 个人中心弹窗 ===== */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 4px 0 8px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; border-radius: 50%; }
.avatar-lg img { border-radius: 50%; }
.profile-head-info { min-width: 0; }
.profile-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.profile-meta { font-size: 13px; color: var(--text-light); }
.avatar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-pane.hidden { display: none; }
.pf-pane .form-item:first-of-type { margin-top: 8px; }

/* 密码规则提示框（强制改密弹窗） */
.pwd-rule-box { background: var(--bg, #f7f8fa); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.8; }
.pwd-rule-box ul { margin: 6px 0 0 18px; padding: 0; }
.pwd-rule-box li { margin: 2px 0; }

/* 安全问题编辑行 */
.sec-edit-row { display: flex; gap: 8px; margin-bottom: 8px; }
.sec-edit-row .sec-q { flex: 1.4; }
.sec-edit-row .sec-a { flex: 1; }

/* ===== 顶栏「导入 / 导出」按钮 ===== */
.btn-topbar {
  background: transparent; color: var(--primary); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .15s;
  white-space: nowrap;
}
.btn-topbar:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 顶部待办下拉面板 ===== */
.todo-wrap { position: relative; }
.todo-btn { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.todo-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: #f5222d; color: #fff; font-size: 11px; line-height: 1;
  position: absolute; top: -7px; right: -7px; font-weight: 600;
}
.todo-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: 520px;
  background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14); z-index: 300; overflow: hidden; display: flex; flex-direction: column;
}
.todo-panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px; background: var(--bg, #f7f8fa);
}
.todo-panel-head .muted { font-weight: 400; font-size: 12px; }
.todo-panel-body { overflow-y: auto; padding: 8px; }
.todo-group-label {
  font-size: 12px; color: var(--text-light); padding: 8px 8px 4px; font-weight: 600;
}
.todo-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background .12s; text-align: left; width: 100%;
}
.todo-item:hover { background: var(--bg, #f7f8fa); }
.todo-item .t-ico { font-size: 18px; line-height: 1.2; flex: none; }
.todo-item .t-body { flex: 1; min-width: 0; }
.todo-item .t-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.todo-item .t-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; line-height: 1.4; }
.todo-item .t-arrow { color: var(--text-light); font-size: 14px; flex: none; align-self: center; }
.todo-item .t-x { flex: none; align-self: center; font-size: 12px; color: var(--text-light); padding: 2px 8px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.todo-item .t-x:hover { color: #f5222d; border-color: #f5222d; }
.todo-empty { padding: 36px 16px; text-align: center; color: var(--text-light); font-size: 13px; }
.todo-empty .big { font-size: 34px; display: block; margin-bottom: 8px; }
.todo-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-light); text-align: center; }
.todo-foot a { color: var(--primary); cursor: pointer; }

/* 待办处理列表弹窗 */
.todo-handle-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; background: var(--bg, #f7f8fa);
}
.todo-handle-item .th-body { flex: 1; min-width: 0; }
.todo-handle-item .th-title { font-size: 14px; color: var(--text); font-weight: 600; }
.todo-handle-item .th-sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }

/* ===== 数据导入弹窗 ===== */
.exio-import .form-item { margin-bottom: 14px; }
.exio-tpl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exio-summary { font-size: 13px; color: var(--text-light); background: #f0f7ff; border: 1px solid #dbeafe;
  padding: 10px 12px; border-radius: 8px; margin: 4px 0 12px; }
.exio-summary b { color: var(--primary); }
.exio-summary.exio-bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.exio-summary.exio-bad b { color: #b91c1c; }
.exio-map-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.exio-map-table th, .exio-map-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.exio-map-table th { background: #f5f7fb; }
.exio-map-table .form-input { padding: 4px 8px; font-size: 12px; min-width: 140px; }
.exio-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ============ 知识中心 / 读书打卡 ============ */
.kb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-tab { padding: 9px 16px; border: 1px solid var(--border); background: var(--card-bg); border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.kb-tab:hover { border-color: var(--primary); color: var(--primary); }
.kb-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.kb-pane.hidden { display: none; }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-book-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--card-bg); transition: box-shadow .15s; }
.kb-book-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.kb-book-top { display: flex; gap: 10px; align-items: center; }
.kb-book-icon { font-size: 28px; flex-shrink: 0; }
.kb-book-title { font-weight: 600; font-size: 15px; }
.kb-book-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.kb-cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.kb-chapter-list { max-height: 60vh; overflow: auto; }
.kb-chapter-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: background .15s; }
.kb-chapter-row:hover { background: #eff6ff; border-color: var(--primary-light); }
.kb-ch-no { color: var(--primary); font-size: 13px; flex-shrink: 0; }
.kb-ch-title { flex: 1; font-size: 14px; }
.kb-ch-dur { color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.kb-ch-ops { flex-shrink: 0; display: inline-flex; gap: 2px; }
.kb-ch-ops a { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-light); transition: all .12s; }
.kb-ch-ops a:hover { background: var(--primary-light); color: var(--primary); }
.kb-book-head { margin-bottom: 12px; }
.kb-read-meta { margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.kb-read-content { line-height: 1.9; font-size: 15px; color: var(--text); max-height: 62vh; overflow: auto; padding-right: 6px; }

/* 读书日历 */
.kb-cal { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.kb-cal-head, .kb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.kb-cal-wd { text-align: center; padding: 8px 0; background: #f5f7fb; font-size: 12px; color: var(--text-light); }
.kb-cal-cell { min-height: 52px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; }
.kb-cal-cell:nth-child(7n+1) { border-left: none; }
.kb-cal-cell.today { background: #eff6ff; }
.kb-cal-cell.clickable { cursor: pointer; }
.kb-cal-cell.clickable:hover { background: #f0f5ff; }
.kb-cal-cell.selected { background: #e6f4ff; outline: 2px solid var(--primary); }
.kb-cal-day { font-size: 13px; }
.kb-cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.kb-cal-dot { font-size: 10px; padding: 0 4px; border-radius: 8px; color: #fff; line-height: 16px; }
.kb-cal-dot.green { background: var(--success); }
.kb-cal-dot.blue { background: var(--primary); }
.kb-cal-dot.orange { background: #fa8c16; }
.kb-cal-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-light); align-items: center; }
.kb-dot-demo { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.kb-dot-demo.green { background: var(--success); }
.kb-dot-demo.blue { background: var(--primary); }
.kb-dot-demo.orange { background: #fa8c16; }
.tag.orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag.yellow { background: #fef3c7; color: #b45309; border: 1px solid #fbbf24; }
.tag.purple { background: #f9f0ff; color: #722ed1; border: 1px solid #d3adf7; }

.kb-done-badge { display: inline-block; margin: 6px 0; padding: 3px 10px; border-radius: 12px; background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; font-size: 13px; font-weight: 600; }
.kb-voice-box { margin: 10px 0; padding: 10px; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.kb-voice-box audio { width: 100%; margin-top: 4px; }
.kb-note-preview { margin: 8px 0; padding: 10px; border-radius: 8px; background: #fffbe6; border: 1px solid #ffe58f; }
.kb-note-content { font-size: 13px; color: var(--text); margin-top: 4px; max-height: 120px; overflow: auto; }
.kb-note-preview audio { width: 100%; margin-top: 6px; }


.kb-plan-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-bottom: 1px dashed var(--border); cursor: pointer; font-size: 13px; }
.kb-plan-row:hover { background: #f5f7fb; }
.kb-plan-date { color: var(--text-light); font-size: 12px; flex-shrink: 0; }

/* 录音 */
.kb-record-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fafbfd; }
.kb-record-head { font-size: 14px; margin-bottom: 10px; }
.kb-record-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-record-timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--primary); }

/* 富文本编辑器 */
.rte { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rte-bar { display: flex; gap: 2px; padding: 6px; background: #f5f7fb; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-bar button { min-width: 28px; height: 28px; border: 1px solid transparent; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text); font-size: 13px; }
.rte-bar button:hover { background: #fff; border-color: var(--border); }
.rte-body { min-height: 120px; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.7; }
.rte-body:empty::before { content: attr(data-placeholder); color: #9ca3af; }

/* 读后感卡片 */
.kb-note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kb-note-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: var(--card-bg); }
.kb-note-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.kb-note-book { color: var(--primary); font-size: 12px; margin-bottom: 8px; }
.kb-note-body { font-size: 14px; line-height: 1.7; color: var(--text); margin-bottom: 10px; }
.kb-note-body blockquote { border-left: 3px solid var(--primary-light); padding-left: 10px; color: var(--text-light); margin: 6px 0; }
.kb-note-audio { width: 100%; margin: 8px 0; }
.kb-note-meta { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.kb-note-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.kb-note-actions .btn-mini.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.kb-note-month, .kb-note-dept { margin-bottom: 22px; }
.kb-note-month-hd, .kb-note-dept-hd { font-size: 14px; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* 阶段110：富文本展示统一约束（读后感全文弹窗/产品落地页等原始 HTML 渲染处） */
.rich-body { font-size: 14px; line-height: 1.8; color: var(--text); word-break: break-word; }
.rich-body img { max-width: 100%; height: auto; border-radius: 6px; }
.rich-body table { max-width: 100%; border-collapse: collapse; }
.rich-body td, .rich-body th { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }
.rich-body blockquote { border-left: 3px solid var(--primary-light); padding-left: 10px; color: var(--text-light); margin: 6px 0; }
/* 编辑区同样所见即所得：图片限宽、表格自适应 */
.rte-body img, .rte-editor img { max-width: 100%; height: auto; }
.rte-body table, .rte-editor table { max-width: 100%; border-collapse: collapse; }
.rte-body td, .rte-body th, .rte-editor td, .rte-editor th { border: 1px solid var(--border); padding: 4px 8px; }
.kb-note-title.link { cursor: pointer; }
.kb-note-title.link:hover { color: var(--primary); }
/* 读后感卡片 v2（统计条 + 置顶 + 部门/月份折叠） */
.kb-note-stats { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-light); }
.kb-note-card { cursor: pointer; transition: box-shadow .15s; }
.kb-note-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.kb-note-top { padding: 10px 14px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(250,140,22,.10), transparent); border-left: 3px solid #fa8c16; border-radius: 6px; font-size: 14px; cursor: pointer; }
.kb-note-dept summary, .kb-note-month summary { list-style: none; cursor: pointer; user-select: none; }
.kb-note-dept summary::-webkit-details-marker, .kb-note-month summary::-webkit-details-marker { display: none; }
.kb-note-dept summary::before, .kb-note-month summary::before { content: '▸'; display: inline-block; margin-right: 6px; transition: transform .15s; color: var(--text-light); }
.kb-note-dept[open] > summary::before, .kb-note-month[open] > summary::before { content: '▾'; }
.kb-comment-item .link { cursor: pointer; font-size: 12px; }

/* 阅读热力图（个人成长 · GitHub 风格贡献日历） */
.kb-heat-wrap { overflow-x: auto; }
.kb-heat-row { display: flex; align-items: flex-start; gap: 6px; }
.kb-heat-weekdays { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; font-size: 10px; color: var(--text-light); line-height: 12px; flex-shrink: 0; }
.kb-heat-weekdays i { font-style: normal; display: block; height: 12px; }
.kb-heat-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; }
.kb-heat-cell { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.kb-heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--text-light); }

/* 自由阅读列表 */
.kb-free-list { display: flex; flex-direction: column; gap: 6px; }
.kb-free-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); }


/* 文档 / 视频预览 */
.kb-pdf { width: 100%; height: 72vh; border: none; }
.kb-img-wrap { text-align: center; }
.kb-img { max-width: 100%; max-height: 74vh; border-radius: 6px; }
.kb-word { min-height: 120px; }
.vid-wrap { display: flex; flex-direction: column; gap: 10px; }
.vid-player { width: 100%; max-height: 64vh; background: #000; border-radius: 8px; }
.vid-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }

/* 移动端适配 */
@media (max-width: 700px) {
  .kb-grid { grid-template-columns: 1fr; }
  .kb-note-grid { grid-template-columns: 1fr; }
  .kb-tab { flex: 1 1 auto; text-align: center; padding: 8px 8px; font-size: 13px; }
  .kb-read-content { max-height: 70vh; }
  .kb-cal-cell { min-height: 42px; }
}

/* ===== 言行一致表（编辑器/预览/审批/评分） ===== */
.btn-mini { padding: 3px 10px; font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; cursor: pointer; }
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.btn-mini.danger { color: #d9534f; border-color: #f5c6cb; }
.btn-mini.danger:hover { background: #fdecea; }

.tgt-score-bar { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.tgt-score { flex: 1; min-width: 120px; text-align: center; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.tgt-score span { display: block; font-size: 12px; color: var(--text-light); }
.tgt-score b { font-size: 24px; font-weight: 600; }
.tgt-score.accent { background: var(--primary-soft, #eef2ff); border-color: var(--primary); }
.tgt-score.accent b { color: var(--primary); }
.tgt-m { padding: 4px 0; font-size: 13px; }
.tgt-comment { margin-top: 10px; padding: 10px; border-radius: 8px; background: #fff8e1; border: 1px solid #ffe082; font-size: 13px; }
.tgt-review-cmt { margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: #fce4ec; border: 1px solid #f8bbd0; font-size: 12px; color: #a32d2d; max-width: 240px; }

/* 言行一致汇总监督：整体进度条 + 组织树 + 完成率条 */
.tgt-progress-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.tgt-progress { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eef0f3; }
.tgt-progress span { transition: width .3s; }
.tgt-progress-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-light); }
.tgt-progress-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.tgt-tree-table { min-width: 760px; }
.tgt-tree-tg { display: inline-block; width: 16px; text-align: center; color: var(--text-light); font-size: 12px; user-select: none; }
.tgt-tree-row td { font-size: 13px; }
.tgt-rate { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.tgt-rate-track { flex: 1; height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.tgt-rate-fill { display: block; height: 100%; border-radius: 4px; }
.tgt-rate em { font-style: normal; font-weight: 600; font-size: 12px; min-width: 34px; text-align: right; }


.tgt-edit-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--surface); }
.tgt-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tgt-edit-head.sm { margin: 10px 0 6px; }
.tgt-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tgt-edit-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--text-light); gap: 4px; }
.tgt-edit-grid select, .tgt-edit-grid input { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }
.tgt-desc { margin-bottom: 10px; }
.tgt-desc label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.tgt-desc textarea, .tgt-measure-row textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; resize: vertical; }
.tgt-ratio { display: flex; gap: 6px; }
.tgt-ratio select { flex: 1; }
.tgt-ratio input { flex: 1; }
.tgt-measure { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.tgt-measure-row { display: flex; gap: 6px; margin-bottom: 8px; }
.tgt-measure-row textarea { flex: 1; }

/* 九字段五段式：目标行（textarea + 指标库下拉）、预览分类标题/表格、模板字段配置 */
.tgt-goal-row { display: flex; gap: 8px; align-items: flex-start; }
.tgt-goal-row textarea { flex: 1; }
.tgt-goal-row label { min-width: 200px; display: flex; flex-direction: column; font-size: 12px; color: var(--text-light); gap: 4px; }
.tgt-goal-row label select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }
.tgt-cat-head { margin: 14px 0 6px; padding: 8px 12px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 600; font-size: 14px; }
.tgt-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.tgt-table th, .tgt-table td { border: 1px solid var(--border); padding: 8px 10px; font-size: 13px; text-align: left; vertical-align: top; }
.tgt-table th { background: var(--bg); color: var(--text-light); white-space: nowrap; }
.tgt-table td { color: var(--text); }
.tpl-cat-list { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 0; }
.tpl-field-head { display: grid; grid-template-columns: 54px 110px 1fr 130px 60px; gap: 8px; padding: 4px 0; font-size: 12px; color: var(--text-light); }
.tpl-field-row { display: grid; grid-template-columns: 54px 110px 1fr 130px 60px; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--border); }
.tpl-field-row .form-input { margin: 0; padding: 6px 8px; }
.tpl-field-row .check-inline { margin: 0; font-size: 12px; white-space: nowrap; }

/* ===== 四层树编辑器（目的→目标→策略→行动） ===== */
.tgt-tpl-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #1677ff30; border-radius: 8px; background: #1677ff0a; font-size: 13px; color: var(--text); }
.tgt-tpl-info b { color: #1677ff; }
.tgt-purpose-box { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px; margin-bottom: 14px; background: var(--surface); }
.tgt-p-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tgt-p-head b { font-size: 14px; color: var(--text); }
.tgt-p-head select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }

.tgt-goal-box { border: 1px solid var(--border); border-left: 3px solid #7c3aed; border-radius: 8px; padding: 10px; margin: 10px 0 10px 16px; background: var(--primary-soft, #eef2ff); }
.tgt-g-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.tgt-strategy-box { border: 1px solid var(--border); border-left: 3px solid #1677ff; border-radius: 8px; padding: 10px; margin: 8px 0 8px 16px; background: var(--surface); }
.tgt-s-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.tgt-tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--primary); color: #fff; }

.tgt-metric-box { border: 1px dashed #b7a3e8; border-radius: 8px; padding: 10px; margin: 6px 0 10px; background: var(--surface); }
.tgt-metric-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text); }

.tgt-actions { margin-top: 10px; }
.tgt-actions-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.tgt-actions-head button { margin-left: auto; }
.tgt-action { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--bg); }
.tgt-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.tgt-cell { display: flex; flex-direction: column; gap: 4px; min-width: 100%; }
.tgt-cell.grow { grid-column: 1 / -1; }
.tgt-cell label { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.tgt-cell textarea, .tgt-cell select, .tgt-cell input { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; width: 100%; min-width: 0; }
.tgt-cell select { padding-right: 26px; } /* 浏览器下拉箭头预留，避免选项文字被箭头遮住 */
.tgt-cell textarea { resize: vertical; }
.tgt-cycle-range { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.tgt-cycle-range input { flex: 1 1 150px; min-width: 150px; padding: 6px 6px !important; }
.tgt-cycle-range .muted { flex: none; font-size: 12px; }
.tgt-cycle-range .req { color: #e0392f; font-weight: 700; }
.tgt-range-cell { grid-column: 1 / -1; }

/* 提交校验报错定位：红框高亮 + 背景泛红（3 秒后自动移除） */
.tgt-err, .tgt-err.tgt-purpose-box, .tgt-err.tgt-goal-box, .tgt-err.tgt-strategy-box, .tgt-err.tgt-action,
.tgt-err textarea, .tgt-err select, .tgt-err input {
  border-color: #e0392f !important;
  box-shadow: 0 0 0 2px #e0392f33 !important;
  background: #fff1f0 !important;
}

/* ===== 四层树预览（目的→目标→策略→行动） ===== */
.tgt-purpose { margin-bottom: 10px; }
.tgt-goal { margin: 8px 0 8px 14px; padding-left: 12px; border-left: 2px solid var(--border); }
.tgt-strategy { margin: 6px 0 6px 14px; }
.tgt-p-head, .tgt-g-head, .tgt-s-head { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tgt-metric { margin: 6px 0; font-size: 13px; color: var(--text); }
.tgt-action-table { margin: 8px 0; }
.tgt-a-content { min-width: 180px; }


/* ============ 万年历日期选择器 + 表单关联快捷新增 ============ */
.date-field, .sel-field, .loc-field { display: flex; gap: 6px; align-items: center; }
.date-field input, .sel-field select, .loc-field input { flex: 1; }
.date-btn, .sel-add, .loc-pick { flex: none; padding: 9px 14px; border: 1px solid var(--border); border-radius: 6px; background: #ffffff; color: var(--text); cursor: pointer; font-size: 15px; min-width: 44px; text-align: center; }
.date-btn:hover, .sel-add:hover, .loc-pick:hover { background: #1677ff10; border-color: #1677ff; }
.sel-add { color: #1677ff; border-color: #1677ff40; }
.sel-add:hover { background: #1677ff10; }
.loc-pick { color: #1677ff; border-color: #1677ff40; white-space: nowrap; }
.loc-pick:hover { background: #1677ff10; }

.datepicker-pop { width: 300px; background: #ffffff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.22); z-index: 10000; padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; font-size: 14px; color: var(--text); }
.dp-nav { width: 28px; height: 28px; border: none; background: var(--bg); color: var(--text); border-radius: 6px; cursor: pointer; font-size: 14px; }
.dp-nav:hover { background: #1677ff20; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 11px; color: var(--text-light); padding: 4px 0; }
.dp-day { text-align: center; padding: 8px 0; font-size: 14px; border-radius: 6px; cursor: pointer; color: var(--text); }
.dp-day.empty { cursor: default; }
.dp-day:hover { background: #1677ff20; }
.dp-day.today { border: 1px solid #1677ff; color: #1677ff; }
.dp-day.sel { background: #1677ff; color: #fff; }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ============ 每日日报（可编辑正文 + 行动闭环 + 管理查阅 + 统计看板） ============ */
.report-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.report-toolbar .tabs { margin-left: auto; }
.report-date { display: flex; gap: 6px; align-items: center; }
.report-date .muted { font-size: 12px; white-space: nowrap; }
.report-date input, .report-date select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; }
.report-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 6px; }
.report-stats .rs-item { flex: 1; min-width: 120px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.report-stats .rs-item b { font-size: 24px; font-weight: 700; color: var(--primary); }
.report-stats .rs-item span { font-size: 12px; color: var(--text-light); }
.report-stats .rs-item.green b { color: #22a06b; }
.report-stats .rs-item.red b { color: #d9534f; }
.report-stats .rs-item.blue b { color: #1677ff; }
.report-summary { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.report-todo { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 1px solid #f0c674; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; color: #8a6d3b; }
.report-todo > span:first-child { font-weight: 700; }
.report-todo .link { margin-left: auto; white-space: nowrap; }
.penalty-box { background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; }
.report-summary-input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; color: var(--text); background: var(--surface); resize: vertical; font-family: inherit; }
.report-summary-input:focus { outline: none; border-color: var(--primary); }
.report-desc.changed { background: #fff8e6; border-color: #f0c674; }
/* 日报行动卡片布局（重排版：标题+完成状态切换钮 / 全宽描述框 / 底部附件+遗留问题） */
.rep-cards { display: flex; flex-direction: column; gap: 10px; }
.rep-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.rep-card.rep-card-reject { border-color: #f5b5b1; background: #fffafa; }
.rep-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rep-card-title { font-size: 13.5px; line-height: 1.65; word-break: break-word; min-width: 0; }
.rep-card-title b { font-size: 13.5px; }
.rep-card-title .tag { vertical-align: baseline; }
.rep-done-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.rep-opt { padding: 5px 12px; font-size: 12px; cursor: pointer; background: var(--surface); color: var(--muted, #888); white-space: nowrap; user-select: none; }
.rep-opt + .rep-opt { border-left: 1px solid var(--border); }
.rep-opt:hover { color: var(--text); }
.rep-opt.on-done { background: #e8f5e9; color: #2e7d32; font-weight: 600; }
.rep-opt.on-undone { background: #fbe9e7; color: #c62828; font-weight: 600; }
.rep-desc { width: 100%; min-height: 100px; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.7; color: var(--text); background: var(--bg, #fff); resize: vertical; font-family: inherit; margin-top: 9px; display: block; }
.rep-desc:focus { outline: none; border-color: var(--primary); }
.rep-desc.changed { background: #fff8e6; border-color: #f0c674; }
.rep-desc-ro { margin-top: 8px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.rep-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
.rep-atts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.rep-file { max-width: 230px; font-size: 12px; }
.rep-issue { margin-left: auto; text-align: right; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.rep-issue-txt { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; color: var(--muted, #888); }
.rep-issue-btn { white-space: nowrap; }
/* 进度条（完成度可视化）：未完成橙黄进行中，100% 满格绿 */
.rep-progress { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.rep-progress-track { flex: 1; height: 14px; background: var(--bg, #eef1f5); border: 1px solid var(--border, #e2e6ee); border-radius: 7px; overflow: hidden; min-width: 140px; cursor: pointer; }
.rep-progress-fill { height: 100%; background: #f0a202; border-radius: 7px; transition: width .25s; }
.rep-progress-fill.full { background: #22a06b; }
/* 批次4 #73：限字框实时计数 + 校验失败高亮 */
.cc-ind { font-size: 11px; color: var(--muted, #888); text-align: right; margin-top: 2px; line-height: 1.3; }
.cc-ind.over { color: #d4380d; font-weight: 600; }
.cc-ind.under { color: #d48806; }
.field-error { border-color: #d4380d !important; box-shadow: 0 0 0 2px rgba(212,56,13,.15); }
/* 批次4 #92：指针穿透弹窗（不锁背景页面滚动） */
.modal-overlay.modal-passthrough { pointer-events: none; }
.modal-overlay.modal-passthrough .modal-box { pointer-events: auto; }
/* 批次4 #40/#41/#42：通用分页条 */
.pg-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border, #e5e7eb); font-size: 12px; }
.pg-bar .btn-mini:disabled { opacity: .4; cursor: default; }
.rep-progress-pct { font-size: 12px; font-weight: 600; color: var(--text); min-width: 38px; text-align: right; }
.rep-progress-step { font-size: 11px; color: var(--muted, #888); white-space: nowrap; }
/* 遗留问题弹窗：解决步骤勾选框 */
.ri-pct { margin-left: 6px; font-size: 12px; font-weight: 700; color: #f0a202; }
.ri-check { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.ri-check input { display: none; }
.ri-check span { font-size: 16px; line-height: 1; }
.ri-step-done input[type="text"] { color: var(--muted, #888); text-decoration: line-through; }
.ri-step-done input[type="date"] { color: var(--muted, #888); }
/* P2：遗留问题台账 */
.ib-row { border: 1px solid var(--border, #e2e6ee); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: var(--surface, #fff); }
.ib-row.ib-overdue { border-left: 4px solid #d9534f; }
.ib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ib-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.ib-meta { line-height: 1.6; }
/* P2：数字目标「今日完成数字」输入行 */
.rep-metric-input input[type="number"] { padding: 4px 8px; border: 1px solid var(--border, #e2e6ee); border-radius: 6px; }
@media (max-width: 768px) {
  .rep-card-head { flex-direction: column; gap: 8px; }
  .rep-issue { margin-left: 0; text-align: left; }
}
.report-att { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.ri-step { display: flex; gap: 6px; margin-bottom: 6px; }
.ri-step input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.bar { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; min-width: 90px; }
.bar-fill { height: 100%; background: #22a06b; border-radius: 6px; transition: width .3s; }



/* ============ 预算编制（阶段二十九） ============ */
.bgt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bgt-toolbar .muted { font-size: 12px; }
.bgt-readonly { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
/* 草稿恢复提示条：检测到未保存草稿时在表格上方展示 */
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff7e6; border: 1px solid #ffd591; color: #874d00; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.draft-bar-msg { flex: 1; min-width: 200px; }
.draft-bar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.draft-bar .btn-mini.draft-save { color: #fff; background: var(--primary, #1a73e8); border-color: var(--primary, #1a73e8); }
.draft-bar .btn-mini.draft-save:hover { opacity: 0.88; }
/* 预算表格滚动容器：横向 + 纵向滚动，表头/左列在容器内固定 */
.bgt-scroll { overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--border); border-radius: 10px; }
.table-scroll { overflow: auto; }
/* 字典申请小表格：状态列垂直堆叠 tag + 副标，整体更紧凑 */
.apply-status { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.apply-status .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 表格：separate 边框模型（sticky 定位需要），左侧两列 + 表头固定 */
.bgt-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1420px; font-size: 13px; }
.bgt-table th, .bgt-table td {
  border: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 6px 8px; text-align: left; background: var(--card-bg);
}
/* 表头固定顶部 */
.bgt-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg); font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}
/* 第1列（科目）+ 第2列（取数规则/公式）固定左侧 */
.bgt-table th:nth-child(1), .bgt-table td:nth-child(1) {
  position: sticky; left: 0; z-index: 2;
  width: 230px; min-width: 230px; max-width: 230px;
}
.bgt-table th:nth-child(2), .bgt-table td:nth-child(2) {
  position: sticky; left: 230px; z-index: 2;
  width: 135px; min-width: 135px; max-width: 135px;
}
/* 表头与左列交叉处层级最高 */
.bgt-table thead th:nth-child(1), .bgt-table thead th:nth-child(2) { z-index: 4; }
.bgt-table .bgt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bgt-table .bgt-calc-row td { background: var(--bg); }
.bgt-table .bgt-calc { color: var(--text-light); }
.bgt-table .bgt-total { font-weight: 600; background: #f0f6ff; }
.bgt-table td .bgt-code { color: var(--primary); font-weight: 700; }
/* 敏感科目数据隐藏（E2/I1~I7 等）：行内容灰显 */
.bgt-table .bgt-masked-row td { opacity: .55; }
.bgt-table .bgt-masked { color: var(--text-light); text-align: center; }
/* 当前月份列高亮（暖黄底色，随月份自然切换） */
.bgt-table th.bgt-cur-month { background: #ffe9c7 !important; color: #ad4e00; }
.bgt-table td.bgt-cur-month { background: #fff7e6 !important; }
.bgt-table td.bgt-cur-month .bgt-input { background: transparent; border-color: #ffb75d; }
.bgt-input { width: 92px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-size: 12px; background: var(--surface); color: var(--text); }
.bgt-input:focus { outline: none; border-color: var(--primary); }
.bgt-input:disabled { background: var(--bg); color: var(--text-light); }
.bgt-formula { color: #1677ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bgt-del { color: #d9534f; }

/* ============ 月度核算表（阶段三十） ============ */
/* 列更多，加宽 min-width，横向滚动时表头 + 左侧两列保持固定 */
.fct-table { min-width: 1720px; }
.fct-table .fct-mp { background: #f4f5f7; color: var(--text-light); font-weight: 500; white-space: nowrap; }
.fct-table .fct-ratio { color: var(--text-light); font-size: 12px; white-space: nowrap; }
.fct-table .fct-diff { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fct-table .fct-diff.neg { color: #d4380d; }   /* 实绩超额（差异额为负）→ 红 */
.fct-table .fct-diff.pos { color: #389e0d; }   /* 实绩未达（差异额为正）→ 绿 */
.fct-table .fct-rate { color: #1677ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fct-input { width: 100px; }
/* 言行一致表同步锁定的科目：月度预定只读，淡蓝底提示 */
.fct-table .bgt-locked { display: inline-block; padding: 4px 8px; background: #e6f4ff; color: #1677ff; font-weight: 600; border-radius: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 月度核算表「当月MP」列：只读淡灰底，强调自动关联 */
.fct-table th.fct-mp-hd { background: #f4f5f7; color: var(--text-light); }

/* ============ 经营分析（阶段四十：推移图 + 同比环比 + 异常分析 + 自省/智能建议） ============ */
.ana-chart-box { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 4px; }
.ana-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ana-metric { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ana-metric-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.ana-metric-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ana-suggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ana-col-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.ana-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.ana-anom { background: #fffafa; border-left: 3px solid #dc2626; }
.ana-sug { background: #f6fbff; border-left: 3px solid #1677ff; }
.ana-item-head { margin-bottom: 6px; }
.ana-item-body { font-size: 13px; color: var(--text); line-height: 1.7; }
.ana-self-ta { width: 100%; min-height: 140px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; line-height: 1.7; resize: vertical; }
.ana-self-ta:focus { outline: none; border-color: var(--primary); }

/* ============ 经营分析重设计：左 2/3 + 右 1/3 ============ */
.ana-page { display: flex; flex-direction: column; height: calc(100vh - 56px - 24px); min-height: 600px; overflow: hidden; }
.ana-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; }
.ana-title { font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.ana-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.ana-toolbar-group { display: flex; align-items: center; gap: 6px; }
.ana-toolbar-group > label { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.ana-toolbar select.ana-sel { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px; min-width: 120px; max-width: 220px; }
.ana-toolbar select.ana-sel:focus { outline: none; border-color: var(--primary); }

/* 年份多选 */
.ana-multi { position: relative; }
.ana-multi-trigger { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px; min-width: 140px; max-width: 260px; cursor: pointer; user-select: none; }
.ana-multi-trigger:hover { border-color: var(--primary); }
.ana-multi-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-multi-arrow { color: var(--text-light); font-size: 10px; }
.ana-multi-panel { position: absolute; top: 100%; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 6px 0; z-index: 100; min-width: 140px; }
.ana-multi-panel label { display: flex; align-items: center; gap: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.ana-multi-panel label:hover { background: var(--bg); }
.ana-multi-panel input { margin: 0; }

/* 主体布局：左 2/3 + 右 1/3 */
.ana-body { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.ana-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
.ana-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.ana-context-bar { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 14px; font-size: 13px; color: #92400e; }
.ana-chart-wrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 8px 4px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ana-chart-wrap svg { width: 100%; height: 100%; flex: 1; min-height: 280px; max-height: 460px; }
.ana-compare-wrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0; max-height: 280px; overflow-y: auto; }
.ana-compare-wrap .panel-header { padding: 10px 14px; }
.ana-compare-wrap .panel-body { padding: 0 14px 12px; overflow-x: auto; }
.ana-compare-wrap table { font-size: 12px; }

/* 右侧面板 */
.ana-right-panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.ana-right-panel .panel-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.ana-right-panel .panel-body { padding: 12px 14px; }
.ana-metrics-panel .ana-metrics { margin-bottom: 0; }
.ana-self-panel .ana-self-ta { min-height: 100px; }
.ana-self-tip { font-size: 12px; color: var(--text-light); margin: 0 0 8px; line-height: 1.6; }

/* 响应式：≤1024 改为上下排布 */
@media (max-width: 1024px) {
  .ana-page { height: auto; min-height: 600px; overflow: visible; }
  .ana-body { grid-template-columns: 1fr; }
  .ana-right { overflow-y: visible; }
  .ana-chart-wrap svg { max-height: 360px; }
  .ana-compare-wrap { max-height: none; }
}
@media (max-width: 768px) {
  .ana-suggest-grid { grid-template-columns: 1fr; }
}

/* ============ 移动端响应式：缩窄固定列 / 公式列取消横向固定 ============ */
/* 表头始终垂直固定（top:0），这里只控制左侧两列的「横向固定」，避免窄屏固定列占屏过大 */
@media (max-width: 768px) {
  .bgt-table th:nth-child(1), .bgt-table td:nth-child(1) {
    width: 150px; min-width: 150px; max-width: 150px;
  }
  .bgt-table th:nth-child(2), .bgt-table td:nth-child(2) {
    left: auto; /* 公式列取消横向固定，随横向滚动 */
    width: 120px; min-width: 120px; max-width: 120px;
  }
}
@media (max-width: 480px) {
  /* 竖屏：科目列展示完整名称（编码+名称，允许换行），公式/取数规则列缩略 */
  .bgt-table th:nth-child(1), .bgt-table td:nth-child(1) {
    width: 150px; min-width: 150px; max-width: 150px;
    white-space: normal; word-break: break-word;
  }
  .bgt-table .bgt-name { display: inline; } /* 保留科目名称，不省略 */
  .bgt-table th:nth-child(2), .bgt-table td:nth-child(2) {
    left: auto;
    width: 88px; min-width: 88px; max-width: 88px;
  }
  .bgt-table td:nth-child(2) { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bgt-table { font-size: 12px; }
  .bgt-input, .fct-input { width: 72px; padding: 4px 3px; }
}
/* 手动解锁：取消左侧两列横向固定（工具栏开关，容器 toggle .bgt-free），表头垂直固定保留 */
.bgt-scroll.bgt-free .bgt-table th:nth-child(1),
.bgt-scroll.bgt-free .bgt-table td:nth-child(1),
.bgt-scroll.bgt-free .bgt-table th:nth-child(2),
.bgt-scroll.bgt-free .bgt-table td:nth-child(2) {
  left: auto !important;
}

/* ============ 表格上方区域收缩开关 ============ */
/* 折叠按钮 + 标题同组靠左，筛选下拉靠右 */
.bgt-head-left { display: flex; align-items: center; gap: 10px; }
.bgt-head-toggle { flex-shrink: 0; white-space: nowrap; }
/* 折叠后隐藏筛选下拉、工具栏、退回原因、只读提示，表格占满；并放大表格可滚动高度 */
.panel.bgt-head-collapsed .panel-extra,
.panel.bgt-head-collapsed .bgt-toolbar,
.panel.bgt-head-collapsed .bgt-reject,
.panel.bgt-head-collapsed .bgt-readonly { display: none; }
.panel.bgt-head-collapsed .bgt-scroll { max-height: calc(100vh - 180px); }

/* ============ 科目权限矩阵 ============ */
.ap-matrix-wrap { overflow: auto; max-height: calc(100vh - 260px); border: 1px solid var(--border); border-radius: 8px; }
.ap-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.ap-table th, .ap-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px 8px; white-space: nowrap; }
.ap-table thead th { position: sticky; top: 0; background: var(--card-bg); z-index: 2; font-weight: 700; text-align: center; }
.ap-subject { position: sticky; left: 0; background: var(--card-bg); z-index: 1; min-width: 200px; }
.ap-table thead th:first-child { position: sticky; left: 0; z-index: 3; }
.ap-td-center { text-align: center; }
.ap-cell { min-width: 66px; padding: 5px 8px; border: 1px dashed transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1; transition: all .12s; }
.ap-cell:hover { transform: scale(1.05); }
.ap-cell[disabled] { cursor: default; opacity: .55; }
.ap-NONE { background: #fdecea; color: #c0392b; }
.ap-VIEW { background: #fff4e0; color: #b8860b; }
.ap-EDIT { background: #e6f7ec; color: #1e8e3e; }
.ap-explicit { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.ap-row-default td { background: #f7f8fb; font-weight: 600; }
.ap-row-default td.ap-subject { background: #eef1f8; }
.ap-col-default { background: #f7f8fb !important; }
.ap-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; align-items: center; }
.ap-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted, #888); }
.ap-legend-item .ap-cell { cursor: default; }
.ap-sel { width: 16px; height: 16px; cursor: pointer; }

/* ============ 活动管理（阶段六十三） ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--text-light); }
.page-actions { flex-shrink: 0; }
.evt-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.evt-filter { padding: 6px 14px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); border-radius: 99px; cursor: pointer; font-size: 13px; }
.evt-filter:hover { border-color: var(--primary); color: var(--primary); }
.evt-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.evt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.evt-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.evt-card:hover { box-shadow: 0 6px 20px rgba(37,99,235,.12); border-color: var(--primary); }
.evt-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.evt-card-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.evt-card-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.evt-card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 10px; }
.evt-card-owner { font-size: 12px; color: var(--text-light); }
.evt-back { margin-bottom: 12px; }
.evt-back a { color: var(--primary); font-size: 13px; text-decoration: none; }
.evt-back a:hover { text-decoration: underline; }
.evt-trash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.evt-trash-head a { color: var(--primary); font-size: 13px; text-decoration: none; }
.evt-trash-head a:hover { text-decoration: underline; }
.evt-trash-grid .evt-card { cursor: default; }
.evt-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.evt-head-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.evt-detail-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.evt-detail-sub { font-size: 13px; color: var(--text-light); }
.evt-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.evt-tab { padding: 8px 16px; border: none; background: none; color: var(--text-light); cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.evt-tab:hover { color: var(--primary); }
.evt-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.evt-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.evt-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.evt-stat .n { font-size: 24px; font-weight: 700; color: var(--primary); }
.evt-stat .l { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.evt-overview-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.evt-overview-box h4 { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.evt-overview-box p { font-size: 13px; color: var(--text-light); line-height: 1.7; margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 10px; overflow: hidden; font-size: 13px; }
.tbl th { background: #eef2ff; color: var(--primary); font-weight: 600; text-align: left; padding: 10px 12px; border: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border: 1px solid var(--border); color: var(--text); }
.evt-toolbar { margin-bottom: 12px; }
.evt-agenda-item { display: flex; gap: 14px; background: var(--card-bg); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.evt-agenda-time { flex-shrink: 0; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--warning); font-weight: 600; min-width: 90px; padding-top: 1px; }
.evt-agenda-body { font-size: 13px; color: var(--text); }
.evt-agenda-body b { font-size: 14px; }
.evt-agenda-ops { margin-left: auto; flex-shrink: 0; align-self: center; }
.evt-signup-tbl { min-width: 760px; }
/* 阶段九十一：现场签到台 */
.evt-ck-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.evt-ck-days { display: flex; gap: 6px; flex-wrap: wrap; }
.evt-ck-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.evt-ck-acts .btn-mini { white-space: nowrap; }
.evt-ops { white-space: nowrap; }
.evt-ops .btn-mini { margin-right: 4px; }
.evt-qr-row { display: flex; gap: 16px; margin-bottom: 16px; }
.evt-qr-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.evt-qr-canvas { display: inline-block; }
.evt-qr-title { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 8px; }
.evt-qr-tip { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.evt-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.evt-qr-actions .btn-mini { text-decoration: none; display: inline-block; }
.btn-mini.primary { color: #fff; background: var(--primary, #1a73e8); border-color: var(--primary, #1a73e8); }
.btn-mini.primary:hover { opacity: 0.88; color: #fff; border-color: var(--primary, #1a73e8); }
.evt-qr-link { font-size: 11.5px; color: var(--text-light); background: var(--surface); border: 1px dashed var(--border); border-radius: 6px; padding: 6px 8px; margin-top: 8px; word-break: break-all; text-align: left; }

/* ============ 活动海报生成弹窗（阶段八十二） ============ */
.poster-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.poster-modal { background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 14px; width: 900px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.poster-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.poster-head-t { font-size: 15px; font-weight: 700; color: var(--text); }
.poster-close { border: none; background: transparent; color: var(--text-light); font-size: 18px; cursor: pointer; }
.poster-close:hover { color: var(--text); }
.poster-body { display: flex; gap: 18px; padding: 18px; overflow: hidden; }
.poster-left { width: 290px; flex-shrink: 0; }
.poster-right { flex: 1; min-width: 0; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
.poster-preview { width: 100%; max-width: 540px; }
.poster-label { font-size: 12.5px; color: var(--text-light); margin: 12px 0 8px; }
.poster-label:first-child { margin-top: 0; }
.poster-styles { display: flex; gap: 8px; }
.poster-style { flex: 1; text-align: center; padding: 10px 6px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.poster-style.on { border-color: var(--primary); color: var(--primary); background: rgba(26,115,232,.06); }
.poster-style-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.poster-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.poster-loading { color: var(--text-light); font-size: 13px; text-align: center; padding: 60px 0; }
@media (max-width: 768px) {
  .poster-body { flex-direction: column; }
  .poster-left { width: 100%; }
  .poster-modal { max-height: 95vh; overflow-y: auto; }
}
.evt-survey-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.evt-survey-title { font-size: 15px; font-weight: 600; color: var(--text); }
.evt-survey-opts { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.evt-int-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.evt-wc-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
@media (max-width: 768px) {
  .evt-grid { grid-template-columns: 1fr; }
  .evt-stat-row { grid-template-columns: repeat(2, 1fr); }
  .evt-agenda-time { min-width: 70px; }
}

/* ============ 活动类型管理 + datetime 时间字段（阶段六十四） ============ */
.dt-field { display: flex; align-items: center; gap: 8px; }
.dt-field .date-field { flex: 1 1 auto; min-width: 0; }
.dt-field .date-field input.form-input { flex: 1 1 auto; width: auto; min-width: 110px; }
.dt-field input.dt-time { flex: 0 0 112px; width: 112px !important; }
.evt-type-toolbar { margin-bottom: 12px; }
.evt-type-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-bottom: 14px; }
.evt-type-item { display: flex; align-items: center; gap: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.evt-type-ico { font-size: 22px; flex-shrink: 0; }
.evt-type-info { flex: 1; min-width: 0; }
.evt-type-info b { display: block; font-size: 14px; color: var(--text); }
.evt-type-info .muted { font-size: 12px; }
.evt-type-ops { display: flex; gap: 6px; flex-shrink: 0; }
.evt-type-sec { font-size: 13px; font-weight: 600; color: var(--primary); margin: 14px 0 8px; }
.evt-apply-item { display: flex; align-items: center; gap: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.evt-apply-info { flex: 1; min-width: 0; }
.evt-apply-info b { font-size: 14px; color: var(--text); }
.evt-apply-info .muted { font-size: 12px; }

/* ============ 阶段二：嘉宾/物料/分工/资产/连载（阶段六十五） ============ */
.evt-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.evt-item-main { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.evt-item-main b { font-size: 14px; }
.evt-item-main .muted { font-size: 12px; }
.evt-item-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.evt-series-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.evt-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.evt-asset-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.evt-asset-ico { font-size: 30px; margin-bottom: 8px; }
.evt-asset-title { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-asset-card .evt-ops { margin-top: 8px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.evt-asset-card .link { font-size: 12px; }
@media (max-width: 768px) {
  .evt-asset-grid { grid-template-columns: repeat(2, 1fr); }
  .evt-item { flex-direction: column; }
  .evt-item-side { flex-direction: row; align-items: center; }
}

/* ============ 阶段三：复盘闭环（阶段六十六） ============ */
.evt-review-done { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.evt-review-draft { background: #f0f7ff; border: 1px solid #dbeafe; border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.evt-review-draft-head { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.evt-review-draft .evt-stat-row { margin-bottom: 10px; }
.evt-review-form .form-item { margin-bottom: 14px; }
.evt-review-form label { font-size: 13px; }
.evt-review-pct { display: flex; align-items: center; gap: 6px; }
.evt-review-pct input { flex: 1; }
.evt-review-pct span { font-size: 13px; color: var(--text-light); }

/* ============ 落地页所见即所得编辑器 + 附件多文件上传（阶段七十一） ============ */
.rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 8px; background: #f8fafc; border: 1px solid var(--border);
  border-bottom: 0; border-radius: 8px 8px 0 0;
}
.rte-btn {
  min-width: 30px; height: 30px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--text); font-size: 14px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; line-height: 1;
}
.rte-btn:hover { background: #eef2f7; border-color: var(--border); }
.rte-btn:active { background: #e2e8f0; }
.rte-select {
  height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); font-size: 13px; padding: 0 6px; cursor: pointer;
}
.rte-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.rte-editor {
  min-height: 280px; max-height: 460px; overflow-y: auto;
  padding: 14px 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 0 0 8px 8px;
  font-size: 14px; line-height: 1.7; color: var(--text); outline: none;
}
.rte-editor:empty::before {
  content: attr(data-placeholder); color: #94a3b8; pointer-events: none;
}
.rte-editor h1 { font-size: 22px; margin: 12px 0 8px; }
.rte-editor h2 { font-size: 19px; margin: 12px 0 8px; }
.rte-editor h3 { font-size: 16px; margin: 10px 0 6px; }
.rte-editor p { margin: 6px 0; }
.rte-editor ul, .rte-editor ol { padding-left: 22px; margin: 6px 0; }
.rte-editor blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--primary); background: #f8fafc; color: var(--text-light); }
.rte-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.rte-editor a { color: var(--primary); text-decoration: underline; }
.rte-source { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* ============ CRM 销售看板（阶段七十二） ============ */
.crm-dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.crm-dash-title { font-size: 18px; font-weight: 700; color: var(--text); }
.crm-dash-scope { font-size: 13px; color: var(--text-light); }
.crm-dash-scope b { color: var(--primary); }

.crm-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.crm-stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.crm-stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.crm-stat-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.crm-stat-sub { font-size: 12px; color: var(--text-light); margin-top: 6px; }

.crm-funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.crm-funnel-step { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; color: #fff; border-radius: 6px; font-size: 14px; }
.crm-funnel-step span { opacity: .9; }
.crm-funnel-step b { font-size: 16px; }

.crm-rate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.crm-rate-item { text-align: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.crm-rate-item span { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.crm-rate-item b { font-size: 18px; color: var(--primary); }

.crm-stage-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crm-stage-name { flex-shrink: 0; width: 72px; font-size: 13px; color: var(--text); }
.crm-stage-bar { flex: 1; height: 18px; background: #eef2f7; border-radius: 9px; overflow: hidden; }
.crm-stage-bar > div { height: 100%; border-radius: 9px; }
.crm-stage-val { flex-shrink: 0; font-size: 12px; color: var(--text-light); min-width: 110px; text-align: right; }

.crm-rank-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crm-rank-idx { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.crm-rank-name { flex-shrink: 0; width: 72px; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-rank-bar { flex: 1; height: 16px; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.crm-rank-bar > div { height: 100%; background: linear-gradient(90deg, #1677ff, #38bdf8); border-radius: 8px; }
.crm-rank-val { flex-shrink: 0; font-size: 12px; color: var(--text-light); min-width: 90px; text-align: right; }

.crm-pay-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.crm-pay-item { text-align: center; }
.crm-pay-item span { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.crm-pay-item b { font-size: 18px; }
.crm-pay-bar { height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.crm-pay-bar > div { height: 100%; background: linear-gradient(90deg, #1677ff, #22c55e); border-radius: 6px; }

/* 商机销售预测汇总条 */
.opp-forecast { background: linear-gradient(120deg, #f0f6ff, #fafcff); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.opp-fc-main { display: flex; gap: 28px; flex-wrap: wrap; }
.opp-fc-item { display: flex; align-items: baseline; gap: 6px; }
.opp-fc-item span { font-size: 12px; color: var(--text-light); }
.opp-fc-item b { font-size: 20px; color: var(--text); }
.opp-fc-item.opp-fc-hl b { color: var(--primary); }
.opp-fc-stages { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.opp-fc-stage { font-size: 12px; color: var(--text-light); background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
.opp-fc-stage b { color: var(--primary); }

@media (max-width: 768px) {
  .crm-stat-row { grid-template-columns: repeat(2, 1fr); }
  .crm-rate-row, .crm-pay-row { grid-template-columns: 1fr; }
  .crm-stage-name, .crm-rank-name { width: 60px; }
}



/* ============ 移动端/Pad 补充适配（stage68：审批中心/待办/弹窗表单/言行一致编辑器） ============ */

/* --- 手机横屏 / Pad 竖屏 (≤768px) --- */
@media (max-width: 768px) {
  /* 待办面板：固定 380px 超出屏幕，改为左右贴边浮层 */
  .todo-panel {
    position: fixed; top: calc(58px + env(safe-area-inset-top, 0px));
    left: 10px; right: 10px; width: auto; max-height: 72vh;
  }
  .todo-panel-body { max-height: calc(72vh - 46px); }

  /* 言行一致表编辑器：内联 min-width 220/320px 撑破窄屏，解除并占满整行 */
  #view-container label[style*="min-width"] {
    min-width: 0 !important; width: 100%; display: flex; flex-wrap: wrap; gap: 6px;
  }
  #view-container label[style*="min-width"] select { flex: 1 1 auto; min-width: 0; max-width: 100%; }

  /* 顶栏适配刘海屏/手势条 */
  .topbar {
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* 弹窗：竖屏下高度用满可视区（dvh 兼容浏览器地址栏收展） */
  .modal-box, .modal-box-lg, .modal-box-xl { max-height: 92vh; max-height: 92dvh; }

  /* 流程项：窄屏允许换行，避免标题/按钮挤压 */
  .flow-item { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .flow-item .flow-type { flex-shrink: 0; }
  .flow-item .flow-body { flex: 1 1 100%; order: 3; }

  /* 标签页可横向滑动，不挤压 */
  .sheet-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* --- 手机竖屏 (≤480px) --- */
@media (max-width: 480px) {
  /* 顶栏省空间：隐藏「待办」文字只留铃铛+角标 */
  .todo-txt { display: none; }

  /* 弹窗底部按钮竖排占满，拇指易点 */
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn, .modal-foot .btn-primary { width: 100%; }

  /* 表单输入放大点击区域 */
  .modal-body .form-input { min-height: 42px; }
  .modal-body .btn, .modal-body .btn-primary, .modal-body .btn-primary-sm { min-height: 40px; }

  /* 弹窗贴边近全屏 */
  .modal-box, .modal-box-lg, .modal-box-xl { max-width: calc(100vw - 16px); border-radius: 10px; }
  .modal-overlay { padding: 8px; }

  /* 统计卡数字防溢出 */
  .stat-card .stat-value { font-size: 20px; word-break: break-all; }

  /* 待办面板单条卡片化，避免长标题截断难读 */
  .todo-item { padding: 10px; }
  .todo-item .t-title { white-space: normal; word-break: break-word; }

  /* 表格容器贴边 */
  .view-container { padding: 10px; }
}

/* --- 手机横屏（高度受限） --- */
@media (max-height: 480px) and (orientation: landscape) {
  .modal-box, .modal-box-lg, .modal-box-xl { max-height: 96vh; }
  .modal-body { padding: 12px 16px; }
  .todo-panel { top: calc(50px + env(safe-area-inset-top, 0px)); max-height: 82vh; }
  .workbench-hero { flex-direction: row; padding: 10px 16px; }
  .wb-cards { grid-template-columns: 1fr 1fr; }
}

/* --- Pad 竖屏 (769–1024px)：保持侧栏但收窄，表格容器给足滚动 --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .modal-box { width: 420px; }
  .modal-box-lg { width: 720px; }
  .todo-panel { width: 340px; }
}

/* ===== 可搜索下拉组件（大数据量选择器，输入即过滤） ===== */
.ss { position: relative; flex: 1; min-width: 0; }
.ss-ctl { position: relative; display: flex; align-items: center; width: 100%; }
.ss-ctl .ss-input { flex: 1; min-width: 0; padding-right: 46px; }
.ss-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-light); pointer-events: none; line-height: 1;
}
.ss-clear {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; line-height: 14px; text-align: center;
  border: none; background: #e5e7eb; color: #6b7280; border-radius: 50%;
  font-size: 10px; cursor: pointer; display: none; padding: 0;
}
.ss.has-val .ss-clear { display: block; }
.ss-clear:hover { background: #d1d5db; color: #374151; }
.ss-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 10001; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  max-height: 240px; overflow-y: auto; display: none; margin: 0; padding: 4px 0;
}
.ss.open .ss-panel { display: block; }
.ss-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text);
  line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-item:hover { background: #f3f4f6; }
.ss-item.ss-active { background: #eef2ff; }
.ss-item.ss-sel { color: var(--primary); font-weight: 600; }
.ss-empty { padding: 12px; text-align: center; color: var(--text-light); font-size: 13px; }
.ss-native { display: none !important; }

/* ============ 阶段九十五：战略与文化 ============ */
/* 三色文化卡：愿景深橙 / 使命橙 / 价值观琥珀（呼应原图三色） */
.cul-card { border-radius:10px; padding:14px 16px; margin-bottom:10px; border:1px solid; position:relative; overflow:hidden; }
.cul-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; }
.cul-vision  { background:#fff7f0; border-color:#ffd8bf; } .cul-vision::before  { background:#d46b08; }
.cul-mission { background:#fff9f0; border-color:#ffe3ba; } .cul-mission::before { background:#fa8c16; }
.cul-value   { background:#fffbf0; border-color:#ffeab8; } .cul-value::before   { background:#d48806; }
.cul-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.cul-badge { font-size:12px; font-weight:600; color:#874d00; }
.cul-ops { display:inline-flex; gap:10px; }
.cul-ops .link.danger { color:#f5222d; }
.cul-card-title { font-size:17px; font-weight:700; color:#262626; margin-bottom:4px; }
.cul-card-content { font-size:14px; color:#595959; line-height:1.7; }
.cul-section { margin-bottom:16px; }
.cul-ver-switch { display:inline-flex; gap:6px; margin-right:8px; }
.cul-head-left { display:flex; align-items:center; gap:8px; font-weight:600; }
/* 年度方针时间线 */
.policy-timeline { position:relative; padding-left:26px; }
.policy-timeline::before { content:''; position:absolute; left:8px; top:6px; bottom:6px; width:2px; background:#ffe3ba; }
.policy-item { position:relative; margin-bottom:12px; }
.policy-dot { position:absolute; left:-24px; top:14px; width:12px; height:12px; border-radius:50%; background:#fa8c16; border:2px solid #fff; box-shadow:0 0 0 2px #ffd8bf; }
.policy-card { background:#fff; border:1px solid #ffe3ba; border-radius:10px; padding:12px 16px; }
.policy-year { font-size:13px; font-weight:700; color:#d46b08; display:flex; align-items:center; justify-content:space-between; }
.policy-theme { font-size:15px; color:#262626; margin-top:4px; font-weight:600; }
.policy-memo { font-size:12px; color:#8c8c8c; margin-top:4px; }
/* 战略目标 */
.strategy-list { display:flex; flex-direction:column; gap:10px; }
.strategy-card { background:#f0f7ff; border:1px solid #c6e2ff; border-radius:10px; padding:12px 16px; }
.strategy-title { font-size:15px; font-weight:700; color:#12467f; display:flex; align-items:center; justify-content:space-between; }
.strategy-obj { font-size:13px; color:#434343; margin-top:4px; line-height:1.6; }
/* 工作台文化卡 */
.wb-culture { display:flex; align-items:center; gap:8px; background:linear-gradient(90deg,#fff7f0,#fff9f0,#fffbf0); border:1px solid #ffd8bf; border-radius:10px; padding:10px 16px; text-decoration:none; overflow:hidden; white-space:nowrap; }
.wb-culture-tag { font-size:12px; font-weight:700; padding:2px 8px; border-radius:4px; flex-shrink:0; }
.wb-culture-vision  { background:#ffe7d1; color:#873800; }
.wb-culture-mission { background:#ffedd1; color:#874d00; }
.wb-culture-value   { background:#fff1b8; color:#614700; }
.wb-culture-txt { font-size:14px; color:#434343; overflow:hidden; text-overflow:ellipsis; }
.wb-culture-more { margin-left:auto; font-size:12px; color:#d46b08; flex-shrink:0; }
/* 预算/预定战略锚条 */
.corp-anchor { display:flex; align-items:center; gap:12px; background:#f0f7ff; border:1px solid #c6e2ff; border-radius:8px; padding:8px 14px; margin:8px 0; font-size:13px; color:#12467f; flex-wrap:wrap; }
.corp-anchor-policy { overflow:hidden; text-overflow:ellipsis; }
.corp-anchor select { max-width:280px; }

/* ============ 阶段九十六：缺口看板（目标-预定-实绩 + 双向校准） ============ */
.gap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gap-table th, .gap-table td { padding: 8px 10px; border-bottom: 1px solid var(--border, #eee); text-align: left; white-space: nowrap; }
.gap-table th { color: #8a6d3b; font-weight: 600; background: #fffaf3; }
.gap-table td.gap-neg { color: #d9534f; font-weight: 600; }
.gap-table td.gap-pos { color: #3c9a5f; font-weight: 600; }
.gap-locked-row { background: #fff8f8; }
.gap-whole-row { background: #fdf6ec; }
.gap-whole-row td { border-top: 2px solid #e8c48f; }
.gap-ops a { margin-right: 8px; }
.gap-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12px; color: #9a8468; }
.cal-card { border: 1px solid #f0e3cf; border-left: 4px solid #d9a441; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; background: #fffdf8; }
.cal-card.cal-has-gap { border-left-color: #d9534f; background: #fffaf8; }
.cal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.cal-meta { font-size: 12px; color: #9a8468; }
.cal-line { font-size: 13px; margin-top: 4px; line-height: 1.6; }
.cal-k { color: #9a8468; }
.gap-c-up { background: #e8f6ec; color: #3c9a5f; }
.gap-c-down { background: #fdeaea; color: #d9534f; }
.gap-c-res { background: #e8f0fb; color: #3b7dd8; }
.gap-c-keep { background: #f0f0f0; color: #888; }

/* ============ 阶段九十七：评分表单化 + 共有会议 ============ */
.modal-info-item .perf-auto-box { background:#fffaf3; border:1px solid #f0e3cf; border-radius:8px; padding:10px 14px; font-size:13px; line-height:1.9; }
.sm-agenda-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
.sm-agenda-card { background:#fffdf8; border:1px solid #f0e3cf; border-left:4px solid #d9a441; border-radius:8px; padding:12px 16px; font-size:13px; line-height:1.8; }
.sm-agenda-t { font-weight:700; color:#8a6d3b; margin-bottom:6px; }
.sm-kpi { margin:6px 0 0 18px; padding:0; color:#5a4a33; }
.sm-kpi li { margin:2px 0; }
.modal-info-item { border:none; }

/* ============ 阶段一百〇六：言行一致表两段式（审批=编制预审 / 检视=结果验收） ============ */
.rv-banner { background:#fff4f4; border:1px solid #f3c9c9; border-left:4px solid #d9534f; border-radius:8px; padding:10px 14px; margin-bottom:12px; font-size:13px; line-height:1.8; color:#8a3b3b; }
.rv-inline { font-size:11px; margin-top:4px; }
.rv-inline.red { color:#d9534f; }
.rv-inline.yellow { color:#c8912a; }
.rv-inline.green { color:#4a9a5b; }
.rv-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.rv-content { font-size:13px; line-height:1.7; color:#333; margin-bottom:8px; }
.rv-detail { margin:6px 0 10px; }
.rv-detail summary { cursor:pointer; font-size:12px; color:#8a6d3b; padding:4px 0; }
.rv-logs { border-left:2px solid #ecdfc8; margin:6px 0 6px 6px; padding-left:12px; }
.rv-log { font-size:12px; line-height:1.9; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.rv-log-date { color:#999; font-family:monospace; }
.rv-log-note { color:#555; }
.rv-none { font-size:12px; color:#999; padding:4px 0; }
.rv-result { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:12px; padding-top:6px; border-top:1px dashed #eee; }
.rv-cmt { color:#666; }

/* ============================================================
   ===== 阶段107：评分真源收敛（巴长系数）+ 移动端适配补强 =====
   ============================================================ */

/* ---- 绩效评分：系数与最终分试算 ---- */
.pf-preview {
  background: linear-gradient(135deg, #f0f7ff 0%, #eef2ff 100%);
  border: 1px solid #dbeafe; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: #334155; line-height: 1.8;
}
.pf-final-num { color: var(--primary); font-size: 16px; }
.pf-final-grade {
  display: inline-block; min-width: 22px; text-align: center;
  background: var(--primary); color: #fff; border-radius: 6px;
  padding: 1px 8px; font-size: 13px; margin-left: 4px;
}

/* ---- 移动端表格卡片化（配合 app.js _mobilizeTables 自动打 data-label） ---- */
@media (max-width: 768px) {
  /* 表格转为卡片：表头隐藏，每个 td 变成「标签: 值」一行 */
  .panel-body table[data-mob] thead { display: none; }
  .panel-body table[data-mob],
  .panel-body table[data-mob] tbody { display: block; width: 100%; min-width: 0 !important; }
  .panel-body table[data-mob] tr {
    display: block; width: 100%;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 8px 12px; margin: 0 0 10px;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
  }
  .panel-body table[data-mob] td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    border: none; padding: 5px 0; text-align: right; font-size: 13px;
    word-break: break-word;
  }
  .panel-body table[data-mob] td::before {
    content: attr(data-label);
    color: var(--text-light); font-size: 12px; text-align: left;
    flex-shrink: 0; max-width: 40%;
  }
  .panel-body table[data-mob] td:empty { display: none; }
  .panel-body table[data-mob] td span.muted { font-size: 12px; }
  /* 卡片内按钮组：右对齐自动换行 */
  .panel-body table[data-mob] td .link { white-space: nowrap; }
  /* 数字/金额列在卡片里右对齐已足够；行首姓名列加粗 */
  .panel-body table[data-mob] td:first-child { font-weight: 500; }
  .panel-body table[data-mob] td b { font-size: 14px; }
  /* 卡片化后外层不再横滚：仅对卡片表格解除 min-width，不全局取消横向滚动
     （年度预算/月度预定未卡片化，需保留 overflow-x:auto 供冻结列矩阵表横滚） */
  .panel-body table[data-mob] { min-width: 0 !important; }

  /* 言行一致表：分数条小屏两列换行 */
  .tgt-score-bar { flex-wrap: wrap; gap: 8px; }
  .tgt-score { min-width: calc(50% - 8px); box-sizing: border-box; }
  /* 检视页/日报页块状内容贴边距 */
  .rv-banner, .rv-detail, .rv-logs { font-size: 12px; }
  /* 弹窗：竖屏占满并内部滚动，底部操作固定 */
  .modal-box, .modal-box-lg, .modal-box-xl {
    width: 100% !important; max-width: 100vw !important;
    height: 94vh; max-height: 94vh; border-radius: 12px 12px 0 0;
  }
  .modal-overlay { padding: 0 !important; align-items: flex-end; }
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  /* 表单字段间距收紧 */
  .form-item { margin-bottom: 10px; }
  .form-item label { font-size: 12px; }
}

@media (max-width: 480px) {
  .panel-body table[data-mob] tr { padding: 6px 10px; border-radius: 8px; }
  .panel-body table[data-mob] td { font-size: 12px; }
  .panel-body table[data-mob] td::before { font-size: 11px; }
  .tgt-score { min-width: 100%; }
  /* 待办/通知面板小屏占满 */
  .todo-panel, .notice-panel { width: 100vw !important; max-width: 100vw !important; }
}

/* 阶段134：日报行动进度条「时间基准」参考线 */
.rep-progress-track{position:relative}
.rep-progress-base{position:absolute;top:-3px;bottom:-3px;width:3px;background:#f59e0b;border-radius:2px;z-index:2;box-shadow:0 0 0 1px rgba(255,255,255,.6)}
.rep-progress-base-txt{font-size:11px;color:#d48806;flex-shrink:0;white-space:nowrap}

/* 阶段158-D9：工作台「今日三件事」聚合卡 */
.tflow-panel{border-left:4px solid #1677ff}
.tflow-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.tflow-step{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--border,#e8e8e8);border-radius:10px;background:#fafbfc}
.tflow-step.tflow-done{background:#f6ffed;border-color:#b7eb8f}
.tflow-step.tflow-todo{background:#fff7e6;border-color:#ffd591}
.tflow-step.tflow-rest{background:#f5f5f5;border-color:#e0e0e0;opacity:.85}
.tflow-num{font-size:22px;flex-shrink:0}
.tflow-body{flex:1;min-width:0;font-size:13px}
.tflow-act{flex-shrink:0}
.tflow-birthday{margin-bottom:10px;padding:8px 12px;background:linear-gradient(90deg,#fff0f6,#fff7e6);border:1px solid #ffadd2;border-radius:8px;font-size:13px;color:#c41d7f}
@media (max-width:900px){.tflow-steps{grid-template-columns:1fr}}

/* 阶段158-D10：遗留问题步骤任务逾期标红 */
tr.task-overdue td{background:#fff1f0}

/* ============ 阶段153：工作日历月历网格 ============ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid.cal-head { margin-bottom: 4px; }
.cal-grid.cal-head > div { text-align: center; font-size: 12px; color: var(--muted, #888); font-weight: 600; padding: 2px 0; }
.cal-cell { border: 1px solid var(--border); border-radius: 8px; min-height: 58px; padding: 4px 6px; font-size: 12px; }
.cal-cell.cal-empty { border: none; background: transparent; }
.cal-cell.cal-editable { cursor: pointer; transition: box-shadow .15s; }
.cal-cell.cal-editable:hover { box-shadow: 0 0 0 2px var(--primary, #1a73e8); }
.cal-cell .cal-d { font-weight: 700; font-size: 14px; }
.cal-cell .cal-t { font-size: 11px; opacity: .75; }
.cal-cell .cal-n { font-size: 11px; font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .cal-cell { min-height: 44px; padding: 2px 3px; }
  .cal-cell .cal-t { display: none; }
}

/* 方案36 A2：内容安全拦截字段高亮 */
.cg-hit { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgba(225, 29, 72, .15) !important; animation: cgShake .4s; }
.cg-hit-tip { color: #e11d48; font-size: 12px; margin-top: 4px; }
@keyframes cgShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ===== 阶段197：考勤统计三视图（个人档案矩阵） ===== */
.as-matrix { display: flex; flex-direction: column; gap: 2px; min-width: 960px; }
.as-row { display: flex; gap: 2px; align-items: center; }
.as-month-label { flex: 0 0 70px; font-size: 12px; color: #6b7280; font-weight: 600; white-space: nowrap; }
.as-cell { flex: 1; min-width: 24px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 4px; cursor: default; }
.as-cell.as-head { background: none; color: #9ca3af; font-size: 11px; height: 20px; }

/* ===== 2026-10-16：月度总览考勤日历格子条（每日状态 · 可横向拖拽查看整月） ===== */
.as-strip { max-width: 300px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #d1d5db transparent; }
.as-strip::-webkit-scrollbar { height: 6px; }
.as-strip::-webkit-scrollbar-track { background: transparent; }
.as-strip::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.as-strip::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.as-strip-inner { display: inline-flex; gap: 2px; }
.as-cell.as-mini { flex: 0 0 18px; min-width: 18px; height: 20px; font-size: 10px; border-radius: 3px; }

/* ===== 公司主体卡片（48号） ===== */
.cmp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px; }
.cmp-card { background:var(--card-bg); border:1px solid var(--border); border-radius:14px; padding:14px 14px 10px; display:flex; flex-direction:column; gap:10px; }
.cmp-head { display:flex; align-items:center; gap:10px; }
.cmp-logo { width:52px; height:52px; border-radius:10px; object-fit:contain; background:#f5f7fb; border:1px solid var(--border); flex:none; }
.cmp-logo-empty { display:flex; align-items:center; justify-content:center; font-size:24px; }
.cmp-head-main { min-width:0; }
.cmp-name { font-weight:700; font-size:15px; line-height:1.35; word-break:break-all; }
.cmp-sub { color:var(--text-light); font-size:12px; margin-top:2px; }
.cmp-rows { display:flex; flex-direction:column; }
.cmp-row { display:flex; gap:8px; padding:5px 0; border-bottom:1px dashed var(--border); font-size:13px; align-items:baseline; }
.cmp-row:last-child { border-bottom:none; }
.cmp-k { color:var(--text-light); flex:none; width:82px; }
.cmp-v { word-break:break-all; line-height:1.5; }
.cmp-mono { font-family:Menlo,Consolas,"Courier New",monospace; letter-spacing:.3px; }
.cmp-foot { border-top:1px solid var(--border); padding-top:8px; font-size:13px; white-space:nowrap; overflow-x:auto; }
