/* ================= 集团 OA 协同办公系统 · 全局样式 ================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e5e7eb;
  --bg: #f5f7fb;
  --card: #ffffff;
  --sidebar: #0f172a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* 图标统一尺寸（inline SVG 无 width/height，必须显式约束，否则会按 300x150 渲染） */
svg { display: inline-block; width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
.stat .ico svg { width: 22px; height: 22px; }
.topbar .icon-btn svg { width: 18px; height: 18px; }
.page-head .btn svg, .card .btn svg, .btn svg { width: 15px; height: 15px; }
.sidebar .nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar); color: #cbd5e1;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; overflow: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar #nav-badges { flex: 1; overflow-y: auto; padding-bottom: 10px; scrollbar-width: none; }
.sidebar #nav-badges::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar .brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px;
  color: #fff; font-weight: 600; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.sidebar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
  flex: 0 0 30px; box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.sidebar .brand .logo svg { width: 18px; height: 18px; }
.sidebar .brand .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .01em; }
.sidebar .group-title {
  padding: 16px 18px 6px; font-size: 11px; letter-spacing: .08em; color: #64748b; text-transform: uppercase;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: #cbd5e1; font-size: 13.5px;
  border-left: 3px solid transparent; cursor: pointer;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar .nav-item.active { background: rgba(37,99,235,.22); color: #fff; border-left-color: #3b82f6; font-weight: 600; }
.sidebar .nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.sidebar .nav-item .badge-count {
  margin-left: auto; background: #ef4444; color: #fff; border-radius: 10px; padding: 0 6px;
  font-size: 11px; line-height: 17px; min-width: 17px; text-align: center;
}
.sidebar .foot {
  margin-top: auto; padding: 12px 18px 16px; color: #64748b; font-size: 11.5px;
  border-top: 1px solid rgba(255,255,255,.07); background: rgba(2,6,23,.35);
}

.main { flex: 1; margin-left: 232px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; color: var(--text-2); border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.topbar .icon-btn:hover { background: #f8fafc; text-decoration: none; }
.topbar .icon-btn .dot {
  position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; font-size: 10px;
  border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center;
}
.topbar .user-chip { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--line); }
.topbar .user-chip .name { font-weight: 600; font-size: 13.5px; }
.topbar .user-chip .role { font-size: 11.5px; color: var(--text-3); }
.menu-toggle { display: none; }

.content { padding: 20px 22px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 18px; }
.page-head .sub { color: var(--text-3); font-size: 12.5px; }
.page-head .spacer { flex: 1; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card > .card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 14px;
}
.card > .card-head .spacer { flex: 1; }
.card > .card-body { padding: 16px 18px; }
.card > .card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: 300px minmax(0, 1fr); }
/* 组织架构页：左侧树更宽一些，长部门名有足够空间 */
.grid-side.org-side { grid-template-columns: 380px minmax(0, 1fr); }

/* 统计卡片 */
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico {
  width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat .num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat .label { color: var(--text-3); font-size: 12.5px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: 13.5px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; line-height: 1.4;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
.form-row { margin-bottom: 14px; }
.form-row > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-row .hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px;
  background: #fff; color: var(--text); font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.textarea { min-height: 88px; resize: vertical; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-row { margin-bottom: 0; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px; color: var(--text-3); font-weight: 600; font-size: 12.5px;
  background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:hover td { background: #fafbff; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 标签 / 徽标 ---------------- */
.tag {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 20px; font-size: 11.5px;
  background: #f1f5f9; color: var(--text-2); margin: 1px 3px 1px 0;
}
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-green { background: var(--success-soft); color: var(--success); }
.tag-orange { background: var(--warn-soft); color: var(--warn); }
.tag-red { background: var(--danger-soft); color: var(--danger); }
.tag-purple { background: #f5f3ff; color: #7c3aed; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-canceled { background: #f1f5f9; color: var(--text-3); }
.dept-path { color: var(--text-3); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600; flex: 0 0 34px;
}
.avatar-lg { width: 56px; height: 56px; font-size: 20px; flex: 0 0 56px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .meta { min-width: 0; }
.user-cell .meta .n { font-weight: 600; }
.user-cell .meta .s { font-size: 12px; color: var(--text-3); }

/* ---------------- 提示条 ---------------- */
.alert { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert-ok { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-err { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--primary-soft); color: #1e40af; border-color: #bfdbfe; }
.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% 10%, #1e3a8a 0%, #0f172a 45%, #020617 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 400px; background: rgba(255,255,255,.98); border-radius: 16px; padding: 32px 30px;
  box-shadow: 0 24px 60px rgba(2,6,23,.45);
}
.login-brand { display: flex; justify-content: center; margin-bottom: 16px; }
.login-box .title { font-size: 21px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.login-box .sub { color: var(--text-3); font-size: 13px; margin-bottom: 22px; text-align: center; }
.login-box .sub:last-child { margin-bottom: 0; }
.login-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.logo-lg {
  width: 52px; height: 52px; border-radius: 14px; font-size: 16px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
}
.logo-lg svg { width: 28px; height: 28px; }

/* 登录页单独做手机端适配（系统内页仍为固定 1280 布局，不受影响） */
body.login-body { min-width: 0; }
@media (max-width: 640px) {
  body.login-body .login-page { padding: 16px 12px 28px; align-items: flex-start; }
  body.login-body .login-box {
    max-width: 100%; padding: 24px 16px; border-radius: 14px; margin-top: 7vh;
  }
  body.login-body .login-box .title { font-size: 19px; }
  body.login-body .login-box .sub { font-size: 12.5px; margin-bottom: 18px; }
  body.login-body .logo-lg { width: 46px; height: 46px; }
  body.login-body .login-foot { font-size: 11.5px; }
  /* 内置滑块：小屏也保证轨道足够宽，滑块一定能拖到缺口 */
  body.login-body .oa-slider .track { width: 260px; max-width: none; }
}

/* ---------------- 聊天 ---------------- */
.chat-wrap { display: flex; height: calc(100vh - 160px); min-height: 460px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-side { width: 350px; flex: 0 0 350px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-side .head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.chat-side .list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f8fafc; cursor: pointer; }
.conv-item:hover { background: #f8fafc; text-decoration: none; }
.conv-item.active { background: var(--primary-soft); }
.conv-item .info { min-width: 0; flex: 1; }
/* 名称独占一行（最多两行），群标签换到下一行，避免群昵称被标签挤成省略号 */
.conv-item .info .top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.conv-item .info .n {
  flex: 1 1 100%; font-weight: 600; color: var(--text); font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all;
}
.conv-item .info .last { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .right { text-align: right; font-size: 11px; color: var(--text-3); white-space: nowrap; flex: 0 0 auto; }
.conv-item .unread { background: #ef4444; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .n { font-weight: 600; }
.chat-head .s { font-size: 12px; color: var(--text-3); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; background: #fafbfd; }
.msg-line { display: flex; gap: 10px; margin-bottom: 14px; }
.msg-line.self { flex-direction: row-reverse; }
.msg-line .bubble {
  max-width: 62%; padding: 9px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  white-space: pre-wrap; word-break: break-word; font-size: 13.5px;
}
.msg-line.self .bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.msg-line .meta { font-size: 11px; color: var(--text-3); align-self: flex-end; flex-wrap: wrap; max-width: 70%; }
.msg-line .meta .read { margin-left: 6px; cursor: pointer; }
.msg-line .meta .read.is-read { color: var(--success); }
.msg-line .meta .read.is-unread { color: var(--text-3); }
.msg-line.self .meta { text-align: right; justify-content: flex-end; }

/* 群消息已读明细（点击「N/M 已读」展开） */
.msg-line .read-detail { display: inline-block; margin-left: 6px; }
.msg-line .read-detail > summary { list-style: none; display: inline-block; cursor: pointer; }
.msg-line .read-detail > summary::-webkit-details-marker { display: none; }
.msg-line .read-detail > summary:hover { text-decoration: underline; }
.msg-line .read-detail .read-box {
  margin-top: 6px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  text-align: left; font-size: 12px; color: var(--text-2); max-width: 420px; box-shadow: var(--shadow);
}
.msg-line.self .read-detail .read-box { margin-left: auto; }
.chat-input { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { flex: 1; min-height: 42px; max-height: 140px; }

/* ---------------- 消息卡片 ---------------- */
.notice { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; margin-bottom: 12px; }
.notice.unread { border-color: #bfdbfe; background: #f8fbff; }
.notice .bar { width: 4px; border-radius: 4px; background: var(--primary); flex: 0 0 4px; }
.notice.level-success .bar { background: var(--success); }
.notice.level-warn .bar { background: var(--warn); }
.notice.level-danger .bar { background: var(--danger); }
.notice .body { flex: 1; min-width: 0; }
.notice .t { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice .c { color: var(--text-2); font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.notice .time { color: var(--text-3); font-size: 12px; }

/* ---------------- 审批流 ---------------- */
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.flow .node { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: #f1f5f9; font-size: 12.5px; }
.flow .node.done { background: var(--success-soft); color: var(--success); }
.flow .node.current { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.flow .node.rejected { background: var(--danger-soft); color: var(--danger); }
.flow .arrow { color: var(--text-3); }
.steps { margin: 10px 0 0; padding-left: 0; list-style: none; }
.steps li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.steps li .idx { width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 11.5px; flex: 0 0 22px; }
.steps li.approved .idx { background: var(--success); color: #fff; }
.steps li.rejected .idx { background: var(--danger); color: #fff; }
.steps li.pending .idx { background: var(--warn); color: #fff; }

/* 组织架构树 */
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul { list-style: none; padding-left: 0; margin: 0; }
.tree details > ul { margin-left: 12px; padding-left: 12px; border-left: 1px dashed #d7e0ee; }
.tree-row {
  display: flex; align-items: flex-start; flex-wrap: wrap; row-gap: 4px; gap: 8px;
  padding: 7px 9px; border-radius: 9px; cursor: pointer; min-width: 0; transition: background .15s;
}
.tree-row:hover { background: #f4f7fe; }
.tree-row.active { background: var(--primary-soft); box-shadow: inset 0 0 0 1px #bfdbfe; }
/* 部门名称最多两行完整展示，不再被截成省略号；标签放不下时自动换到下一行 */
.tree-row .tree-name {
  flex: 1 1 150px; font-weight: 600; font-size: 13.5px; color: var(--text); min-width: 0;
  line-height: 1.35; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tree-row a.tree-name { color: inherit; }
.tree-row a.tree-name:hover { color: var(--primary); text-decoration: none; }
.tree-row .tree-meta { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tree-row .tree-mgr { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 11.5px; }
.tree details > summary { list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary.tree-row::before {
  content: ''; width: 0; height: 0; flex: 0 0 0; margin-top: 6px;
  border-left: 5px solid #94a3b8; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s;
}
.tree details[open] > summary.tree-row::before { transform: rotate(90deg); }
.tree .tree-leaf { padding-left: 15px; }
.tree .dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; flex: 0 0 6px; margin-top: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; height: 19px; border-radius: 6px;
  background: #eef2f7; color: var(--text-2); font-size: 11.5px; white-space: nowrap;
}
.chip-blue { background: var(--primary-soft); color: var(--primary); }
.chip-green { background: var(--success-soft); color: var(--success); }
.chip-amber { background: var(--warn-soft); color: var(--warn); }
.tree-toolbar { display: flex; gap: 6px; }

/* 标签选择器 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tag-chip {
  border: 1px solid var(--line); background: #fff; color: var(--text-2); border-radius: 20px;
  padding: 3px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.tag-chip:hover { border-color: #bfdbfe; color: var(--primary); }
.tag-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-chip.preset { font-weight: 500; }

/* 凭据展示 */
.cred { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cred .val { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f8fafc; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; min-width: 160px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-size: 13.5px; border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--primary); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 撤回消息 */
.bubble.recalled { background: #f1f5f9 !important; color: var(--text-3) !important; border-color: var(--line) !important; font-style: italic; }
.msg-line .meta .btn { margin-left: 4px; }

/* 在线状态圆点 */
.online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; display: inline-block; margin-right: 5px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9);
}
.online-dot.is-online { background: var(--success); }

/* 云文档正文 */
.doc-body { line-height: 1.9; font-size: 14px; color: var(--text); word-break: break-word; }
.doc-body h1 { font-size: 22px; margin: 16px 0 10px; }
.doc-body h2 { font-size: 18px; margin: 16px 0 8px; }
.doc-body h3, .doc-body h4 { font-size: 15.5px; margin: 14px 0 6px; }
.doc-body p { margin: 8px 0; white-space: pre-wrap; }
.doc-body li { white-space: pre-wrap; }
.doc-body blockquote { white-space: pre-wrap; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { white-space: pre-wrap; }
.doc-body ul, .doc-body ol { margin: 8px 0 8px 22px; }
.doc-body li { margin: 3px 0; }
.doc-body code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.doc-body blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid #bfdbfe; background: #f8fbff; color: var(--text-2);
}
.doc-body .doc-code {
  background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.7; margin: 10px 0;
}
.doc-body a { color: var(--primary); }

/* 防截屏遮罩 */
.secure-overlay {
  position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center;
  background: #000; color: #f8fafc; text-align: center; padding: 30px;
}
.secure-overlay.show { display: flex; }
/* 黑屏时同步隐藏真实内容，避免遮罩渲染延迟导致瞬时泄露 */
body.oa-secure-hidden .app { visibility: hidden !important; }
/* 鼠标移出窗口时的隐私模糊（回到页面自动恢复，比黑屏更轻，避免刷新误触） */
body.oa-privacy .app { filter: blur(16px); }
body.oa-privacy::after {
  content: '内容已模糊保护 · 回到页面自动恢复';
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 13px; letter-spacing: .05em; pointer-events: none;
}

/* 细腻滚动条（避免出现粗重滑块） */
.chat-msgs, .chat-side .list, .table-wrap, .steps, details > div {
  scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.chat-msgs::-webkit-scrollbar, .chat-side .list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar, details > div::-webkit-scrollbar { width: 6px; height: 6px; }
.chat-msgs::-webkit-scrollbar-thumb, .chat-side .list::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb, details > div::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 4px;
}
.chat-msgs::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }
.secure-overlay .box { max-width: 520px; }
.secure-overlay h3 { margin: 0 0 8px; font-size: 18px; }
.secure-overlay p { color: #94a3b8; margin: 0; font-size: 13.5px; }
.secure-overlay .warn-icon { font-size: 40px; margin-bottom: 12px; }

@media print { body { display: none !important; } }

/* ===================== 不做手机端适配 =====================
 * 与 PC 端完全一致的布局：固定最小宽度，手机浏览器按 1280 宽度整体缩小显示，
 * 需要操作时由用户自行放大页面（因此不限制 user-scalable）。
 * ======================================================== */
body { min-width: 1280px; }

/* ===================== 全局细节优化 ===================== */
/* 键盘可达性 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
::placeholder { color: #b3bfd0; }
::selection { background: #bfdbfe; color: #0f172a; }

/* 全局细滚动条（不再出现粗重滑块） */
html { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
body::-webkit-scrollbar { width: 8px; height: 8px; }
body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
body::-webkit-scrollbar-track { background: transparent; }

/* 卡片与按钮微交互 */
.card { transition: box-shadow .18s ease, border-color .18s ease; }
.card:hover { box-shadow: 0 2px 6px rgba(15, 23, 42, .07), 0 12px 28px rgba(15, 23, 42, .07); }
.btn:active { transform: translateY(1px); }
.tag, .chip, .badge { white-space: nowrap; }
.dept-path { line-height: 1.5; }
.empty { padding: 38px 16px; }
.table td { color: var(--text); }
.mono, .cred .val { font-variant-numeric: tabular-nums; }

/* 统计卡：图标底色随指标区分 */
.stat .ico { position: relative; }
.stat:hover .ico { filter: brightness(1.04); }

/* 尊重"减少动效"偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===================== 极验 4.0 人机验证 ===================== */
.oa-captcha { margin: 4px 0 14px; }
.oa-captcha .oa-captcha-box { min-height: 44px; }
.oa-captcha .oa-captcha-tip { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.oa-captcha .oa-captcha-tip.err { color: var(--danger); }
.oa-captcha.done .oa-captcha-tip { color: var(--success); }
.oa-captcha.done .oa-captcha-box { display: none; }
.login-box .oa-captcha { margin: 2px 0 16px; }
.login-box .oa-captcha .oa-captcha-tip { text-align: center; }
.oa-captcha .oa-captcha-error {
  border: 1px dashed #fecaca; background: var(--danger-soft); color: #991b1b; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; text-align: center;
}
.oa-captcha.load-failed .oa-captcha-box { min-height: 0; }

/* ===================== 内置滑块人机验证 ===================== */
.oa-slider { margin: 4px 0 14px; user-select: none; }
.oa-slider .track {
  position: relative; width: 260px; max-width: 100%; height: 42px;
  background: var(--bg-2, #f1f5f9); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; touch-action: none;
}
.oa-slider .fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(90deg, rgba(37,99,235,.12), rgba(37,99,235,.22));
  border-right: 1px solid rgba(37,99,235,.35); width: 0; pointer-events: none;
}
.oa-slider .gap {
  position: absolute; top: 3px; height: 34px;
  background: repeating-linear-gradient(45deg, #dbe3ee, #dbe3ee 5px, #eef2f7 5px, #eef2f7 10px);
  border: 1px dashed #94a3b8; border-radius: 6px; pointer-events: none;
}
.oa-slider .handle {
  position: absolute; left: 0; top: 0; width: 40px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--primary); font-size: 20px; font-weight: 700; cursor: grab;
  box-shadow: 0 1px 4px rgba(15,23,42,.12); z-index: 2;
}
.oa-slider.dragging .handle { cursor: grabbing; box-shadow: 0 2px 10px rgba(37,99,235,.35); }
.oa-slider.done .handle { cursor: default; color: var(--success); border-color: var(--success); }
.oa-slider.done .gap { border-color: var(--success); }
.oa-slider .tip { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.oa-slider .tip.err { color: var(--danger); }
.oa-slider.done .tip { color: var(--success); }
.login-box .oa-slider { margin: 2px 0 16px; }
.login-box .oa-slider .track { margin: 0 auto; }
.login-box .oa-slider .tip { text-align: center; }

/* ===================== 首次登录强制绑定手机号 ===================== */
body.oa-force-bind { overflow: hidden; }
.bind-mask {
  /* 高于防截屏遮罩（99999），保证绑定窗口始终可见可操作 */
  position: fixed; inset: 0; z-index: 100000; background: rgba(15, 23, 42, .62);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.bind-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 28px 26px; box-shadow: 0 24px 60px rgba(2, 6, 23, .35);
}
.bind-card .bind-icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.bind-card .bind-icon svg { width: 24px; height: 24px; }
.bind-card h3 { margin: 0 0 6px; font-size: 17px; }
.bind-card p { margin: 0 0 16px; color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.bind-card .form-row { margin-bottom: 12px; }
.bind-card .bind-foot { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-3); }
