/* ============================================================
   欧莱 OA — Apple 风格设计系统
   浅色画布 #f5f5f7 / 近黑文字 #1d1d1f / 苹果蓝 #0071e3
   磨砂导航 · 白卡柔影 · 胶囊按钮 · 自动深色模式
   ============================================================ */
:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --line: rgba(0, 0, 0, .08);
  --line-soft: rgba(0, 0, 0, .05);
  --blue: #0071e3;
  --blue-press: #0062c4;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --input-bg: #f5f5f7;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, .10);
  --topbar-bg: rgba(251, 251, 253, .72);
  --sidebar-bg: rgba(251, 251, 253, .82);
  --nav-hover: rgba(0, 0, 0, .04);
  --btn-hover: rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", Helvetica, "Microsoft YaHei", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000;
    --panel: #1d1d1f;
    --panel-2: #232325;
    --line: rgba(255, 255, 255, .12);
    --line-soft: rgba(255, 255, 255, .08);
    --blue: #0a84ff;
    --blue-press: #0a75e0;
    --text: #f5f5f7;
    --muted: #98989d;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --input-bg: #1c1c1e;
    --topbar-bg: rgba(22, 22, 24, .72);
  --sidebar-bg: rgba(22, 22, 24, .82);
    --nav-hover: rgba(255, 255, 255, .08);
    --btn-hover: rgba(255, 255, 255, .1);
    --shadow: 0 4px 24px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, .6);
  }
}

/* 手动深色开关：覆盖系统偏好 */
[data-theme="dark"] {
  --bg: #000000;
  --panel: #1d1d1f;
  --panel-2: #232325;
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .08);
  --blue: #0a84ff;
  --blue-press: #0a75e0;
  --text: #f5f5f7;
  --muted: #98989d;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --input-bg: #1c1c1e;
  --topbar-bg: rgba(22, 22, 24, .72);
  --sidebar-bg: rgba(22, 22, 24, .82);
  --nav-hover: rgba(255, 255, 255, .08);
  --btn-hover: rgba(255, 255, 255, .1);
  --shadow: 0 4px 24px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 侧边栏（左右结构） ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  width: 212px; display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px;
  overflow: hidden;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 6px 6px 22px; font-weight: 600; font-size: 18px; letter-spacing: .2px; }
