/* ============ 产品变更管理系统 · 样式 ============ */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e5e9f0;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --green-line: #b7e4c6;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-line: #f3c2c2;
  --amber: #d97706;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; font-weight: 650; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }
.req { color: var(--red); font-weight: 600; }
.center { text-align: center; }

/* ---------- 管理端骨架 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
}
.brand-name { font-weight: 650; font-size: 16px; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 14px;
  border-radius: 8px;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: #f1f5f9; text-decoration: none; }
.nav a.active { background: #eff4ff; color: var(--accent); font-weight: 600; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 24px 60px; }

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 28px;
  color: #9aa3b2;
  font-size: 12px;
  text-align: center;
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 22px; letter-spacing: -.2px; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s ease;
}
.btn:hover { border-color: #cfd8e3; background: #f8fafc; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { background: transparent; }
.btn.danger { background: #fff; border-color: #f0c0c0; color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }

/* ---------- 提示条 ---------- */
.flash-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}
.flash.success { border-color: var(--green-line); background: var(--green-bg); color: #14532d; }
.flash.error { border-color: var(--red-line); background: var(--red-bg); color: #7f1d1d; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar input[type=search], .toolbar select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.toolbar input[type=search] { min-width: 260px; flex: 0 1 320px; }
.toolbar input:focus, .toolbar select:focus { border-color: #a9c0f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

/* ---------- 表格 ---------- */
.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grid { width: 100%; border-collapse: collapse; }
.grid thead th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  white-space: nowrap;
}
.grid tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #fafcff; }
.grid.compact tbody td { padding: 8px 10px; }
.col-state { width: 46px; }
.col-op { width: 130px; white-space: nowrap; }
.col-op a { margin-right: 10px; }

.state {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.state.red { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.state.green { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.state.none { background: #9ca3af; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 2px 0 8px; }
.dot.red { background: var(--red); }
.dot.green { background: var(--green); }

.title-link { font-weight: 600; color: #111827; }
.title-link:hover { color: var(--accent); }

.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.ratio { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: #edf1f6;
  overflow: hidden;
  min-width: 56px;
}
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #22c55e); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 6px;
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
}
.tag.pending { background: var(--red-bg); color: #b91c1c; border: 1px solid #f7d5d5; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge.red { background: var(--red-bg); color: #b91c1c; border-color: var(--red-line); }
.badge.green { background: var(--green-bg); color: #15803d; border-color: var(--green-line); }
.badge.none { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count, .m-count {
  font-size: 11.5px;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 1px 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}
.detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 78px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* ---------- 键值 ---------- */
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- 文件列表 ---------- */
.file-rows { list-style: none; margin: 0 0 12px; padding: 0; }
.file-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  margin-bottom: 8px;
  background: #fcfdff;
}
.file-ico { font-size: 17px; line-height: 1; }
.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-weight: 500;
}
.file-size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-ops { display: flex; gap: 10px; white-space: nowrap; font-size: 13px; }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  flex-wrap: wrap;
}
.inline-form input[type=file] { font-size: 13px; color: var(--muted); }

/* ---------- 更改后内容 ---------- */
.after-text {
  padding: 11px 13px;
  background: #f8fafc;
  border: 1px solid #edf2f8;
  border-radius: 10px;
  white-space: pre-wrap;
  line-height: 1.65;
  margin-bottom: 12px;
  color: #374151;
}
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.thumb {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}
.thumb img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
}
.thumb:hover { border-color: #bcd0f7; }
.thumb-wrap { position: relative; }
.thumb-del {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
}
.thumb-del button {
  padding: 3px 9px;
  border: 1px solid #f0c9c9;
  background: rgba(255, 255, 255, .92);
  color: #c53030;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.thumb-del button:hover { background: #fff5f5; border-color: #e59a9a; }
.del-form { display: inline; margin: 0; }
.link-danger {
  border: 0;
  background: none;
  padding: 0;
  color: #c53030;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}
.link-danger:hover { text-decoration: underline; }

/* ---------- 部门确认卡 ---------- */
.confirm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.confirm-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.confirm-row.ok { border-color: var(--green-line); background: var(--green-bg); }
.confirm-row.wait { border-color: var(--red-line); background: #fffafa; }
.cr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.ok { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pill.wait { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.cr-body { margin-top: 6px; font-size: 13px; }
.opinion {
  margin-top: 6px;
  padding: 7px 9px;
  background: #fff;
  border: 1px dashed #d9e1ea;
  border-radius: 7px;
  color: #374151;
  font-size: 12.5px;
  white-space: pre-wrap;
}

.chk-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  margin-right: 4px;
}

/* ---------- 二维码卡 ---------- */
.qr-card { text-align: center; }
.qr-card .card-title { justify-content: center; }
.qr-box {
  display: inline-flex;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.qr-box img { display: block; border-radius: 6px; }
.qr-tip { color: var(--muted); font-size: 12.5px; margin: 12px 4px; text-align: left; }
.url-copy { display: flex; gap: 6px; }
.url-copy input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
  background: #fafbfd;
}
.qr-actions { margin-top: 10px; display: flex; justify-content: center; }

.danger-card .btn { margin-top: 8px; }
.danger-card { border-color: #f0dcdc; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-row.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.mt { margin-top: 14px; }
.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}
.lbl em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.form input[type=text], .form input[type=number], .form input[type=password], .form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: .15s;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { border-color: #a9c0f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.form-foot { display: flex; gap: 10px; padding-top: 4px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 26px 16px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 11px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: center;
  transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: #93b4f5; background: #f5f9ff; }
.dropzone.slim { padding: 16px; margin-top: 8px; }
.dropzone strong { color: var(--accent); font-size: 14px; }
.dropzone span { color: var(--muted); font-size: 12.5px; }
.dropzone input { display: none; }
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.file-line .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-line .file-size { color: var(--muted); font-size: 12px; }

.dept-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dept-check {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.dept-check:hover { border-color: #bcd0f7; background: #fafcff; }
.dept-check input { margin: 0 0 4px; }
.dept-check:has(input:checked) { border-color: #93b4f5; background: #f2f7ff; }
.dept-name { font-weight: 600; font-size: 13.5px; }
.dept-person { color: var(--muted); font-size: 12px; }

/* ---------- 设置页 ---------- */
.dept-edit-row { display: flex; align-items: center; gap: 8px; }
.dept-edit-form { display: flex; gap: 8px; flex: 1; min-width: 0; }
.dept-edit-form input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.dept-edit-form input[name=name] { flex: 0 0 150px; }
.dept-edit-form input[name=default_person] { flex: 1; }
.dept-edit-cell { padding: 6px 10px !important; }
.add-dept { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.add-dept input { flex: 1; min-width: 140px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; }
.archived { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 空状态 ---------- */
.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 20px;
  text-align: center;
}
.empty-ico { font-size: 34px; margin-bottom: 8px; opacity: .7; }
.empty p { color: var(--muted); margin: 0 0 16px; }

/* ---------- 登录 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
}
.login-box .brand { justify-content: center; margin-bottom: 18px; }
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 18px; }

/* ================= 手机端（微信扫码页） ================= */
body.mobile {
  background: #eef1f6;
  font-size: 15px;
}

.m-head {
  background: linear-gradient(150deg, #1e40af 0%, #2563eb 55%, #0284c7 100%);
  color: #fff;
  padding: 22px 18px 20px;
}
.m-kicker {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: .85;
  margin-bottom: 8px;
}
.m-title { font-size: 21px; line-height: 1.35; font-weight: 700; }
.m-meta { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; opacity: .9; }

.m-wrap { padding: 14px 12px 32px; max-width: 640px; margin: 0 auto; }

.m-flash {
  margin: 10px 2px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  background: #fff;
  border: 1px solid var(--line);
}
.m-flash.success { background: var(--green-bg); border-color: var(--green-line); color: #14532d; }
.m-flash.error { background: var(--red-bg); border-color: var(--red-line); color: #7f1d1d; }

.m-status {
  border-radius: 14px;
  padding: 16px 18px;
  margin: 4px 0 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.m-status.red { background: linear-gradient(180deg, #fff5f5, #fff); border-color: var(--red-line); }
.m-status.green { background: linear-gradient(180deg, #f2fdf6, #fff); border-color: var(--green-line); }
.m-status-main { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.m-status.red .m-status-main { color: #b91c1c; }
.m-status.green .m-status-main { color: #15803d; }
.big-ico { font-size: 20px; }
.m-status-sub { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.m-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px -14px rgba(16, 24, 40, .35);
}
.m-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f4f9;
}

.m-kv-row {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
}
.m-kv-row span { flex: 0 0 74px; color: var(--muted); }
.m-kv-row b { flex: 1; min-width: 0; font-weight: 550; word-break: break-word; }

.m-after-text { margin-bottom: 10px; margin-top: 0; }
.m-note {
  margin-top: 12px;
  padding: 11px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 13.5px;
  color: #374151;
  white-space: pre-wrap;
  line-height: 1.6;
}

.m-file { border: 1px solid #eef2f7; border-radius: 11px; padding: 10px 12px; margin-bottom: 10px; background: #fcfdff; }
.m-file-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-file-ico { font-size: 18px; }
.m-file-main { min-width: 0; }
.m-file-name { font-size: 14px; font-weight: 550; word-break: break-all; }
.m-file-size { color: var(--muted); font-size: 12px; }
.m-file-ops { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.m-file-img img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  background: #f1f5f9;
}

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
}
.m-btn:hover { text-decoration: none; background: #f8fafc; }
.m-btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.m-btn.light { background: #f2f6ff; border-color: #d5e1fb; color: #1d4ed8; }
.m-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-btn.primary:hover { background: var(--accent-dark); }
.m-btn.ghost { background: transparent; color: #6b7280; border-color: transparent; padding: 0 6px; height: 28px; font-size: 12.5px; text-decoration: underline; }
.m-btn.block { display: flex; width: 100%; height: 44px; font-size: 15px; margin-top: 12px; border-radius: 10px; }

.m-tip { color: #9aa3b2; font-size: 12px; margin: 10px 0 0; line-height: 1.5; }
.m-empty { color: var(--muted); text-align: center; padding: 12px 0; margin: 0; }

.m-pill {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.m-pill.ok { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.m-pill.wait { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.m-confirm {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.m-confirm.ok { background: #f6fef9; border-color: var(--green-line); }
.m-confirm.wait { background: #fffafa; border-color: var(--red-line); }
.m-confirm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-confirm-head strong { font-size: 15.5px; }

.m-confirm-body { margin-top: 8px; }
.m-line { display: flex; gap: 10px; font-size: 13.5px; padding: 2px 0; }
.m-line span { flex: 0 0 70px; color: var(--muted); }
.m-line b { font-weight: 550; }
.m-opinion {
  margin-top: 7px;
  padding: 8px 10px;
  background: #fff;
  border: 1px dashed #d9e1ea;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  white-space: pre-wrap;
}

.m-form { margin-top: 10px; }
.m-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin: 10px 0 6px; }
.m-opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.m-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  background: #fff;
  font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.m-textarea { font-size: 15px; resize: vertical; line-height: 1.5; }
.m-input:focus { border-color: #7fa9f0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.m-input::placeholder { color: #a4adbb; font-size: 14px; }

.m-foot { text-align: center; color: #a3acbb; font-size: 12px; margin-top: 18px; line-height: 1.6; }

.m-404 { text-align: center; padding: 40px 22px; }
.m-404-ico { font-size: 38px; margin-bottom: 10px; opacity: .7; }
.m-404 h1 { font-size: 18px; margin-bottom: 10px; }
.m-404 p { color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* ---------- 账号 / 权限 ---------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12.5px;
  color: #4b5563;
}
.u-name { font-weight: 600; color: #111827; }
.u-role, .u-perm {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.u-role.super { background: #eef2ff; color: #4338ca; border-color: #dcdcff; }
.u-role.admin { background: #ecfdf5; color: #047857; border-color: #c9f1dd; }
.u-role.staff { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.u-perm.write { background: #fff7ed; color: #b45309; border-color: #fde3c2; }
.u-perm.read { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.u-logout { color: #6b7280; text-decoration: none; }
.u-logout:hover { color: #111827; text-decoration: underline; }

.row-ops { white-space: nowrap; }
.row-ops form { display: inline-block; margin: 0 4px 0 0; }
.hidden { display: none !important; }
.plain-list { margin: 6px 0 14px; padding-left: 0; list-style: none; }
.plain-list li { font-size: 13px; line-height: 1.9; color: #475569; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.inline-form.wide input, .inline-form.wide select { min-width: 130px; }

/* ---------- 删除确认弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .46);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 18px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
}
.modal h3 { margin: 0 0 10px; font-size: 17px; color: #b91c1c; }
.modal-text { font-size: 13.5px; line-height: 1.7; color: #374151; margin-bottom: 12px; }
.modal-check { display: block; margin: 10px 0; font-size: 13px; color: #374151; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.danger-text { color: #b91c1c; }
.btn.danger:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .detail-grid, .two-col { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .topbar-inner { padding: 0 14px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .wrap { padding: 18px 14px 50px; }
  .nav { width: 100%; overflow-x: auto; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .table-card { overflow-x: auto; }
  .grid { min-width: 860px; }
  .page-head h1 { font-size: 19px; }
  .kv { grid-template-columns: 74px minmax(0, 1fr); }
  .toolbar input[type=search] { min-width: 0; flex: 1 1 100%; }
}

/* ---------------- 手写签名弹窗（手机端） ---------------- */
.m-sig-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 2px;
}

.m-sign {
  display: block;
  max-height: 46px;
  max-width: 70%;
  margin: 8px 0 2px;
  border-bottom: 1px solid #e5e7eb;
}

.sig-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .55);
  padding: 16px;
}
.sig-mask.show { display: flex; }

.sig-panel {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
}
.sig-title { font-weight: 700; font-size: 15px; color: #111827; }
.sig-tip { font-size: 12px; color: #6b7280; margin: 4px 0 10px; }
.sig-canvas {
  width: 100%;
  height: 190px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  touch-action: none;
  display: block;
}
.sig-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.sig-actions .m-btn { padding: 0 12px; height: 36px; border-radius: 8px; }
.sig-actions .m-btn.ghost { border-color: #e5e7eb; text-decoration: none; }
.sig-actions .m-btn.primary { margin-top: 0; width: auto; display: inline-flex; }

/* ---------------- 详情页手写签名 ---------------- */
.sig-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}
.sig-line img {
  height: 40px;
  max-width: 180px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

/* ---------------- 新建页：图片选择后的缩略图预览 ---------------- */
.pick-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pick-thumb {
  width: 96px;
  height: 96px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pick-tip {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

/* ---------------- 手机端签名入口与签署人字段 ---------------- */
.m-ver {
  font-size: 12.5px;
  color: #475569;
  margin: 2px 0 8px;
}

.m-sign-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  background: #f8fbff;
  border: 1px dashed #9db8e8;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: #1f3b66;
}
.m-sign-box:active { background: #eef5ff; }
.m-sign-icon { font-size: 18px; line-height: 1; }
.m-sign-text { font-size: 14px; font-weight: 600; }
.m-sign-name { margin-left: auto; font-size: 12px; color: #6b7280; }

.sig-name-row,
.sig-opinion-row {
  margin-bottom: 8px;
}
.sig-name-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.m-sign-namebox { margin-top: 10px; }
.m-sign-namebox .m-input { height: 40px; }

/* 表单模板选择卡 */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid #dcdfe6;
  border-radius: 10px; background: #fff; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.tpl-card:hover { border-color: #2f6fed; box-shadow: 0 6px 18px rgba(47, 111, 237, .12); }
.tpl-code { font-size: 12px; color: #2f6fed; letter-spacing: .5px; }
.tpl-name { font-size: 17px; }
.tpl-desc { font-size: 12px; color: #7a828e; line-height: 1.5; }

/* 签署登录 */
.m-login-form { display: flex; gap: 8px; }
.m-login-form .m-input { flex: 1; }
.m-login-on { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-login-who b { font-size: 16px; }
.m-login-dept { margin-left: 8px; font-size: 12px; color: #6b7280; }
/* 部门签署表单 */
.m-sign-form { margin-top: 10px; }
.m-sign-label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.m-sign-actions { margin-top: 8px; }
.m-confirm.mine { border-left: 3px solid #2f6fed; }

/* 多人签署（每部门可累加多条签名） */
.m-sign-row { padding: 8px 0; border-top: 1px dashed rgba(148,163,184,.45); }
.m-sign-row:first-child { border-top: none; padding-top: 0; }
.cr-sign-block { padding: 10px 0; border-top: 1px dashed rgba(148,163,184,.45); }
.cr-sign-block:first-child { border-top: none; padding-top: 0; }
.qr-cap { margin-top: 8px; font-size: 13px; line-height: 1.5; color: #475569; text-align: center; word-break: break-all; }
