/* 发现身边雷锋 · 证书查询系统
   版式复刻机构证书查询官网：浅粉灰底 / 红头红脚 / 白卡内容区 */
:root {
  --header-red: #D0241C;
  --footer-red: #B91C1C;
  --main-red: #E70012;
  --orange: #E7801C;
  --page-bg: #f9f5f5;
  --row-bg: #F5F6F9;
  --line: #E5E5E5;
  --ink: #333;
  --ink-2: #666;
  --ink-3: #999;
  --font: "Noto Sans SC", sans-serif;
  --form-font: "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-width: 320px;
  color: var(--ink); background: var(--page-bg);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
}
a { color: var(--main-red); text-decoration: none; }
h1, h2, h3, h6 { margin: 0; font-weight: normal; }
p { margin: 0 0 6px; }

.w1200 { width: 1200px; margin: 0 auto; }
@media (max-width: 1340px) { .w1200 { width: 90%; } }
@media (max-width: 640px) { .w1200 { width: calc(100% - 30px); } }

/* ---------- 头部（红色横幅 + logo 图） ----------
   注：证书查询系统用 zslogo.webp（雷锋头像 + 《雷锋》杂志社公共事业服务中心｜证书查询系统，1307×144 ≈ 9.08:1，
   已裁掉透明留白）。该素材是「红底/白底双适配」稿：左段《雷锋》杂志社为红字白描边、
   右段证书查询系统为纯白字 —— 落在红底横幅上两段都读得清（左段靠白描边、右段靠白填充）。
   盒高由**头像**决定（头像撑满墨迹高度），高度 72（手机 42）下右侧字形高 ≈32px。
   换素材时头像尺寸不变、只有文字随素材比例浮动，所以改素材不动盒高。 */
.header { padding: 14px 0; background: var(--header-red); }
.header .logo a { display: inline-block; }
.header .logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}
@media (max-width: 640px) {
  .header .logo img { max-height: 42px; }
}

/* ---------- 内容白卡 ---------- */
.page_content {
  margin: 20px auto;
  min-height: calc(100vh - 250px);
  background: #fff;
  overflow: hidden;
}
@media (max-width: 640px) { .page_content { min-height: calc(100vh - 218px); } }

/* ---------- 查询区 ---------- */
.certificate_section { margin: 35px auto 0; }
.certificate_section { line-height: normal; }
.certificate_title { text-align: center; }
.certificate_title h6 { font-size: 24px; color: var(--ink); }
.certificate_title p { font-size: 14px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 640px) {
  .certificate_section { margin-top: 20px; }
  .certificate_title h6 { font-size: 18px; }
}

