/* ===== 全局变量 ===== */
:root {
  --c-primary: #2b6cb0;
  --c-primary-dark: #1e4d7b;
  --c-primary-light: #ebf4fb;
  --c-accent: #dd6b20;
  --c-success: #2f855a;
  --c-warning: #d69e2e;
  --c-danger: #c53030;
  --c-info: #319795;

  --c-bg: #f5f7fa;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-border-dark: #cbd5e0;
  --c-text: #1a202c;
  --c-text-secondary: #4a5568;
  --c-text-muted: #718096;

  --c-high: #c53030;
  --c-mid: #d69e2e;
  --c-low: #38a169;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);

  --radius: 8px;
  --radius-sm: 4px;

  --sidebar-w: 220px;
  --header-h: 56px;
}

/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--c-primary); text-decoration: none; }
ul { list-style: none; }

/* ===== 布局 ===== */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--c-primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}
.sidebar-brand .logo {
  width: 28px; height: 28px;
  background: var(--c-accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; }
.nav-section-title {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  padding: 14px 14px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-foot {
  padding: 12px 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--c-text-secondary);
  padding-left: 12px; margin-left: 4px;
  border-left: 1px solid var(--c-border);
}
.topbar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.topbar-user .avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.topbar-user .user-meta { line-height: 1.3; }
.topbar-user .user-name {
  font-size: 13px; font-weight: 600; color: var(--c-text);
  display: flex; align-items: center; gap: 6px;
}
.topbar-user .user-level {
  font-size: 10px; font-weight: 500; color: var(--c-text-muted);
  background: var(--c-bg); padding: 1px 6px; border-radius: 8px;
  border: 1px solid var(--c-border);
}
.topbar-user .user-badges { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.topbar-user .user-badges .badge { font-size: 10px; padding: 1px 6px; }
.content { padding: 24px; flex: 1; }

/* 身份切换弹窗 */
.user-pick-list { display: flex; flex-direction: column; gap: 6px; }
.user-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); cursor: pointer;
  transition: all .15s;
}
.user-pick:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.user-pick.active { border-color: var(--c-success); background: #f0fff4; }
.user-pick-info { flex: 1; line-height: 1.4; }
.user-pick-info .user-badges { display: flex; gap: 4px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.user-pick-info .user-level {
  font-size: 10px; font-weight: 500; color: var(--c-text-muted);
  background: var(--c-bg); padding: 1px 6px; border-radius: 8px;
  border: 1px solid var(--c-border);
}

/* 只读排班横幅 */
.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px;
  background: #fffbeb; border: 1px solid #fbd38d;
  border-left: 4px solid var(--c-warning);
  border-radius: var(--radius-sm);
  font-size: 13px; color: #744210; line-height: 1.5;
}
.readonly-banner .rb-icon { font-size: 18px; }
.schedule-table.day-grid.readonly td.day-cell { cursor: default; }
.schedule-table.day-grid.readonly td.day-cell:hover { background: transparent; }
.schedule-table.day-grid.readonly td.day-cell.empty-day:hover { background: var(--c-bg); }
.sched-card.readonly .day-chip { cursor: default; }

/* ===== 通用组件 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-outline { background: #fff; border-color: var(--c-border-dark); color: var(--c-text-secondary); }
.btn-outline:hover { background: var(--c-bg); border-color: var(--c-text-muted); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost { color: var(--c-text-secondary); padding: 4px 8px; }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.data-table th {
  background: var(--c-bg);
  font-weight: 600;
  color: var(--c-text-secondary);
  font-size: 12px;
  white-space: nowrap;
  position: sticky; top: 0;
}
.data-table tbody tr:hover { background: var(--c-primary-light); }
.data-table .actions { display: flex; gap: 4px; }

/* 标签/徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-high { background: #fed7d7; color: #9b2c2c; }
.badge-mid { background: #feebc8; color: #9c4221; }
.badge-low { background: #c6f6d5; color: #276749; }
.badge-info { background: #bee3f8; color: #2c5282; }
.badge-success { background: #c6f6d5; color: #276749; }
.badge-warning { background: #feebc8; color: #9c4221; }
.badge-muted { background: #e2e8f0; color: #4a5568; }
.badge-danger { background: #fed7d7; color: #9b2c2c; }

/* 状态点 */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-running { background: var(--c-success); }
.dot-prep { background: var(--c-warning); }
.dot-done { background: var(--c-text-muted); }
.dot-pause { background: var(--c-danger); }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--c-text-secondary); margin-bottom: 4px; font-weight: 600; }
.form-row label .req { color: var(--c-danger); }
.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-border-dark);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(43,108,176,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-lg { max-width: 820px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-close { font-size: 22px; color: var(--c-text-muted); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--c-text); }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }

