/* ===== 全局重置与变量 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Apple 风格配色：系统蓝 + 中性灰阶（变量名保持不变，仅调色） */
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-light: #e9f2fe;
  --success: #34c759;
  --success-light: #e3f9e9;
  --warning: #ff9f0a;
  --warning-light: #fff4e0;
  --danger: #ff3b30;
  --danger-light: #ffe9e7;
  --gray-50: #f5f5f7;   /* Apple 招牌浅灰底 */
  --gray-100: #ececef;
  --gray-200: #d2d2d7;  /* 分隔线/边框 */
  --gray-300: #c7c7cc;
  --gray-500: #6e6e73;  /* 次要文字 */
  --gray-700: #424245;
  --gray-900: #1d1d1f;  /* Apple 近黑主文字 */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 980px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* ===== 导航栏（毛玻璃半透明）===== */
.navbar {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { font-size: 17px; font-weight: 600; color: var(--gray-900); display: flex; align-items: center; gap: 8px; letter-spacing: -0.02em; }
.navbar-user { display: flex; align-items: center; gap: 12px; color: var(--gray-500); font-size: 13px; }
.navbar-tabs { display: flex; gap: 2px; }
.navbar-tab { padding: 6px 14px; border-radius: var(--radius-pill); font-size: 14px; color: var(--gray-500); cursor: pointer; text-decoration: none; transition: all .2s ease; }
.navbar-tab:hover { color: var(--gray-900); background: rgba(0,0,0,.04); }
.navbar-tab.active { background: var(--gray-900); color: #fff; font-weight: 500; }

/* ===== 页面容器 ===== */
.page { max-width: 900px; margin: 0 auto; padding: 16px; }
.page-wide { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 18px; }
.card-title { font-size: 19px; font-weight: 600; color: var(--gray-900); margin-bottom: 16px; letter-spacing: -0.02em; }

/* ===== 指标卡 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.stat-card .value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.stat-card .label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.stat-card.primary .value { color: var(--primary); }
.stat-card.success .value { color: var(--success); }
.stat-card.warning .value { color: var(--warning); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; display: block; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--gray-900);
  background: #fff; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.form-input::placeholder, .form-textarea::placeholder { color: #aeaeb2; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,113,227,.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== 等级选择按钮 ===== */
.grade-buttons { display: flex; gap: 8px; }
.grade-btn {
  flex: 1; padding: 10px 4px; border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm); background: #fff; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: all .15s; text-align: center;
}
.grade-btn[data-grade="A"]:hover, .grade-btn[data-grade="A"].selected { background: #d1fae5; border-color: #10b981; color: #065f46; }
.grade-btn[data-grade="B"]:hover, .grade-btn[data-grade="B"].selected { background: #dbeafe; border-color: #3b82f6; color: #1e3a8a; }
.grade-btn[data-grade="C"]:hover, .grade-btn[data-grade="C"].selected { background: #fef3c7; border-color: #f59e0b; color: #78350f; }
.grade-btn[data-grade="D"]:hover, .grade-btn[data-grade="D"].selected { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }

/* ===== 按钮（Apple 胶囊样式）===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 22px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .2s ease; text-decoration: none; -webkit-appearance: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-outline { background: rgba(0,0,0,.04); color: var(--primary); border: none; }
.btn-outline:hover { background: rgba(0,0,0,.08); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--gray-50); font-size: 12px; font-weight: 700; color: var(--gray-500); text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
td { padding: 12px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:hover td { background: var(--gray-50); }

/* ===== 标签/徽章 ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #78350f; }
.badge-danger { background: var(--danger-light); color: #7f1d1d; }
.badge-primary { background: var(--primary-light); color: #1e3a8a; }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ===== 进度条 ===== */
.progress-bar { background: var(--gray-100); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--primary); transition: width .4s; }

/* ===== 加载/错误状态 ===== */
.loading-wrap, .error-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; gap: 12px; color: var(--gray-500); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast 通知 ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(40,40,42,.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fff; padding: 13px 24px; border-radius: var(--radius-pill); font-size: 14px; opacity: 0; transition: all .3s; z-index: 9999; white-space: nowrap; box-shadow: var(--shadow-md); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--danger); }
.toast.toast-warning { background: var(--warning); }

/* ===== 分隔线 ===== */
.divider { height: 1px; background: var(--gray-200); margin: 16px 0; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 40px; color: var(--gray-500); }
.empty-icon { font-size: 40px; margin-bottom: 8px; }

/* ===== 弹窗 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 24px; padding: 24px; width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-close { float: right; font-size: 20px; cursor: pointer; color: var(--gray-500); background: none; border: none; }

/* ===== KPI开关 ===== */
.toggle-wrap { display: flex; gap: 8px; }
.toggle-btn { flex: 1; padding: 10px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); background: #fff; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; transition: all .15s; }
.toggle-btn.yes.selected { background: var(--success-light); border-color: var(--success); color: #065f46; }
.toggle-btn.no.selected { background: var(--danger-light); border-color: var(--danger); color: #7f1d1d; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .page, .page-wide { padding: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .navbar-tabs { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; }
}

/* ===== 工作内容展示 ===== */
.work-section { margin-bottom: 16px; }
.work-section-title { font-size: 13px; font-weight: 700; color: var(--gray-500); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.work-items { display: flex; flex-direction: column; gap: 6px; }
.work-item { background: var(--gray-50); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; color: var(--gray-700); border-left: 3px solid var(--gray-300); }
.work-item.daily { border-color: #60a5fa; }
.work-item.key { border-color: #a78bfa; }
.work-item.temp { border-color: #34d399; }
.work-item.kpi { border-color: #f97316; }

/* 工作要求分条：表格式边框 + 序号列（用于评分页汇总，避免单条 .work-item 左侧色条被误认为括号） */
.req-table {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.req-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  line-height: 1.5;
}
.req-row:last-child { border-bottom: none; }
.req-idx {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
}
.req-text { padding: 10px 12px; color: var(--gray-700); min-width: 0; word-break: break-word; }
.req-row--daily .req-idx { color: #1d4ed8; background: #eff6ff; border-right-color: #93c5fd; }
.req-row--key .req-idx { color: #5b21b6; background: #f5f3ff; border-right-color: #c4b5fd; }
.req-row--temp .req-idx { color: #047857; background: #ecfdf5; border-right-color: #6ee7b7; }
.req-row--kpi .req-idx { color: #c2410c; background: #fff7ed; border-right-color: #fdba74; }

/* ===== 分数标签 ===== */
.score-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 700; background: var(--gray-100); }

/* ===== 列表项 ===== */
.list-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-100); gap: 12px; }
.list-item:last-child { border-bottom: none; }
.list-item-main { flex: 1; }
.list-item-title { font-weight: 600; font-size: 14px; }
.list-item-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
