:root {
  --ink: #13283d;
  --ink-soft: #40566b;
  --navy: #0b2945;
  --teal: #0d7773;
  --teal-dark: #075e5b;
  --gold: #c89a4b;
  --gold-soft: #f4ead7;
  --paper: #fffdf9;
  --page: #f4f1eb;
  --line: #e4ddd2;
  --muted: #6f7f8e;
  --danger: #a43b32;
  --danger-bg: #fff0ed;
  --success: #176b47;
  --success-bg: #e8f5ee;
  --warning: #805d20;
  --warning-bg: #fff6db;
  --shadow: 0 18px 55px rgba(22, 38, 54, 0.1);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(200, 154, 75, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(13, 119, 115, 0.09), transparent 30rem),
    var(--page);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
}

a:hover {
  color: var(--navy);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}

button:hover,
.btn:hover {
  background: var(--teal-dark);
  color: #fff;
  transform: translateY(-1px);
}

button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.btn.secondary,
.btn-soft {
  border-color: #d7e5e2;
  background: #edf7f5;
  color: var(--teal-dark);
}

.btn.secondary:hover,
.btn-soft:hover {
  border-color: #b9d8d2;
  background: #e1f1ed;
  color: var(--teal-dark);
}

.btn-outline {
  border-color: #b9c6d2;
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 36px;
}

.brand-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 154px;
  overflow: hidden;
  padding: 24px 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.04), transparent 56%),
    linear-gradient(135deg, #0b2945 0%, #123c58 58%, #0d5d64 100%);
  box-shadow: var(--shadow);
  color: #fff;
}

