/* ===== 企业微信绩效考核系统 - 样式（移动优先）===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  max-width: 640px; margin: 0 auto; min-height: 100vh;
}

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user-chip { font-size: 13px; color: var(--text-2); }
.btn-ghost { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; padding: 4px 6px; }

/* ===== 导航 ===== */
.navbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 640px; background: #fff;
  border-top: 1px solid var(--border); display: flex; z-index: 100;
}
.navbar a {
  flex: 1; text-align: center; padding: 8px 0 10px; font-size: 12px; color: var(--text-2);
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.navbar a.active { color: var(--primary); font-weight: 600; }
.navbar a .icon { font-size: 20px; line-height: 1; }

/* ===== 卡片与列表 ===== */
.page { padding: 16px; padding-bottom: 76px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--text-2); font-size: 13px; }
.small { font-size: 12px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
}
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #d1fae5; color: #059669; }
.badge.orange { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #e5e7eb; color: #4b5563; }

/* ===== 状态标签 ===== */
.status { font-size: 12px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.status-pending_confirmation { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-self_submitted { background: #ede9fe; color: #6d28d9; }
.status-manager_reviewed { background: #d1fae5; color: #065f46; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none; font-size: 14px;
  cursor: pointer; background: var(--primary); color: #fff; width: 100%;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: var(--danger); }
.btn.small { width: auto; padding: 6px 12px; font-size: 13px; }
.btn-group { display: flex; gap: 10px; margin-top: 16px; }
.btn-group .btn { flex: 1; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--text);
  outline: none; font-family: inherit;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }

/* ===== 登录页 ===== */
.login-wrap { padding: 48px 24px; text-align: center; }
.login-logo {
  width: 64px; height: 64px; border-radius: 16px; background: var(--primary);
  overflow: hidden; margin: 0 auto 16px; font-weight: 700;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 32px; }
.login-box { background: #fff; border-radius: var(--radius); padding: 20px; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.tab-row { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-row .tab { flex: 1; text-align: center; padding: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.tab-row .tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); font-weight: 600; }
.emp-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.emp-option:hover { border-color: var(--primary); background: #f8fafc; }
.emp-option .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.emp-option .info { flex: 1; }
.emp-option .info .name { font-size: 14px; font-weight: 500; }
.emp-option .info .meta { font-size: 12px; color: var(--text-2); }

/* ===== 任务项 ===== */
.task-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.task-item .t-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.task-item .t-name { font-size: 14px; font-weight: 500; }
.task-item .t-weight { font-size: 12px; color: var(--text-2); }
.task-item .t-desc { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.score-row { display: flex; gap: 10px; align-items: center; }
.score-row input { width: 90px; }
.score-row .muted { flex: 1; }

/* ===== 签名板 ===== */
.signature-box {
  border: 2px dashed var(--border); border-radius: 10px; background: #fafafa;
  margin-top: 10px; position: relative; touch-action: none;
}
.signature-box canvas { width: 100%; height: 160px; display: block; }
.signature-placeholder {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: #9ca3af; font-size: 13px; pointer-events: none;
}
.signed-preview { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; background: #fff; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-mask.center { align-items: center; }
.modal {
  background: #fff; width: 100%; max-width: 640px; border-radius: 16px 16px 0 0;
  padding: 20px; max-height: 88vh; overflow-y: auto;
}
.modal-mask.center .modal { border-radius: 16px; max-width: 480px; }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal .close {
  float: right; background: none; border: none; font-size: 22px; color: var(--text-2); cursor: pointer;
}

/* ===== Toast ===== */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; width: 90%; max-width: 400px; }
.toast {
  background: rgba(17,24,39,0.9); color: #fff; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; margin-bottom: 8px; text-align: center;
  animation: fadeIn 0.25s ease;
}
.toast.error { background: rgba(220,38,38,0.95); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-2); font-weight: 500; background: #f9fafb; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.stat-card .num { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ===== 后台 tab ===== */
.admin-tabs { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 45px; z-index: 90; }
.admin-tabs .atab { padding: 10px 14px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.admin-tabs .atab.active { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); }

.section-title { font-size: 16px; font-weight: 600; margin: 18px 0 12px; }
.empty { text-align: center; color: var(--text-2); padding: 32px 0; font-size: 14px; }

/* 隐藏滚动条美化 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