.side-brand .brand-img { display: block; max-width: 100%; height: auto; }
.side-brand .brand-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .side-brand .brand-logo-light { display: none; }
  :root:not([data-theme]) .side-brand .brand-logo-dark { display: block; }
}
[data-theme="dark"] .side-brand .brand-logo-light { display: none; }
[data-theme="dark"] .side-brand .brand-logo-dark { display: block; }
.side-brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #0a84ff, #0071e3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 12px rgba(0, 113, 227, .35);
}
.side-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  transition: background .2s, color .2s; position: relative;
}
.nav-item .nav-ic { width: 20px; height: 20px; display: inline-flex; flex: none; }
.nav-item .nav-ic svg { width: 20px; height: 20px; }
.nav-item:hover { text-decoration: none; color: var(--text); background: var(--nav-hover); }
.nav-item.active { color: var(--blue); background: rgba(0, 113, 227, .1); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--blue);
}
.side-foot { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border-radius: 12px; text-decoration: none; color: inherit;
  transition: background .15s;
}
.side-user:hover { background: var(--btn-hover); text-decoration: none; }
.side-user .side-user-go { margin-left: auto; font-size: 18px; color: var(--muted); opacity: .5; transition: opacity .15s, transform .15s; }
.side-user:hover .side-user-go { opacity: 1; color: var(--blue); transform: translateX(2px); }
.side-user .avatar { width: 36px; height: 36px; font-size: 13px; flex: none; }
.side-uinfo { min-width: 0; }
.side-uinfo .nm { font-size: 14px; font-weight: 600; }
.side-uinfo .rl { font-size: 12px; color: var(--muted); }
.side-actions { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.logout-link { color: var(--muted); font-size: 13px; margin-left: auto; }
.logout-link:hover { color: var(--red); text-decoration: none; }
.menu-btn {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 19px; line-height: 1;
  align-items: center; justify-content: center;
}
.nav-mask { display: none; }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
  transition: background .2s, transform .1s; flex: none;
}
.theme-toggle:hover { background: var(--btn-hover); }
.theme-toggle:active { transform: scale(.92); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 布局 ---------- */
.wrap { max-width: none; margin: 0 0 0 212px; padding: 40px 44px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.eyebrow {
  display: inline-block;
  font-size: 12px; letter-spacing: .4px; color: var(--muted);
  text-transform: none; margin-bottom: 8px;
}
h1.page-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- 卡片 ---------- */
.card {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .25s, transform .25s;
}
.card.grad { box-shadow: var(--shadow); }
.card h3 { margin: 0 0 16px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 统计数字卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  border-radius: var(--radius); padding: 22px 24px;
  background: var(--panel); border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  transition: box-shadow .25s, transform .25s;
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card .num { font-size: 42px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--text); }
.stat-card .num.blue { color: var(--blue); }
.stat-card .num.green { color: var(--green); }
.stat-card .num.red { color: var(--red); }
.stat-card .lbl { color: var(--muted); font-size: 14px; margin-top: 8px; }
.stat-hint { font-size: 12px; color: var(--blue); margin-top: 10px; opacity: 0; transform: translateY(-2px); transition: opacity .2s, transform .2s; }
.stat-card.link:hover .stat-hint { opacity: 1; transform: translateY(0); }
/* 可点击数字：整卡跳转 */
.stat-card.link { cursor: pointer; text-decoration: none; display: block; color: inherit; position: relative; }
.stat-card.link::after {
  content: "›"; position: absolute; top: 18px; right: 20px;
  font-size: 26px; line-height: 1; color: var(--muted);
  opacity: .35; transition: opacity .2s, transform .2s;
}
.stat-card.link:hover::after { opacity: .9; color: var(--blue); transform: translateX(3px); }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px;
  letter-spacing: .3px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl td.ellipsis { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 徽章/状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 980px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.st-pending    { background: rgba(255, 149, 0, .14); color: #c77700; }
.st-processing { background: rgba(0, 113, 227, .12); color: var(--blue); }
.st-resolved   { background: rgba(52, 199, 89, .14); color: #248a3d; }
.st-none       { background: rgba(110, 110, 115, .14); color: var(--muted); }
.badge.gold { background: rgba(0, 113, 227, .12); color: var(--blue); }

/* ---------- 表单 ---------- */
input[type=text], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; outline: none; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .15);
}
label.f { display: block; color: var(--muted); font-size: 13px; margin: 18px 0 7px; font-weight: 500; }
label.f b { color: var(--red); margin-right: 3px; }

/* ---------- 按钮（胶囊） ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 980px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--text);
  cursor: pointer; font-size: 14.5px; font-weight: 500; font-family: inherit;
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn:hover { text-decoration: none; background: var(--btn-hover); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--blue); color: #fff;
  border: none; font-weight: 600;
}
.btn.primary:hover { background: var(--blue-press); }
.btn.sm { padding: 6px 15px; font-size: 13.5px; }
.btn.danger { border-color: rgba(255, 59, 48, .4); color: var(--red); background: rgba(255, 59, 48, .08); }

/* ---------- 提示条 ---------- */
.flash { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14.5px; }
.flash.ok { background: rgba(52, 199, 89, .14); color: #248a3d; }
.flash.err { background: rgba(255, 59, 48, .12); color: #d70015; }
@media (prefers-color-scheme: dark) { .flash.ok { color: #4cd964; } .flash.err { color: #ff6961; } }

/* ---------- 周报期次分组 ---------- */
.day-head { display: flex; align-items: center; gap: 14px; margin: 30px 0 12px; }
.day-head .d { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.day-head .line { flex: 1; height: 1px; background: var(--line); }
.report-item { display: flex; gap: 13px; padding: 14px 6px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.report-item:hover { background: var(--panel-2); }

/* ---------- 图表 ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-box { height: 320px; }

/* ---------- 登录页（苹果大留白） ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-inner { width: 400px; max-width: 100%; }
.login-logo {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 26px; box-shadow: var(--shadow);
}
.login-card { width: 100%; padding: 32px 30px; margin-top: 6px; }
.login-theme { position: fixed; top: 18px; right: 18px; z-index: 60; }
.qr-tip { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 问题跟进内联编辑（平滑展开） ---------- */
.issue-edit {
  max-height: 0; overflow: hidden; opacity: 0;
  border-top: 1px solid var(--line); margin-top: 0; padding-top: 0;
  transition: max-height .35s ease, opacity .3s ease, margin-top .35s ease, padding-top .35s ease;
}
.issue-edit.open {
  max-height: 640px; opacity: 1; margin-top: 14px; padding-top: 16px;
}
.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 14px; }
.muted { color: var(--muted); }
.gold { color: var(--blue); }
.mt0 { margin-top: 0; } .mt1 { margin-top: 12px; } .mt2 { margin-top: 22px; }
.row { display: flex; gap: 14px; align-items: center; }
.row .grow { flex: 1; }
.filelink { display: inline-flex; align-items: center; gap: 5px; margin: 4px 10px 4px 0; font-size: 13.5px; }
.hr-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 覆盖全局 input{width:100%}，让筛选控件回到一行内自适应宽度 */
.hr-filter .f-in { width: auto; min-width: 150px; flex: 0 1 auto; }
.hr-filter input[name=q] { min-width: 160px; }
.hr-filter .btn { width: auto; padding: 8px 18px; flex: none; }

/* ---------- 问题跟进：手机端字段栅格（仿企微智能表） ---------- */
.iss-grid { display: none; }
.iss-ops { display: none; }
/* 桌面端字段块（严格按 Excel 字段显示） */
.iss-field { margin-top: 8px; }
.iss-field .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.iss-field .fval { font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.iss-field .fval-note { background: rgba(91,160,240,.06); border-left: 3px solid rgba(91,160,240,.4); padding: 8px 12px; border-radius: 0 8px 8px 0; }
@media (max-width: 700px) {
  .iss-card { padding: 4px 16px 12px; }
  .iss-default { display: none; }
  .iss-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }
  .iss-grid .cell {
    padding: 11px 0 13px;
    border-bottom: 1px solid var(--line-soft);
    min-width: 0;
  }
  .iss-grid .cell.span2 { grid-column: 1 / -1; }
  .iss-grid .cell:nth-last-child(-n+2) { border-bottom: none; }
  .iss-grid .lbl {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .iss-grid .val { font-size: 14.5px; line-height: 1.65; word-break: break-word; }
  .iss-grid .val-desc {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .iss-ops { display: flex; justify-content: flex-end; padding-top: 6px; }
}

/* ---------- 悬浮新建按钮（手机端） ---------- */
.fab {
  display: none; position: fixed; right: 20px; bottom: 30px; z-index: 40;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 28px; font-weight: 300; line-height: 1;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 113, 227, .40);
  transition: transform .15s, background .2s;
}
.fab:hover { text-decoration: none; background: var(--blue-press); }
.fab:active { transform: scale(.92); }
@media (max-width: 700px) { .fab { display: inline-flex; } }

/* ---------- 手机端：表格转卡片（仿企微智能表样式） ---------- */
@media (max-width: 700px) {
  .tbl-cards { background: transparent; border: none; box-shadow: none; padding: 0; }
  .tbl-cards table, .tbl-cards tbody { display: block; }
  .tbl-cards thead { display: none; }
  .tbl-cards tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 6px 16px;
    margin: 14px 0;
  }
  .tbl-cards td {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
    min-width: 0;
  }
  .tbl-cards td:last-child { border-bottom: none; }
  .tbl-cards td::before {
    content: attr(data-l);
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .tbl-cards td.span2 { grid-column: 1 / -1; }
  .tbl-cards td[colspan] { grid-column: 1 / -1; }
  .tbl-cards td[colspan]::before { content: none; }
  .tbl-cards td.acts { flex-wrap: wrap; gap: 8px; }
  .tbl-cards td.acts .btn { flex: none; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
    box-shadow: var(--shadow-hover);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-mask { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 49; }
  .menu-btn { display: inline-flex; }
  .wrap { margin-left: 0; padding: 72px 18px 60px; }
  .chart-grid { grid-template-columns: 1fr; }
  h1.page-title { font-size: 26px; }
}

/* ---------- 成员管理：企微通讯录（左部门树 + 右成员卡片） ---------- */
.users-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.dept-tree {
  position: sticky; top: 20px;
  padding: 12px 10px;
  max-height: calc(100vh - 60px);
  overflow: auto;
}
.dept-node {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-radius: 10px;
  font-size: 14px; cursor: pointer;
  color: var(--text);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dept-node:hover { background: var(--btn-hover); }
.dept-node.active { background: rgba(0, 113, 227, .1); color: var(--blue); font-weight: 600; }
.dept-icon { font-size: 14px; flex: none; }
.dept-name { overflow: hidden; text-overflow: ellipsis; }
.dept-count {
  margin-left: auto; flex: none;
  font-size: 11px; color: var(--muted);
  background: var(--input-bg); border-radius: 980px;
  padding: 1px 8px;
}
.dept-node.active .dept-count { color: var(--blue); background: rgba(0, 113, 227, .12); }
.dept-arrow {
  flex: none; width: 14px;
  font-size: 11px; color: var(--muted);
  text-align: center; cursor: pointer;
  transition: transform .2s; user-select: none;
}
.dept-arrow.none { visibility: hidden; }
.dept-item.collapsed > .dept-node .dept-arrow { transform: rotate(-90deg); }
.dept-item.collapsed > .dept-children { display: none; }
.dept-children { margin-left: 14px; border-left: 1px solid var(--line-soft); padding-left: 6px; }

.dept-members-wrap { min-width: 0; }
.member-search {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  position: sticky; top: 12px; z-index: 5;
}
.ms-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.ms-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.14); }
.ms-ico { font-size: 14px; opacity: .55; flex: none; }
.member-search input[type=search] {
  flex: 1; width: auto; border: 0; background: transparent;
  height: 100%; padding: 0; font-size: 14.5px; color: var(--text);
  outline: none; -webkit-appearance: none; appearance: none;
}
.member-search input[type=search]::-webkit-search-cancel-button { display: none; }
.ms-clear {
  flex: none; border: 0; background: var(--input-bg); color: var(--text-2);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  font-size: 14px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.ms-clear:hover { background: var(--btn-hover); color: var(--text); }
.ms-count {
  flex: none; font-size: 12.5px; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 980px; padding: 6px 14px; white-space: nowrap;
}
.member-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-2);
  padding: 54px 0; font-size: 14px;
}
.dept-members {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1320px) {
  .dept-members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.member-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(0,113,227,.28); }
.member-top { display: flex; align-items: center; gap: 12px; }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; box-shadow: 0 3px 10px rgba(0,0,0,.10); }
.member-id { min-width: 0; flex: 1; }
.member-name { display: flex; align-items: center; gap: 6px; font-size: 15.5px; flex-wrap: wrap; }
.member-name b { font-weight: 600; }
.member-dept {
  font-size: 12px; color: var(--muted);
  background: var(--input-bg);
  border-radius: 8px; padding: 6px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-ops {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border-top: 1px solid var(--line-soft); padding-top: 11px; margin-top: auto;
}
/* 卡片内表单/控件：覆盖全局 100% 宽，防止被撑竖排 */
.member-ops form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.member-ops select {
  width: auto; padding: 5px 22px 5px 9px; font-size: 12.5px; border-radius: 8px;
  background-color: var(--input-bg); cursor: pointer;
}
.member-ops input[type=password] {
  width: auto; flex: 1 1 auto; min-width: 0; padding: 5px 9px; font-size: 12.5px; border-radius: 8px;
}
.member-ops .btn.sm { padding: 5px 12px; font-size: 12.5px; white-space: nowrap; }
.member-ops .role-form { flex: 1 1 100%; }
.member-ops .role-form select { width: 100%; }
.member-ops .pass-form { flex: 1 1 100%; }
.member-ops .pass-form[hidden] { display: none !important; }
.member-ops .pass-form input[type=password] { flex: 1; width: auto; min-width: 0; }

/* --- 图标化操作区 --- */
.mo-icons { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
.mo-icons form { display: inline-flex; }
.mo-ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; min-width: 32px; padding: 0 10px;
  font-size: 14px; line-height: 1;
  color: var(--text-2);
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 9px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.mo-ibtn:hover { background: var(--btn-hover); color: var(--text); }
.mo-ibtn:active { transform: scale(.95); }
.mo-ibtn:disabled { opacity: .38; cursor: not-allowed; }
.mo-ibtn:disabled:hover { background: var(--input-bg); color: var(--text-2); }
.mo-ibtn.danger:hover { background: #fdeceb; color: #d33a2c; border-color: #f6c9c4; }
.mo-ibtn.ok:hover { background: #e7f7ee; color: #1a9e4b; border-color: #b9e6cc; }
.mo-ibtn.report { font-size: 12px; font-weight: 600; padding: 0 11px; }
.mo-ibtn.report .mo-tt { font-size: 12px; }
.mo-ibtn.report.on { background: var(--blue); color: #fff; }
.mo-ibtn.report.on:hover { background: #0062c4; color: #fff; }
.mo-ibtn.key { font-size: 13px; }
.mo-ibtn.key:hover { border-color: rgba(0,113,227,.3); color: var(--blue); }
.member-ops.pass-open .mo-ibtn.key { background: rgba(0,113,227,.1); color: var(--blue); }

@media (max-width: 900px) {
  .users-layout { grid-template-columns: 1fr; }
  .dept-tree { position: static; max-height: 300px; }
  .member-search { position: static; flex-wrap: wrap; }
  .ms-count { order: 3; margin-left: auto; }
}
@media (max-width: 700px) {
  .dept-members { grid-template-columns: 1fr; gap: 12px; }
  .member-card { padding: 14px 14px 12px; border-radius: 14px; }
  .member-ops select { font-size: 13px; padding: 8px 24px 8px 11px; }
  .mo-ibtn { height: 36px; min-width: 36px; border-radius: 10px; }
  .mo-ibtn.report { padding: 0 14px; }
}

/* ---------- 成员档案抽屉 ---------- */
.pf-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 90;
}
.pf-mask.open { opacity: 1; visibility: visible; }
.pf-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 540px; max-width: 92vw;
  background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(0, 0, 0, .18);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 100; overflow: auto;
}
.pf-drawer.open { transform: translateX(0); }
.pf-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pf-close:hover { background: var(--btn-hover); }
.pf-body { padding: 24px 22px 60px; }
.pf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; flex-wrap: wrap; }
.pf-tab {
  background: none; border: none; padding: 8px 12px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
  text-decoration: none;
}
.pf-tab i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 2px; }
.pf-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.pf-pane { display: none; }
.pf-pane.active { display: block; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pf-stat {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 14px; text-align: center;
  font: inherit; color: inherit; width: 100%; display: block;
}
.pf-stat b { display: block; font-size: 22px; font-weight: 700; }
.pf-stat span { font-size: 12px; color: var(--muted); }
/* 可点击的概览卡片 */
.pf-stat.clickable { cursor: pointer; text-decoration: none; transition: border-color .18s, box-shadow .18s, transform .18s; position: relative; }
.pf-stat.clickable:hover { border-color: var(--blue); box-shadow: 0 4px 16px rgba(0,113,227,.14); transform: translateY(-2px); text-decoration: none; }
.pf-stat.clickable::after {
  content: "›"; position: absolute; top: 8px; right: 10px;
  font-size: 15px; color: var(--muted); opacity: 0; transition: opacity .18s;
}
.pf-stat.clickable:hover::after { opacity: .85; color: var(--blue); }
.pf-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pf-sub .badge { text-decoration: none; cursor: pointer; transition: filter .15s, transform .15s; }
.pf-sub .badge:hover { filter: brightness(.94); transform: translateY(-1px); text-decoration: none; }
.tbl.mini { font-size: 13px; }
.tbl.mini td, .tbl.mini th { padding: 9px 10px; }

/* 打卡 4 次分段表（上午/下午 上下班） */
.tbl.ck-4x th { text-align: center; font-weight: 600; color: var(--text-2); background: var(--input-bg); }
.tbl.ck-4x th[rowspan] { vertical-align: middle; }
.tbl.ck-4x td { text-align: center; }
.tbl.ck-4x td:first-child { text-align: left; font-weight: 500; }
.tbl.ck-4x td:last-child { text-align: left; }
.tbl.ck-4x tr.ck-off td { color: var(--muted); opacity: .72; }
.ck-np { font-size: 11.5px; color: #c26a00; background: rgba(255,149,0,.14); border-radius: 980px; padding: 1px 8px; }
/* 手机端专用元素，桌面端隐藏 */
.ck-tag, .ck-pin { display: none; }
.ck-loc-dash { display: none; }

/* 角色权限管理 */
.roles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.role-card { padding: 18px; }
.role-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.role-name { font-size: 16px; }
.role-key { font-size: 12px; color: var(--muted); background: var(--line-soft); padding: 2px 6px; border-radius: 6px; margin-left: 6px; }
.role-perms { display: flex; flex-direction: column; gap: 6px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.perm-item:hover { background: var(--btn-hover); }
.perm-item.locked { opacity: .7; cursor: not-allowed; }
.perm-label { font-weight: 500; }
.perm-code { font-size: 11px; color: var(--muted); margin-left: auto; }
/* ---------- 汇报给：联系人选择器（企微风） ---------- */
.rcpt-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--line);
  min-height: 52px;
  transition: border-color .2s, box-shadow .2s;
}
.rcpt-chips:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.15); }
.rcpt-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 980px; padding: 4px 12px 4px 5px;
  font-size: 13.5px; font-weight: 500; line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 34, 78, .06);
}
.rcpt-chip .avatar { width: 26px; height: 26px; font-size: 11px; }
.rcpt-chip .chip-x {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 0 0 0 2px;
}
.rcpt-chip .chip-x:hover { color: var(--red); }
.chip-add {
  height: 34px; border-radius: 980px; flex: none;
  padding: 0 15px 0 11px; gap: 5px;
  border: 1px dashed var(--blue); color: var(--blue);
  background: rgba(51, 120, 255, .06); cursor: pointer;
  font-size: 14px; font-weight: 500; font-family: inherit; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, transform .1s;
}
.chip-add .plus { font-size: 17px; font-weight: 400; }
.chip-add:hover { background: rgba(51, 120, 255, .14); }
.chip-add:active { transform: scale(.95); }

.picker-mask {
  position: fixed; inset: 0; background: rgba(10, 20, 45, .5);
  display: none; align-items: center; justify-content: center;
  z-index: 120; padding: 20px;
}
.picker-mask.open { display: flex; }
.picker {
  width: 720px; max-width: 100%; max-height: 86vh;
  background: var(--panel); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(10, 20, 45, .35);
  display: flex; flex-direction: column; overflow: hidden;
}
.picker-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.picker-head h3 { margin: 0 0 12px; font-size: 16.5px; }
.picker-head input { width: 100%; padding: 9px 13px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--line); color: var(--text); font-size: 14.5px; }
.pk-body { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 0; flex: 1; }
.pk-tree { overflow: auto; padding: 10px 8px; border-right: 1px solid var(--line-soft); max-height: 52vh; }
.pk-list { overflow: auto; padding: 8px 10px; max-height: 52vh; }
.pk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.pk-item:hover { background: var(--btn-hover); }
.pk-item.off { opacity: .45; cursor: not-allowed; }
.pk-item .avatar { width: 32px; height: 32px; font-size: 12px; }
.pk-item .pk-nm { font-size: 14.5px; font-weight: 500; }
.pk-item .pk-dp { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-item .pk-box {
  margin-left: auto; flex: none; width: 19px; height: 19px; border-radius: 6px;
  border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; transition: background .15s, border-color .15s;
}
.pk-item.sel .pk-box { background: var(--blue); border-color: var(--blue); }
.pk-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--panel-2);
}
.pk-foot .cnt { font-size: 13.5px; color: var(--muted); }
.pk-foot .cnt b { color: var(--blue); }
.pk-foot .sp { flex: 1; }

/* 移动端选人弹窗：置底单列（需在基础样式之后覆盖） */
@media (max-width: 860px) {
  .picker .pk-body { grid-template-columns: 1fr; }
  .picker .pk-tree { max-height: 150px; border-right: none; border-bottom: 1px solid var(--line-soft); }
  .picker { height: 100vh; max-height: 100vh; border-radius: 0; }
  .picker-mask { padding: 0; }
}

/* ---------- 会议列表筛选条 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 980px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
}
.filter-chip:hover { text-decoration: none; background: var(--btn-hover); color: var(--text); }
.filter-chip b { font-size: 14px; color: var(--text); font-weight: 700; }
.filter-chip.on {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.filter-chip.on b { color: #fff; }
.filter-owner {
  margin-left: 6px; font-size: 13px; color: var(--muted);
  padding: 6px 12px; border-radius: 980px;
  background: rgba(0,113,227,.1); color: var(--blue);
}
.filter-owner b { color: var(--blue); }
.filter-owner a { margin-left: 6px; font-size: 12.5px; }

/* 看板数字可点击 */
.stat-card.link { cursor: pointer; text-decoration: none; display: block; color: inherit; }
.stat-card.link:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card .num.clickable { transition: color .2s; }

/* 自动同步状态条（成员管理） */
.sync-status {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12.5px; color: var(--text-2);
  background: var(--bg-soft, rgba(127,127,127,.06));
  border: 1px solid var(--border);
  border-radius: 980px; padding: 5px 14px;
}
.sync-status b { color: var(--text-1); font-weight: 600; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.sync-dot.ok { background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.16); }
.btn.loading { opacity: .6; pointer-events: none; }

/* ---------- 我的档案页 ---------- */
.card-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head-row h3 { margin: 0; }
.month-pill { margin-left: auto; font-size: 12.5px; color: var(--text-2); background: var(--input-bg); border-radius: 980px; padding: 5px 14px; }
.tabs-inline { display: inline-flex; gap: 4px; background: var(--input-bg); border-radius: 980px; padding: 3px; }
.tab-btn {
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 980px;
  display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s;
}
.tab-btn i { font-style: normal; font-size: 11px; color: var(--muted); background: var(--panel); border-radius: 980px; padding: 0 6px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--panel); color: var(--blue); box-shadow: var(--shadow); font-weight: 600; }
.tab-btn.active i { color: var(--blue); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 月度统计表 */
.tbl.month-tbl th { background: var(--input-bg); }
.tbl.month-tbl td, .tbl.month-tbl th { text-align: left; }
.tbl.month-tbl tr.row-cur { background: rgba(0, 113, 227, .06); }
.tbl.month-tbl tr.row-cur td:first-child a { color: var(--blue); font-weight: 600; }
.tbl.month-tbl a { text-decoration: none; }
.tbl.month-tbl a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .pf-stats { grid-template-columns: repeat(3, 1fr) !important; }
  .card-head-row { align-items: flex-start; }
  .month-pill { width: 100%; margin-left: 0; text-align: center; }
}

/* ========== 我的档案页 · 手机端优化 ========== */
@media (max-width: 700px) {

  /* --- 页头：竖排，资料行紧凑 --- */
  .me-page .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
  }
  .me-page .page-head h1.page-title { font-size: 24px; }
  .me-page .page-head .muted { font-size: 12px !important; }
  .me-page .me-head-side {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; text-align: left !important;
  }
  .me-page .me-head-side .muted { margin-top: 0 !important; text-align: left; }
  .me-page .me-head-side .btn { flex: none; }

  /* --- 卡片与内边距收紧 --- */
  .me-page .card { padding: 16px 14px; border-radius: 16px; }
  .me-page .card h3 { font-size: 16px; margin-bottom: 12px; }
  .me-page .card-head-row { gap: 8px; }

  /* --- 汇总：3×2 网格，数字放大 --- */
  .me-page .pf-stats {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 0;
  }
  .me-page .pf-stat {
    padding: 12px 6px !important;
    border-radius: 12px;
  }
  .me-page .pf-stat b { font-size: 22px !important; }
  .me-page .pf-stat span { font-size: 11px !important; white-space: nowrap; }

  /* --- 明细区：标题 + 月份上下两行 --- */
  .me-page .card-head-row { flex-direction: column; align-items: stretch; }
  .me-page .card-head-row > h3:first-child { display: flex; align-items: baseline; justify-content: space-between; }
  .me-page .card-head-row > .muted { font-size: 12px; }
  .me-page .month-pill {
    width: 100%; margin-left: 0; text-align: center;
    padding: 7px 14px; font-size: 12.5px;
  }

  /* --- Tabs：四等分通栏，加大点按面积 --- */
  .me-page .tabs-inline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
  }
  .me-page .tab-btn {
    justify-content: center;
    padding: 9px 4px;
    border-radius: 10px;
    font-size: 13px;
    gap: 3px;
    flex-direction: column;
  }
  .me-page .tab-btn i { font-size: 10.5px; background: transparent; padding: 0; }
  .me-page .tab-btn.active i { color: var(--blue); }

  /* ========== 月度统计：表格转卡片 ========== */
  .me-page .tbl-cards table,
  .me-page .tbl-cards tbody { display: block; width: 100%; }
  .me-page .tbl-cards thead { display: none; }
  .me-page .tbl-cards tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 4px 14px;
    margin: 10px 0;
  }
  .me-page .tbl-cards tr.row-cur { border-color: rgba(0,113,227,.45); box-shadow: 0 0 0 3px rgba(0,113,227,.08); }
  .me-page .tbl-cards td {
    display: block;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    min-width: 0;
    text-align: left !important;
  }
  .me-page .tbl-cards td:last-child { border-bottom: none; }
  .me-page .tbl-cards td::before {
    content: attr(data-l);
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 3px;
  }
  /* 月份作为卡片标题通栏 */
  .me-page .tbl-cards td.mc-month {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 15px; font-weight: 700;
    padding: 11px 0 9px;
    border-bottom: 1px solid var(--line-soft);
  }
  .me-page .tbl-cards td.mc-month::before { content: none; }
  .me-page .tbl-cards td.mc-month a { color: var(--text); }
  .me-page .tbl-cards tr.row-cur td.mc-month a { color: var(--blue); }
  .me-page .tbl-cards td.mc-month::after {
    content: '查看明细 ›';
    font-size: 11.5px; font-weight: 500; color: var(--muted);
  }
  .me-page .tbl-cards tr.row-cur td.mc-month::after { color: var(--blue); }

  /* ========== 打卡 4 次表：表格转「两行卡片」 ========== */
  .me-page .tbl.ck-4x { font-size: 14px; }
  .me-page .tbl.ck-4x thead { display: none; }
  .me-page .tbl.ck-4x tr:first-child { display: none; }  /* 兼容无 thead 的写法 */
  .me-page .tbl.ck-4x,
  .me-page .tbl.ck-4x tbody { display: block; width: 100%; }
  .me-page .tbl.ck-4x tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin: 10px 0;
  }
  .me-page .tbl.ck-4x tr.ck-off { background: var(--panel-2); }
  .me-page .tbl.ck-4x td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
  }
  .me-page .tbl.ck-4x td::before {
    content: attr(data-l);
    font-size: 12px; color: var(--muted); font-weight: 500;
    flex: none;
  }
  /* 日期通栏标题 */
  .me-page .tbl.ck-4x td.ck-date {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14.5px; font-weight: 700;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-soft);
  }
  .me-page .tbl.ck-4x td.ck-date::before { content: none; }
  /* 日期右侧状态（未打卡 / 天数序号） */
  .me-page .tbl.ck-4x td.ck-date .ck-tag {
    display: inline;
    font-size: 11.5px; font-weight: 500; color: var(--muted);
  }
  .me-page .tbl.ck-4x tr.ck-off td.ck-date .ck-tag { color: #c26a00; }
  /* 地点通栏 */
  .me-page .tbl.ck-4x td.ck-loc {
    grid-column: 1 / -1;
    font-size: 12px;
    justify-content: flex-start;
    gap: 0;
    color: var(--muted);
    padding-top: 4px;
  }
  .me-page .tbl.ck-4x td.ck-loc::before { content: none; }
  /* 未打卡：整行无地点，只显示标签（已在日期右侧显示，此处隐藏重复） */
  .me-page .tbl.ck-4x tr.ck-off td.ck-loc { display: none; }
  .me-page .tbl.ck-4x td.ck-loc .ck-pin { display: inline; flex: none; margin-right: 5px; font-size: 12px; }
  /* 未打卡行：打卡时间列整体弱化 */
  .me-page .tbl.ck-4x tr.ck-off td[data-l] { color: var(--muted); opacity: .65; }

  /* ========== 请假 / 加班 / 出差表：转卡片 ========== */
  .me-page .card .tab-pane > .tbl:not(.ck-4x) { display: block; width: 100%; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) tbody { display: block; width: 100%; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin: 10px 0;
  }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) tr:first-child { display: none; } /* 无 thead 的旧写法 */
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0; border: 0; text-align: right !important;
    font-size: 13.5px;
  }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td::before {
    content: attr(data-l);
    font-size: 12px; color: var(--muted); font-weight: 500; flex: none;
  }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td.mc-title { grid-column: 1 / -1; justify-content: flex-start; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td.mc-title::before { content: none; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td.span2 { grid-column: 1 / -1; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td.mc-reason {
    grid-column: 1 / -1; flex-direction: column; align-items: flex-start;
    text-align: left !important; gap: 3px;
  }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td.mc-reason::before { margin-bottom: 2px; }
  .me-page .card .tab-pane > .tbl:not(.ck-4x) td .ellipsis {
    max-width: none !important; white-space: normal !important;
    text-align: left; font-size: 13px;
  }
  .me-page .empty { padding: 34px 0; }
}

@media (max-width: 380px) {
  .me-page .pf-stat b { font-size: 20px !important; }
  .me-page .tab-btn { font-size: 12px; padding: 8px 2px; }
  .me-page .tbl.ck-4x tr,
  .me-page .card .tab-pane > .tbl:not(.ck-4x) tr { padding: 10px 12px; }
}

/* ========== 人事管理页 · 手机端优化 ========== */
@media (max-width: 700px) {

  /* --- 页头：竖排 --- */
  .hr-page .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .hr-page .page-head h1.page-title { font-size: 24px; }
  .hr-page .sync-status { font-size: 12px; flex-wrap: wrap; }
  .hr-page .hr-head-acts {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .hr-page .hr-head-acts .btn {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
  }
  .hr-page .hr-head-acts .muted {
    align-self: stretch !important;
    text-align: left;
    line-height: 1.5;
  }

  /* --- 汇总：2×2 网格，避免 4 个挤在一行 --- */
  .hr-page .pf-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .hr-page .pf-stat { padding: 13px 8px !important; border-radius: 12px; }
  .hr-page .pf-stat b { font-size: 21px !important; }
  .hr-page .pf-stat span { font-size: 11.5px !important; white-space: nowrap; }

  /* --- 筛选：两列网格，日期上下排 --- */
  .hr-page .hr-filter {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 8px;
    align-items: center;
  }
  .hr-page .hr-filter .f-in {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
    grid-column: 1 / -1;
  }
  .hr-page .hr-filter input[name=q] { min-width: 0; }
  .hr-page .hr-filter input[type=text] { grid-column: 1 / -1; }
  /* 「至」小字与第二个日期同排 */
  .hr-page .hr-filter > .muted { grid-column: 1; text-align: center; font-size: 12px; }
  .hr-page .hr-filter .btn { width: auto; padding: 10px 14px; justify-content: center; }
  .hr-page .hr-filter .btn:last-child { grid-column: 2; }
  .hr-page .hr-filter .btn[type=submit] { grid-column: 1; }
  /* 假期统计（balance）筛选：年度 label 通栏 + 不换行 */
  .hr-page .hr-filter .lq-f {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    white-space: nowrap;
    flex-wrap: nowrap;
  }
  .hr-page .hr-filter .lq-f .f-in { width: 130px; min-width: 0; flex: none; }

  /* --- Tab：横向可滑，通栏 --- */
  .hr-page .pf-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    margin: 12px 0 !important;
    padding-bottom: 2px;
  }
  .hr-page .pf-tabs::-webkit-scrollbar { display: none; }
  .hr-page .pf-tab {
    flex: 1 0 auto;
    justify-content: center;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* --- 卡片容器收紧 --- */
  .hr-page .card { padding: 6px 12px; border-radius: 16px; }
  .hr-page .empty { padding: 34px 0; }

  /* ========== 审批表（请假/加班/出差）转卡片 ========== */
  .hr-page .tbl-cards table,
  .hr-page .tbl-cards tbody { display: block; width: 100%; }
  .hr-page .tbl-cards thead { display: none; }
  .hr-page .tbl-cards tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin: 10px 0;
  }
  .hr-page .tbl-cards td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0; border: 0; text-align: right !important;
    font-size: 13.5px; min-width: 0;
  }
  .hr-page .tbl-cards td::before {
    content: attr(data-l);
    font-size: 12px; color: var(--muted); font-weight: 500; flex: none;
  }
  /* 首列（姓名+状态）通栏标题 */
  .hr-page .tbl-cards td.mc-title {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 15px; font-weight: 700;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-soft);
    gap: 10px;
  }
  .hr-page .tbl-cards td.mc-title::before { content: none; }
  /* 状态列在卡片标题已显示，隐藏重复 */
  .hr-page .tbl-cards td[data-l="状态"] { display: none; }
  .hr-page .tbl-cards td.mc-reason {
    grid-column: 1 / -1;
    flex-direction: column; align-items: flex-start;
    text-align: left !important; gap: 3px;
    padding-top: 4px;
  }
  .hr-page .tbl-cards td.mc-reason::before { margin-bottom: 2px; }
  .hr-page .tbl-cards td .ellipsis {
    max-width: none !important; white-space: normal !important;
    text-align: left; font-size: 13px; line-height: 1.55;
  }

  /* ========== 打卡 4 次表转卡片 ========== */
  .hr-page .tbl.ck-4x { font-size: 14px; }
  .hr-page .tbl.ck-4x thead { display: none; }
  .hr-page .tbl.ck-4x,
  .hr-page .tbl.ck-4x tbody { display: block; width: 100%; }
  .hr-page .tbl.ck-4x tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin: 10px 0;
  }
  .hr-page .tbl.ck-4x tr.ck-off { background: var(--panel-2); }
  .hr-page .tbl.ck-4x td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0; border: 0; text-align: right !important;
    font-variant-numeric: tabular-nums;
  }
  .hr-page .tbl.ck-4x td::before {
    content: attr(data-l);
    font-size: 12px; color: var(--muted); font-weight: 500; flex: none;
  }
  .hr-page .tbl.ck-4x td::before:empty { content: none; }
  /* 姓名通栏标题（含打卡次数/未打卡） */
  .hr-page .tbl.ck-4x td.ck-name {
    grid-column: 1 / -1;
    font-size: 15px; font-weight: 700;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-soft);
  }
  .hr-page .tbl.ck-4x td.ck-name::before { content: none; }
  .hr-page .tbl.ck-4x td.ck-name .ck-tag {
    display: inline;
    font-size: 11.5px; font-weight: 500; color: var(--muted);
  }
  .hr-page .tbl.ck-4x tr.ck-off td.ck-name .ck-tag { color: #c26a00; }
  /* 日期：紧跟标题行 */
  .hr-page .tbl.ck-4x td.ck-date {
    grid-column: 1 / -1;
    justify-content: flex-start;
    font-size: 12.5px; color: var(--text-2);
    padding-bottom: 4px;
  }
  .hr-page .tbl.ck-4x td.ck-date::before { content: none; }
  /* 地点通栏 */
  .hr-page .tbl.ck-4x td.ck-loc {
    grid-column: 1 / -1;
    justify-content: flex-start;
    font-size: 12px; color: var(--muted);
    padding-top: 4px;
  }
  .hr-page .tbl.ck-4x td.ck-loc::before { content: none; }
  .hr-page .tbl.ck-4x td.ck-loc .ck-pin { display: inline; flex: none; margin-right: 5px; font-size: 12px; }
  .hr-page .tbl.ck-4x tr.ck-off td[data-l] { color: var(--muted); opacity: .65; }
}