.brand-hero::after {
  position: absolute;
  right: -55px;
  bottom: -92px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(244, 234, 215, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(244, 234, 215, 0.035),
    0 0 0 72px rgba(244, 234, 215, 0.025);
  content: "";
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  border: 5px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.brand-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.brand-kicker {
  display: block;
  margin-bottom: 4px;
  color: #e5c98f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-name {
  margin: 0;
  font-size: clamp(25px, 3.5vw, 38px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.brand-sub {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(13px, 1.7vw, 16px);
  letter-spacing: 0.08em;
}

.card,
.query-panel,
.certificate-card {
  margin-top: 20px;
  border: 1px solid rgba(228, 221, 210, 0.92);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.query-panel {
  position: relative;
  padding: clamp(26px, 5vw, 52px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.query-panel h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 5vw, 45px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.query-intro {
  max-width: 660px;
  margin: 12px 0 26px;
  color: var(--ink-soft);
  font-size: 16px;
}

.searchform,
.query-form {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.searchform input,
.query-form input,
.field,
input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.searchform input,
.query-form input {
  min-height: 54px;
  font-size: 18px;
  letter-spacing: 0.03em;
}

.searchform input:focus,
.query-form input:focus,
.field:focus,
input:not([type="checkbox"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 119, 115, 0.11);
}

.query-form button {
  min-width: 132px;
  padding-inline: 28px;
  font-size: 17px;
}

.searchform button {
  min-width: 92px;
  white-space: nowrap;
}

.query-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.step {
  padding: 20px 22px;
  background: rgba(255, 253, 249, 0.88);
}

.step-number {
  display: block;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 23px;
  line-height: 1;
}

.step strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 15px;
}

.step span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-entry {
  margin: 20px 4px 0;
  text-align: right;
}

.admin-entry a {
  color: var(--muted);
  font-size: 13px;
}

.notice {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid #ecd8aa;
  border-radius: 12px;
  background: var(--warning-bg);
  color: #664b18;
}

.notice.error {
  border-color: #f0cbc4;
  background: var(--danger-bg);
  color: var(--danger);
}

.certificate-card {
  overflow: hidden;
}

.certificate-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 30px 20px;
  border-bottom: 1px solid var(--line);
}

.certificate-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
}

.certificate-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge {
  padding: 7px 13px;
}

.status-badge.revoked,
.badge.revoked {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.suspended,
.badge.suspended {
  background: var(--warning-bg);
  color: var(--warning);
}

.media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #faf8f4;
}

.media-figure {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 28px;
}

.media-figure + .media-figure {
  border-left: 1px solid var(--line);
}

.gem-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
}

.qr-image {
  display: block;
  width: min(100%, 250px);
  border: 10px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(19, 40, 61, 0.08);
  object-fit: contain;
}

.media-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.missing-img {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px dashed #cfc6b8;
  border-radius: 14px;
  background: #f7f4ee;
  color: var(--muted);
  text-align: center;
}

.certificate-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.certificate-number .label {
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.certificate-number strong {
  color: var(--navy);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(20px, 3.5vw, 28px);
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.result-section {
  padding: 28px 30px 30px;
}

.result-title {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 25px;
  font-weight: 600;
}

.state-banner {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #f0cbc4;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
}

.resultbox {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.resultrow {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 1px solid #ede8df;
  font-size: 16px;
}

.resultrow:last-child {
  border-bottom: 0;
}

.resultrow > div {
  padding: 13px 16px;
  overflow-wrap: anywhere;
}

.resultrow > div:first-child {
  background: #f8f5f0;
  color: var(--ink-soft);
}

.reviewrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.reviewrow > div {
  padding: 13px 16px;
  background: #f8f5f0;
  color: var(--ink-soft);
}

.certificate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 0;
}

.admin-shell {
  max-width: 1120px;
  margin: 26px auto;
  padding: 0 16px 36px;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-bar h1 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
}

.admin-card,
.panel {
  margin: 16px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 10px 34px rgba(22, 38, 54, 0.07);
}

.admin-card h1,
.admin-card h2,
.panel h1 {
  color: var(--navy);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions a:not(.btn) {
  padding: 3px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid #eee8de;
  text-align: left;
}

th {
  background: #f6f2eb;
  color: var(--ink-soft);
  font-size: 13px;
}

td {
  font-size: 14px;
}

.flash-stack {
  position: fixed;
  z-index: 90;
  top: 16px;
  left: 50%;
  width: min(560px, calc(100% - 28px));
  transform: translateX(-50%);
}

.flash {
  margin-bottom: 8px;
  padding: 12px 15px;
  border: 1px solid #ead8ac;
  border-radius: 11px;
  background: var(--warning-bg);
  box-shadow: 0 8px 24px rgba(22, 38, 54, 0.12);
  color: #664b18;
  text-align: center;
}

.flash.error {
  border-color: #f0cbc4;
  background: var(--danger-bg);
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.badge {
  padding: 4px 10px;
}

.footer {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 28px;
  color: #87939f;
  font-size: 12px;
  text-align: center;
}

.footer a {
  color: #66798a;
}

.qr-download {
  padding: 10px 0;
}

.no-record {
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 16px;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1040px);
    padding-top: 10px;
  }

  .brand-hero {
    gap: 15px;
    min-height: 122px;
    padding: 18px;
    border-radius: 16px;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
    border-width: 4px;
  }

  .brand-kicker {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .brand-name {
    font-size: clamp(21px, 6.4vw, 28px);
  }

  .brand-sub {
    margin-top: 2px;
    font-size: 12px;
    letter-spacing: 0.03em;
  }

  .brand-sub + .brand-sub {
    margin-top: 1px;
  }

  .card,
  .query-panel,
  .certificate-card {
    margin-top: 12px;
    border-radius: 16px;
  }

  .query-panel {
    padding: 24px 18px;
  }

  .query-panel h1 {
    font-size: 29px;
  }

  .query-intro {
    margin: 9px 0 20px;
    font-size: 14px;
  }

  .searchform,
  .query-form {
    flex-direction: column;
  }

  .searchform button,
  .query-form button {
    width: 100%;
  }

  .steps {
    grid-template-columns: 1fr;
    margin-top: 12px;
    border-radius: 16px;
  }

  .step {
    display: grid;
    grid-template-columns: 34px 1fr;
    padding: 14px 17px;
  }

  .step-number {
    grid-row: span 2;
  }

  .step strong {
    margin-top: 0;
  }

  .certificate-heading {
    padding: 20px 18px 16px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-figure {
    min-height: 260px;
    padding: 20px;
  }

  .media-figure + .media-figure {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .media-figure:first-child {
    min-height: 300px;
  }

  .qr-image {
    width: min(72vw, 250px);
  }

  .certificate-number {
    display: block;
    padding: 17px 14px;
  }

  .certificate-number .label {
    display: block;
    font-size: 12px;
  }

  .certificate-number strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
  }

  .result-section {
    padding: 20px 14px 22px;
  }

  .result-title {
    font-size: 22px;
  }

  .resultrow {
    grid-template-columns: 105px minmax(0, 1fr);
    font-size: 14px;
  }

  .resultrow > div {
    padding: 11px 10px;
  }

  .reviewrow {
    font-size: 13px;
  }

  .reviewrow > div {
    padding: 11px 10px;
  }

  .certificate-actions .btn {
    flex: 1 1 42%;
    padding-inline: 12px;
  }

  .admin-shell {
    margin-top: 14px;
    padding-inline: 10px;
  }

  .admin-card,
  .panel {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 7px;
  }
}

@media (max-width: 390px) {
  .brand-logo {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .brand-kicker {
    display: none;
  }

  .brand-name {
    font-size: 20px;
  }

  .brand-sub {
    font-size: 11px;
  }

  .resultrow {
    grid-template-columns: 92px minmax(0, 1fr);
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Certificate verification landing and scan result */
body.public-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 18%, rgba(92, 99, 96, 0.05), transparent 24rem),
    radial-gradient(circle at 84% 64%, rgba(29, 52, 47, 0.07), transparent 27rem),
    repeating-linear-gradient(92deg, rgba(54, 56, 52, 0.018) 0 1px, transparent 1px 5px),
    #f1f1ed;
}

body.result-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(245, 244, 239, 0.94), rgba(240, 239, 234, 0.96)),
    repeating-linear-gradient(4deg, rgba(63, 72, 68, 0.035) 0 1px, transparent 1px 6px);
}

.landing-page {
  position: relative;
  display: flex;
  min-height: calc(100vh - 54px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 30px 20px 72px;
}

.verification-shell {
  position: relative;
  z-index: 2;
  width: min(650px, 100%);
}

.verification-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 42px;
}

.verification-brand img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: contain;
  filter: saturate(0.82);
}

.verification-brand span {
  display: block;
  color: #8e8e89;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.verification-brand strong {
  display: block;
  margin-top: 2px;
  color: #262624;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.ink-query-card {
  text-align: center;
}

.ink-rule {
  width: 78px;
  height: 1px;
  margin: 0 auto 24px;
  background: linear-gradient(90deg, transparent, #8e1b1b, transparent);
}

.ink-query-card h1 {
  margin: 0;
  color: #242422;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(45px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.25;
}

.ink-query-intro {
  margin: 16px 0 38px;
  color: #5f5f5b;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.ink-query-form {
  width: min(500px, 100%);
  margin: 0 auto;
}

.ink-field {
  position: relative;
  margin-bottom: 22px;
}

.ink-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ink-field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid #6f0b12;
  border-radius: 0;
  outline: 0;
  background: rgba(255, 255, 255, 0.94);
  color: #263b46;
  font-size: 18px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.08);
}

.ink-field input::placeholder {
  color: #7f8588;
}

.ink-field input:focus {
  border-color: #9b111b;
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(111, 11, 18, 0.12);
}

.ink-query-button {
  width: 100%;
  height: 52px;
  border-radius: 0;
  background: #6f0b12;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.08em;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.ink-query-button:hover {
  background: #4d060b;
}

.ink-security-note {
  margin: 28px 0 0;
  color: #93938e;
  font-size: 12px;
}

.ink-form-notice {
  width: min(500px, 100%);
  margin: 0 auto 20px;
  padding: 11px 14px;
  border: 1px solid #d7b3b3;
  background: rgba(255, 242, 240, 0.82);
  color: #8d1b1b;
  font-size: 14px;
}

.landing-admin {
  margin: 32px 0 0;
  text-align: center;
}

.landing-admin a {
  color: #898984;
  font-size: 12px;
}

.ink-decor {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: 0.17;
  filter: grayscale(1);
}

.ink-decor-right {
  right: -30px;
  bottom: -20px;
  width: 390px;
  height: 510px;
  background:
    radial-gradient(ellipse at 88% 24%, #28302b 0 1.4%, transparent 1.7%),
    radial-gradient(ellipse at 75% 34%, #28302b 0 2.2%, transparent 2.5%),
    radial-gradient(ellipse at 65% 15%, #28302b 0 2.8%, transparent 3.1%),
    linear-gradient(76deg, transparent 48%, #28302b 48.3% 48.9%, transparent 49.2%) 40% 12%/100% 72% no-repeat,
    radial-gradient(ellipse at 30% 86%, #3c433e 0 9%, transparent 9.4%),
    radial-gradient(ellipse at 56% 78%, #3c433e 0 12%, transparent 12.4%);
}

.ink-decor-left {
  left: -115px;
  top: 32%;
  width: 260px;
  height: 300px;
  border: 16px double rgba(77, 82, 77, 0.3);
  border-radius: 46% 54% 18% 82%;
  transform: rotate(-12deg);
}

body.public-body .footer {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  background: rgba(23, 23, 23, 0.96);
  color: #d7d7d5;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.result-page {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.result-brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid #dfddd6;
  background: rgba(255, 255, 252, 0.82);
}

.result-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: contain;
}

.result-brand strong,
.result-brand span {
  display: block;
}

.result-brand strong {
  color: #202b32;
  font-size: 18px;
  font-weight: 600;
}

.result-brand span {
  color: #8b8d8b;
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-heading {
  margin: 26px 0 20px;
  text-align: center;
}

.result-heading h1 {
  margin: 0;
  color: #1e1e1e;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.result-heading p {
  margin: 4px 0 0;
  color: #696a66;
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.digital-certificate {
  width: 100%;
}

.certificate-sheet {
  position: relative;
  display: grid;
  grid-template-columns: 54% 46%;
  width: 100%;
  aspect-ratio: 127 / 89;
  overflow: hidden;
  border: 7px solid #1c90d2;
  outline: 3px solid #dff5ff;
  background:
    linear-gradient(rgba(188, 239, 255, 0.42), rgba(236, 252, 255, 0.68)),
    #f9feff;
  box-shadow:
    0 0 0 1px #1c90d2,
    0 18px 48px rgba(28, 51, 64, 0.17);
}

.certificate-sheet::before,
.certificate-sheet::after {
  position: absolute;
  z-index: 0;
  width: 85px;
  height: 85px;
  border: 10px dotted rgba(20, 136, 198, 0.45);
  border-radius: 50%;
  content: "";
}

.certificate-sheet::before {
  top: -39px;
  left: -39px;
}

.certificate-sheet::after {
  right: -39px;
  bottom: -39px;
}

.certificate-left,
.certificate-right {
  position: relative;
  z-index: 1;
}

.certificate-left {
  display: flex;
  flex-direction: column;
  padding: 32px 26px 24px 38px;
  border-right: 1px solid rgba(18, 115, 166, 0.35);
  background: linear-gradient(135deg, rgba(178, 234, 252, 0.48), rgba(248, 253, 255, 0.55));
}

.certificate-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.certificate-title img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
}

.certificate-title h2 {
  margin: 0;
  color: #16384a;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(19px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.certificate-title p {
  margin: 2px 0 0;
  color: #496d7d;
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.certificate-fields {
  border-top: 1px solid rgba(33, 83, 105, 0.45);
}

.certificate-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 31px;
  align-items: center;
  border-bottom: 1px solid rgba(33, 83, 105, 0.35);
}

.certificate-field-wide {
  grid-template-columns: 120px minmax(0, 1fr);
}

.certificate-label {
  color: #3b525d;
  font-family: "Songti SC", SimSun, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.certificate-label small {
  display: block;
  color: #6a818c;
  font-family: Georgia, serif;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}

.certificate-field strong {
  min-width: 0;
  padding-left: 9px;
  color: #243a44;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.certificate-standard {
  margin-top: auto;
  color: #38535e;
  font-size: 9px;
  line-height: 1.45;
}

.certificate-standard span {
  font-weight: 700;
}

.certificate-standard p {
  margin: 1px 0 0;
}

.certificate-warning {
  margin: 6px 0 0;
  color: #294854;
  font-family: "Songti SC", SimSun, serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

.certificate-right {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  grid-template-rows: auto 1fr auto;
  gap: 10px 16px;
  padding: 32px 26px 24px 28px;
}

.certificate-number-block {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(27, 85, 108, 0.3);
}

.certificate-number-block span {
  color: #38505a;
  font-family: "Songti SC", SimSun, serif;
  font-size: 14px;
  font-weight: 700;
}

.certificate-number-block strong {
  color: #1a3440;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(14px, 1.7vw, 20px);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.certificate-photo-frame {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.certificate-photo-frame img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.certificate-photo-frame .missing-img {
  min-height: 150px;
  background: rgba(255, 255, 255, 0.42);
}

.certificate-signatures {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
}

.certificate-signatures span,
.certificate-qr-block span {
  display: block;
  color: #526972;
  font-size: 10px;
}

.certificate-signatures strong,
.certificate-qr-block strong {
  display: block;
  color: #1d3540;
  font-size: 14px;
  font-weight: 600;
}

.certificate-qr-block {
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: end;
  text-align: center;
}

.certificate-qr-block img {
  width: 116px;
  height: 116px;
  margin-bottom: 5px;
  background: #fff;
}

.certificate-qr-disabled {
  display: flex;
  width: 116px;
  height: 116px;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  border: 1px dashed #9a6e66;
  color: #9a4339;
  font-size: 11px;
}

.identification-results {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid #dedbd4;
  background: rgba(255, 255, 252, 0.82);
}

.identification-results h2,
.certificate-origin h2 {
  margin: 0 0 14px;
  color: #323835;
  font-family: "Songti SC", SimSun, serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.data-table {
  border: 1px solid #d4d1ca;
}

.data-row {
  display: grid;
  grid-template-columns: 42% 58%;
  min-height: 40px;
}

.data-row > div {
  display: flex;
  align-items: center;
  padding: 8px 13px;
  border-bottom: 1px solid #ddd9d1;
  color: #41433f;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.data-row:last-child > div {
  border-bottom: 0;
}

.data-row:nth-child(odd) > div:first-child {
  background: #dedede;
}

.data-row:nth-child(odd) > div:last-child {
  background: #f5f5f5;
}

.data-row:nth-child(even) > div:first-child {
  background: #fff8dc;
}

.data-row:nth-child(even) > div:last-child {
  background: #fffaf0;
}

.data-row small {
  margin-left: 7px;
  color: #777974;
  font-family: Georgia, serif;
  font-size: 9px;
}

.certificate-origin {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #dedbd4;
  background: rgba(255, 255, 252, 0.82);
}

.certificate-origin img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.result-body .certificate-actions {
  margin-top: 22px;
}

.grid-span-2 {
  grid-column: 1 / -1;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.upload-field {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
}

.upload-preview,
.upload-existing {
  display: block;
  width: 100%;
  max-width: 420px;
  max-height: 240px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.upload-preview[hidden] {
  display: none;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-weight: 500;
}

.inline-check input {
  width: auto;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 40px;
}

@media (max-width: 820px) {
  .certificate-sheet {
    aspect-ratio: auto;
    grid-template-columns: 1fr;
  }

  .certificate-left {
    padding: 26px 24px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(18, 115, 166, 0.35);
  }

  .certificate-right {
    min-height: 300px;
    padding: 22px 24px 24px;
  }

  .certificate-field {
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 34px;
  }
}

@media (max-width: 720px) {
  .landing-page {
    min-height: calc(100vh - 42px);
    padding: 20px 16px 62px;
  }

  .verification-brand {
    margin-bottom: 30px;
  }

  .verification-brand img {
    width: 52px;
    height: 52px;
  }

  .verification-brand strong {
    font-size: 16px;
  }

  .ink-query-card h1 {
    font-size: clamp(38px, 12vw, 52px);
    letter-spacing: 0.04em;
  }

  .ink-query-intro {
    margin: 13px 0 28px;
    font-size: 14px;
  }

  .ink-field {
    margin-bottom: 16px;
  }

  .ink-field input,
  .ink-query-button {
    height: 50px;
  }

  .ink-decor-right {
    right: -150px;
    opacity: 0.1;
  }

  .ink-decor-left {
    left: -180px;
    opacity: 0.09;
  }

  .result-page {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .result-brandbar {
    padding: 11px 12px;
  }

  .result-brand {
    gap: 8px;
    min-width: 0;
  }

  .result-brand img {
    width: 42px;
    height: 42px;
  }

  .result-brand strong {
    font-size: 14px;
  }

  .result-brand span {
    font-size: 8px;
  }

  .result-heading {
    margin: 19px 0 15px;
  }

  .result-heading h1 {
    font-size: 31px;
  }

  .certificate-sheet {
    border-width: 5px;
    outline-width: 2px;
  }

  .certificate-left {
    padding: 20px 15px 18px;
  }

  .certificate-title {
    gap: 8px;
    margin-bottom: 14px;
  }

  .certificate-title img {
    width: 34px;
    height: 34px;
  }

  .certificate-title h2 {
    font-size: 20px;
  }

  .certificate-title p {
    font-size: 7px;
  }

  .certificate-field {
    grid-template-columns: 98px minmax(0, 1fr);
    min-height: 34px;
  }

  .certificate-label {
    font-size: 11px;
  }

  .certificate-label small {
    font-size: 6px;
  }

  .certificate-field strong {
    padding-left: 5px;
    font-size: 12px;
  }

  .certificate-standard {
    margin-top: 13px;
    font-size: 8px;
  }

  .certificate-right {
    grid-template-columns: minmax(0, 1fr) 106px;
    min-height: 280px;
    gap: 8px 10px;
    padding: 18px 15px 18px;
  }

  .certificate-number-block {
    display: block;
  }

  .certificate-number-block span {
    font-size: 11px;
  }

  .certificate-number-block strong {
    display: block;
    margin-top: 2px;
    font-size: 15px;
  }

  .certificate-photo-frame img {
    max-height: 160px;
  }

  .certificate-photo-frame .missing-img {
    min-height: 120px;
  }

  .certificate-signatures span,
  .certificate-qr-block span {
    font-size: 9px;
  }

  .certificate-signatures strong,
  .certificate-qr-block strong {
    font-size: 12px;
  }

  .certificate-qr-block img,
  .certificate-qr-disabled {
    width: 98px;
    height: 98px;
  }

  .identification-results,
  .certificate-origin {
    margin-top: 12px;
    padding: 14px 10px;
  }

  .data-row {
    grid-template-columns: 44% 56%;
  }

  .data-row > div {
    padding: 8px 9px;
    font-size: 12px;
  }

  .data-row small {
    display: block;
    margin: 2px 0 0;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body.result-body {
    background: #fff;
  }

  .result-page {
    width: 100%;
    padding: 0;
  }

  .result-brandbar,
  .result-heading,
  .state-banner,
  .identification-results,
  .certificate-origin,
  .certificate-actions,
  .result-body .footer {
    display: none !important;
  }

  .certificate-sheet {
    width: 100%;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
