:root {
  --primary: #1f6feb;
  --primary-d: #1558c0;
  --ok: #2e9e4f;
  --bad: #d6453d;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1f2733;
  --muted: #6b7785;
  --warn: #b8860b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
.topbar {
  background: var(--primary); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .nav a { color: #fff; margin-left: 14px; font-size: 14px; opacity: .9; }
.container { max-width: 920px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(20,40,80,.04); }
.card h2 { font-size: 15px; margin: 0 0 12px; padding-left: 9px; border-left: 4px solid var(--primary); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.field { flex: 1 1 200px; min-width: 140px; margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field label .req { color: var(--bad); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.btn {
  display: inline-block; padding: 11px 18px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.ghost.danger { color: var(--bad); border-color: var(--bad); }
table.tbl select { padding: 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); }
table.tbl .ops { white-space: nowrap; }
table.tbl .ops .btn { margin-right: 4px; margin-bottom: 2px; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { padding: 8px 16px; cursor: pointer; font-size: 14px; }
.seg input { display: none; }
.seg input:checked + span { background: var(--primary); color: #fff; }
.seg label span { display: block; padding: 8px 16px; margin: -8px -16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
table.tbl th { background: #f0f4fa; color: var(--muted); font-weight: 600; }
table.tbl input { width: 100%; border: 1px solid transparent; padding: 4px; font-size: 13px; }
table.tbl input:focus { border-color: var(--primary); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #e6f6ec; color: var(--ok); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.kcp { background: #fdeede; color: var(--warn); }
.badge.scp { background: #e7eefc; color: var(--primary); }
.badge.gcp { background: #eef1f4; color: var(--muted); }
.qcp-item { background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.qcp-item .qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qcp-item .qname { font-weight: 600; }
.qcp-item .qmeta { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.qcp-item .qrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qcp-item .qrow input { flex: 1 1 90px; min-width: 70px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.qcp-item .qrow select { padding: 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.att-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); margin-top: 8px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att-thumb { width: 84px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; background: #fff; }
.att-thumb img { width: 100%; height: 70px; object-fit: cover; display: block; }
.att-thumb .nm { font-size: 10px; padding: 2px 4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-thumb .del { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; line-height: 16px; cursor: pointer; font-size: 12px; }
/* 项目级附件 */
.qcp-item .item-att { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.qcp-item .item-add-att { background: #fff; color: var(--primary); border: 1px dashed var(--primary); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.qcp-item .item-add-att:hover { background: #eef4ff; }
.qcp-item .item-att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.item-thumb { width: 64px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; position: relative; background: #fff; }
.item-thumb img { width: 100%; height: 50px; object-fit: cover; display: block; }
.item-thumb .doc { height: 50px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.item-thumb .nm { font-size: 9px; padding: 1px 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-thumb .item-att-del { position: absolute; top: 1px; right: 1px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 16px; height: 16px; line-height: 14px; cursor: pointer; font-size: 11px; }
.item-att-evidence { margin: 4px 0 6px; }
.item-att-evidence .ev-item { display: inline-block; width: 72px; margin: 0 6px 6px 0; vertical-align: top; text-align: center; }
.item-att-evidence .ev-item img { width: 72px; height: 56px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; display: block; }
.item-att-evidence .ev-item .doc { width: 72px; height: 56px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; font-size: 20px; background: #fafbfd; }
.item-att-evidence .ev-item .nm { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { border-left: 3px solid var(--line); margin-left: 8px; padding-left: 16px; }
.tl-stage { margin-bottom: 18px; position: relative; }
.tl-stage::before { content:""; position:absolute; left:-23px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--primary); border:2px solid #fff; box-shadow:0 0 0 2px var(--line); }
.tl-stage h3 { margin: 0 0 8px; font-size: 15px; }
.rec-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.rec-card .rh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rec-card .who { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.hint { background: #eef4ff; border: 1px solid #cfe0ff; color: #2b4a86; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: rgba(20,30,45,.92); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 99; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-mask img { max-width: 92%; max-height: 90%; border-radius: 6px; }
/* 打印 */
@media print {
  body { background: #fff; }
  .topbar, .no-print { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; margin: 0 0 14px; }
  .rec-card, table.tbl { page-break-inside: avoid; }
  @page { size: A4; margin: 14mm; }
}