.certificate_form { margin: 20px auto 0; width: 600px; overflow: hidden; }
.form_group { margin-bottom: 20px; width: 100%; overflow: hidden; }
.item_tit {
  float: left; width: 110px;
  font-size: 16px; color: var(--ink); text-align: right; line-height: 40px;
}
.item_tit span { margin-right: 5px; color: #EF0F0F; }
.item_cont { margin-left: 110px; overflow: hidden; }
.item_cont select,
.item_cont input {
  padding-left: 10px; width: 100%; height: 40px;
  font-size: 14px; color: var(--ink-2);
  border-radius: 3px; border: 1px solid var(--line);
  font-family: var(--form-font); background: #fff; outline: none;
}
.item_cont input::placeholder {
  color: #C0C4CC;
  font-family: var(--form-font);
  opacity: 1;
}
.item_cont input:focus, .item_cont select:focus { border-color: var(--main-red); }
.item_cont select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") 96% center no-repeat;
}
.item_cont select:invalid { color: #C0C4CC; }
.item_cont select option { color: var(--ink-2); }
.item_cont input.yzm_inp { float: left; width: calc(100% - 120px); }
.img_box {
  float: left;
  display: flex; align-items: center; justify-content: center;
  width: 120px; height: 50px; overflow: hidden; cursor: pointer;
}
.img_box img { width: 120px; height: 50px; }

.btn1, .btn2 {
  display: block; margin: 10px auto 0;
  width: 150px; height: 36px;
  font-size: 16px; color: #fff; border: 0; border-radius: 5px;
  cursor: pointer; font-family: var(--form-font);
}
.btn1 { background: var(--main-red); }
.btn1:hover { background: #c40a1a; }
.btn2 { background: var(--orange); }
.btn2:hover { background: #c46d17; }
@media (max-width: 640px) {
  .certificate_form { margin-top: 10px; padding: 0 15px; width: 100%; }
  .form_group { margin-bottom: 15px; }
  .item_tit { float: none; margin-bottom: 5px; width: 100%; font-size: 14px; text-align: left; line-height: 20px; }
  .item_cont { margin-left: 0; }
  .item_cont select, .item_cont input { height: 30px; line-height: 30px; }
  .item_cont input.yzm_inp { width: calc(100% - 120px); }
  .img_box, .img_box img { height: 30px; }
  .btn1 { width: 100px; height: 30px; font-size: 14px; margin-top: 0; }
}

/* 错误提示 */
.msg { text-align: center; font-size: 14px; margin: 10px 0; min-height: 20px; color: var(--main-red); }
.msg:empty { display: none; }

/* ---------- 结果表格 ---------- */
.result_table { margin: 40px auto 30px; width: 1000px; overflow: hidden; }
.result_table table { width: 100%; border-collapse: collapse; }
.result_table thead th {
  padding: 10px 15px; font-size: 16px; color: #fff;
  text-align: left; background: var(--main-red); border-bottom: 2px solid #fff;
  white-space: nowrap; font-weight: normal;
}
.result_table tbody td {
  padding: 10px 15px; font-size: 16px; color: var(--ink); background: var(--row-bg);
}
.result_table thead th:first-child,
.result_table tbody td:first-child { padding-left: 30px; }
.result_table tbody tr:hover td { background: #eceef4; }
.result_table td a.detail-link { color: var(--main-red); }
.result_table td .st-revoked { color: var(--main-red); }
@media (max-width: 1340px) {
  .result_table { width: 95%; overflow-x: auto; }
  .result_table thead th, .result_table tbody td { padding: 10px; }
}
@media (max-width: 768px) {
  .result_table thead th, .result_table tbody td { font-size: 14px; }
}
@media (max-width: 640px) {
  .result_table { margin-top: 10px; width: 90%; overflow-x: auto; }
  .result_table thead th, .result_table tbody td { padding: 5px 10px; }
  .result_table tbody td:first-child { white-space: nowrap; }
}

.no_data_box { margin: 30px 0; text-align: center; overflow: hidden; }
.no_data_box p { margin-top: 10px; font-size: 16px; color: var(--ink-3); line-height: 20px; }
@media (max-width: 640px) {
  .no_data_box { margin: 15px 0; padding: 0 15px; }
  .no_data_box img { max-width: 35%; }
  .no_data_box p { font-size: 14px; }
}

/* ---------- 结果区按钮 ---------- */
.resultbtn_section { margin-bottom: 30px; width: 100%; text-align: center; }
.resultbtn_section a, .resultbtn_section button {
  display: inline-block; margin: 0 8px; width: 90px; height: 33px;
  font-size: 14px; color: var(--main-red); text-align: center; line-height: 31px;
  background: #fff; border-radius: 5px; border: 1px solid var(--main-red);
  cursor: pointer; font-family: inherit;
}
.resultbtn_section a:hover, .resultbtn_section button:hover { color: #fff; background: var(--main-red); text-decoration: none; }
@media (max-width: 768px) { .resultbtn_section .print_btn { display: none; } }

/* ---------- 常见问题弹窗 ---------- */
.pop_questions {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 9999;
  display: none; align-items: center; justify-content: center;
}
.pop_questions.show { display: flex; }
.questions_panel { width: 800px; max-width: calc(100% - 30px); background: #fff; }
.panel_title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 50px; background: var(--header-red);
}
.panel_title h6 { font-size: 18px; color: #fff; }
.panel_title .close {
  border: 0; background: transparent; color: #fff;
  font-size: 24px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.panel_body { padding: 20px 30px; overflow: hidden; }
.questions_text {
  min-height: 200px; max-height: calc(100vh - 250px); overflow-y: auto;
  font-size: 16px; color: var(--ink); line-height: 30px;
}
.questions_text strong { font-weight: 700; }

/* ---------- 页脚（深红） ---------- */
.footer { padding: 18px 0; background: var(--footer-red); overflow: hidden; }
.footer p { font-size: 14px; color: #fff; line-height: 28px; text-align: center; margin: 0; }
.footer a { color: #fff; }
@media (max-width: 640px) { .footer { padding: 15px 10px; } .footer p { font-size: 12px; line-height: 1.8; } }

/* ---------- 证书详情页 ---------- */
.cert-detail-page {
  position: relative;
  background: #fff;
}
.cert-detail-page::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--header-red);
}
.cert-page { padding: 38px 40px 48px; }
.cert-head { text-align: center; margin: 0 auto 30px; max-width: 720px; }
.cert-head h1 { margin-top: 12px; font-size: 28px; line-height: 1.3; color: #222; font-weight: 600; letter-spacing: .05em; }
.cert-head .status-line { font-size: 14px; margin-top: 8px; }
.cert-head-note { margin-top: 8px; color: var(--ink-3); font-size: 13px; }
.cert-head-action { margin-top: 18px; }
.cert-verify-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border: 1px solid #9bc9ad; border-radius: 3px;
  color: #08723c; background: #f7fbf8; font-size: 13px; font-weight: 600;
}
.cert-verify-badge svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cert-verify-badge.is-revoked { color: #b42318; background: #fff4f3; border-color: #ffc9c5; }
.cert-verify-icon { display: grid; place-items: center; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.status-ok { color: #647067; }
.status-revoked { color: var(--main-red); }
.cert-layout {
  display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(320px, .9fr);
  gap: 24px; align-items: start; max-width: 1080px; margin: 0 auto;
}
@media (max-width: 860px) { .cert-layout { grid-template-columns: 1fr; } }
.cert-frame {
  position: relative; padding: 10px; border: 1px solid #d9d9d9; border-radius: 2px;
  background: #fff;
}
.cert-frame::after { display: none; }
.cert-frame img { position: relative; z-index: 1; width: 100%; height: auto; display: block; border-radius: 0; }
.cert-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.cert-actions a {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 18px; border-radius: 3px;
  font-size: 14px; font-weight: 500; transition: background .18s ease, border-color .18s ease;
}
.cert-actions a:hover { text-decoration: none; }
.cert-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cert-action-primary { color: #fff; background: var(--header-red); border: 1px solid var(--header-red); }
.cert-action-primary:hover { color: #fff; background: #b91c1c; border-color: #b91c1c; }
.cert-action-secondary { color: #8f1f1a; background: #fff; border: 1px solid #c9a5a2; }
.cert-action-secondary:hover { color: #fff; border-color: var(--header-red); background: var(--header-red); }
.cert-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-card {
  border: 1px solid #ddd; border-radius: 2px; padding: 18px;
  background: #fff;
}
.panel-card-title { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #e5e5e5; }
.panel-card-title h3 { padding-left: 10px; border-left: 3px solid var(--header-red); font-size: 16px; color: #222; font-weight: 600; line-height: 1.25; margin: 0; }
.meta { display: grid; grid-template-columns: 84px 1fr; font-size: 14px; }
.meta dt, .meta dd { padding: 9px 0; border-bottom: 1px solid #f2edeb; }
.meta dt { color: #99908e; }
.meta dd { margin: 0; color: #332b29; overflow-wrap: anywhere; }
.meta dt:nth-last-of-type(1), .meta dd:last-child { border-bottom: 0; }
.meta-emphasis { color: #211817 !important; font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* 160px：码里带了中心图标后纠错等级升到 H，模块数从 37 涨到 49，
   显示尺寸要跟着放大才不至于比改造前更难扫（3.0 px/模块，与原来持平）。 */
.qr-image-wrap { padding: 7px; border: 1px solid #ddd; border-radius: 2px; background: #fff; }
.qr-box img { display: block; width: 160px; height: 160px; }
.qr-box .cap { font-size: 12px; color: #938987; text-align: center; }
.link-copy { display: flex; gap: 8px; margin-top: 12px; }
.link-copy input {
  flex: 1; min-width: 0; padding: 9px 11px; font-size: 12px; font-family: inherit;
  border: 1px solid #d9d9d9; border-radius: 2px; outline: none;
  color: var(--ink-2); background: #fafafa;
}
.link-copy input:focus { border-color: #dca9a4; box-shadow: 0 0 0 3px rgba(208,36,28,.07); }
.link-copy .btn { white-space: nowrap; border-radius: 2px; }
.cert-notice-card { display: flex; gap: 11px; padding: 14px 16px; background: #fafafa; border-color: #ddd; border-left: 3px solid #b58a43; box-shadow: none; }
.notice-icon { display: grid; place-items: center; flex: 0 0 19px; width: 19px; height: 19px; margin-top: 1px; border: 1px solid #b58a43; border-radius: 50%; color: #8c6528; background: transparent; font-size: 11px; font-weight: 700; }
.notice { margin: 0; font-size: 12.5px; color: #666; line-height: 1.75; }
.pill-valid { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid #acd3b9; border-radius: 2px; color: #08723c; background: #f7fbf8; font-size: 12px; font-weight: 600; }
.pill-valid i { width: 6px; height: 6px; border-radius: 50%; background: #17a45b; box-shadow: 0 0 0 3px rgba(23,164,91,.12); }
.pill-revoked { color: var(--main-red); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-outline {
  display: inline-block; border: 1px solid var(--main-red); color: var(--main-red);
  background: #fff; border-radius: 5px; font-family: inherit; cursor: pointer;
}
.btn-outline:hover { color: #fff; background: var(--main-red); text-decoration: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }

@media (max-width: 860px) {
  .cert-page { padding: 30px 24px 38px; }
  .cert-layout { max-width: 640px; }
}
@media (max-width: 640px) {
  .cert-detail-page { width: 100%; margin: 0; }
  .cert-page { padding: 26px 15px 32px; }
  .cert-head { margin-bottom: 22px; }
  .cert-head h1 { font-size: 25px; }
  .cert-head .status-line { padding: 0 8px; font-size: 13px; line-height: 1.7; }
  .cert-frame { padding: 7px; border-radius: 2px; }
  .cert-frame img { border-radius: 0; }
  .cert-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cert-actions a { width: 100%; min-height: 44px; padding: 9px 12px; }
  .panel-card { padding: 16px 15px; border-radius: 2px; }
  .meta { grid-template-columns: 76px minmax(0, 1fr); font-size: 13px; }
  .meta dt, .meta dd { padding: 8px 0; }
  .link-copy { flex-direction: column; }
  .link-copy .btn { width: 100%; min-height: 40px; }
  .cert-notice-card { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media print {
  .header, .footer, .certificate_form, .cert-actions, .resultbtn_section { display: none !important; }
  .page_content { margin: 0; }
  .cert-layout { display: block; }
}
