:root {
  --yh-red: #C7000B;
  --yh-red-light: #FDECEC;
  --yh-red-dark: #A00009;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #2B2F36;
  --muted: #8A9099;
  --line: #E8EAEE;
  --ok: #1E9E5A;
  --warn: #E6892B;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; }

#topbar { background: var(--yh-red); color: #fff; display: flex; align-items: center; padding: 0 24px; height: 54px; gap: 20px; position: sticky; top: 0; z-index: 10; }
#topbar.hidden, .hidden { display: none !important; }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-logo { height: 24px; width: auto; flex-shrink: 0; }
.brand .logo { font-weight: 700; font-size: 17px; letter-spacing: 1px; }
.brand .sub { font-size: 12px; opacity: .85; }
#nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
#nav a { color: rgba(255,255,255,.88); text-decoration: none; padding: 7px 14px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
#nav a.active, #nav a:hover { background: rgba(255,255,255,.18); color: #fff; }
.userbox { font-size: 13px; white-space: nowrap; }
.userbox a { color: rgba(255,255,255,.85); margin-left: 10px; text-decoration: none; }

/* 主区域拉宽 + 宽松留白 */
main { max-width: 1760px; width: 100%; margin: 0 auto; padding: 22px 44px 60px; }
h2.page-title { font-size: 20px; margin: 4px 0 20px; border-left: 4px solid var(--yh-red); padding-left: 12px; }
.page-sub { font-size: 13.5px; color: var(--muted); margin: -12px 0 18px 16px; }
.card { background: var(--card); border-radius: 12px; padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card h3 { font-size: 16px; margin-bottom: 14px; color: var(--yh-red-dark); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.stat { background: var(--card); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.stat .num { font-size: 27px; font-weight: 700; color: var(--yh-red); }
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 表格：一行一行舒展显示 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 18px 20px; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: #FAFBFC; white-space: nowrap; }
tbody tr:hover { background: #FCFCFD; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
td.def-cell { color: #5A6068; font-size: 13.5px; line-height: 1.9; }
.sum-row td { background: #FAFBFC; font-weight: 700; border-top: 2px solid var(--line); color: var(--yh-red-dark); }

/* 头像（首字圆头像，参考截图样式） */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--yh-red-light); color: var(--yh-red); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; user-select: none; }
.avatar.gm { background: #FFF3E0; color: #B26B00; }
.avatar.leader { background: #E8F1FD; color: #2C6BD8; }
.person { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.score-cell { display: inline-flex; align-items: center; gap: 9px; }
.score-cell b { font-size: 15px; }

/* 流程进度条（考核单详情顶部，参考截图） */
/* 进度节点条（v0.5.3 大框版：红框卡片 + 大圆点 + 节点名 + 处理人 + 节点间箭头） */
.stepper-box { display: flex; align-items: stretch; background: #fff; border: 2px solid var(--yh-red); border-radius: 12px; padding: 18px 20px; margin: 16px 0 22px; box-shadow: 0 2px 12px rgba(194,0,25,.07); overflow-x: auto; }
.step2 { flex: 1; min-width: 108px; text-align: center; position: relative; display: flex; flex-direction: column; gap: 5px; padding: 2px 16px; justify-content: center; }
.step2 + .step2::before { content: '›'; position: absolute; left: -9px; top: 50%; transform: translateY(-58%); font-size: 26px; color: #E5A9AE; font-weight: 700; line-height: 1; }
.st-top { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.st-dot { width: 26px; height: 26px; border-radius: 50%; background: #D9DDE3; color: #fff; font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.st-name { font-size: 15.5px; font-weight: 700; color: #7A8088; white-space: nowrap; }
.st-by { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.step2.done .st-dot, .step2.cur .st-dot { background: var(--yh-red); }
.step2.done .st-name { color: #4A4A4A; }
.step2.cur .st-name { color: var(--yh-red); }
.step2.cur .st-by { color: var(--yh-red-dark); font-weight: 600; }
.step2.cur .st-dot { box-shadow: 0 0 0 5px var(--yh-red-light); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; }
.tag.blue { background: #E8F1FD; color: #2C6BD8; }
.tag.green { background: #E7F6EE; color: var(--ok); }
.tag.orange { background: #FDF1E3; color: var(--warn); }
.tag.red { background: var(--yh-red-light); color: var(--yh-red); }
.tag.gray { background: #EFF1F4; color: var(--muted); }

button, .btn { background: var(--yh-red); color: #fff; border: none; border-radius: 7px; padding: 9px 18px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: #fff; color: var(--yh-red); border: 1px solid var(--yh-red); }
button.gray, .btn.gray { background: #fff; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm { padding: 5px 12px; font-size: 13px; }

input, select, textarea { border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; font-size: 14px; width: 100%; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yh-red); }
.form-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.form-row label { font-size: 13px; color: var(--muted); min-width: 70px; }
.form-row input, .form-row select { width: auto; min-width: 140px; flex: 1; }
textarea { width: 100%; }

.score-input { width: 84px !important; text-align: right; padding: 7px 8px !important; }

/* 筛选条 */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 130px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 16px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--yh-red); border-color: var(--yh-red); color: #fff; }

/* 登录 */
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-card { background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 6px 24px rgba(199,0,11,.10); }
.login-card h1 { font-size: 20px; color: var(--yh-red); text-align: center; margin-bottom: 4px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.login-card input { margin-bottom: 12px; }
.login-card button { width: 100%; padding: 11px; }
.login-tip { font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; }

/* 签名板 */
#sigpad { border: 1.5px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 340px; }
.sig-actions { display: flex; gap: 10px; margin-top: 12px; }

/* 时间线 */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--yh-red); }
.timeline li::after { content: ''; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .t-time { color: var(--muted); font-size: 12px; }

.kv-warn { background: #FDF1E3; color: var(--warn); border-radius: 7px; padding: 10px 14px; font-size: 13.5px; margin: 10px 0; }
.note-box { background: #FFFBEF; border: 1px solid #F2E3B3; color: #8A6D1A; border-radius: 7px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; line-height: 1.7; }
.hint-bar { background: var(--yh-red-light); color: var(--yh-red-dark); border-radius: 8px; padding: 10px 16px; font-size: 13.5px; margin-bottom: 16px; }

#toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(30,32,36,.92); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 99; max-width: 80vw; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--yh-red); text-decoration: none; }

/* 结果大数字 */
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }

/* ================= v0.4.0 覆盖与新增 ================= */
/* 全局更大气：加粗菜单、加大字号与留白 */
#nav a { font-weight: 700; font-size: 14.5px; letter-spacing: 0.5px; }
body { font-size: 14.5px; }
.card { padding: 20px 24px; margin-bottom: 18px; }
.card h3 { font-size: 15.5px; font-weight: 700; }
.page-title { font-size: 21px; font-weight: 800; }
th, td { padding: 18px 14px; }
th { font-weight: 700; color: #4A4F59; background: #FAFAFB; }
.brand .name { font-weight: 800; letter-spacing: 1px; }

/* 计划/详情页标题行 */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dropdown-wrap { position: relative; }

/* 下拉菜单（更多 ▾） */
.dd-menu { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 34px rgba(20,22,28,.16); min-width: 168px; z-index: 90; padding: 6px 0; overflow: hidden; }
.dd-menu button { display: block; width: 100%; text-align: left; padding: 10px 18px; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.dd-menu button:hover { background: var(--yh-red-light); color: var(--yh-red-dark); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,22,28,.46); display: flex; align-items: center; justify-content: center; z-index: 95; }
.modal { background: #fff; border-radius: 14px; min-width: 440px; max-width: 760px; max-height: 82vh; overflow: auto; padding: 24px 28px; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal h3 { font-size: 16.5px; font-weight: 800; }

/* 计划四阶段箭头（参照考核流程截图） */
.phase-arrows { display: flex; gap: 6px; margin: 14px 0 18px; }
.pa { flex: 1; padding: 13px 18px; font-size: 14px; font-weight: 700; color: #fff; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); }
.pa:first-child { clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.pa b { font-size: 15px; margin-left: 6px; }
.pa1 { background: #B4232A; } .pa2 { background: #C34A50; } .pa3 { background: #D67075; } .pa4 { background: #E8999D; color: #5C2226; }

/* 模板详情双页签 */
.detail-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 14px 0 16px; }
.dtab { border: 0; background: none; padding: 10px 20px; font-size: 14.5px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; }
.dtab.on { color: var(--yh-red); border-bottom-color: var(--yh-red); }

/* 绩效档案分数徽章（蓝色圆角 pill，参照截图） */
.score-badge { display: inline-block; min-width: 44px; text-align: center; background: #EAF2FE; color: #1F66E0; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.score-badge:hover { background: #1F66E0; color: #fff; }

/* 近三月走势 */
.trend-dot { display: inline-block; background: #EAF2FE; color: #1F66E0; border-radius: 6px; padding: 2px 7px; font-size: 12px; font-weight: 700; }
.trend-arr { color: var(--muted); margin: 0 4px; font-size: 12px; }

/* 考核角色页 */
.roles-layout { display: flex; gap: 18px; align-items: flex-start; }
.roles-side { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.role-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 14px; color: var(--text); }
.role-item b { color: var(--text); font-weight: 600; }
.role-item span { font-size: 12.5px; color: var(--muted); }
.role-item.on { border-color: var(--yh-red); background: var(--yh-red-light); color: var(--yh-red-dark); }
.role-item.on b { color: var(--yh-red-dark); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.perm-item { font-size: 13.5px; color: #3E773E; background: #EFF7EF; border-radius: 6px; padding: 7px 12px; }

/* 重置流程节点选择 */
.reset-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }
.reset-item { display: flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; cursor: pointer; }
.reset-item:has(input:checked) { border-color: var(--yh-red); background: var(--yh-red-light); color: var(--yh-red-dark); font-weight: 700; }

/* 打印：隐藏交互元素 */
@media print {
  #topbar, .breadcrumb, .form-row button, .btn, .dd-menu, .modal-mask, .hint-bar, .filter-bar, .sig-actions, .dd-wrap, .plan-head button { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .stepper-box, .phase-arrows { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================= v0.5.0 ================= */
/* 顶栏三段均衡：品牌 | 导航铺满均分 | 用户信息，右侧不再空旷 */
#topbar { height: 56px; padding: 0 28px; gap: 18px; }
#nav { display: flex; flex: 1; justify-content: space-evenly; gap: 2px; overflow-x: auto; }
#nav a { padding: 8px 13px; font-size: 14px; letter-spacing: 0.3px; }
#nav::-webkit-scrollbar { height: 0; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.userbox #uname { opacity: .95; }

/* 模板名称链接：不再用蓝色 */
.tpl-link { color: var(--text); text-decoration: none; cursor: pointer; }
.tpl-link:hover { color: var(--yh-red); }
.tpl-link b { font-weight: 700; }

/* 发起考核：待考核人员确认名单 */
.preview-box { margin-top: 14px; background: #FAFBFC; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; font-size: 13.5px; line-height: 2; }
.member-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; margin: 2px 6px 2px 0; font-size: 13px; font-weight: 600; }
.member-pill i { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; }
.member-pill.big { padding: 5px 14px; font-size: 13.5px; }
.admin-list { display: flex; flex-wrap: wrap; gap: 6px; }
.member-pill .rm { color: var(--muted); cursor: pointer; text-decoration: none; font-size: 15px; padding: 0 2px; }
.member-pill .rm:hover { color: var(--yh-red); }

/* 考核单列表进度列 */
.mini-bar { display: inline-block; vertical-align: middle; width: 74px; height: 8px; background: var(--yh-red-light); border-radius: 4px; overflow: hidden; }
.mini-bar > div { height: 100%; background: var(--yh-red); border-radius: 4px; }
.mini-pct { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* 紧凑排版模式（设置中可切换） */
body.compact { font-size: 13.5px; }
body.compact th, body.compact td { padding: 8px 10px; }
body.compact .card { padding: 14px 16px; margin-bottom: 12px; }
body.compact main { padding: 16px 22px 40px; }
body.compact h2.page-title { font-size: 18px; margin-bottom: 12px; }
body.compact .grid { gap: 10px; }
body.compact .stat { padding: 10px 14px; }
body.compact .stat .num { font-size: 22px; }

/* ================= v0.5.2 考核模板表美化（红白·永合风） ================= */
.tpl-table th { background: var(--yh-red); color: #fff; font-weight: 600; white-space: nowrap; border-bottom: none; }
.tpl-table th:first-child { border-top-left-radius: 8px; }
.tpl-table th:last-child { border-top-right-radius: 8px; }
.tpl-table td { white-space: nowrap; padding: 18px 18px; }
.tpl-table td:nth-child(2) { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
/* v0.7.59 被考核人列：多人名字超宽时裁剪显示省略号（悬浮 title 可看全名单），防止压到版本列 */
.tpl-table td:nth-child(5) { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.tpl-table td:nth-child(6) { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tpl-table tbody tr:nth-child(even) { background: #FCF8F8; }
.tpl-table tbody tr:hover { background: var(--yh-red-light); }
.tpl-table .tpl-link { color: var(--text); text-decoration: none; }
.tpl-table .tpl-link:hover b { color: var(--yh-red); }
.tpl-table .sm { margin-right: 4px; }

/* ================= 评分人部门树弹层（红白·永合风） ================= */
.scorer-btn { min-width: 150px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.scorer-btn:hover { border-color: var(--yh-red); background: var(--yh-red-light); }
.scorer-btn .sp-caret { color: var(--yh-red); float: right; }
#scorer-pop { position: fixed; z-index: 1000; width: 300px; max-height: 430px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); overflow: hidden; display: flex; flex-direction: column; }
#scorer-pop .sp-search { padding: 10px 12px 6px; }
#scorer-pop .sp-search input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; outline: none; }
#scorer-pop .sp-search input:focus { border-color: var(--yh-red); }
#scorer-pop .sp-company { padding: 2px 14px 8px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
#scorer-pop .sp-body { overflow-y: auto; padding: 4px 0 8px; }
#scorer-pop .sp-group { padding: 8px 14px 2px; font-size: 12px; color: var(--yh-red); font-weight: 600; }
#scorer-pop .sp-dept { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
#scorer-pop .sp-dept:hover { background: var(--yh-red-light); }
#scorer-pop .sp-dept .sp-arrow { color: var(--yh-red); font-size: 11px; width: 12px; }
#scorer-pop .sp-dept i { font-style: normal; margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
#scorer-pop .sp-item { padding: 8px 14px 8px 34px; font-size: 13.5px; cursor: pointer; }
#scorer-pop .sp-item i { font-style: normal; margin-left: 8px; font-size: 12px; color: var(--muted); }
#scorer-pop .sp-item:hover { background: var(--yh-red); color: #fff; }
#scorer-pop .sp-item:hover i { color: rgba(255,255,255,.8); }
#scorer-pop .sp-role { padding-left: 14px; }

/* ================= 考核附件上传区（醒目·红白） ================= */
.attach-zone { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--yh-red); background: #FFF7F7; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; cursor: pointer; transition: background .15s; }
.attach-zone:hover { background: var(--yh-red-light); }
.attach-zone .az-icon { font-size: 26px; }
.attach-zone .az-txt { flex: 1; display: flex; flex-direction: column; }
.attach-zone .az-txt b { color: var(--yh-red-dark); font-size: 14.5px; }
.attach-zone .az-txt span { font-size: 12.5px; color: var(--muted); }
.az-btn { background: var(--yh-red); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.az-btn:hover { background: var(--yh-red-dark); }
.att-link { color: var(--yh-red); text-decoration: none; word-break: break-all; }
.att-link:hover { text-decoration: underline; }
#scorer-pop .sp-head { display: inline-block; background: var(--yh-red); color: #fff; font-size: 11px; border-radius: 8px; padding: 1px 7px; margin-left: 6px; font-weight: 400; }

/* ================= v0.5.3 全局红白风弹层下拉 ================= */
.nice-select-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.nice-select-btn:hover { border-color: var(--yh-red); background: var(--yh-red-light); }
.nice-select-btn .ns-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scorer-pop .ns-body { max-height: 320px; }
#scorer-pop .ns-item.ns-cur { background: var(--yh-red); color: #fff; font-weight: 600; }
#scorer-pop .ns-item.ns-cur:hover { background: var(--yh-red-dark); }

/* ================= v0.5.3 模板编辑器：定义大文本域 ================= */
#tpl-items th { background: #F7F4F4; color: #4A4A4A; font-size: 13px; padding: 16px 18px; }
#tpl-items td { padding: 18px 18px; vertical-align: top; border-bottom: 1px solid #F0EAEA; }
#tpl-items td:nth-child(2) { width: 46%; }
#tpl-items textarea.ti-def { width: 100%; min-height: 96px; line-height: 1.8; font-size: 13.5px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; font-family: inherit; background: #fff; color: var(--text); }
#tpl-items textarea.ti-def:focus { border-color: var(--yh-red); outline: none; box-shadow: 0 0 0 3px rgba(194,0,25,.07); }
#tpl-items input.ti-name { height: 44px; font-weight: 600; }
#tpl-items input.ti-w { height: 44px; font-size: 15px; font-weight: 600; text-align: center; }

/* ================= v0.5.3 员工自评 / 领导评分界面（编辑器同款风格） ================= */
.score-table th { background: #F7F4F4; color: #4A4A4A; font-size: 13px; padding: 16px 20px; white-space: nowrap; }
.score-table td { padding: 20px 20px; border-bottom: 1px solid #F0EAEA; vertical-align: middle; }
.score-table tbody tr:hover { background: #FCF8F8; }
.score-table td.def-cell { white-space: normal; min-width: 340px; line-height: 1.9; }
.score-table td:first-child b { font-size: 14px; }
.score-table .score-input { width: 110px; text-align: center; font-size: 16px; font-weight: 600; padding: 11px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.score-table .score-input:focus { border-color: var(--yh-red); outline: none; box-shadow: 0 0 0 3px rgba(194,0,25,.08); }
.score-table .score-input::-webkit-outer-spin-button, .score-table .score-input::-webkit-inner-spin-button { opacity: 1; }
.score-table .sum-row td { background: #FDF6F6; font-weight: 700; padding: 18px 20px; }

/* ================= v0.5.3 工作台：统计卡拉宽 + 本期考核进度面板 ================= */
.dash-top { display: flex; gap: 18px; align-items: stretch; margin-bottom: 4px; }
.dash-stats { flex: 1; align-content: stretch; }
.dash-stats .stat { display: flex; flex-direction: column; justify-content: center; min-height: 96px; border-top: 3px solid var(--yh-red); transition: box-shadow .15s, transform .15s; }
.dash-stats .stat:hover { box-shadow: 0 6px 18px rgba(194,0,25,.12); transform: translateY(-2px); }
.dash-stats .stat .num { font-size: 34px; }
.dash-stats .stat .lbl { font-size: 13.5px; }
.dash-side { width: 360px; flex-shrink: 0; padding: 18px 20px; }
.pg-num { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pg-num b { font-size: 34px; color: var(--yh-red); line-height: 1; }
.pg-num span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pg-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #F0EAEA; }
.pg-seg { display: block; height: 100%; }
.pg-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pg-legend li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #4A4A4A; }
.pg-legend li i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pg-legend li b { margin-left: auto; color: var(--text); }
@media (max-width: 980px) { .dash-top { flex-direction: column; } .dash-side { width: 100%; } }

/* ================= v0.5.3 统一加减分项 + 最终得分卡 ================= */
.extras-card { border: 1.5px solid var(--yh-red); }
.final-card { border: 1.5px solid var(--yh-red); background: #FFFBFB; }
.final-table td { padding: 16px 20px; }
.final-table td:first-child { color: #4A4A4A; }
.final-table .final-row td { background: var(--yh-red); color: #fff; }
.final-table .final-row td:first-child { color: #fff; font-weight: 700; }
.final-table .final-row td b { color: #fff; font-size: 17px; }
.comp-cell { text-align: center; font-weight: 700; color: var(--yh-red-dark); }
.main-score th[rowspan], .extras-score-table th[rowspan] { vertical-align: middle; }
.extras-score-table input.score-input { width: 110px; }

/* ================= v0.6.0 角色与权限（钉钉式勾选矩阵） ================= */
.perm-layout { display: flex; gap: 18px; align-items: flex-start; }
.perm-side { width: 270px; flex-shrink: 0; }
.perm-side h3 { margin-bottom: 10px; }
.perm-role-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 14px; border-radius: 9px; cursor: pointer; border: 1.5px solid transparent; font-size: 14px; margin-bottom: 4px; }
.perm-role-item:hover { background: #FAF4F4; }
.perm-role-item.on { background: var(--yh-red-light); border-color: var(--yh-red); }
.perm-role-item.on b { color: var(--yh-red-dark); }
.perm-role-item span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.perm-subtabs { display: flex; gap: 8px; margin: 2px 0 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #FDFCFC; }
.perm-gtitle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.perm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 9px 18px; margin-top: 12px; padding-left: 26px; }
.perm-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.perm-check input, .pg-all { cursor: pointer; }
@media (max-width: 980px) { .perm-layout { flex-direction: column; } .perm-side { width: 100%; } }

/* ================= v0.6.1 结果分析（BI 报表 + 271 人才盘点） ================= */
.ana-kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ana-kpi { flex: 1; min-width: 180px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--yh-red); border-radius: 10px; padding: 16px 18px; text-align: center; }
.ana-kpi b { display: block; font-size: 26px; color: var(--yh-red-dark); line-height: 1.3; }
.ana-kpi b span { font-size: 14px; }
.ana-kpi span:last-child { font-size: 12.5px; color: var(--muted); }
.bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.bar-lab { width: 190px; font-size: 13.5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-lab i { font-style: normal; color: var(--muted); font-size: 12px; }
.bar-track { flex: 1; height: 18px; background: #F5F0F0; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--yh-red), #E58A9B); border-radius: 9px; transition: width .5s; }
.bar-val { width: 70px; font-size: 13.5px; color: var(--yh-red-dark); }
.ana-tiers { display: flex; gap: 14px; flex-wrap: wrap; }
.ana-tier { flex: 1; min-width: 240px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #FDFCFC; }
.ana-tier-h { font-size: 14.5px; font-weight: 700; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.ana-tier-h.A { background: var(--yh-red-light); color: var(--yh-red-dark); }
.ana-tier-h.B { background: #FFF8E8; color: #9A6700; }
.ana-tier-h.C { background: #F3F4F6; color: #4B5563; }
.ana-tier-r { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 2px; border-bottom: 1px dashed var(--line); }

/* ================= v0.6.2 数据提醒角标 + 详情页操作条 + 管理弹层 ================= */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #FFDADA; color: #B4232A; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 2px; }
#nav a.active .nav-badge, #topbar .nav-badge { background: #fff; color: #B4232A; }
#nav a .nav-badge { background: rgba(255, 255, 255, .25); color: #fff; }
.op-bar { gap: 8px; flex-wrap: wrap; }
.op-bar .sm { white-space: nowrap; }
.main-score.hd .sc-detail { display: none; }
.manage-table td { vertical-align: middle; }
.manage-table .sm { padding: 4px 10px; font-size: 12.5px; }

/* ===== v0.6.3 绩效管理页 · 当前进展与待办区 ===== */
.todo-card { border: 1.5px solid var(--yh-red-light); background: linear-gradient(180deg, #FFFDFD 0%, #FFFFFF 60%); }
.todo-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.todo-summary { font-size: 13.5px; color: var(--muted); }
.todo-hl { color: var(--yh-red); font-size: 15px; }
.stage-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 12px; border-bottom: 1px dashed var(--line); }
.stage-pill { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 86px; padding: 10px 14px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: all .15s; }
.stage-pill:hover { border-color: var(--yh-red); box-shadow: 0 2px 8px rgba(199,0,11,.10); }
.stage-pill.active { border-color: var(--yh-red); background: var(--yh-red-light); }
.stage-pill.active .sp-label { color: var(--yh-red); font-weight: 700; }
.sp-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sp-n { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stage-pill.active .sp-n { color: var(--yh-red); }
.stage-arrow { color: #C9CDD4; font-size: 15px; }
.todo-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.todo-row .tr-ico { font-size: 16px; }
.todo-row .tr-label { font-size: 14px; flex: 1; }
.todo-row .tr-n { font-size: 17px; color: var(--yh-red); }
.todo-row .tr-unit { font-size: 12.5px; color: var(--muted); margin-right: 6px; }
.todo-row.overdue { border-color: #F5C6C0; background: #FFF7F6; }
.todo-row .btn.sm { cursor: pointer; }

/* ===== v0.6.4 指标定义条目化排版 ===== */
.def-list { margin: 0; padding-left: 20px; }
.def-list li { margin: 4px 0; line-height: 1.75; padding-left: 2px; }
.def-list li::marker { color: #AF2423; font-weight: 600; }
.def-lines > div { margin: 3px 0; line-height: 1.75; }
.def-lines > div::before { content: '·'; color: #AF2423; font-weight: 700; margin-right: 6px; }
.def-note { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #E5E9EE; color: #5A6672; font-size: 12.5px; line-height: 1.7; }
/* 工作台待办明细 */
.todo-sum { font-size: 13px; color: #5A6672; margin: 4px 0 10px; }
.todo-sum b { color: #AF2423; font-size: 15px; }

/* ===== v0.6.12 编辑器格子化（智办事风格）：无边框输入 + 悬停/选中高亮 ===== */
.grid-edit td { padding: 10px 12px; vertical-align: top; transition: background .12s; }
.grid-edit td:hover { background: #FDF2F2; }
.grid-edit td:focus-within { background: #fff; box-shadow: inset 0 0 0 2px #AF2423; border-radius: 2px; }
.grid-edit input[type="text"], .grid-edit input:not([type]), .grid-edit input[type="number"], .grid-edit textarea {
  width: 100%; border: none; background: transparent; padding: 2px 4px; font-size: 13.5px;
  color: var(--text); line-height: 1.7; resize: vertical; outline: none; font-family: inherit;
}
.grid-edit input:focus, .grid-edit textarea:focus { background: transparent; }
.grid-edit input::placeholder, .grid-edit textarea::placeholder { color: #B8BFC9; }
/* 条件项勾选列 */
.ti-cond-cell { font-size: 12.5px; }
.cond-check { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cond-check input { width: auto; accent-color: #AF2423; cursor: pointer; }
.cond-hint { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-top: 4px; }
/* 评分页：条件项 / 未触发 */
.skip-check { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; color: #5A6672; cursor: pointer; white-space: nowrap; }
.skip-check input { width: auto; accent-color: #AF2423; cursor: pointer; }
.skip-tag { background: #FDF2F2; color: #8B1A1A; border: 1px solid #F0D5D5; }
.skip-row { background: #FBFBFC; }
.skip-row td { color: #8A8F99; }
.skip-cell { color: #A6ABB5; font-size: 12.5px; }

/* ===== v0.7.1 整行可点击交互 ===== */
tr.row-link, .todo-row.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--yh-red-light) !important; }
.todo-row.row-link { transition: background .12s, border-color .12s; }
.todo-row.row-link:hover { background: var(--yh-red-light); border-color: #E8B7B4; }

/* ===== v0.7.2 未读消息区分 + 评分备注 + 校准双框 ===== */
.notif-list li.unread {
  background: #FDF2F2;
  border-left: 3px solid #B4232A;
  padding-left: 12px;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}
.notif-list li.read { color: #5A6672; opacity: .82; }
.score-remark {
  font-size: 12px;
  color: #8C2A30;
  background: #FBEBEC;
  border-radius: 4px;
  padding: 3px 7px;
  margin-top: 5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.remark-input {
  width: 100%;
  margin-top: 5px;
  border: 1px solid #E5E9EE;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12.5px;
  color: #333E4A;
}
.remark-input:focus { border-color: #C93A39; outline: none; }
.calib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calib-box { border: 1px solid #E5E9EE; border-radius: 10px; padding: 12px 14px; }
.calib-box .cb-title { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.calib-sub { border-color: #E8B7B4; background: #FDF7F7; }
.calib-sub .cb-title { color: #B4232A; }
.calib-add { border-color: #BFE3C6; background: #F7FCF8; }
.calib-add .cb-title { color: #1D7A3C; }
@media (max-width: 720px) { .calib-grid { grid-template-columns: 1fr; } }

/* v0.7.3 全局返回上一页按钮（内容区左上角，非工作台页面常驻） */
#backbar { max-width: 1280px; margin: 0 auto; padding: 10px 20px 0; }
#backbar.hidden { display: none; }
#btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #E5E9EE; background: #fff; color: #5A6672;
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
#btn-back:hover { color: #AF2423; border-color: #C93A39; background: #FDF2F2; }

/* v0.7.4 菜单栏视觉增强：图标 + 激活态高亮（红底白字主题内的层次感） */
#nav a { display: inline-flex; align-items: center; gap: 6px; position: relative; transition: background .15s, color .15s; border-radius: 8px; }
#nav a .nav-ico { font-size: 15px; line-height: 1; filter: saturate(.9); }
#nav a:hover { background: rgba(255,255,255,.12); }
#nav a.active {
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 -2.5px 0 rgba(255,255,255,.95);
  color: #fff;
}
#nav a.active .nav-ico { filter: none; }
#nav a:not(.active) { opacity: .92; }

/* v0.7.4 客户版评分录入指引卡 */
.guide-card { border-left: 3px solid #AF2423; background: #FFFDFD; }
.guide-steps { margin: 6px 0 0; padding-left: 4px; list-style: none; counter-reset: gs; }
.guide-steps li { counter-increment: gs; position: relative; padding: 5px 0 5px 34px; font-size: 13.5px; color: #333E4A; line-height: 1.7; }
.guide-steps li::before {
  content: counter(gs);
  position: absolute; left: 0; top: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #AF2423; color: #fff;
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* v0.7.8 签名区直达高亮 */
.flash-hl { animation: flashhl 3s ease; }
@keyframes flashhl {
  0%, 100% { box-shadow: none; }
  15%, 75% { box-shadow: 0 0 0 3px rgba(175, 36, 35, .35); border-color: #AF2423; }
}

/* v0.7.9 测试静默模式提示条（导航栏内） */
.silent-chip {
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, .95); color: #B4232A;
  font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 4px 12px;
  cursor: help; margin-right: 6px;
  animation: silentPulse 2.4s ease infinite;
}
@keyframes silentPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ================= v0.7.62 手机端全面适配（置于文件末尾，确保覆盖全部历史规则） ================= */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }              /* 杜绝整页横向滚动 */
  main { padding: 12px 12px 50px; }
  body { font-size: 14px; }

  /* —— 顶栏：三行紧凑结构，高度随内容自动扩展 —— */
  #topbar { flex-wrap: wrap; height: auto; min-height: 48px; padding: 8px 10px; gap: 6px 10px; align-items: center; align-content: flex-start; }
  .brand { gap: 6px; flex: none; align-items: center; }
  .brand .sub { display: none; }
  .brand .logo { font-size: 14px; letter-spacing: 0; }
  .brand-logo { height: 20px; }
  /* 第一行右侧：姓名 · 角色 · 退出，完整可见可点 */
  .userbox { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; justify-content: flex-end; font-size: 12.5px; white-space: nowrap; min-width: 0; }
  .userbox a { margin-left: 0; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,.16); color: #fff; }
  /* 菜单：整行铺开换行，不滑动；覆盖 v0.5.0 的 flex:1/space-evenly/overflow-x:auto */
  #nav { display: flex; flex: 1 1 100%; order: 3; width: 100%; gap: 2px 4px; flex-wrap: wrap; overflow: visible; justify-content: flex-start; }
  #nav a { padding: 8px 11px; font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
  #nav::-webkit-scrollbar { display: none; }

  /* —— 卡片与标题 —— */
  .card { padding: 14px 12px; margin-bottom: 12px; border-radius: 10px; }
  .card h3 { font-size: 14.5px; }
  .page-title { font-size: 18px; margin-bottom: 14px; }
  .page-sub { margin: -8px 0 14px 10px; }

  /* —— 表格：紧凑 + 卡内横向滑动兜底 —— */
  th, td { padding: 10px 8px; font-size: 13px; }
  th { white-space: normal; }
  .card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* —— 流程步骤条：压缩可换行 —— */
  .stepper-box { padding: 12px 8px; margin: 12px 0 16px; }
  .step2 { min-width: 64px; padding: 2px 4px; }
  .st-dot { width: 22px; height: 22px; font-size: 12px; }
  .st-name { font-size: 12.5px; white-space: normal; line-height: 1.4; }
  .st-by { font-size: 11px; white-space: normal; }

  /* —— 表单与按钮 —— */
  .form-row, .filter-bar { flex-direction: column; align-items: stretch; }
  .form-row label { min-width: 0; }
  button, .btn { padding: 9px 14px; font-size: 13.5px; }
  .plan-head { gap: 10px; }
  .person { white-space: normal; }

  /* —— 弹窗适配窄屏 —— */
  .modal { min-width: 0; max-width: 94vw; padding: 18px 14px; }

  /* —— 工作台统计卡两列 —— */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 12px; }
  .stat .num { font-size: 22px; }
}