@media (max-width: 380px) {
  .hr-page .pf-stat b { font-size: 19px !important; }
  .hr-page .pf-tab { padding: 9px 12px; font-size: 13px; }
}

/* ================= 假期额度管理页 ================= */
.lq-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.lq-tool {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 14px 16px;
}
.lq-tool-t { font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.lq-tool .btn { margin-top: 4px; }
.lq-f { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.lq-f .f-in { width: auto; min-width: 92px; flex: 0 1 auto; padding: 8px 11px; }
.lq-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.55; }

.lq-tbl th { text-align: center; }
.lq-tbl td { text-align: center; }
.lq-tbl td.lq-name { text-align: left; font-weight: 600; }
.lq-tbl td.lq-dept { text-align: left; font-size: 12.5px; }
.lq-tbl td.lq-acts { text-align: right; }
.lq-left { color: #1a9e4b; font-weight: 600; }
.lq-over { color: #d33a2c; font-weight: 600; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 110; opacity: 0; visibility: hidden; transition: opacity .22s; }
.modal.show { opacity: 1; visibility: visible; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.42); }
.modal-box {
  position: relative; z-index: 1;
  max-width: 560px; width: calc(100% - 32px);
  margin: 6vh auto 0;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28);
  max-height: 88vh; overflow: auto;
  transform: translateY(10px); transition: transform .22s;
}
.modal.show .modal-box { transform: none; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x {
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px;
  display: grid; place-items: center; padding: 0;
}
.modal-x:hover { background: var(--btn-hover); color: var(--text); }
.modal-body { padding: 18px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.lq-grid { display: grid; gap: 14px; }
.lq-row {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 12px 14px;
}
.lq-row-t { font-weight: 600; font-size: 13.5px; margin-bottom: 9px; }
.lq-row .lq-f { margin-right: 12px; }
.lq-row .lq-f .f-in { min-width: 84px; }

/* ---- 手机端 ---- */
@media (max-width: 700px) {
  .lq-page .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .lq-page .page-head h1.page-title { font-size: 24px; }
  .lq-page .page-head .row { display: flex; gap: 8px; }
  .lq-page .page-head .row .btn { flex: 1; justify-content: center; padding: 11px 10px; }
  .lq-page .pf-stats { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; margin-bottom: 14px !important; }
  .lq-page .pf-stat { padding: 13px 8px !important; }
  .lq-page .pf-stat b { font-size: 21px !important; }
  .lq-page .pf-stat span { font-size: 11.5px !important; }
  .lq-page .card { padding: 16px 14px; border-radius: 16px; }
  .lq-tools { grid-template-columns: 1fr; }
  .lq-tool .btn { width: 100%; justify-content: center; padding: 11px; }
  .lq-tool .lq-f { display: flex; justify-content: space-between; margin: 8px 0; }
  .lq-tool .lq-f .f-in { min-width: 0; width: 110px; }
  .lq-page .hr-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .lq-page .hr-filter .f-in,
  .lq-page .hr-filter .lq-f { grid-column: 1 / -1; width: 100%; }
  .lq-page .hr-filter .lq-f { display: flex; justify-content: space-between; }
  .lq-page .hr-filter .lq-f .f-in { min-width: 0; width: 130px; }
  .lq-page .hr-filter .btn { justify-content: center; padding: 10px; }
  .lq-page .hr-filter > .muted { grid-column: 1 / -1; }

  /* 额度表转卡片 */
  .lq-tbl { display: block; width: 100%; }
  .lq-tbl tbody { display: block; width: 100%; }
  .lq-tbl thead { display: none; }
  .lq-tbl tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin: 10px 0;
  }
  .lq-tbl td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0; border: 0; text-align: right !important;
    font-size: 13.5px; min-width: 0;
  }
  .lq-tbl td::before {
    content: attr(data-l);
    font-size: 12px; color: var(--muted); font-weight: 500; flex: none;
  }
  .lq-tbl td::before:empty { content: none; }
  .lq-tbl td.lq-name {
    grid-column: 1 / -1;
    font-size: 15px; font-weight: 700;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left !important;
  }
  .lq-tbl td.lq-name::before { content: none; }
  .lq-tbl td.lq-dept {
    grid-column: 1 / -1;
    justify-content: flex-start; font-size: 12.5px;
    padding-bottom: 4px;
  }
  .lq-tbl td.lq-dept::before { content: none; }
  .lq-tbl td.lq-acts {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 8px;
  }
  .lq-tbl td.lq-acts::before { content: none; }
  .lq-tbl td.lq-acts .btn { width: 100%; justify-content: center; }

  /* 弹窗 */
  .modal-box { margin-top: 3vh; max-height: 94vh; width: calc(100% - 20px); border-radius: 16px; }
  .modal-head { padding: 15px 16px 11px; }
  .modal-body { padding: 14px 16px 18px; }
  .modal-foot .btn { flex: 1; justify-content: center; padding: 11px; }
  .lq-row .lq-f { display: flex; justify-content: space-between; margin: 8px 0; }
  .lq-row .lq-f .f-in { min-width: 0; width: 130px; }
}
