*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  color: #333;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
.hidden { display: none !important; }

.field:empty { display: none; }

.btn-primary, .btn-secondary, .btn-success {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: opacity .15s;
}
.btn-primary:disabled, .btn-secondary:disabled, .btn-success:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary:active, .btn-secondary:active, .btn-success:active { opacity: .85; }
.btn-primary { background: #1989fa; color: #fff; }
.btn-secondary { background: #f2f3f5; color: #333; }
.btn-success { background: #07c160; color: #fff; }

.toast {
  position: fixed; color: #fff; padding: 10px 20px; border-radius: 6px;
  font-size: 14px; z-index: 99999; display: none; max-width: 80%;
}
.toast.show { display: block; }
.toast.success { background: rgba(7,193,96,0.9); }
.toast.error { background: rgba(245,34,45,0.9); }

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.5);

  display: flex;
  justify-content: center;
  align-items: flex-start;

  z-index: 999;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding: 20px;
  box-sizing: border-box;
}
.modal.hidden { display: none !important; }
.modal-title { font-size: 16px; font-weight: 600; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 10px 0 10px 16px;
  position: relative;
  border-left: 2px solid #eee;
}
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #1989fa; border: 2px solid #fff;
}
.timeline .t-title { font-size: 14px; color: #222; font-weight: 500; }
.timeline .t-remark { font-size: 13px; color: #666; margin-top: 2px; }
.timeline .t-time { font-size: 12px; color: #999; margin-top: 2px; }

.img-block { margin-top: 10px; }
.img-block .img-label { font-size: 12px; color: #999; margin: 6px 0 4px; }
.img-block .imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.img-block .imgs img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
}

.pair-item {
  border: 1px solid #ebeef5;
  border-left: 3px solid #1989fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.pair-item.is-fault { border-left-color: #fa8c16; }
.pair-item.is-extra { border-left-color: #722ed1; background: #f9f0ff; }
.pair-item.is-admin { border-left-color: #1989fa; background: #fafbfc; }

.pair-item-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.pair-no { font-weight: 600; font-size: 13px; color: #fa8c16; flex-shrink: 0; }
.pair-item.is-extra .pair-no { color: #722ed1; }
.pair-item.is-admin .pair-no { color: #1989fa; }
.pair-loc {
  font-size: 12px; color: #666; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pair-status {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; font-weight: 500; flex-shrink: 0;
}
.pair-status.st-ok    { background: #f6ffed; color: #52c41a; }
.pair-status.st-warn  { background: #fff7e6; color: #fa8c16; }
.pair-status.st-muted { background: #f0f0f0; color: #888; }

.pair-block { padding: 6px 0; }
.pair-block:not(:last-child) {
  border-bottom: 1px dashed #f0f0f0; margin-bottom: 8px; padding-bottom: 10px;
}
.pair-block-title { font-size: 12px; color: #999; margin-bottom: 4px; font-weight: 500; }
.pair-block.pair-fault .pair-block-title  { color: #fa8c16; }
.pair-block.pair-repair .pair-block-title { color: #1989fa; }
.pair-empty { font-size: 12px; color: #999; padding: 8px 0; text-align: center; }
.pair-note {
  background: #f9f0ff; border-left: 3px solid #722ed1;
  padding: 6px 10px; font-size: 13px; color: #531dab;
  margin: 6px 0; border-radius: 0 4px 4px 0;
}

.extra-section { margin-top: 14px; padding-top: 12px; border-top: 2px dashed #d3adf7; }
.extra-title { font-size: 13px; font-weight: 600; color: #722ed1; margin-bottom: 10px; }

.ri-summary {
  background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d;
  font-size: 12px; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px;
}

.page-footer {
  text-align: center;
  color: #9aa0a6;
  font-size: 12px;
  line-height: 1.8;
  padding: 20px 16px 24px;
  user-select: none;
  -webkit-user-select: none;
}
.page-footer .footer-brand {
  font-weight: 500;
  color: #7a8290;
}
.page-footer .footer-sub {
  color: #b0b5bb;
  font-size: 11px;
  margin-left: 8px;
}
.page-footer.above-actions {
  padding-bottom: 84px;
}
.page-footer.footer-absolute {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  padding: 0 16px;
}

.pdf-host {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #525659;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.pdf-canvas {
  display: block;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  max-width: 100%;
  height: auto;

  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.pdf-loading,
.pdf-error {
  padding: 48px 20px;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  line-height: 1.8;
}
.pdf-error { color: #ff7875; }
.pdf-error a { color: #69c0ff; text-decoration: underline; }