/* 访客进入系统 H5 — Chromium 86 基线；无外部字体、无 CDN、无构建。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #F3F6FB;
  color: #0F1E3D;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* 顶栏 */
.topbar { background: #0F2557; color: #F5F8FF; }
.topbar-inner {
  max-width: 480px; margin: 0 auto; padding: 14px 20px;
  display: -webkit-box; display: flex;
  -webkit-box-align: center; align-items: center;
  -webkit-box-pack: justify; justify-content: space-between;
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.topbar-tag { font-size: 11px; color: #A9C1F1; border: 1px solid #33518F; border-radius: 999px; padding: 2px 9px; }

/* 文档卡 */
.shell { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.doc {
  background: #FFFFFF; border: 1px solid #DCE5F2; border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 37, 87, .07); overflow: hidden;
}
.doc-head { padding: 22px 20px 16px; border-bottom: 1px dashed #DCE5F2; }
.doc-title { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 700; letter-spacing: .4px; }
.doc-sub { margin: 7px 0 0; font-size: 13px; line-height: 1.65; color: #52627A; }
.doc-body { padding: 16px 20px 22px; }

/* 信息行 */
.rows { margin: 0; padding: 0; }
.row {
  display: -webkit-box; display: flex;
  padding: 11px 0; border-bottom: 1px solid #EDF2F9;
  font-size: 14px; line-height: 1.55;
}
.row:last-child { border-bottom: 0; }
.row-label { -webkit-box-flex: 0; flex: 0 0 78px; width: 78px; color: #71809A; }
.row-value { -webkit-box-flex: 1; flex: 1; min-width: 0; color: #0F1E3D; word-break: break-all; }

/* 状态徽章:有效=通行绿,未生效/过期/作废=禁止灰 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-not_started { background: #E5E7EB; color: #4B5563; }
.badge-valid { background: #DCFCE7; color: #15803D; }
.badge-expired { background: #E5E7EB; color: #4B5563; }
.badge-revoked { background: #E5E7EB; color: #4B5563; }

/* 表单 */
.field { margin-top: 20px; }
.field-label { display: block; font-size: 13px; color: #52627A; margin-bottom: 8px; }
.input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid #C8D5E8; border-radius: 10px;
  background: #FBFCFE; color: #0F1E3D; outline: none;
}
.input:focus { border-color: #1D4ED8; box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.btn {
  display: block; width: 100%; height: 50px; margin-top: 14px;
  border: 0; border-radius: 10px; background: #1D4ED8; color: #FFFFFF;
  font-size: 16px; font-weight: 600; letter-spacing: .5px; cursor: pointer;
}
.btn:active { background: #1E40AF; }
.btn[disabled] { background: #C7D2E1; color: #7E8DA3; cursor: not-allowed; }
.hint { margin: 12px 0 0; min-height: 20px; font-size: 13px; line-height: 1.6; color: #B23A32; }
.muted { color: #71809A; font-size: 14px; line-height: 1.7; }

/* 邀请人详情页 */
.qr-frame {
  width: 100%; max-width: 276px; margin: 6px auto 0; padding: 14px;
  background: #FFFFFF; border: 1px solid #DCE5F2; border-radius: 14px;
}
.qr-frame img { display: block; width: 100%; height: auto; }
.qr-note { margin: 12px 0 0; text-align: center; font-size: 12px; color: #71809A; }
.copy-row { display: -webkit-box; display: flex; margin-top: 18px; }
.copy-input {
  -webkit-box-flex: 1; flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid #C8D5E8; border-right: 0; border-radius: 10px 0 0 10px;
  background: #FBFCFE; color: #0F1E3D; font-size: 12px;
}
.copy-btn {
  -webkit-box-flex: 0; flex: 0 0 96px; height: 44px;
  border: 1px solid #1D4ED8; border-radius: 0 10px 10px 0;
  background: #1D4ED8; color: #FFFFFF; font-size: 14px; cursor: pointer;
}
.copy-btn:active { background: #1E40AF; }

/* 邀请卡:整块背景按状态变色 —— 绿=允许通行,灰=不允许通行 */
.card-hero { position: relative; padding: 24px 20px 18px; background: #4B5563; background: linear-gradient(160deg, #5B6675, #3F4854); color: #EAFBF1; }
.card-hero[data-status="valid"] { background: #0F8A55; background: linear-gradient(160deg, #0F8A55, #0A6140); }
.card-hero[data-status="not_started"],
.card-hero[data-status="expired"],
.card-hero[data-status="revoked"] { background: #4B5563; background: linear-gradient(160deg, #5B6675, #3F4854); }
.visitor-name { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: 1px; }
.count { display: inline-block; margin-top: 8px; font-size: 13px; color: #C9D3E0; }
.status-line { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; margin-top: 18px; }
.status-dot {
  width: 10px; height: 10px; margin-right: 9px; border-radius: 50%;
  background: #D1D5DB; animation: breathe 2.2s ease-in-out infinite;
}
.card-hero[data-status="valid"] .status-dot { background: #6EE7A8; }
.status-text { font-size: 15px; font-weight: 600; }
.clock-label { margin-top: 18px; font-size: 11px; letter-spacing: 1px; color: #9AA6B5; }
.clock {
  margin-top: 3px; font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 32px; line-height: 1.1; letter-spacing: 2px; color: #FFFFFF;
}
.scanbar { position: relative; height: 3px; background: #374151; overflow: hidden; }
.scanbar:after {
  content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 3px;
  background: #9CA3AF; animation: scan 2.4s linear infinite;
}
.card-hero[data-status="valid"] + .scanbar { background: #0A6140; }
.card-hero[data-status="valid"] + .scanbar:after { background: #4ADE80; }
.card-body { padding: 16px 20px 22px; }
.info-grid { display: -webkit-box; display: flex; -webkit-box-lines: multiple; flex-wrap: wrap; margin: 0 -5px; }
.info-cell { width: 50%; padding: 8px 5px; }
.info-cell-full { width: 100%; padding: 8px 5px; }
.info-label { font-size: 11px; color: #71809A; }
.info-value { margin-top: 4px; font-size: 14px; line-height: 1.5; color: #0F1E3D; word-break: break-all; }
.foot-note {
  margin: 20px 0 0; padding-top: 16px; border-top: 1px dashed #DCE5F2;
  text-align: center; font-size: 12px; line-height: 1.8; color: #7E8DA3;
}

@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes scan { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .status-dot, .scanbar:after { animation: none; }
}
