* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #222; background: #f5f5f3; }
main { max-width: 960px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h3 { margin: 0 0 8px; }
h4 { margin: 16px 0 6px; font-size: 14px; color: #555; }
.topnav { display: flex; gap: 16px; align-items: center; padding: 10px 24px; background: #1f3a5f; color: #fff; }
.topnav a { color: #cdd9e8; text-decoration: none; }
.topnav a.active, .topnav a:hover { color: #fff; }
.topnav .brand { font-weight: 600; margin-right: 12px; }
.topnav .spacer { flex: 1; }
.topnav .muted { color: #cdd9e8; }
button { font: inherit; padding: 6px 14px; border: 1px solid #1f3a5f; background: #1f3a5f; color: #fff; border-radius: 4px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: none; color: #cdd9e8; padding: 0; }
button.secondary { background: #fff; color: #1f3a5f; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; width: 100%; }
label { display: block; margin: 12px 0 4px; color: #555; }
.card { background: #fff; border: 1px solid #e3e3e0; border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.alert { padding: 8px 12px; border-radius: 4px; margin: 8px 0; }
.alert.error { background: #fdecec; color: #a12622; }
.alert.warn { background: #fff6e0; color: #7a5600; }
.alert.info { background: #eaf2fb; color: #1f3a5f; }
.tag { font-size: 12px; padding: 1px 6px; border-radius: 3px; margin-left: 8px; }
.tag.warn { background: #fff6e0; color: #7a5600; }
.tag.major { background: #fdecec; color: #a12622; }
.tag.ok { background: #e8f5ec; color: #23683a; }
.clause { border-left: 3px solid #c8d3e0; padding: 6px 10px; margin: 8px 0; background: #fafbfc; }
.clause-text { white-space: pre-wrap; }
.answers { display: flex; gap: 12px; margin-top: 4px; }
.answers label { display: inline; margin: 0; color: #222; }
.answers input { width: auto; }
.verdict { border-radius: 6px; padding: 16px; margin: 16px 0; border: 2px solid; }
.verdict.major { border-color: #c0392b; background: #fff7f6; }
.verdict.review { border-color: #d68910; background: #fffaf0; }
.verdict.ok { border-color: #27ae60; background: #f6fcf8; }
.verdict-line { font-size: 18px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
.muted { color: #888; }
.disclaimer { color: #7a5600; font-size: 13px; }
.login-card { max-width: 360px; margin: 80px auto; }
a.button-link { display: inline-block; padding: 8px 16px; background: #1f3a5f; color: #fff; border-radius: 4px; text-decoration: none; }
button.danger, button.link.danger { color: #a12622; }
.tag.status-pending { background: #fdecec; color: #a12622; }
.tag.status-rectifying { background: #fff6e0; color: #7a5600; }
.tag.status-awaiting_acceptance { background: #eaf2fb; color: #1f3a5f; }
.tag.status-accepted { background: #e8f5ec; color: #23683a; }
.tag { display: inline-block; }
.match-box { margin: 8px 0; }
.match-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px; margin: 6px 0; border: 1px solid #e3e3e0; border-radius: 4px; background: #fafbfc; color: #222; cursor: pointer; }
.match-item input { width: auto; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.photo { width: 120px; text-align: center; }
.photo img { width: 120px; height: 120px; object-fit: cover; border-radius: 4px; border: 1px solid #e3e3e0; }
label.upload { display: block; margin: 8px 0 16px; }
label.upload input { width: auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid #e3e3e0; border-radius: 6px; padding: 12px 16px; }
.stat-value { font-size: 28px; font-weight: 600; color: #1f3a5f; }
.stat-label { color: #555; }
.stat.warn .stat-value { color: #a12622; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 40px; gap: 8px; align-items: center; }
.bar-track { height: 14px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #1f3a5f; border-radius: 0 4px 4px 0; }
.bar-row:hover .bar-fill { background: #2d5a8e; }
.bar-value { text-align: right; color: #222; }
.signatures { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.print-title { text-align: center; }
.print-table th, .print-table td { border: 1px solid #999; font-size: 12px; vertical-align: top; }

@media (max-width: 640px) {
  main { margin: 12px auto; padding: 0 10px; }
  .topnav { flex-wrap: wrap; gap: 10px; padding: 8px 12px; overflow-x: auto; }
  .topnav .spacer { display: none; }
  .row { flex-direction: column; gap: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 12px; }
  button, a.button-link { padding: 10px 16px; }
  input, select, textarea { font-size: 16px; }
  th, td { padding: 6px; }
}

@media print {
  body { background: #fff; }
  .topnav, .no-print { display: none; }
  main { max-width: none; margin: 0; padding: 0; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
}