/* 筛选栏 */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input[type=text], .toolbar input[type=date] {
  padding: 7px 10px; border: 1px solid var(--c-border-dark); border-radius: var(--radius-sm); font-size: 13px;
}

/* 页面标题 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.page-head .desc { font-size: 13px; color: var(--c-text-muted); margin-top: 2px; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--c-text-muted); }
.empty .icon { font-size: 40px; margin-bottom: 8px; }

/* Toast */
#toast-container { position: fixed; top: 70px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1a202c; color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 360px;
}
.toast.success { background: var(--c-success); }
.toast.error { background: var(--c-danger); }
.toast.warning { background: var(--c-warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* 进度条 */
.progress { height: 6px; background: var(--c-border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--c-primary); border-radius: 3px; transition: width .3s; }

/* 排班表 */
.schedule-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.schedule-table th, .schedule-table td {
  border: 1px solid var(--c-border);
  padding: 0;
  vertical-align: top;
}
.schedule-table th {
  background: var(--c-primary-dark);
  color: #fff;
  font-weight: 600;
  padding: 8px 6px;
  text-align: center;
  position: sticky; top: 0; z-index: 2;
}
.schedule-table th.member-col {
  background: var(--c-primary);
  position: sticky; left: 0; z-index: 3;
  min-width: 110px;
  text-align: left; padding-left: 10px;
}
.schedule-table td.member-cell {
  background: var(--c-surface);
  position: sticky; left: 0; z-index: 1;
  padding: 6px 10px;
  font-weight: 600;
  border-right: 2px solid var(--c-border-dark);
  white-space: nowrap;
}
.schedule-table td.member-cell .role-tag { font-size: 10px; color: var(--c-text-muted); font-weight: 400; }
.schedule-table td.week-cell { min-width: 150px; padding: 4px; cursor: pointer; transition: background .1s; }
.schedule-table td.week-cell:hover { background: var(--c-primary-light); }
.schedule-table td.week-cell.empty-week { background: var(--c-bg); }
.schedule-table td.week-cell .week-label {
  font-size: 10px; color: var(--c-text-muted);
  padding: 2px 4px; border-bottom: 1px dashed var(--c-border);
  margin-bottom: 3px;
}
.assign-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 6px;
  margin: 2px 0;
  border-radius: 3px;
  font-size: 11px;
  gap: 4px;
}
.assign-chip .proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-chip .alloc { font-size: 10px; font-weight: 700; flex-shrink: 0; }
.assign-chip .rm { cursor: pointer; opacity: .5; }
.assign-chip .rm:hover { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--c-text-secondary); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-color { width: 14px; height: 14px; border-radius: 3px; }

/* 按天排班网格 */
.schedule-table.day-grid th.member-col { min-width: 120px; }
.schedule-table.day-grid th.day-h {
  min-width: 58px; width: 58px; padding: 4px 2px; text-align: center;
  font-weight: 600; line-height: 1.25;
}
.schedule-table.day-grid th.day-h .day-h-num { font-size: 13px; }
.schedule-table.day-grid th.day-h .day-h-wk { font-size: 10px; opacity: .85; font-weight: 400; }
.schedule-table.day-grid th.day-h.weekend { background: var(--c-primary); }
.schedule-table.day-grid th.day-h.today { background: var(--c-danger); }
.schedule-table.day-grid th.day-h.today .day-h-wk::after { content: '·今天'; }

.schedule-table.day-grid td.day-cell {
  min-width: 58px; width: 58px; padding: 2px; cursor: pointer;
  transition: background .1s; vertical-align: top;
}
.schedule-table.day-grid td.day-cell { cursor: pointer; }
.schedule-table.day-grid td.day-cell:hover { background: var(--c-primary-light); }
.schedule-table.day-grid td.day-cell.weekend { background: var(--c-bg); }
.schedule-table.day-grid td.day-cell.today { box-shadow: inset 0 0 0 2px var(--c-danger); }
.schedule-table.day-grid td.day-cell.empty-day { background: var(--c-bg); }
.schedule-table.day-grid td.day-cell.empty-day:hover { background: var(--c-primary-light); }
.schedule-table.day-grid td.day-cell.overload { background: #fff5f5; }
.schedule-table.day-grid td.day-cell.hit { box-shadow: inset 0 0 0 2px var(--c-warning); }
.schedule-table.day-grid td.day-cell .day-total { text-align: center; margin-bottom: 2px; }
.schedule-table.day-grid td.day-cell .day-total .badge { font-size: 9px; padding: 1px 4px; }
.schedule-table.day-grid td.day-cell .day-chips { display: flex; flex-direction: column; gap: 2px; }

.day-chip {
  display: flex; align-items: center; gap: 2px;
  padding: 2px 3px; border-radius: 3px; font-size: 10px; line-height: 1.2;
  border-left: 3px solid; overflow: hidden;
}
.day-chip .dc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.day-chip .dc-alloc { font-size: 9px; font-weight: 700; flex-shrink: 0; }
.day-chip .dc-rm { cursor: pointer; opacity: .45; font-size: 12px; line-height: 1; padding: 0 1px; flex-shrink: 0; }
.day-chip .dc-rm:hover { opacity: 1; }
.day-chip.dim { opacity: .35; }

.schedule-table td.member-cell .row-stat {
  font-size: 10px; color: var(--c-text-muted); font-weight: 400; margin-top: 2px;
}

/* 行内复选 */
.inline-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-text-secondary); cursor: pointer; user-select: none; }
.inline-check input { cursor: pointer; }


