:root {
  --navy: #102a43;
  --navy-2: #1e4665;
  --blue: #176b87;
  --cyan: #dff4f5;
  --green: #16865c;
  --red: #c63d45;
  --ink: #17242f;
  --muted: #657580;
  --line: #dce5e9;
  --paper: #ffffff;
  --canvas: #f1f5f7;
  --radius: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 16px; line-height: 1.6; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 42px; }

.report-body { background: linear-gradient(135deg, #eaf3f5 0, #f8fafb 48%, #eef2f4 100%); padding: 28px 16px 56px; }
.report-shell { max-width: 900px; margin: 0 auto; background: var(--paper); border: 1px solid rgba(16,42,67,.08); border-radius: 24px; box-shadow: 0 24px 70px rgba(16,42,67,.12); overflow: hidden; }
.report-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 36px 24px; color: white; background: linear-gradient(125deg, var(--navy), var(--navy-2) 58%, #187b84); position: relative; }
.report-header::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -100px; top: -140px; }
.brand-block { display: flex; gap: 18px; align-items: center; min-width: 0; z-index: 1; }
.brand-logo { width: 70px; height: 70px; border-radius: 14px; object-fit: contain; background: white; padding: 6px; }
.organization { margin: 0 0 3px; font-size: 1rem; opacity: .82; }
.report-header h1 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.15rem); letter-spacing: .04em; line-height: 1.3; }
.report-number { margin: 8px 0 0; font-size: .92rem; opacity: .86; }
.report-qr { margin: 0; padding: 9px; background: white; border-radius: 12px; color: var(--navy); text-align: center; z-index: 1; flex: 0 0 auto; }
.report-qr img { display: block; width: 106px; height: 106px; }
.report-qr figcaption { font-size: .75rem; margin-top: 3px; }
.verified-line { padding: 12px 36px; color: var(--green); background: #e9f8f1; font-size: .9rem; font-weight: 700; border-bottom: 1px solid #d5eee3; }
.verified-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: white; margin-right: 6px; }
.info-section, .result-section { margin: 30px 36px 0; }
.info-section h2, .result-section h2 { font-size: 1.08rem; margin: 0 0 14px; color: var(--navy); }
.info-grid { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.info-grid > div { display: grid; grid-template-columns: 112px 1fr; min-width: 0; border-bottom: 1px solid var(--line); }
.info-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.info-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.info-grid dt, .info-grid dd { margin: 0; padding: 12px 14px; }
.info-grid dt { background: #f4f8fa; color: var(--muted); font-size: .88rem; }
.info-grid dd { font-weight: 600; word-break: break-word; }
.info-section.compact { display: grid; grid-template-columns: 110px 1fr; align-items: start; padding: 18px 20px; background: #f6f9fa; border-radius: var(--radius); }
.info-section.compact h2 { margin: 2px 0 0; }
.equipment { margin: 0; white-space: pre-wrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading span { color: var(--muted); font-size: .88rem; }
.results-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result-row { display: grid; grid-template-columns: 1.45fr 1fr .75fr; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-row > div, .result-row > span { padding: 15px 16px; word-break: break-word; }
.result-head { color: white; background: var(--navy); font-size: .9rem; font-weight: 700; }
.conclusion-pill { display: inline-block; padding: 3px 10px; color: var(--green); background: #e7f7ef; border-radius: 99px; font-weight: 700; }
.conclusion-pill.bad { color: var(--red); background: #fff0f1; }
.empty-note { padding: 30px; text-align: center; color: var(--muted); background: #f7fafb; border-radius: var(--radius); }
.final-card { margin: 30px 36px 0; padding: 22px 24px; min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; color: white; border-radius: var(--radius); background: linear-gradient(120deg, #176b65, #18865f); }
.final-card span { display: block; font-size: .88rem; opacity: .76; }
.final-card strong { display: block; margin-top: 5px; font-size: 1.35rem; white-space: pre-wrap; }
.seal { position: absolute; right: 24px; width: 104px; height: 104px; object-fit: contain; opacity: .86; }
.report-footer { display: flex; justify-content: space-between; gap: 12px; padding: 26px 36px 30px; color: var(--muted); font-size: .78rem; }
.preview-banner { max-width: 900px; margin: 0 auto 10px; padding: 9px 16px; text-align: center; color: #684b00; background: #fff3c4; border-radius: 10px; font-weight: 700; }

.admin-body { background: #f3f6f8; color: var(--ink); min-height: 100vh; }
.admin-topbar { height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: white; background: var(--navy); }
.admin-topbar > div { display: flex; align-items: center; gap: 10px; }
.mini-mark, .login-mark { display: inline-grid; place-items: center; background: var(--cyan); color: var(--navy); font-weight: 900; border-radius: 9px; }
.mini-mark { width: 34px; height: 34px; }
.text-button { border: 0; color: rgba(255,255,255,.82); background: transparent; cursor: pointer; }
.admin-main, .form-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 70px; }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-heading h1 { margin: 0; font-size: 2rem; }
.admin-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 2px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .15em; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 700; cursor: pointer; }
.button.primary { color: white; background: var(--blue); box-shadow: 0 8px 20px rgba(23,107,135,.2); }
.button.subtle { color: var(--navy); background: white; border-color: var(--line); }
.button.danger { color: var(--red); background: white; border-color: #f2cbd0; }
.report-list { display: grid; gap: 14px; }
.report-list-card { display: flex; justify-content: space-between; gap: 24px; padding: 22px; background: white; border: 1px solid #e4ebee; border-radius: 14px; box-shadow: 0 5px 20px rgba(16,42,67,.04); }
.report-list-main h2 { display: inline; margin: 0 8px 0 10px; font-size: 1.08rem; }
.report-list-main p { margin: 8px 0 0; color: var(--muted); }
.report-list-main .list-no { display: inline; color: var(--navy); font-weight: 700; }
.status { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 800; }
.status.published { color: var(--green); background: #e5f7ef; }
.status.draft { color: #7a6500; background: #fff5cb; }
.status.disabled { color: #68747d; background: #edf1f3; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.report-actions form { display: inline-flex; }
.empty-state { padding: 70px 24px; text-align: center; background: white; border: 1px dashed #c9d6dc; border-radius: 18px; }
.empty-state > div { font-size: 3rem; color: var(--blue); }
.empty-state h2 { margin: 4px 0; }
.empty-state p { color: var(--muted); }

.login-body { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 10%, #1c6071, var(--navy) 48%, #091b2b); }
.login-card { width: min(430px, 100%); padding: 40px; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-mark { width: 52px; height: 52px; font-size: 1.35rem; }
.login-card h1 { margin: 20px 0 4px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; color: #40515e; font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #cbd7dc; border-radius: 9px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,135,.12); }
.alert { margin-bottom: 18px; padding: 11px 14px; color: #8e2932; background: #fff0f1; border: 1px solid #f5ccd0; border-radius: 9px; }

.back-link { color: white; text-decoration: none; }
.form-main { max-width: 980px; }
.report-form { display: grid; gap: 18px; }
.form-section { padding: 26px; background: white; border: 1px solid #e1e9ed; border-radius: 16px; }
.form-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.form-section-title > span { display: grid; place-items: center; width: 38px; height: 38px; color: var(--blue); background: var(--cyan); border-radius: 10px; font-size: .8rem; font-weight: 900; }
.form-section-title h2 { margin: 0; font-size: 1.08rem; }
.form-section-title p { margin: 1px 0 0; color: var(--muted); font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label b { color: var(--red); }
label small { color: var(--muted); font-weight: 400; }
textarea { resize: vertical; min-height: 72px; }
.test-items { display: grid; gap: 12px; }
.test-item { display: grid; grid-template-columns: 24px 1fr 34px; align-items: center; gap: 10px; padding: 14px; background: #f6f9fa; border: 1px solid #e1e9ed; border-radius: 12px; }
.drag-handle { color: #8fa0aa; cursor: grab; user-select: none; }
.item-fields { display: grid; grid-template-columns: 1.4fr 1fr .65fr; gap: 12px; }
.remove-item { width: 34px; height: 34px; min-height: 34px; border: 0; border-radius: 8px; color: var(--red); background: #fff0f1; font-size: 1.25rem; cursor: pointer; }
.add-item { margin-top: 14px; }
.test-item.dragging { opacity: .45; }
.form-actions { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; background: rgba(243,246,248,.92); backdrop-filter: blur(8px); border-radius: 14px; }
.error-body { min-height: 100vh; display: grid; place-items: center; }
.error-card { width: min(460px, 100%); padding: 44px; text-align: center; background: white; border-radius: 20px; box-shadow: 0 20px 60px rgba(16,42,67,.12); }
.error-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: auto; color: white; background: var(--red); border-radius: 50%; font-size: 1.5rem; font-weight: 900; }
.error-card h1 { margin: 16px 0 6px; }
.error-card p { margin: 0 0 22px; color: var(--muted); }

/* 扫码查询页：按参考页面设计的移动端卡片布局 */
.lookup-page { min-height: 100vh; margin: 0; padding: 16px 12px 34px; color: #16233b; background: #f5f7fc; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
.lookup-card { width: min(480px, 100%); margin: 0 auto; padding: 24px 20px 28px; overflow: hidden; background: #fff; border-radius: 32px; box-shadow: 0 16px 44px rgba(29, 60, 112, .10), 0 2px 10px rgba(29, 60, 112, .05); }
.lookup-header { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.lookup-brand-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #173f83, #2466c4); border-radius: 14px; box-shadow: 0 7px 16px rgba(31, 91, 191, .22); font-size: 21px; font-weight: 800; }
.lookup-brand-icon img { width: 30px; height: 30px; object-fit: contain; }
.lookup-title h1 { margin: 0; color: #14223b; font-size: 18px; line-height: 1.35; font-weight: 750; }
.lookup-title p { margin: 3px 0 0; color: #8a96aa; font-size: 12px; letter-spacing: .08em; }
.lookup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.lookup-item { min-width: 0; padding: 13px 14px 14px; background: #f8faff; border: 1px solid #eef2f9; border-radius: 18px; }
.lookup-item.full, .lookup-item.lookup-full { grid-column: 1 / -1; }
.lookup-item.accent, .lookup-item.lookup-accent { background: #f2f7ff; border-color: #e4edfb; }
.lookup-label { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; color: #8a96aa; font-size: 11px; line-height: 1.25; }
.lookup-label-icon { color: #4c7ec8; font-size: 13px; line-height: 1; }
.lookup-value { color: #17233a; font-size: 14px; line-height: 1.65; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.lookup-conclusion { margin-top: 18px; padding: 17px 18px; background: #eef5ff; border-left: 5px solid #1f5bbf; border-radius: 5px 18px 18px 5px; }
.lookup-conclusion-label { margin-bottom: 7px; color: #5273a7; font-size: 11px; font-weight: 700; }
.lookup-conclusion-value, .lookup-conclusion-text { margin: 0; color: #153b78; font-size: 15px; line-height: 1.7; font-weight: 700; white-space: pre-wrap; }
.lookup-section { margin-top: 18px; border: 1px solid #eef2f9; border-radius: 18px; overflow: hidden; }
.lookup-section-toggle { width: 100%; min-height: 54px; padding: 0 16px; display: flex; align-items: center; gap: 9px; color: #23334f; background: #f8faff; border: 0; font: inherit; cursor: pointer; }
.lookup-section-left { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; }
.lookup-section-icon { color: #4777bd; }
.lookup-badge { min-width: 22px; padding: 2px 7px; color: #fff; background: #2c68bd; border-radius: 99px; font-size: 11px; text-align: center; }
.lookup-chevron { margin-left: auto; color: #738199; transition: transform .2s ease; }
.lookup-section-toggle[aria-expanded="true"] .lookup-chevron { transform: rotate(180deg); }
.lookup-section-body { padding: 14px; background: #fff; }
.lookup-section-body[hidden] { display: none; }
.lookup-report-image { display: block; width: 100%; padding: 0; background: transparent; border: 0; border-radius: 12px; cursor: zoom-in; }
.lookup-report-image img { display: block; width: 100%; max-height: 560px; object-fit: contain; border-radius: 12px; }
.lookup-no-image { padding: 12px 0 8px; color: #9aa5b6; font-size: 13px; text-align: center; }
.lookup-no-image > span { font-size: 24px; }
.lookup-no-image p { margin: 5px 0 0; }
.lookup-footer { margin-top: 24px; color: #a0aabb; font-size: 11px; text-align: center; letter-spacing: .05em; }
.lookup-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(6, 14, 28, .86); }
.lookup-modal[hidden] { display: none; }
.lookup-modal > img, .lookup-modal-image { max-width: 100%; max-height: 92vh; object-fit: contain; }
.lookup-modal-close { position: fixed; top: 15px; right: 15px; width: 42px; height: 42px; color: white; background: rgba(255,255,255,.16); border: 0; border-radius: 50%; font-size: 25px; cursor: pointer; }

@media (max-width: 720px) {
  .report-body { padding: 0; background: white; }
  .report-shell { border: 0; border-radius: 0; box-shadow: none; }
  .report-header { align-items: flex-start; padding: 24px 18px 20px; }
  .brand-logo { width: 50px; height: 50px; }
  .organization { font-size: .86rem; }
  .report-number { font-size: .82rem; }
  .report-qr { padding: 6px; }
  .report-qr img { width: 72px; height: 72px; }
  .report-qr figcaption { display: none; }
  .verified-line { padding: 10px 18px; }
  .info-section, .result-section { margin: 24px 18px 0; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid > div, .info-grid > div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
  .info-grid > div:last-child { border-bottom: 0; }
  .info-grid > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .info-section.compact { grid-template-columns: 1fr; gap: 4px; }
  .result-head { display: none; }
  .result-row { display: block; padding: 8px 14px; }
  .result-row > div { display: grid; grid-template-columns: 92px 1fr; padding: 8px 0; }
  .result-row > div::before { content: attr(data-label); color: var(--muted); font-size: .86rem; }
  .final-card { margin: 24px 18px 0; }
  .report-footer { padding: 22px 18px 28px; flex-direction: column; gap: 2px; }
  .admin-heading, .report-list-card { align-items: stretch; flex-direction: column; }
  .report-actions { justify-content: flex-start; }
  .form-grid, .item-fields { grid-template-columns: 1fr; }
  .test-item { grid-template-columns: 18px 1fr 34px; align-items: start; }
  .login-card { padding: 28px 24px; }
}

@media (max-width: 430px) {
  .lookup-page { padding: 10px 8px 24px; }
  .lookup-card { padding: 21px 16px 25px; border-radius: 27px; }
  .lookup-grid { gap: 12px 10px; }
  .lookup-item { padding: 12px 11px 13px; border-radius: 16px; }
  .lookup-title h1 { font-size: 17px; }
  .brand-block { gap: 10px; }
  .brand-logo { display: none; }
  .report-header h1 { font-size: 1.24rem; }
  .info-grid > div { grid-template-columns: 94px 1fr; }
  .info-grid dt, .info-grid dd { padding: 11px 10px; }
  .admin-topbar { padding: 0 16px; }
  .admin-main, .form-main { width: calc(100% - 24px); padding-top: 24px; }
  .form-section { padding: 18px 14px; }
}
