/* 强制：HTML hidden 属性始终生效（避免被后续业务 display 覆盖） */
[hidden] { display: none !important; }

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e5e8ee;
  --text: #1f2430;
  --text-2: #5a6472;
  --text-3: #9aa3af;
  --primary: #2f6fed;
  --primary-weak: #eaf1fe;
  --green: #18a058;
  --green-weak: #e8f7ef;
  --amber: #d98c1a;
  --amber-weak: #fdf3e3;
  --red: #d03050;
  --red-weak: #fdeef1;
  --gray-weak: #f0f1f4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
code { background: var(--gray-weak); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* 通用按钮 */
.btn { border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; transition: all .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2660d8; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-weak); }
.btn-soft { background: var(--primary-weak); color: var(--primary); }
.btn-soft:hover { background: #dbe7fd; }
.btn-danger-soft { background: var(--red-weak); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef3fc 0%, #f6f7fa 60%); }
.login-card { width: 360px; max-width: 92vw; background: var(--card); border-radius: 18px; padding: 36px 32px; box-shadow: 0 8px 40px rgba(30, 50, 90, .10); }
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--primary); color: #fff; font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 20px; font-weight: 600; }
.login-sub { text-align: center; color: var(--text-3); font-size: 13px; margin: 6px 0 24px; }
.login-card input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 12px; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; margin-top: 8px; }
.login-hint { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-3); line-height: 1.9; text-align: center; }

/* 主布局 */
#main-view { display: flex; min-height: 100vh; }
.sidebar { width: 216px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.logo-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.logo-text { font-weight: 600; font-size: 15px; }
.side-nav { flex: 1; padding: 14px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; margin-bottom: 4px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav-item:hover { background: var(--gray-weak); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; }
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.side-user { padding: 14px 18px; border-top: 1px solid var(--border); }
.side-user-actions { display: flex; gap: 8px; margin-top: 8px; }
.side-user-actions .btn { flex: 1; justify-content: center; }
.side-user-name { font-weight: 500; }
.side-user-role { font-size: 12px; color: var(--text-3); margin: 2px 0 8px; }

.content { flex: 1; margin-left: 216px; padding: 24px 28px 60px; max-width: 1280px; }

/* 底部导航（仅窄屏手机显示，桌面统一左侧导航栏） */
.mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); display: none; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.mobile-nav .m-item { flex: 1; text-align: center; padding: 9px 0 7px; font-size: 12px; color: var(--text-3); }
.mobile-nav .m-item.active { color: var(--primary); font-weight: 500; }
.mobile-nav .m-ico { display: block; font-size: 17px; margin-bottom: 2px; }

/* 页面标题 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-title { font-size: 19px; font-weight: 600; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 6px; }
.stat-value.warn { color: var(--amber); }
.stat-value.danger { color: var(--red); }
.stat-value.ok { color: var(--green); }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 600; font-size: 15px; }
.card-body { padding: 16px 18px; }
.card + .card { margin-top: 16px; }

/* 负载条 */
.load-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.load-row + .load-row { border-top: 1px dashed var(--border); }
.load-name { width: 76px; font-weight: 500; flex-shrink: 0; }
.load-bar-wrap { flex: 1; background: var(--gray-weak); border-radius: 6px; height: 10px; overflow: hidden; }
.load-bar { height: 100%; border-radius: 6px; background: var(--primary); transition: width .3s; }
.load-bar.high { background: var(--amber); }
.load-bar.full { background: var(--red); }
.load-num { width: 108px; text-align: right; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-blue { background: var(--primary-weak); color: var(--primary); }
.badge-green { background: var(--green-weak); color: var(--green); }
.badge-amber { background: var(--amber-weak); color: var(--amber); }
.badge-red { background: var(--red-weak); color: var(--red); }
.badge-gray { background: var(--gray-weak); color: var(--text-2); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; padding: 10px 12px; color: var(--text-2); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 人员看板整表居中：月承接单量/接单中等短内容列与表头、其他列视觉对齐 */
.tbl.center-all th, .tbl.center-all td { text-align: center; }

/* 筛选条 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); outline: none; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); }

/* 评价 */
.review-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.review-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.review-line { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.review-line:last-child { border-bottom: none; }
.stars { color: #e8a33d; font-size: 15px; letter-spacing: 1px; }
.tag { display: inline-block; background: var(--gray-weak); border-radius: 20px; padding: 2px 10px; font-size: 12px; margin: 0 6px 6px 0; color: var(--text-2); }

/* 定级徽章（S/A/B） */
.level-chip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; font-size: 13px; font-weight: 700; margin-right: 2px; vertical-align: middle; }
.level-chip.s { background: #fdecee; color: #c03050; border: 1px solid #f2c4cb; }
.level-chip.a { background: var(--primary-weak); color: var(--primary); border: 1px solid #c9dbf9; }
.level-chip.b { background: var(--gray-weak); color: var(--text-2); border: 1px solid var(--border); }

/* 可承接档位小方片 */
.allow-chip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 600; margin-right: 3px; border: 1px solid var(--border); color: var(--text-3); background: var(--card); vertical-align: middle; }
.allow-chip.on { background: var(--green-weak); color: var(--green); border-color: transparent; }

/* 工作台内嵌负载条数字 */
.load-num-inline { text-align: right; color: var(--text-2); font-size: 12px; margin-top: 3px; }

/* 提示条 */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 10px; }
.alert-danger { background: var(--red-weak); color: var(--red); }
.alert-amber { background: var(--amber-weak); color: var(--amber); }
.alert-info { background: var(--primary-weak); color: var(--primary); }
.alert-green { background: var(--green-weak); color: var(--green); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 25, 45, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; width: 480px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 12px 48px rgba(20, 30, 50, .18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .10); }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 空状态 */
.empty { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 13px; }

/* Toast */
#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; background: #232a36; color: #fff; padding: 10px 20px; border-radius: 9px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 80vw; }
#toast.show { opacity: 1; }

/* 对账摘要 */
.sum-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.sum-line + .sum-line { border-top: 1px dashed var(--border); }
.sum-total { font-size: 16px; font-weight: 600; color: var(--primary); }

/* 兼职任务卡 */
.task-list { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; }
.task-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.task-title { font-weight: 600; font-size: 15px; line-height: 1.45; }
.task-meta { color: var(--text-3); font-size: 12.5px; line-height: 1.9; }
.task-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.money { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.money-big { font-size: 22px; }
.section-tab { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.section-tab .st { padding: 7px 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.section-tab .st.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.month-picker { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; box-shadow: var(--shadow); }
.month-picker label { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.month-picker input { border: none; background: transparent; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; outline: none; padding: 2px 0; }
.count-pill { background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 16px 14px 84px; }
  .mobile-nav { display: flex; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .filter-bar select { flex-shrink: 0; }
  .page-head { margin-bottom: 14px; }
}
