/* ========== HR 管理端 ========== */
:root { --side: #0e2a2f; --side2: #133740; --side-t: #b7cdd0; }
/* 宽屏时「侧边栏 + 主内容」作为一个整体水平居中，避免侧边栏贴左、内容漂在中间留出大空档 */
.layout { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; max-width: 1704px; margin: 0 auto; box-shadow: 1px 0 0 var(--line); }
.side { background: var(--side); color: var(--side-t); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.logo-box { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; }
.logo-box .lg { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #12b886, #0f9f74); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.logo-box b { font-size: 15px; display: block; } .logo-box span { font-size: 11px; color: #7fa3a8; letter-spacing: .5px; }
.nav-g { font-size: 11.5px; color: #6f9197; padding: 14px 18px 6px; letter-spacing: .5px; }
.nav a { display: flex; align-items: center; gap: 10px; margin: 2px 10px; padding: 9px 12px; border-radius: 9px; color: var(--side-t); font-size: 14px; transition: background .15s; }
.nav a:hover { background: var(--side2); color: #fff; }
.nav a.on { background: linear-gradient(90deg, #12b886, #0f9f74); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(18, 184, 134, .25); }
.nav a i { font-style: normal; width: 20px; text-align: center; }
.nav a .nb { margin-left: auto; background: #e5484d; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 11.5px; color: #6f9197; border-top: 1px solid #1c434c; }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 30; }
.crumb { color: var(--muted); font-size: 13px; } .crumb b { color: var(--text); }
.top-search { margin-left: auto; position: relative; }
.top-search input { width: 240px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #f8fafc; padding: 0 12px 0 32px; outline: none; }
.top-search::before { content: "🔍"; position: absolute; left: 10px; top: 7px; font-size: 13px; opacity: .6; }
.top-date { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.td-time { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.bell { position: relative; border: 1px solid var(--line); background: #fff; width: 36px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.bell b { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: #0e2a2f; color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; border: 0; }
.user-chip i { width: 7px; height: 7px; border-radius: 50%; background: #12b886; }
#main { padding: 22px 24px 40px; width: 100%; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.ph p { color: var(--muted); margin-top: 4px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* KPI */
.kpi { padding: 14px 16px; position: relative; overflow: hidden; cursor: default; }
.kpi[data-href] { cursor: pointer; }
.kpi[data-href]:hover { border-color: #b8e6d4; }
.kpi .kl { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.kpi .ki { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.kpi .kv { font-size: 30px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.kpi .kv small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .ks { font-size: 12px; color: var(--faint); margin-top: 4px; }
.kpi.red .kv { color: var(--red); }
.hello { display: flex; align-items: center; gap: 20px; padding: 16px 20px; }
.hello .rings { display: flex; gap: 18px; margin-left: auto; }
.hello .rings > div { text-align: center; font-size: 12px; color: var(--muted); }

/* 漏斗 / 条形 */
.funnel { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.funnel .fs { height: 32px; border-radius: 7px; color: #fff; font-size: 12.5px; display: flex; align-items: center; justify-content: center; font-weight: 600; min-width: 140px; position: relative; }
.funnel-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.funnel-row .fl { width: 96px; text-align: right; font-size: 12.5px; color: var(--muted); flex: none; }
.funnel-row .fr { flex: 1; } .funnel-row .fp { width: 70px; font-size: 11.5px; color: var(--faint); flex: none; }
.hbar { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; cursor: pointer; border-radius: 6px; }
.hbar:hover { background: #fafbfc; }
.hbar .hl { width: 130px; flex: none; } .hbar .ht { flex: 1; height: 10px; border-radius: 5px; background: var(--line2); overflow: hidden; }
.hbar .ht i { display: block; height: 100%; border-radius: 5px; }
.hbar .hn { width: 64px; text-align: right; flex: none; color: var(--muted); font-size: 12px; }
/* 卡点排行：同一环节的条形按责任方分段着色，颜色与右侧「卡在谁手里」一致 */
.hbar .ht .hsegs { display: flex; height: 100%; min-width: 3px; border-radius: 5px; overflow: hidden; }
.hbar .ht .hsegs i { height: 100%; border-radius: 0; flex: none; }
.step-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.step-legend span { display: inline-flex; align-items: center; gap: 4px; }
.step-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.chart svg { width: 100%; height: auto; display: block; }

/* 人员行 */
.prow { display: grid; grid-template-columns: 28px minmax(170px, 1.1fr) minmax(320px, 3fr) 130px 200px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.prow:hover { background: #fbfcfd; }
.prow.head { font-size: 12px; color: var(--muted); background: #f8fafc; font-weight: 600; padding-top: 9px; padding-bottom: 9px; }
.pname { font-weight: 700; font-size: 14.5px; cursor: pointer; } .pname:hover { color: var(--pri-d); }
.psub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.stages { display: flex; gap: 4px; }
.stg { flex: 1; min-width: 0; position: relative; }
.stg .sb { height: 8px; border-radius: 4px; background: #e9edf2; overflow: hidden; }
.stg .sb i { display: block; height: 100%; background: var(--pri); }
.stg.risk .sb { background: #fbd5d6; } .stg.risk .sb i { background: var(--red); }
.stg.active .sb i { background: var(--blue); }
.stg .sn { font-size: 11px; color: var(--faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stg.active .sn { color: #1d63c8; font-weight: 600; } .stg.risk .sn { color: var(--red); font-weight: 600; } .stg.done .sn { color: var(--pri-d); }
.cur-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 11.5px; border-radius: 5px; padding: 0 6px; line-height: 19px; background: var(--gray-l); color: var(--muted); white-space: nowrap; }
.chip.rejected { background: var(--red-l); color: #c4282d; } .chip.submitted { background: var(--purple-l); color: var(--purple); }
.chip.ready, .chip.in_progress { background: var(--blue-l); color: #1d63c8; }
.riskcell .badge { cursor: help; }
.rr { font-size: 11.5px; color: var(--red); margin-top: 3px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 环节健康度（哪些还没完成 / 堵在哪一环） ===== */
.health-cap { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 7px; }
.health-cap span { font-weight: 400; color: var(--faint); margin-left: 6px; }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.hc-hint { font-size: 11px; color: var(--faint); margin-top: 2px; line-height: 1.4; height: 30px; overflow: hidden; }
.filter-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 12px; margin: -4px 0 12px; background: var(--pri-l); border: 1px solid #c9ebdd; border-radius: 8px; font-size: 12.5px; color: var(--pri-d); }
.hcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.hcard:hover { border-color: #c9d3df; background: #fcfdfe; }
.hcard.on { border-color: var(--pri); background: #f7fdfa; }
.hcard.worst { border-top: 3px solid var(--red); padding-top: 9px; }
.hc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.hc-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-cnt { color: var(--faint); flex: none; }
.hc-worst { background: var(--red-l); color: var(--red); border-radius: 4px; padding: 0 6px; font-size: 11px; flex: none; }
.hc-right { display: flex; align-items: center; gap: 5px; flex: none; }
.hc-num { font-size: 25px; font-weight: 700; line-height: 1.35; margin-top: 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.hc-num small { font-size: 12px; font-weight: 400; color: var(--muted); }
/* 「未完成」与「卡住」是包含关系，用徽章直接点破，避免两个数字并列被误解 */
.hc-rel { font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-l); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.hc-rel.ok { color: var(--pri-d); background: var(--pri-l); }
.hc-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line2); margin: 7px 0 5px; }
.hc-bar i.ok { background: var(--pri); } .hc-bar i.nm { background: var(--blue); } .hc-bar i.bk { background: var(--red); }
/* 图例即拆解：已完成 + 待办理 + 卡住 = 共 N 人，且待办理 + 卡住 = 未完成 */
.hc-legend { display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.hc-legend span { display: inline-flex; align-items: center; white-space: nowrap; }
.hc-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; flex: none; }
.hc-legend i.ok { background: var(--pri); } .hc-legend i.nm { background: var(--blue); } .hc-legend i.bk { background: var(--red); }
.hc-sub { font-size: 11.5px; color: var(--faint); }
.hc-sub b { color: var(--muted); }
.hc-risk { margin-top: 6px; font-size: 11.5px; color: var(--red); background: var(--red-l); border: 0; border-radius: 5px; padding: 2px 7px; cursor: pointer; }
.hc-ok { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--pri-d); }
.vseg button { padding: 0 10px; }

/* ===== 人员行：焦点徽章 + 流水线节点 + 未完成清单 ===== */
.lhead { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 9px 16px; background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line2); }
.person { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; padding: 13px 16px; border-bottom: 1px solid var(--line2); }
.person:hover { background: #fbfcfd; }
.person.blocked { box-shadow: inset 3px 0 0 var(--red); } .person.todo { box-shadow: inset 3px 0 0 var(--blue); }
.person.review { box-shadow: inset 3px 0 0 var(--purple); } .person.done { box-shadow: inset 3px 0 0 var(--pri); }
.pmain { min-width: 0; }
.pline1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pinfo { min-width: 185px; flex: 1 1 230px; align-items: center; }
.focus { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 4px 9px; white-space: nowrap; }
.focus b { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: rgba(255,255,255,.75); font-size: 10px; }
.focus.blocked { background: var(--red-l); color: #c4282d; } .focus.review { background: var(--purple-l); color: var(--purple); }
.focus.unregistered { background: var(--gray-l); color: var(--muted); } .focus.todo { background: var(--blue-l); color: #1d63c8; }
.focus.done { background: var(--pri-l); color: var(--pri-d); }
.pprog { display: flex; align-items: center; gap: 7px; width: 104px; } .pprog .bar { flex: 1; } .pprog b { font-size: 12.5px; width: 34px; text-align: right; }
.pacts { display: flex; gap: 6px; }
.pipeline { display: flex; margin: 10px 0 8px; }
.pnode { flex: 1; min-width: 0; position: relative; text-align: center; }
.pnode::after { content: ''; position: absolute; top: 10px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.pnode:last-child::after { display: none; }
.pnode.done::after { background: var(--pri-l); }
.pdot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; background: var(--gray-l); color: var(--faint); border: 2px solid #fff; }
.pnode.done .pdot { background: var(--pri); color: #fff; } .pnode.active .pdot { background: var(--blue); color: #fff; }
.pnode.risk .pdot { background: var(--red); color: #fff; } .pnode.warn .pdot { background: var(--warn); color: #fff; }
.pnode.now .pdot { width: 26px; height: 26px; margin-top: -2px; box-shadow: 0 0 0 3px var(--blue-l); }
.pnode.now.risk .pdot { box-shadow: 0 0 0 3px var(--red-l); }
.pnm { display: block; max-width: 100%; font-size: 11px; color: var(--faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnode.done .pnm { color: var(--pri-d); } .pnode.risk .pnm { color: var(--red); font-weight: 600; }
.pnode.warn .pnm { color: #b35c00; } .pnode.active .pnm { color: #1d63c8; font-weight: 600; }
.pnow { display: block; width: fit-content; max-width: 100%; min-height: 14px; font-size: 10px; line-height: 14px; color: #1d63c8; background: var(--blue-l); border-radius: 3px; padding: 0 4px; margin: 2px auto 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnow.risk { color: var(--red); background: var(--red-l); }
.pnow.empty { background: transparent; }
.pline3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blockmsg { font-size: 11.5px; color: #c4282d; background: var(--red-l); border-radius: 5px; padding: 3px 8px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blockmsg em { font-style: normal; font-weight: 600; }
.reviewmsg { font-size: 11.5px; color: var(--purple); background: var(--purple-l); border-radius: 5px; padding: 3px 8px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.pnum { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pchip { font-size: 11px; color: var(--muted); background: var(--gray-l); border-radius: 5px; padding: 2px 7px; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.risk { background: var(--red-l); color: #c4282d; }
.pmore { font-size: 11px; color: var(--faint); }
.pdone { font-size: 11.5px; color: var(--pri-d); }

/* ===== 看板视图（按当前所处环节分列） ===== */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.bcol { flex: 0 0 236px; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 170px; }
.bhead { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; padding: 2px 4px 10px; }
.bhead b { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; font-size: 11px; color: var(--muted); font-weight: 400; }
.bsub { font-size: 11px; color: var(--faint); padding: 0 4px 9px; margin-top: -6px; line-height: 1.5; overflow-wrap: anywhere; }
.bbody { display: flex; flex-direction: column; gap: 8px; }
.bcard { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; padding: 10px; cursor: pointer; }
.bcard:hover { border-color: #c9d3df; background: #fcfdfe; }
.bcard.blocked { border-left-color: var(--red); } .bcard.review { border-left-color: var(--purple); }
.bcard.unregistered { border-left-color: var(--faint); } .bcard.done { border-left-color: var(--pri); }
.bav { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-l); color: #1d63c8; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.bpct { font-size: 12px; color: var(--muted); }
.bfocus { font-size: 12px; font-weight: 600; margin-top: 8px; }
.bfocus.blocked { color: var(--red); } .bfocus.review { color: var(--purple); } .bfocus.todo { color: #1d63c8; }
.bfocus.unregistered { color: var(--muted); } .bfocus.done { color: var(--pri-d); }
.bdetail { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bfoot { font-size: 11px; color: var(--faint); margin: 6px 0 5px; }
.bcard .bar { height: 4px; }
.bnone { text-align: center; color: var(--faint); font-size: 12px; padding: 18px; }

/* 筛选 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; }
.filters .input { height: 34px; width: auto; min-width: 110px; font-size: 13px; }
.filters .search { min-width: 200px; }
.daterange { display: flex; align-items: center; gap: 5px; }
.daterange span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.daterange .input { min-width: 125px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 12px; height: 32px; font-size: 13px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--pri); color: #fff; font-weight: 600; }

/* 详情 */
.dhead { display: flex; gap: 16px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.dhead .avatar { width: 52px; height: 52px; font-size: 20px; }
.dhead h1 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dmeta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--pri-d); border-color: var(--pri); font-weight: 700; }
.dag-box { overflow-x: auto; padding: 8px 4px; }
.dag-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); padding: 4px 4px 10px; }
.dag-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.dag-legend .ln { display: inline-block; width: 22px; border-top: 2px solid #0f9f74; margin-right: 4px; vertical-align: 3px; }
.dag-legend .ln.dash { border-top-style: dashed; }
.trow { display: grid; grid-template-columns: 26px minmax(0, 1fr) 110px 150px 170px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.trow:hover { background: #fbfcfd; } .trow.sel { background: #f1faf6; }
.trow .tn { font-weight: 600; } .trow .tf { font-size: 11.5px; color: var(--red); margin-top: 2px; }
.stage-h { padding: 10px 14px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line2); }
.stage-hint { font-weight: 400; font-size: 11.5px; color: var(--faint); margin-left: 10px; }
.owner { display: inline-block; font-size: 11.5px; color: #fff; border-radius: 5px; padding: 0 7px; line-height: 20px; white-space: nowrap; }
/* 详情页：只把「第一个卡点」做成主告警，其余异常折叠，避免显示成 N 个卡点 */
.rp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.rp-tag { background: var(--red); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.rp-h .owner { font-size: 11px; }
.rp-t { margin-top: 8px; font-size: 13.5px; line-height: 1.6; font-weight: 500; }
.rp-a { margin-top: 9px; }
.risk-more { margin-top: 10px; border-top: 1px solid rgba(166, 27, 32, .16); padding-top: 8px; font-size: 12.5px; }
.risk-more summary { cursor: pointer; font-weight: 600; outline: none; }
.risk-more[open] summary { margin-bottom: 6px; }
.rp-x { padding: 5px 0; line-height: 1.5; cursor: pointer; border-top: 1px dashed rgba(166, 27, 32, .12); }
.rp-x:hover { text-decoration: underline; }
.timeline { padding: 6px 0; }
.ev { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.ev::before { content: ""; position: absolute; left: 5px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.ev:last-child::before { display: none; }
.ev .ed { width: 12px; height: 12px; border-radius: 50%; background: var(--pri); margin-top: 5px; flex: none; border: 2px solid #d7f3e7; }
.ev .et { font-size: 13px; } .ev .em { font-size: 12px; color: var(--faint); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.att { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.att .ai { height: 110px; background: #f5f7fa; display: flex; align-items: center; justify-content: center; font-size: 34px; overflow: hidden; }
.att .ai img { width: 100%; height: 100%; object-fit: cover; }
.att .ab { padding: 8px 10px; font-size: 12px; }
.att.rejected { border-color: #f5c2c4; } .att.accepted { border-color: #b8e6d4; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 800; box-shadow: -12px 0 40px rgba(16,24,40,.16); display: flex; flex-direction: column; animation: din .2s; }
@keyframes din { from { transform: translateX(30px); opacity: 0; } }
.drawer-h { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-h h3 { font-size: 16px; flex: 1; }
.drawer-b { padding: 16px 18px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.drawer-mask { position: fixed; inset: 0; background: rgba(16,24,40,.25); z-index: 799; }
.kv2 { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px 10px; font-size: 13px; }
.kv2 dt { color: var(--muted); }
.ocrbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fcfdfe; }
.ocrbox .flag { color: #a14a00; font-size: 12.5px; padding: 2px 0; }

/* 批次矩阵 */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.matrix th { position: sticky; top: 0; background: #f8fafc; padding: 6px 4px; font-weight: 600; color: var(--muted); writing-mode: vertical-rl; text-orientation: mixed; height: 130px; vertical-align: bottom; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix th.nm { writing-mode: horizontal-tb; height: auto; text-align: left; vertical-align: bottom; min-width: 140px; }
.matrix td { padding: 3px; border-bottom: 1px solid var(--line2); text-align: center; }
.matrix td.nm { text-align: left; padding: 6px 8px; white-space: nowrap; }
.cell { width: 22px; height: 22px; border-radius: 5px; display: inline-block; background: #eef1f5; cursor: pointer; }
.cell.done { background: #12b886; } .cell.ready, .cell.in_progress { background: #74a9f5; } .cell.submitted { background: #9b87f5; }
.cell.rejected { background: #e5484d; } .cell.skipped { background: repeating-linear-gradient(45deg, #f2f4f7 0 3px, #fff 3px 6px); }
.cell.risk { box-shadow: 0 0 0 2px #e5484d; }
.colstat { font-size: 10.5px; color: var(--faint); }
.qr-sheet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.qr-card { border: 1px dashed #c3cad5; border-radius: 10px; padding: 12px; text-align: center; break-inside: avoid; }
.qr-card svg { width: 140px; height: 140px; }
.qr-card b { display: block; font-size: 15px; margin-top: 4px; }

/* 模板编辑 */
.tpl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.prop { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
.prop .field { margin-bottom: 10px; }
.prop .input { height: 34px; font-size: 13px; }
.deps { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.deps .dr { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line2); }
.deps .dr:last-child { border-bottom: 0; }
.deps select { height: 24px; font-size: 11.5px; border: 1px solid var(--line); border-radius: 5px; margin-left: auto; }
.gantt { font-size: 12px; }
.gantt .gr { display: grid; grid-template-columns: 170px 1fr; align-items: center; min-height: 28px; border-bottom: 1px solid var(--line2); }
.gantt .gl { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt .gt { position: relative; height: 28px; }
.gantt .gb { position: absolute; top: 7px; height: 14px; border-radius: 4px; opacity: .85; min-width: 4px; }
.gantt .gb.crit { outline: 2px solid #f08c00; }
.gantt .gx { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #d0d5dd; font-size: 10px; color: var(--faint); padding-left: 2px; }
.gantt .gx.d0 { border-left: 2px solid var(--red); color: var(--red); }

.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.notif.unread { background: #f4fbf8; } .notif:hover { background: #fafbfc; }

/* 登录 */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-l { background: radial-gradient(circle at 20% 20%, #17505a, #0e2a2f 60%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.login-l h1 { font-size: 34px; font-weight: 800; line-height: 1.35; }
.login-l p { color: #a9c6ca; margin-top: 12px; font-size: 15px; line-height: 1.8; }
.login-l ul { margin-top: 26px; list-style: none; display: grid; gap: 12px; }
.login-l li { display: flex; gap: 10px; align-items: flex-start; color: #d6e6e8; }
.login-r { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.demo-box { margin-top: 18px; padding: 12px; background: var(--gray-l); border: 1px solid var(--line); border-radius: 10px; }
.demo-h { font-size: 12.5px; font-weight: 600; margin-bottom: 9px; } .demo-h span { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.demo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.demo-chip:hover { border-color: var(--pri); background: var(--pri-l); }
.demo-chip.on { border-color: var(--pri); background: var(--pri-l); box-shadow: inset 0 0 0 1px var(--pri); }
.demo-chip b { font-size: 12px; font-weight: 600; } .demo-chip span { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.mtabs { display: none; }
.menu-btn { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; }

@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .tpl-wrap { grid-template-columns: 1fr; } .prop { position: static; max-height: none; } .qr-sheet { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 600; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: block; }
  .topbar { padding: 0 12px; }
  .top-search, .td-date, .user-chip span { display: none; }
  .top-date { font-size: 12px; } .td-time { font-size: 12px; }
  #main { padding: 14px 12px calc(80px + env(safe-area-inset-bottom)); }
  .ph h1 { font-size: 21px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .kv { font-size: 24px; }
  .hello { flex-wrap: wrap; } .hello .rings { margin-left: 0; }
  .prow { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .prow.head { display: none; }
  .prow > .pc { display: none; }
  .health { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .hcard { flex: 0 0 148px; }
  .person { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .person > .pc, .lhead { display: none; }
  .pline1 { gap: 8px; }
  .pprog { width: 88px; }
  .pnm { font-size: 10px; }
  .pnow .nw { display: none; }
  .pchip { max-width: 106px; }
  .blockmsg { max-width: 100%; }
  .bcol { flex: 0 0 76vw; }
  .trow { grid-template-columns: 22px 1fr auto; }
  .trow .tdue, .trow .town { display: none; }
  .mtabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 500; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .mtabs a { flex: 1; text-align: center; padding: 7px 0 6px; font-size: 11px; color: var(--faint); position: relative; }
  .mtabs a i { display: block; font-style: normal; font-size: 19px; line-height: 1.25; }
  .mtabs a.on { color: var(--pri-d); font-weight: 700; }
  .mtabs a b { position: absolute; top: 2px; left: 56%; background: var(--red); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 4px; line-height: 15px; }
  .login-page { grid-template-columns: 1fr; } .login-l { padding: 32px 24px; } .login-l ul { display: none; } .login-l h1 { font-size: 24px; }
  .qr-sheet { grid-template-columns: repeat(2, 1fr); }
  .filters .input, .filters .search { flex: 1 1 140px; min-width: 0; }
  .daterange { flex: 1 1 100%; }
  .daterange .input { flex: 1; min-width: 0; }
}
@media print {
  .side, .topbar, .mtabs, .no-print { display: none !important; }
  .layout { display: block; } #main { padding: 0; } body { background: #fff; }
  .qr-sheet { grid-template-columns: repeat(4, 1fr); }
}
