:root {
  color-scheme: light;
  --navy: #12335b;
  --navy-dark: #0a2442;
  --blue: #1768b3;
  --blue-soft: #e9f2fb;
  --green: #137348;
  --green-soft: #e8f6ee;
  --amber: #9b6500;
  --amber-soft: #fff5d9;
  --red: #b4232d;
  --red-soft: #fcebed;
  --ink: #182433;
  --muted: #647184;
  --line: #d8e0e9;
  --surface: #ffffff;
  --canvas: #f3f6f9;
  --shadow: 0 12px 32px rgba(24, 45, 72, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--blue);
}

.topbar {
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--navy-dark);
}

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

.brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  color: #b8cae0;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--navy-dark);
  background: #fff;
  border-radius: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.environment-banner {
  padding: 8px 18px;
  color: #674400;
  background: #fff1bf;
  border-bottom: 1px solid #e2c76d;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.detail-hero {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.hero h1,
.detail-hero h1,
.login-card h1 {
  margin: 5px 0 8px;
  color: var(--navy-dark);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.25;
}

.hero p,
.detail-hero p,
.login-card p,
.panel-heading p,
.danger-zone p,
.compare-card p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.provider-card {
  min-width: 220px;
  padding: 17px 19px;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.provider-card span,
.provider-card small {
  color: #c6d7e9;
}

.provider-card strong {
  margin: 3px 0;
  font-size: 21px;
}

.provider-link {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.panel,
.login-card,
.verify-info,
.compare-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.panel + .panel,
.summary-grid + .panel {
  margin-top: 22px;
}

.panel-heading {
  margin-bottom: 22px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.panel-heading h2,
.danger-zone h2,
.compare-card h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 20px;
}

.step-number {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.report-upload-table {
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #cbd7e3;
  border-radius: 10px;
}

.report-upload-table-head,
.report-upload-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.75fr) minmax(230px, 1.45fr) minmax(125px, 0.6fr);
  gap: 12px;
  align-items: center;
}

.report-upload-table-head {
  padding: 7px 12px;
  color: #526174;
  background: #e8eef5;
  border-bottom: 1px solid #ccd7e2;
  font-size: 12px;
  font-weight: 800;
}

.report-upload-row {
  padding: 9px 12px;
}

.report-upload-row + .report-upload-row {
  border-top: 1px solid #dce4ec;
}

.report-upload-row:focus-within {
  background: #eef5fc;
}

.report-upload-type {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-upload-type > span:last-child {
  min-width: 0;
  display: grid;
}

.report-upload-type strong {
  color: var(--navy-dark);
  font-size: 15px;
}

.report-upload-type small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.report-file-cell,
.report-serial-cell {
  min-width: 0;
}

.report-file-cell input,
.report-serial-cell input {
  min-height: 40px;
}

.report-upload-note {
  padding: 6px 12px;
  color: var(--muted);
  background: #f1f5f9;
  border-top: 1px solid #dce4ec;
  font-size: 11px;
}

.mobile-field-label {
  display: none;
}

.report-type-fieldset,
.signature-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.report-type-fieldset legend,
.signature-fieldset legend {
  margin-bottom: 7px;
  color: #304257;
  font-size: 14px;
  font-weight: 800;
}

.report-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.report-type-card {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f7f9fb;
  border: 1px solid #cbd6e1;
  border-radius: 10px;
  cursor: pointer;
}

.report-type-card:has(input:checked) {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(23, 104, 179, 0.12);
}

.report-type-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.report-type-card > span:last-child {
  min-width: 0;
  display: grid;
}

.report-type-card small,
.report-group-heading small,
.staff-row small {
  color: var(--muted);
  font-size: 12px;
}

.report-type-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-type-code {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  font-weight: 900;
}

.shared-record-field {
  padding: 11px 12px;
  background: #eef4fa;
  border: 1px solid #c8d8e8;
  border-radius: 10px;
}

.signature-fieldset {
  padding: 11px 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.signature-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.signature-fieldset > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.final-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  gap: 12px;
  align-items: end;
}

.auto-layout-note {
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  color: #304257;
  background: #eef5fb;
  border: 1px solid #c8d8e8;
  border-radius: 10px;
}

.auto-layout-note strong {
  color: var(--navy);
}

.auto-layout-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

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

.retry-form {
  margin-top: 16px;
}

.retry-inline-form {
  display: inline;
  margin-left: 8px;
}

.stack-form label,
.custom-position label {
  display: grid;
  gap: 6px;
}

label > span {
  color: #304257;
  font-size: 14px;
  font-weight: 800;
}

label small {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c5d2;
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 104, 179, 0.14);
}

select option {
  color: #111;
  background: #fff;
}

input[type="file"] {
  padding: 7px;
}

.custom-position {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
  background: #f5f8fb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-position.visible {
  display: grid;
}

.button {
  min-height: 42px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.button:hover {
  filter: brightness(0.96);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  color: #788493;
  background: #e4e8ed;
  cursor: not-allowed;
}

.button.primary {
  color: #fff;
  background: var(--blue);
}

.button.secondary {
  color: var(--navy);
  background: #fff;
  border-color: #9db0c4;
}

.button.success {
  color: #fff;
  background: var(--green);
}

.button.danger {
  color: #fff;
  background: var(--red);
}

.text-button {
  padding: 7px 11px;
  color: #fff;
  background: transparent;
  border: 1px solid #7189a3;
  border-radius: 7px;
  cursor: pointer;
}

.logout-form {
  margin: 0;
}

.alert {
  margin: 14px 0;
  padding: 11px 13px;
  border: 1px solid;
  border-radius: 8px;
  font-weight: 700;
}

.alert.danger {
  color: #7f1821;
  background: var(--red-soft);
  border-color: #e8a9af;
}

.alert.warning {
  color: #745000;
  background: var(--amber-soft);
  border-color: #e8ca7a;
}

.alert.success {
  color: #0b5c38;
  background: var(--green-soft);
  border-color: #8ac8a9;
}

.job-list {
  display: grid;
  gap: 9px;
}

.job-row {
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  background: #f7f9fb;
  border: 1px solid #e1e7ee;
  border-radius: 9px;
  text-decoration: none;
}

.job-row:hover {
  border-color: #9fb9d5;
}

.job-row div {
  min-width: 0;
  display: grid;
}

.job-row span:not(.status) {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status.large {
  padding: 7px 13px;
  font-size: 15px;
}

.status-verified {
  color: var(--green);
  background: var(--green-soft);
}

.status-failed,
.status-tampered,
.status-signature_error,
.status-hash_mismatch,
.status-rejected,
.status-invalid,
.status-revoked {
  color: var(--red);
  background: var(--red-soft);
}

.empty-state {
  padding: 42px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #b9c5d2;
  border-radius: 10px;
}

.empty-state.compact {
  padding: 18px 10px;
}

.report-groups {
  display: grid;
  gap: 17px;
}

.report-group + .report-group {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.report-group-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-group-heading > div {
  display: grid;
}

.report-group .report-type-code {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.staff-list {
  display: grid;
  gap: 10px;
}

.staff-row {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f7f9fb;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
}

.staff-row > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-row img {
  width: 104px;
  height: 42px;
  padding: 3px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d9e1e9;
  border-radius: 6px;
}

.staff-row span {
  display: grid;
}

.staff-row.inactive {
  opacity: 0.62;
}

.staff-row .button {
  min-height: 36px;
  padding: 6px 12px;
}

.back-link {
  display: inline-block;
  margin-bottom: 15px;
  font-weight: 800;
  text-decoration: none;
}

.summary-grid,
.verify-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-grid > div,
.verify-metrics > div {
  min-width: 0;
  padding: 15px;
  display: grid;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.summary-grid span,
.verify-metrics span,
.verify-info span {
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong,
.verify-metrics strong {
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row form {
  display: contents;
}

.verify-url {
  display: block;
  overflow-wrap: anywhere;
  padding: 12px;
  color: var(--navy);
  background: #eef4fa;
  border: 1px solid #c8d8e8;
  border-radius: 8px;
  font-weight: 800;
}

.verify-metrics {
  margin-top: 15px;
}

.danger-zone {
  border-color: #e8b5b9;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-card {
  width: min(460px, 100%);
  margin: 48px auto;
}

.verify-body {
  min-height: 100vh;
  padding: 32px 16px;
  background: #eaf0f6;
}

.verify-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.verify-brand {
  margin-bottom: 20px;
  color: var(--navy-dark);
  font-size: 19px;
  text-decoration: none;
}

.verify-brand .brand-mark {
  color: #fff;
  background: var(--navy-dark);
}

.verify-result {
  margin-bottom: 18px;
  padding: 25px;
  display: flex;
  gap: 17px;
  align-items: flex-start;
  color: #5f4200;
  background: var(--amber-soft);
  border: 1px solid #dfbf65;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.verify-result.valid {
  color: #0d5a38;
  background: var(--green-soft);
  border-color: #8dccad;
}

.verify-result.revoked {
  color: #7f1821;
  background: var(--red-soft);
  border-color: #e2a1a7;
}

.result-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--amber);
  border-radius: 50%;
  font-size: 27px;
  font-weight: 900;
}

.valid .result-icon {
  background: var(--green);
}

.revoked .result-icon {
  background: var(--red);
}

.verify-result span {
  font-size: 13px;
  font-weight: 800;
}

.verify-result h1 {
  margin: 1px 0 4px;
  font-size: 29px;
}

.verify-result p {
  margin: 0;
}

.verify-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.verify-info > div {
  min-width: 0;
  padding: 13px 0;
  display: grid;
  border-bottom: 1px solid #e4e9ef;
}

.verify-info > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.verify-info > div:nth-child(odd):not(.full) {
  padding-right: 18px;
}

.verify-info .full {
  grid-column: 1 / -1;
}

.verify-info strong {
  overflow-wrap: anywhere;
}

.compare-card {
  margin-top: 18px;
}

.compare-card form {
  margin-top: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.compare-result {
  margin-top: 18px;
  padding: 12px 14px;
  color: #684900;
  background: var(--amber-soft);
  border: 1px solid #ddbf6c;
  border-radius: 9px;
  font-weight: 800;
}

.compare-result.match {
  color: #0b5c38;
  background: var(--green-soft);
  border-color: #8ac8a9;
}

.compare-result.mismatch,
.compare-result.invalid {
  color: #821a23;
  background: var(--red-soft);
  border-color: #e1a3a9;
}

.verify-footer {
  padding: 22px 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.verify-footer a {
  margin-left: 8px;
  font-weight: 800;
}

.verify-home-body {
  padding-top: 20px;
  background:
    linear-gradient(180deg, #dfeaf5 0, #edf3f8 300px, var(--canvas) 560px);
}

.verify-home-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.verify-home-header {
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.verify-home-header .verify-brand {
  margin: 0;
}

.verify-home-header .verify-brand > span:last-child {
  display: grid;
}

.verify-home-header .verify-brand small {
  color: var(--muted);
  font-size: 12px;
}

.staff-entry {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.verify-home-hero {
  margin-bottom: 24px;
  padding: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.35fr);
  gap: 32px;
  align-items: center;
  color: #fff;
  background: var(--navy-dark);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(10, 36, 66, 0.2);
}

.verify-kicker {
  color: #9fc9ee;
  font-size: 14px;
  font-weight: 800;
}

.verify-home-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.2;
}

.verify-home-hero p {
  max-width: 650px;
  margin: 0;
  color: #c7d8e9;
}

.trust-panel {
  padding: 20px;
  display: grid;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

.trust-panel span {
  color: #9fc9ee;
  font-size: 12px;
  font-weight: 800;
}

.verify-home-error {
  margin: 0 0 18px;
}

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

.verify-method-card,
.verify-guide {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.verify-method-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-content: start;
}

.method-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 900;
}

.method-heading h2,
.verify-guide h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 20px;
}

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

.verify-query-form,
.verify-upload-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
}

.verify-query-form label,
.verify-upload-form label {
  color: #304257;
  font-size: 14px;
  font-weight: 800;
}

.verify-query-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.verify-upload-form small {
  color: var(--muted);
}

.verify-guide {
  margin-top: 20px;
  text-align: center;
}

@media (max-width: 820px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .summary-grid,
  .verify-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .provider-card {
    min-width: 190px;
  }

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

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

@media (max-width: 600px) {
  .topbar {
    padding: 11px 14px;
  }

  .brand small {
    display: none;
  }

  .environment-banner {
    text-align: left;
  }

  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .hero,
  .detail-hero {
    display: grid;
  }

  .hero h1,
  .detail-hero h1 {
    font-size: 27px;
  }

  .provider-card {
    width: 100%;
  }

  .panel,
  .login-card,
  .verify-info,
  .compare-card {
    padding: 18px;
    border-radius: 11px;
  }

  .custom-position,
  .signature-select-grid,
  .final-action-grid,
  .summary-grid,
  .verify-metrics,
  .verify-info {
    grid-template-columns: 1fr;
  }

  .report-upload-table {
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .report-upload-table-head {
    display: none;
  }

  .report-upload-row {
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 9px;
    background: #f8fafc;
    border: 1px solid #cbd7e3;
    border-radius: 10px;
  }

  .report-upload-row + .report-upload-row {
    margin-top: 10px;
    border-top: 1px solid #cbd7e3;
  }

  .mobile-field-label {
    display: block;
  }

  .action-row,
  .inline-form,
  .compare-card form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .staff-row,
  .staff-row > div {
    align-items: stretch;
  }

  .staff-row {
    display: grid;
  }

  .staff-row img {
    width: 92px;
    flex: 0 0 auto;
  }

  .verify-body {
    padding: 20px 11px;
  }

  .verify-home-header {
    margin-bottom: 22px;
    align-items: flex-start;
  }

  .verify-home-header .verify-brand small {
    display: none;
  }

  .staff-entry {
    padding-top: 7px;
    font-size: 13px;
  }

  .verify-home-hero {
    padding: 24px 20px;
    grid-template-columns: 1fr;
    gap: 20px;
    border-radius: 13px;
  }

  .verify-home-hero h1 {
    font-size: 30px;
  }

  .trust-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .trust-panel span {
    grid-column: 1 / -1;
  }

  .verify-method-card,
  .verify-guide {
    padding: 19px;
  }

  .verify-query-form > div {
    grid-template-columns: 1fr;
  }

  .verify-result {
    padding: 19px;
  }

  .verify-info > div,
  .verify-info > div:nth-child(odd):not(.full) {
    padding-right: 0;
    border-bottom: 1px solid #e4e9ef;
  }
}
