:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7785;
  --line: #e3e8ef;
  --primary: #2f6fed;
  --primary-d: #1f55c7;
  --ok: #1f9d55;
  --warn: #d9822b;
  --bad: #d64545;
  --chip: #eef3ff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: linear-gradient(90deg, #2f6fed, #4b86f0); color: #fff; }
.brand { font-weight: 700; font-size: 17px; }
.user-box { font-size: 14px; }
.user-box button { margin-left: 10px; }
.view { max-width: 1080px; margin: 22px auto; padding: 0 16px; }
.hidden { display: none !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: 0 2px 10px rgba(20,40,80,.05); }
h2 { margin: 0 0 6px; font-size: 19px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
code { background: #f0f3f9; padding: 1px 6px; border-radius: 5px; font-size: 12px; color: #244; }
label { display: block; margin: 10px 0; font-size: 14px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; margin-top: 5px; }
button { cursor: pointer; border: none; border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-d); }
.ghost { background: #eef1f6; color: var(--ink); }
.ghost:hover { background: #e2e7ef; }
button:disabled { opacity: .55; cursor: not-allowed; }
.msg { margin-top: 12px; font-size: 13px; color: var(--bad); min-height: 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2733; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 50; }

/* 登录 */
.login-card { max-width: 420px; margin: 40px auto; }
.login-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.login-grid .login-card { margin: 40px 0; flex: 1 1 360px; max-width: 460px; }
.leader-row td { background: var(--chip); font-weight: 600; }
.demo { margin-top: 14px; font-size: 13px; color: var(--muted); }
.demo-list { margin-top: 8px; line-height: 1.7; font-size: 13px; }
.lan-panel { display: flex; gap: 16px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.lan-qr { width: 180px; height: 180px; flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.lan-qr img, .lan-qr canvas { display: block; }
.lan-tip { flex: 1 1 220px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.lan-url { margin: 8px 0; font-size: 15px; font-weight: 600; word-break: break-all; }
.lan-url a { color: var(--primary, #2563eb); }
.lan-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.lan-alt { margin-top: 6px; font-size: 12px; font-weight: 400; }
.lan-alt code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }
.exp-list { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.exp-col-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.exp-col-row code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.exp-idx { width: 20px; height: 20px; line-height: 20px; text-align: center; background: var(--primary, #2563eb); color: #fff; border-radius: 50%; font-size: 12px; }
.exp-label-input { flex: 1 1 140px; min-width: 120px; max-width: 240px; padding: 5px 8px; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.exp-label-input:focus { outline: none; border-color: var(--primary, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.exp-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
button.sm { padding: 5px 10px; font-size: 13px; }
button.ghost.sm { padding: 5px 10px; font-size: 13px; }
.exp-hint { margin: 8px 0; }

/* 管理员登录弹窗 */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.modal-box { position: relative; z-index: 1; width: 360px; max-width: 92vw; margin: 0; }

/* 结构化人员编辑 */
.cfg-admin { background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.cfg-admin input { width: auto; display: inline-block; }
.grp-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; background: #fcfdff; }
.grp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.grp-head input, .grp-leader input, .mem-row input { width: auto; display: inline-block; }
.grp-leader { margin: 6px 0; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grp-members { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mem-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.miss-list { color: var(--bad); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }

/* 员工状态 */
.emp-status { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-pill { background: var(--chip); border-radius: 20px; padding: 6px 14px; font-size: 13px; }

/* 材料卡片 */
.mat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.mat-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fcfdff; }
.mat-card h3 { margin: 0 0 4px; font-size: 15px; }
.mat-card .desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.mat-card .row { margin: 8px 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e6f7ee; color: var(--ok); }
.badge.bad { background: #fdeaea; color: var(--bad); }
.badge.pending { background: #fff3e0; color: var(--warn); }
.badge.miss { background: #eef1f6; color: var(--muted); }

/* 上传范例：员工参照 + 管理员编辑 */
.examples-box { background: #f3f7ff; border: 1px dashed #bcd2ff; border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.examples-box .ex-title { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.ex-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; width: 150px; }
.ex-item img, .ex-item video { width: 100%; max-height: 110px; border-radius: 6px; display: block; object-fit: contain; background: #f0f3f9; }
.ex-item audio { width: 100%; margin-top: 4px; }
.ex-item .ex-cap { font-size: 11px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.ex-item.ex-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.ex-item.ex-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(31, 56, 100, .18); border-color: var(--primary); }
/* 范例放大查看弹层 */
.ex-lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, .82); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 24px; }
.ex-lightbox.hidden { display: none; }
.ex-lightbox-box { position: relative; max-width: 92vw; max-height: 90vh; background: #fff; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.ex-lightbox-body { max-width: 86vw; max-height: 76vh; display: flex; align-items: center; justify-content: center; }
.ex-lightbox-body img { max-width: 86vw; max-height: 76vh; border-radius: 8px; object-fit: contain; }
.ex-lightbox-body video { max-width: 86vw; max-height: 76vh; border-radius: 8px; background: #000; }
.ex-lightbox-body audio { width: 70vw; max-width: 640px; }
.ex-lightbox-cap { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; word-break: break-all; }
.ex-lightbox-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #fff; color: #333; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.ex-lightbox-close:hover { background: #fdeaea; color: var(--bad); }
.mat-examples { background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.ex-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ex-del { width: auto; display: inline-block; padding: 1px 8px; font-size: 11px; margin-left: 6px; background: #fdeaea; color: var(--bad); }
.mat-card .msg.low { color: var(--bad); font-weight: 600; background: #fdeef0; border: 1px solid #f3c0c6; padding: 8px 10px; border-radius: 8px; }
.file-in { font-size: 12px; }
.naming-tip { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { background: transparent; color: var(--muted); border-radius: 8px 8px 0 0; padding: 8px 14px; }
.tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.tabpane { font-size: 14px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
th { background: #f6f8fc; }
tr:nth-child(even) td { background: #fafbfe; }

/* 提醒框 */
.reminder { background: #fff8ef; border: 1px solid #f3d9b0; border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; font-size: 13px; line-height: 1.6; }
.reminder.low { background: #fdeef0; border-color: #f3c0c6; }
.reminder b { color: var(--bad); }
.person-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.person-row .name { font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; }

/* 上传结果提示条 */
.emp-result { margin: 4px 0 14px; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.5; }
.emp-result.hidden { display: none; }
.emp-result.ok { background: #e6f7ee; color: var(--ok); border: 1px solid #b8e6cb; }
.emp-result.err { background: #fdeaea; color: var(--bad); border: 1px solid #f3c0c6; }
.emp-result.warn { background: #fff3e0; color: var(--warn); border: 1px solid #f6d8a8; }
.emp-result.info { background: #eef3ff; color: var(--primary); border: 1px solid #cfe0ff; }

/* 组长看板：每人卡片，6 项逐行 */
.lead-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: #fff; }
.lead-card.leader-card { border-color: var(--primary); background: #f7faff; box-shadow: 0 0 0 2px rgba(47,111,237,.08); }
.lead-card-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.tag-self { font-size: 12px; font-weight: 600; color: var(--primary); background: #eef3ff; padding: 1px 8px; border-radius: 10px; }
.lead-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.lead-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.lead-item:first-of-type { border-top: none; }
.lead-idx { width: 20px; height: 20px; border-radius: 50%; background: #eef1f6; color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.lead-name { flex: 1; }
.lead-tag { font-weight: 600; font-size: 13px; }
.lead-item.done .lead-tag { color: var(--ok); }
.lead-item.done .lead-idx { background: #e6f7ee; color: var(--ok); }
.lead-item.todo .lead-tag { color: var(--bad); }
.lead-item.todo .lead-idx { background: #fdeaea; color: var(--bad); }
.lead-item.todo .lead-name { color: var(--bad); font-weight: 600; }
.lead-miss { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: #fdeaea; color: var(--bad); font-weight: 600; }
.lead-miss.ok { background: #e6f7ee; color: var(--ok); }

/* 云盘同步目录设置 */
.cfg-store { background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.cfg-store input { width: 100%; }
.cfg-store code { background: #e9eefb; }

.arch-info { background: #eef6ff; border: 1px solid #cfe0ff; border-radius: 10px; padding: 12px; margin-top: 10px; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.kv .k { color: var(--muted); }
.btn-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 材料目录 + 每人材料分配编辑 */
.mat-catalog-block { background:#f6f8fc; border:1px solid var(--line); border-radius:10px; padding:12px; margin:12px 0; }
.mat-edit { border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin:10px 0; background:#fff; }
.mat-edit-row { display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; }
.mat-edit-row label { display:inline-block; width:auto; margin:4px 0; }
.mat-edit-row input, .mat-edit-row select { width:auto; min-width:84px; }
.chk { display:inline-flex; align-items:center; gap:3px; margin-right:10px; font-size:13px; }
.chk input { width:auto; }
.mem-mats { margin:6px 0 2px; font-size:13px; }
td.na { color:var(--muted); text-align:center; background:#fafbfd; }

/* 统计台账：方正居中对齐 */
.ledger-wrap { overflow-x: auto; margin-top: 6px; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ledger th, table.ledger td { border: 1px solid var(--line); padding: 8px 6px; text-align: center; vertical-align: middle; }
table.ledger th { background: #f6f8fc; font-weight: 600; }
table.ledger .c-fixed { white-space: nowrap; }
table.ledger .c-mat { font-size: 12px; word-break: break-all; min-width: 96px; }
table.ledger .c-ico { display: block; font-size: 16px; line-height: 1.15; }
table.ledger .c-st { display: block; font-size: 11px; margin-top: 2px; }
table.ledger .c-cell.ok .c-st { color: var(--ok); }
table.ledger .c-cell.bad .c-st { color: var(--bad); }
table.ledger .c-done { font-weight: 700; color: var(--primary); }
table.ledger td.na { color: var(--muted); background: #fafbfd; font-size: 15px; }
table.ledger tr:nth-child(even) td { background: #fafbfe; }
