:root {
  --brand: #2cbba8;
  --brand-dark: #1f9e8d;
  --brand-light: #e8f8f5;
  --bg: #f7faf9;
  --card: #ffffff;
  --text: #2d3b38;
  --muted: #7a8a86;
  --border: #e2ece9;
  --danger: #e05a4e;
  --warn: #e6a23c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }

/* ---------- 布局 ---------- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar .logo { font-size: 17px; font-weight: 700; color: var(--brand-dark); }
.topbar .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.container { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(44,187,168,.06);
}
.card h3 { font-size: 16px; margin-bottom: 14px; color: var(--text); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { margin: 12px auto; }
}

/* ---------- 表单 ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.form-item { margin-bottom: 12px; }
.btn {
  display: inline-block; padding: 9px 20px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 14px; cursor: pointer; user-select: none;
}
.btn:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn-plain { background: #f0f4f3; color: var(--muted); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #fafcfb; }
.table tr:hover td { background: #f6fbfa; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-green { background: var(--brand-light); color: var(--brand-dark); }
.tag-gray { background: #f0f4f3; color: var(--muted); }
.tag-orange { background: #fdf3e3; color: #c07a11; }
.tag-red { background: #fdecea; color: var(--danger); }

/* ---------- 登录页 ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, #eafaf7 0%, #f7faf9 60%); }
.login-box { background: #fff; border-radius: 16px; padding: 36px 32px; width: 360px;
  box-shadow: 0 8px 30px rgba(44,187,168,.12); }
.login-box h1 { font-size: 20px; text-align: center; color: var(--brand-dark); margin-bottom: 6px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs .tab {
  padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted);
  background: #fff; border: 1px solid var(--border);
}
.tabs .tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 文档阅读 ---------- */
.doc-view {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 26px 22px;
  font-family: "宋体", SimSun, serif; font-size: 14.5px; line-height: 2;
  max-height: 65vh; overflow-y: auto;
  -webkit-user-select: none; user-select: none;
}
.doc-view h2.doc-title { text-align: center; font-size: 18px; margin-bottom: 14px; }
.doc-view h3 { font-size: 15px; margin: 10px 0 4px; }
.doc-view p { margin: 4px 0; text-align: justify; }
.doc-view table.doc-table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.doc-view td, .doc-view th { border: 1px solid #999; padding: 5px 8px; font-size: 13px; }
.doc-view .sig-area { margin-top: 20px; }
.doc-view .sig-line { margin: 8px 0; }
.doc-view .sig-img { height: 56px; vertical-align: middle; }
.doc-view .fp-img { height: 72px; vertical-align: middle; }
.doc-view .id-img { max-width: 200px; max-height: 140px; }
.doc-view .sig-placeholder { color: #bbb; }

/* ---------- 签名板 ---------- */
.sig-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sig-modal { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 520px; }
.sig-modal h4 { margin-bottom: 10px; }
#sigCanvas, #fpCanvas {
  width: 100%; height: 200px; border: 1.5px dashed var(--brand); border-radius: 10px;
  background: #fdfefd; touch-action: none;
}
#fpCanvas { height: 140px; }
.sig-actions { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 水印/防截图 ---------- */
.watermark-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
}
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; }
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(45,59,56,.92); color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 14px; z-index: 999; display: none;
}
.empty-tip { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.photo-upload { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.photo-upload img, .photo-upload .ph-empty {
  width: 100%; max-width: 240px; height: 150px; object-fit: cover; border-radius: 8px;
  border: 1.5px dashed var(--border); background: #fafcfb;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step-chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; background: #f0f4f3; color: var(--muted); }
.step-chip.done { background: var(--brand-light); color: var(--brand-dark); }
.step-chip.current { background: var(--brand); color: #fff; }
.inline-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.checkbox-row input { width: auto; }
