:root {
  --primary: #1e5d8f;
  --primary-2: #2f7dbf;
  --accent: #c9a24b;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #2b3440;
  --muted: #7a8794;
  --line: #e6ebf1;
  --green: #18a05e;
  --red: #d64545;
  --shadow: 0 10px 30px rgba(30, 60, 100, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }

/* 顶部 */
.topbar {
  background: linear-gradient(135deg, #1e5d8f 0%, #2f7dbf 100%);
  color: #fff;
  padding: 22px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,.15), transparent 40%);
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: 2px; font-weight: 700; }
.topbar .sub { margin-top: 8px; font-size: 14px; opacity: .9; letter-spacing: 1px; }
.topbar .org { margin-top: 6px; font-size: 13px; opacity: .8; }

.container { max-width: 860px; margin: 0 auto; padding: 28px 16px 60px; }

/* 查询卡片 */
.search-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 30px;
  margin-top: -40px;
  position: relative;
}
.search-card h2 { margin: 0 0 6px; font-size: 20px; }
.search-card .hint { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row .field { flex: 1 1 200px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; transition: border .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(47,125,191,.12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 26px; border: none; border-radius: 10px;
  font-size: 15px; cursor: pointer; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--line); }
.btn-block { width: 100%; }

/* 结果 */
.result { margin-top: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.badge-ok { background: #e7f7ef; color: var(--green); }
.badge-fail { background: #fdecec; color: var(--red); }

.cert-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; margin-top: 16px;
}
.cert-head { background: linear-gradient(135deg, #f7f9fc, #eef3f9); padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.cert-head .t { font-size: 17px; font-weight: 700; }
.cert-head .no { color: var(--muted); font-size: 13px; }
.cert-body { padding: 22px; display: flex; gap: 22px; flex-wrap: wrap; }
.cert-photo { width: 150px; flex-shrink: 0; }
.cert-photo img { width: 150px; height: 210px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: #f0f3f7; }
.cert-photo .cert-qr { text-align: center; margin-top: 14px; }
.cert-photo .cert-qr .qr { width: 96px; height: 96px; margin: 0 auto; }
.cert-photo .cert-qr .qr img, .cert-photo .cert-qr .qr canvas { width: 96px; height: 96px; }
.cert-photo .cert-qr .qr-cap { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cert-info { flex: 1; min-width: 260px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.info-table td.k { width: 100px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.info-table td.v { font-weight: 600; }

.notice { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.7; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }

/* 电子证书标签 */
.badge-ecert { background: #eaf2ff; color: var(--primary); }

/* 电子证书展示 */
.ecert-box { margin-top: 16px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.ecert-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.ecert-sheet-wrap { position: relative; overflow: hidden; background: #eef0f3; border-radius: 8px; }
.ecert-sheet-wrap .cert-sheet { transform-origin: top left; margin: 0; box-shadow: none; }
.ecert-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-size: 64px; letter-spacing: 12px;
  color: rgba(190, 40, 40, 0.14); font-weight: 700;
  white-space: nowrap; pointer-events: none; z-index: 10;
}

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 30px; }

@media (max-width: 600px) {
  .cert-body { flex-direction: column; align-items: center; }
  .cert-info { width: 100%; }
}

