/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff4ff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f7fb;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --radius: 14px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.35; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px;
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  color: #dbeafe;
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: #fff; color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.brand b { color: #fff; font-size: 15px; display: block; }
.brand span { font-size: 11px; color: #93c5fd; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav a {
  color: #c7d7f8; padding: 10px 12px; border-radius: 10px;
  display: flex; align-items: center; gap: 9px; font-size: 13.5px;
}
.nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.nav a.active { background: #fff; color: var(--blue-dark); font-weight: 600; }
.nav .ico { width: 18px; text-align: center; }
.nav-sep { height: 1px; background: rgba(255,255,255,.12); margin: 12px 6px; }

.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
/* 个人报告页：收窄居中，两侧留白 */
.person-page { max-width: 1040px; margin: 0 auto; padding: 0 12px; }
@media (min-width: 1400px) { .person-page { max-width: 1100px; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar .titles h1 { margin-bottom: 2px; }
.topbar .titles p { margin: 0; color: var(--muted); font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.sub { color: var(--muted); font-size: 12.5px; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 2px; letter-spacing: -0.5px; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--muted); }
.stat.blue .value { color: var(--blue); }
.stat.green .value { color: var(--green); }
.stat.orange .value { color: var(--orange); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-family: inherit; line-height: 1.4; white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: #334155; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
textarea { resize: vertical; min-height: 74px; }
input[type=file] { width: auto; max-width: 280px; padding: 6px 8px; }
select[multiple] { min-height: 150px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #334155; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: #475569; font-weight: 600; font-size: 12px;
  background: #f8fafc; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:hover td { background: #fafbfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.center, th.center { text-align: center; }

/* 表头内联筛选 */
.filter-table th { vertical-align: top; }
.th-filter {
  display: block; margin-top: 6px; min-width: 88px;
  padding: 5px 8px !important; font-size: 12px !important; font-weight: 400;
  border-radius: 7px !important; border-color: #dbe3ee !important; background: #fff;
}
.th-clear {
  display: inline-block; margin-top: 8px; font-size: 11.5px;
  font-weight: 400; color: var(--blue); white-space: nowrap;
}
#list, #relList { scroll-margin-top: 18px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.tag.blue { background: var(--blue-soft); color: var(--blue-dark); }
.tag.green { background: #ecfdf5; color: #047857; }
.tag.orange { background: #fff7ed; color: #c2410c; }
.tag.red { background: #fef2f2; color: #b91c1c; }
.tag.purple { background: #f5f3ff; color: #6d28d9; }
.tag.gray { background: #f1f5f9; color: #64748b; }

/* ---------- 提示 ---------- */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.flash.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.note {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 12px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 14px;
}
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 13px; }

/* ---------- 进度条 ---------- */
.bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.bar.green > i { background: var(--green); }
.bar.orange > i { background: var(--orange); }
.bar.red > i { background: var(--red); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }
.bar-row .val { width: 44px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 关系小卡片 ---------- */
.person-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.person-card .pc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.person-card .pc-name { font-weight: 600; font-size: 14.5px; }
.role-line { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; flex-wrap: wrap; }
.role-line .role-name { width: 62px; flex: 0 0 62px; color: var(--muted); font-size: 12px; padding-top: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px 3px 11px; font-size: 12.5px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.chip.ok .dot { background: var(--green); }
.chip form { display: inline; margin: 0; }
.chip button {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer;
  padding: 2px 5px; border-radius: 50%; font-size: 13px; line-height: 1;
}
.chip button:hover { background: #fee2e2; color: var(--red); }

/* ---------- 人员选择器 ---------- */
.people-picker {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  max-height: 280px; overflow-y: auto;
}
.person-check {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px; border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px; cursor: pointer;
}
.person-check:last-child { border-bottom: 0; }
.person-check:hover { background: #f8fafc; }
.person-check.hidden { display: none; }
.person-check input { width: 16px; height: 16px; accent-color: var(--blue); flex: 0 0 auto; }
.person-check .p-name { font-weight: 600; color: #1e293b; }
.person-check .p-meta { color: var(--muted); font-size: 11px; }
.people-selected { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.people-selected .chip { padding-right: 4px; }
option[hidden], optgroup[hidden] { display: none; }

/* ---------- 搜索联想输入框（被评人） ---------- */
.typeahead { position: relative; max-width: 360px; }
.ta-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.14);
  max-height: 280px; overflow-y: auto;
}
.ta-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
}
.ta-item:last-child { border-bottom: 0; }
.ta-item:hover { background: #f8fafc; }
.ta-item.hidden { display: none; }
.ta-item .p-name { font-weight: 600; font-size: 13px; color: #1e293b; }
.ta-item .p-meta { color: var(--muted); font-size: 11px; }
.ta-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.ta-selected { margin-top: 8px; }
.ta-selected .chip { padding-right: 4px; font-size: 13px; }

/* 添加评价关系：左中右三栏 */
.rel-grid { grid-template-columns: 1.1fr 150px 1.5fr; align-items: start; }
@media (max-width: 1100px) {
  .rel-grid { grid-template-columns: 1fr 150px; }
  .rel-grid .field:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .rel-grid { grid-template-columns: 1fr; }
}

/* ---------- 二维码 ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.qr-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  text-align: center; background: #fff; break-inside: avoid;
}
.qr-card img { width: 150px; height: 150px; display: block; margin: 6px auto; }
.qr-card .who { font-weight: 600; font-size: 13.5px; }
.qr-card .who small { font-weight: 400; color: var(--muted); }
.qr-card .link { font-size: 10.5px; color: var(--muted); word-break: break-all; margin-top: 4px; }
.qr-card .role-tag { margin-top: 2px; }

/* ---------- 报表 ---------- */
.rank-top { display: flex; gap: 8px; }
.grade-卓越 { color: #6d28d9; font-weight: 600; }
.grade-优秀 { color: #047857; font-weight: 600; }
.grade-胜任 { color: var(--blue); font-weight: 600; }
.grade-待提升 { color: var(--orange); font-weight: 600; }
.grade-不合格 { color: var(--red); font-weight: 600; }
.dim-row { margin-bottom: 14px; }
.dim-row .dim-name { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.subj-item { border-left: 3px solid #dbeafe; padding: 6px 0 6px 12px; margin-bottom: 10px; }
.subj-item .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 500px at 20% 0%, #dbeafe 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 100%, #e0e7ff 0%, transparent 55%),
              #f4f7fb;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 390px; background: #fff; border-radius: 18px;
  padding: 34px 32px; box-shadow: 0 20px 50px rgba(30,58,138,.13);
}
.login-card .logo-lg {
  width: 50px; height: 50px; border-radius: 14px; background: var(--blue);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; margin-bottom: 16px;
}
.login-card p.sub { margin: 0 0 22px; }

/* ---------- 手机评分页 ---------- */
.mobile { background: #f2f5fa; min-height: 100vh; padding-bottom: 110px; }
.m-head {
  background: linear-gradient(160deg, #1e40af, #2563eb 60%, #3b82f6);
  color: #fff; padding: 22px 18px 26px; border-radius: 0 0 22px 22px;
}
.m-head .m-title { font-size: 13px; color: #bfdbfe; }
.m-head .m-name { font-size: 24px; font-weight: 700; margin-top: 4px; }
.m-head .m-meta { font-size: 12.5px; color: #dbeafe; margin-top: 4px; }
.m-body { padding: 16px 14px; max-width: 620px; margin: 0 auto; }
.m-card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 13px; border: 1px solid #e6ecf5; }
.m-q-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-q-title { font-weight: 600; font-size: 15.5px; margin-bottom: 4px; }
.m-q-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.m-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.m-scale label { position: relative; cursor: pointer; }
.m-scale input { position: absolute; opacity: 0; pointer-events: none; }
.m-scale .dot {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1.5px solid #dbe3ee; border-radius: 11px; padding: 9px 2px 7px;
  background: #fbfcfe; transition: all .12s;
}
.m-scale .num { font-size: 17px; font-weight: 700; color: #475569; line-height: 1.1; }
.m-scale .word { font-size: 10px; color: #94a3b8; }
.m-scale input:checked + .dot {
  background: var(--blue); border-color: var(--blue);
  box-shadow: 0 6px 14px rgba(37,99,235,.28);
}
.m-scale input:checked + .dot .num,
.m-scale input:checked + .dot .word { color: #fff; }
.m-desc {
  margin-top: 12px; background: var(--blue-soft); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: #1e40af; line-height: 1.65;
  display: none;
}
.m-desc.show { display: block; }
.m-desc b { display: block; margin-bottom: 2px; }
details.levels { margin-top: 10px; }
details.levels summary { font-size: 12px; color: var(--muted); cursor: pointer; }
details.levels .lv { font-size: 12px; color: #475569; padding: 5px 0; border-bottom: 1px dashed #eef2f7; }
details.levels .lv b { color: var(--blue-dark); }
.m-textarea { min-height: 96px; }
.m-submit {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px 16px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-top: 1px solid #e6ecf5;
}
.m-submit .btn { width: 100%; max-width: 620px; margin: 0 auto; padding: 14px;
  font-size: 16px; display: flex; border-radius: 13px; }
.m-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; }
.m-section-title { font-size: 13px; color: var(--muted); margin: 20px 4px 10px; }

/* ---------- 批量评分（矩阵） ---------- */
.step { display: none; }
.step.active { display: block; }

.level-ref { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 6px; }
.level-ref .lv-row {
  font-size: 12px; color: #475569; line-height: 1.65;
  padding: 6px 0; border-bottom: 1px dashed #eef2f7;
}
.level-ref .lv-row:last-child { border-bottom: 0; }
.level-ref .lv-row b { display: block; color: #1e40af; margin-bottom: 2px; font-size: 12.5px; }

.matrix-wrap {
  overflow-x: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; margin-top: 12px;
}
table.matrix { width: 100%; border-collapse: collapse; min-width: 330px; }
.matrix thead th {
  background: #f8fafc; color: #64748b; font-weight: 600;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
  font-size: 11px; text-align: center;
}
.matrix thead th.name-col { text-align: left; padding-left: 12px; }
.matrix .lv-num { display: block; font-size: 15px; font-weight: 700; color: #334155; line-height: 1.2; }
.matrix .lv-word { display: block; font-size: 9.5px; color: #94a3b8; }
.matrix td { padding: 6px 2px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.matrix td.name-col {
  text-align: left; padding-left: 12px; min-width: 96px; max-width: 124px;
  position: sticky; left: 0; background: #fff; z-index: 1;
}
.matrix td.name-col b {
  display: block; font-size: 13.5px; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.matrix td.name-col small {
  display: block; color: #94a3b8; font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.matrix tbody tr:nth-child(even) td { background: #fbfcfe; }
.matrix tbody tr:nth-child(even) td.name-col { background: #fbfcfe; }
.matrix tbody tr:last-child td { border-bottom: 0; }

.mcell { display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 3px 0; }
.mcell input { position: absolute; opacity: 0; pointer-events: none; }
.mcell span {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid #dbe3ee; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.mcell span::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.mcell input:checked + span {
  background: var(--blue); border-color: var(--blue);
  box-shadow: 0 4px 10px rgba(37,99,235,.3);
}
.mcell input:checked + span::after { background: #fff; }

.matrix-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-top: 1px solid #e6ecf5; padding: 9px 14px 14px;
}
.matrix-progress { text-align: center; font-size: 11.5px; color: #64748b; margin-bottom: 6px; }
.matrix-actions { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.matrix-actions .btn { flex: 1; padding: 12px; font-size: 15px; }

.msg-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.msg-card { background: #fff; border-radius: 18px; padding: 34px 28px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 16px 40px rgba(30,58,138,.1); }
.msg-card .emoji { font-size: 46px; margin-bottom: 10px; }
.msg-card h1 { font-size: 20px; }
.msg-card p { color: var(--muted); font-size: 13.5px; }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar-right, .no-print, .btn, .flash { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .qr-card { border: 1px dashed #cbd5e1; }
  body { background: #fff; }
}

@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar { width: 100%; height: auto; position: static; padding: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 7px 10px; font-size: 12.5px; }
  .nav .ico { display: none; }
  .main { padding: 16px 14px 50px; }
  .nav-sep { display: none; }
}