/* 周报 */
.weekly-card { margin-bottom: 14px; }
.weekly-card .week-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.completion-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
}
.section-block { margin-bottom: 14px; }
.section-block .sb-title { font-size: 12px; font-weight: 700; color: var(--c-text-secondary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.section-block .sb-content { background: var(--c-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; white-space: pre-wrap; line-height: 1.6; }

/* 选择列表 */
.check-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--c-border); cursor: pointer; }
.check-item:hover { background: var(--c-primary-light); }
.check-item input { margin: 0; }

/* 帮助文字 */
.help { font-size: 11px; color: var(--c-text-muted); margin-top: 3px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* 月份切换 */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .month-label { font-size: 16px; font-weight: 700; min-width: 130px; text-align: center; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }

/* ===== 职级标签 (11档) ===== */
.level-tag {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600; background: #edf2f7; color: var(--c-text-secondary);
  white-space: nowrap; line-height: 1.4;
}
.level-tag.level-10 { background: #fff5f5; color: #c53030; }       /* 部门经理 */
.level-tag.level-9 { background: #faf5ff; color: #6b46c1; }        /* 权益合伙人 */
.level-tag.level-8 { background: #fffaf0; color: #c05621; }        /* 授薪合伙人 */
.level-tag.level-7 { background: #feebc8; color: #7b341e; }        /* 三级经理 */
.level-tag.level-6, .level-tag.level-5 { background: #ebf8ff; color: #2c5282; } /* 一/二级经理 */
.level-tag.level-4, .level-tag.level-3 { background: #e6fffa; color: #234e52; } /* 项目经理甲/乙等 */
.level-tag.level-2, .level-tag.level-1, .level-tag.level-0 { background: #edf2f7; color: #4a5568; } /* 审计员 */

/* ===== 状态 Tab (周报审核) ===== */
.status-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.status-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--c-border);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--c-text-secondary);
  transition: all .15s;
}
.status-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.status-tab.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.status-tab .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--c-bg); color: var(--c-text-secondary); font-size: 11px; font-weight: 700;
}
.status-tab.active .tab-count { background: rgba(255,255,255,.28); color: #fff; }

/* ===== 审核信息块 ===== */
.audit-block {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  border-left: 3px solid; font-size: 13px; line-height: 1.6;
}
.audit-block.audit-pass { background: #f0fff4; border-left-color: var(--c-success); }
.audit-block.audit-reject { background: #fff5f5; border-left-color: var(--c-danger); }

/* ===== 待审核卡片高亮 ===== */
.card-highlight-warn { box-shadow: 0 0 0 1px var(--c-warning); border-color: var(--c-warning); }

/* 按钮成功/危险色 (审核用) */
.btn-success { background: var(--c-success); color: #fff; border: 1px solid var(--c-success); }
.btn-success:hover { filter: brightness(.95); }

.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--c-text-muted); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ===== 登录 / 注册页 ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 12px;
  padding: 32px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-logo {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.auth-logo img {
  width: 30px; height: 30px; object-fit: contain; display: block;
}
.auth-title { font-size: 20px; font-weight: 700; color: var(--c-text); }
.auth-sub { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--c-border); margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 10px; text-align: center; border: none; background: none;
  font-size: 14px; font-weight: 600; color: var(--c-text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.auth-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-group label {
  display: block; font-size: 13px; font-weight: 600; color: var(--c-text-secondary);
  margin-bottom: 6px;
}
.auth-error { color: var(--c-danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.auth-submit { width: 100%; padding: 11px; font-size: 15px; font-weight: 600; }
.auth-hint { text-align: center; font-size: 12px; color: var(--c-text-muted); margin-top: 14px; }
.auth-demo { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--c-border); }
.auth-demo-title { font-size: 12px; color: var(--c-text-muted); margin-bottom: 8px; }
.auth-demo-list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 6px; border: 1px solid var(--c-border); background: var(--c-bg);
  font-size: 11px; cursor: pointer; transition: all .15s; font-family: inherit;
}
.demo-chip:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.demo-tag { font-size: 10px; color: var(--c-text-muted); }
.code-info { font-size: 12px; margin-top: 4px; }
.code-ok { color: var(--c-success); }
.code-bad { color: var(--c-danger); }

/* ===== Tab 栏 (通用) ===== */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); }
.tab-btn {
  padding: 8px 18px; border: none; background: none; font-size: 14px;
  font-weight: 600; color: var(--c-text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.tab-btn:hover { color: var(--c-primary); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ===== 表单组 (通用) ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-secondary); margin-bottom: 5px; }

/* ===== 统计小卡 ===== */
.stat-mini {
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
  padding: 12px 20px; text-align: center; min-width: 100px;
}
.stat-mini-val { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-mini-label { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }

/* ===== 邀请码 ===== */
.invite-code {
  font-family: 'Courier New', monospace; font-size: 14px; font-weight: 700;
  background: var(--c-primary-light); color: var(--c-primary);
  padding: 3px 10px; border-radius: 4px; letter-spacing: 1px;
}
.big-code {
  font-family: 'Courier New', monospace; font-size: 32px; font-weight: 800;
  letter-spacing: 4px; color: var(--c-primary);
  background: var(--c-primary-light); padding: 12px 24px; border-radius: 8px;
  display: inline-block;
}

/* ===== 人员/用户选择列表 ===== */
.member-pick-list { display: flex; flex-direction: column; gap: 4px; }
.member-pick {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--c-border); border-radius: 6px; cursor: pointer; transition: all .12s;
}
.member-pick:hover { background: var(--c-primary-light); border-color: var(--c-primary); }
.member-pick-info { flex: 1; }
.member-pick-info > div:first-child { font-size: 13px; }

/* 高亮卡片 */
.card-highlight-warn { border: 2px solid var(--c-warning); box-shadow: 0 0 0 3px rgba(237,137,54,.1); }

/* ===== 项目进度 (里程碑节点) ===== */
.ms-head { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--c-border); }
.ms-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.ms-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 1.6fr) 108px minmax(120px, 1.4fr) 84px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: background .12s, border-color .12s;
}
.ms-row:hover { border-color: var(--c-primary); }
.ms-row.doing { background: #fffbeb; border-color: #fbd38d; }
.ms-row.done { background: #f0fff4; border-color: #c6f6d5; }
.ms-idx {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-bg); color: var(--c-text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.ms-row.doing .ms-idx { background: var(--c-warning); color: #fff; }
.ms-row.done .ms-idx { background: var(--c-success); color: #fff; }
.ms-name { font-size: 13px; font-weight: 600; color: var(--c-text); line-height: 1.35; }
.ms-row.done .ms-name { color: var(--c-text-muted); text-decoration: line-through; }
.ms-status .ms-sel { padding: 5px 8px; font-size: 12px; }
.ms-note .ms-note-inp { padding: 5px 8px; font-size: 12px; }
.ms-jump { text-align: right; }
@media (max-width: 720px) {
  .ms-row { grid-template-columns: 30px 1fr 100px; grid-auto-rows: auto; }
  .ms-note, .ms-jump { grid-column: 2 / -1; }
}

/* 导入异常提示框 */
.err-box {
  background: #fff5f5; border: 1px solid #fed7d7; border-left: 3px solid var(--c-danger);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 12px;
  font-size: 12px; color: #9b2c2c; line-height: 1.7; max-height: 150px; overflow: auto;
}

/* ===== 项目进度 · 详细进度表 ===== */
.seg-switch { display: inline-flex; border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; background: #fff; }
.seg-btn { padding: 6px 14px; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--c-text-muted); cursor: pointer; transition: all .12s; }
.seg-btn:hover { background: var(--c-primary-light); color: var(--c-primary); }
.seg-btn.active { background: var(--c-primary); color: #fff; }

.pg-legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--c-text-muted); }
.pg-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.pg-matrix-wrap { max-height: 62vh; overflow: auto; }
table.pg-matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.pg-matrix th, .pg-matrix td {
  border-right: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border);
  padding: 4px 6px; text-align: center; white-space: nowrap; background: #fff;
}
.pg-matrix thead th {
  position: sticky; top: 0; z-index: 2; background: #f7fafc;
  color: var(--c-text-secondary); font-weight: 700; font-size: 11px;
}
.mx-fix { position: sticky; z-index: 1; text-align: left !important; }
.pg-matrix thead .mx-fix { z-index: 3; }
.mx-fix-1 { left: 0; width: 200px; min-width: 200px; max-width: 200px; }
.mx-fix-2 { left: 200px; width: 90px; min-width: 90px; max-width: 90px; box-shadow: 2px 0 4px -2px rgba(0,0,0,.14); }
.mx-pname { font-size: 13px; font-weight: 600; color: var(--c-text); white-space: normal; line-height: 1.3; }
.mx-pct { font-weight: 800; }
.mx-pct.is-done { color: var(--c-success); }
.mx-col { width: 36px; min-width: 36px; }
.mx-cell { width: 36px; min-width: 36px; cursor: pointer; }
.mx-cell.mx-ro { cursor: default; }
.mx-dot { display: inline-block; width: 18px; height: 18px; border-radius: 5px; transition: transform .1s; }
.mx-cell:hover .mx-dot { transform: scale(1.18); }
.mx-cell.mx-ro:hover .mx-dot { transform: none; }
.mx-cell.st-0 .mx-dot { background: #e2e8f0; border: 1px solid #cbd5e0; }
.mx-cell.st-1 .mx-dot { background: #f6c86b; border: 1px solid #e0aa3e; }
.mx-cell.st-2 .mx-dot { background: #5cc38a; border: 1px solid #38a169; }
.pg-matrix tbody tr:hover td { background: #f9fbfd; }

.pg-keymap { margin-top: 12px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
.pg-keymap > summary { cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--c-text-secondary); }
.pg-keymap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; padding: 2px 16px 14px; }
.pg-keymap-item { display: flex; gap: 8px; font-size: 12px; color: var(--c-text-secondary); line-height: 1.5; }
.pg-keymap-item b { color: var(--c-primary); min-width: 18px; text-align: right; }

.ms-idx-inline {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: #edf2f7; color: var(--c-text-secondary); font-size: 11px; font-weight: 700;
}
.ms-idx-inline.st-1 { background: var(--c-warning); color: #fff; }
.ms-idx-inline.st-2 { background: var(--c-success); color: #fff; }

/* ===== 工时填报 ===== */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }

.ts-content { font-size: 13px; color: var(--c-text-secondary); line-height: 1.5; white-space: normal; min-width: 200px; }
.ts-total-row td { background: #f7fafc; font-weight: 600; }

.ts-rank { display: flex; flex-direction: column; gap: 7px; }
.ts-rank-item { display: flex; align-items: center; gap: 10px; }
.ts-rank-name { width: 70px; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* 上/下午单元格 (工时 + 项目 + 内容) */
.ts-half { display: flex; flex-direction: column; gap: 3px; }
.ts-half-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ts-half-head .ts-hours { font-size: 13px; font-weight: 700; color: var(--c-text); flex-shrink: 0; }
.ts-proj-tag {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--c-primary-light); color: var(--c-primary-dark, #2b6cb0);
  border: 1px solid rgba(49,130,206,.25);
}
.ts-half-content {
  font-size: 12px; color: var(--c-text-secondary); line-height: 1.45;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ts-reject-note { font-size: 11px; color: #c53030; margin-top: 3px; line-height: 1.4; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-audit-note { font-size: 11px; color: var(--c-text-muted); margin-top: 3px; }

/* 填报弹窗: 上下午双卡片 */
.ts-fill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .ts-fill-grid { grid-template-columns: 1fr; } }
.ts-fill-card { border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 12px 14px 4px; background: #fcfdfe; }
.ts-fill-title { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--c-text-secondary); margin-bottom: 10px; }
.ts-fill-card .form-group { margin-bottom: 10px; }

/* 待审批高亮统计卡 */
.stat-card-hl { border: 2px solid var(--c-warning); box-shadow: 0 0 0 3px rgba(237,137,54,.1); }
.page-note { font-size: 12px; color: var(--c-text-secondary); margin: 8px 0 12px; }

/* 账号锁定 */
.badge-locked { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.lock-reason { font-size: 12px; color: var(--c-danger); margin-top: 2px; line-height: 1.4; }

/* ===== 移动端适配 (手机 / 平板竖屏) =====
   公网部署后同事会用手机打开, 而侧边栏是 fixed + 220px 宽,
   在 375px 宽的手机上会吃掉一大半屏幕。这里把侧边栏改成顶部的横向可滑动导航,
   内容区占满宽度。桌面端不受影响(媒体查询只在窄屏生效)。 */
@media (max-width: 720px) {
  #app { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: column;
  }
  .sidebar-brand { height: 46px; font-size: 15px; padding: 0 14px; }
  .nav {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { height: 0; }
  .nav-item {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 7px 11px;
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-item .icon { width: auto; }
  .nav-section-title { display: none; }
  .sidebar-foot { padding: 6px 14px; font-size: 11px; }
  .main { margin-left: 0; }
  .topbar { height: auto; min-height: 48px; padding: 8px 12px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .topbar-user .user-meta { display: none; }
  .content { padding: 12px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 12px 14px; }
  table { font-size: 12px; }
  th, td { padding: 6px 8px; }
  .modal-box, .modal-body { max-width: 100%; }
  .stat-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.lock-hint {
  background: #fff5f5; border: 1px solid #fed7d7; border-left: 3px solid var(--c-danger);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: #9b2c2c; line-height: 1.7;
}


/* ===== 登录页新版 (电脑宽屏适配) ===== */
.auth-page {
  min-height: 100vh;
  width: 100vw;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    linear-gradient(rgba(8, 14, 30, 0.52), rgba(8, 14, 30, 0.52)),
    url('/img/bg_login.png') center / cover no-repeat;
  position: relative; overflow: hidden;
}
.auth-card {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 42% 58%;
  width: 100%; max-width: 1180px; min-height: 580px;
  margin: 0 auto; padding: 0;
  background: rgba(255,255,255,.10);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
/* 左侧品牌区 */
.auth-aside {
  background:
    radial-gradient(560px 380px at 120% 18%, rgba(255,255,255,.14), transparent 62%),
    linear-gradient(160deg, rgba(15,23,42,.94) 0%, rgba(30,58,138,.88) 55%, rgba(76,29,149,.86) 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 44px 40px;
}
.auth-aside .auth-brand { margin-bottom: 0; }
.auth-aside .auth-logo {
  background: rgba(255,255,255,.20); color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.auth-aside .auth-title { color: #fff; }
.auth-aside .auth-sub { color: rgba(255,255,255,.78); }
/* 右侧表单区 */
.auth-main {
  padding: 44px 50px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-main .auth-tabs { margin-bottom: 26px; }
.auth-submit { background: var(--c-primary); border-radius: 8px; transition: filter .15s; }
.auth-submit:hover { filter: brightness(1.08); }
.auth-hint span { display: block; margin: 2px 0; }
/* ===== 玻璃质感表单区适配 ===== */
.auth-main .auth-tab { color: rgba(255,255,255,.72); }
.auth-main .auth-tab:hover { color: #fff; }
.auth-main .auth-tab.active { color: #fff; border-bottom-color: #fff; }
.auth-main .auth-form .form-group label { color: rgba(255,255,255,.92); }
.auth-main .form-control {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.32);
  color: #111;
}
.auth-main .form-control::placeholder { color: rgba(255,255,255,.55); }
.auth-main .form-control:focus {
  border-color: rgba(255,255,255,.75);
  box-shadow: 0 0 0 3px rgba(255,255,255,.18);
  background: rgba(255,255,255,.20);
}
.auth-main input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,.14) inset;
  -webkit-text-fill-color: #111;
}
.auth-main .auth-submit {
  background: linear-gradient(135deg, #2b6cb0 0%, #4338ca 100%);
  box-shadow: 0 8px 20px rgba(43,108,176,.35);
  color: #fff;
  text-align: center;
}
.auth-main .auth-hint { color: rgba(255,255,255,.68); }
.auth-main .auth-error { color: #ff9aa2; }
.auth-main .auth-demo-title { color: rgba(255,255,255,.78); }
.auth-main .demo-chip {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.30); color: #fff;
}
.auth-main .demo-chip:hover { background: rgba(255,255,255,.22); border-color: #fff; }
.auth-main .demo-tag { color: rgba(255,255,255,.6); }
.auth-main .code-info { color: rgba(255,255,255,.85); }
/* 窄屏: 隐藏左侧品牌区, 单栏卡片 */
@media (max-width: 800px) {
  .auth-card { grid-template-columns: 1fr; min-height: auto; }
  .auth-aside { display: none; }
  .auth-main { padding: 34px 28px; }
}

