:root {
  --page-bg: #ffffff;
  --panel-bg: #f4f5f7;
  --panel-border: #a9d0ff;
  --text: #17395f;
  --muted: #d6dce2;
  --soft-row: #f0f0f0;
  --blue: #1d7eea;
  --link-red: #ee2b22;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 16px;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1110px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  background: #f5f6f8;
  border-bottom: 1px solid #edf0f3;
}

.topbar-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 245px;
  height: auto;
  display: block;
}

.mobile-menu {
  display: none;
  width: 44px;
  height: 32px;
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  background: #f5f6f8;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu span {
  display: block;
  width: 18px;
  height: 2px;
  background: #8f8f8f;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 16px;
}

.top-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1d3d67;
}

.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
  color: #17395f;
}

.icon-search::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.icon-search::after {
  content: "";
  width: 7px;
  height: 2px;
  background: currentColor;
  position: absolute;
  right: -1px;
  bottom: 2px;
  transform: rotate(45deg);
  transform-origin: center;
}

.icon-scale::before {
  content: "";
  width: 12px;
  height: 2px;
  background: currentColor;
  position: absolute;
  top: 2px;
  left: 2px;
}

.icon-scale::after {
  content: "";
  width: 2px;
  height: 12px;
  background: currentColor;
  position: absolute;
  left: 7px;
  top: 1px;
  box-shadow: -5px 7px 0 0 currentColor, 5px 7px 0 0 currentColor;
}

.icon-book::before,
.icon-book::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 5px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 1px;
}

.icon-book::before {
  left: 0;
}

.icon-book::after {
  right: 0;
}

.icon-at::before {
  content: "@";
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  position: absolute;
  inset: -1px 0 0 0;
}

.page {
  padding: 18px 0 32px;
  min-height: calc(100vh - 140px);
}

h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 600;
  color: #132f4f;
}

.details-strip {
  border-top: 1px solid #d8dde3;
}

.meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  padding: 4px 0;
  border-bottom: 1px solid #d8dde3;
  font-size: 16px;
}

.label {
  font-weight: 700;
  color: #112c4b;
  padding-left: 4px;
}

.notice {
  margin: 30px 0 14px;
  border: 1px solid #abd0fb;
  background: #fbfdff;
  border-radius: 3px;
  padding: 12px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  font-size: 16px;
  color: #0d56a5;
}

.notice p {
  margin: 0;
  text-align: center;
  width: auto;
  max-width: 100%;
  font-size: 14px;
  white-space: nowrap;
}

.notice a {
  color: var(--link-red);
  font-weight: 700;
  font-size: 14px;
}

.notice-icon {
  color: #0d56a5;
  width: 13px;
  min-width: 13px;
  height: 16px;
  position: relative;
  display: inline-block;
  margin: 2px 2px 0 0;
}

.notice-icon::before,
.notice-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  top: 3px;
}

.notice-icon::before {
  left: 0;
}

.notice-icon::after {
  left: 5px;
}

.seal-banner {
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-size: 16px;
  padding: 4px 12px;
  margin-bottom: 0;
}

.seal-card {
  margin-top: 0;
}

.table-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 28px;
  align-items: center;
  font-size: 16px;
}

.table-row.shaded,
.seal-total {
  background: var(--soft-row);
}

.table-label,
.table-value {
  padding: 2px 4px;
}

.table-label {
  font-weight: 700;
  color: #112c4b;
}

.seal-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 28px;
  padding: 2px 6px;
  color: #617a97;
  font-size: 16px;
  font-style: italic;
}

.seal-total .notice-icon {
  color: inherit;
}

.notice-bottom {
  margin-top: 14px;
}

.footer {
  background: #f5f6f8;
  border-top: 1px solid #edf0f3;
}

.footer p {
  margin: 0;
  text-align: center;
  padding: 14px 0 16px;
  color: #232323;
  font-size: 15px;
}

.certificate-body {
  margin: 0;
  min-height: 100vh;
  background: #5e6972;
  color: #1a3657;
}

.certificate-topbar {
  background: #20391b;
  padding: 10px 18px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.certificate-topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.certificate-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f5ef;
  font-size: 22px;
}

.certificate-url {
  flex: 1;
  min-height: 44px;
  border-radius: 24px;
  border: 2px solid #a1cf8a;
  background: #f6fbec;
  color: #111;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.certificate-page {
  min-height: calc(100vh - 64px);
}

.certificate-summary {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #d1d8e0;
}

.certificate-summary h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  color: #22689f;
}

.certificate-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #1f466d;
}

.certificate-summary-item span {
  font-size: 18px;
}

.certificate-summary-item strong {
  font-size: 19px;
  font-weight: 400;
}

.certificate-viewer {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: calc(100vh - 146px);
}

.viewer-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 220px;
}

.viewer-toolbar button {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 0;
  background: #f7f7f7;
  color: #8b9299;
  font-size: 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
}

.viewer-stage {
  padding: 18px 24px 30px;
  overflow: auto;
}

.document-sheet {
  width: min(100%, 555px);
  min-height: 780px;
  margin: 0 auto;
  background:
    linear-gradient(125deg, transparent 0 58%, rgba(168, 76, 76, 0.18) 58% 67%, transparent 67%),
    #fff;
  color: #1d1d1d;
  padding: 22px 30px 28px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.document-sheet-header,
.document-title-block,
.document-footer {
  position: relative;
  z-index: 1;
}

.document-sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.document-micro,
.document-title-block p,
.document-content p,
.document-footer span {
  margin: 0;
}

.document-micro {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.document-page-counter {
  font-size: 11px;
}

.document-title-block {
  margin-top: 26px;
  padding: 12px 14px;
  border: 1px solid #bfbfbf;
  font-size: 11px;
  line-height: 1.5;
}

.document-content {
  margin-top: 32px;
  border: 1px solid #b3b3b3;
  padding: 22px 18px 120px;
  font-family: "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.48;
}

.document-content p + p {
  margin-top: 10px;
}

.document-watermark {
  position: absolute;
  inset: 130px 0 auto;
  text-align: center;
  transform: rotate(-60deg);
  font-size: 56px;
  letter-spacing: 0.08em;
  color: rgba(155, 86, 86, 0.2);
  pointer-events: none;
}

.document-footer {
  margin-top: 12px;
  border-top: 1px solid #b7b7b7;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.info-modal {
  width: min(398px, 100%);
  max-width: 398px;
  background: #fff;
  border: 1px solid #c4c7cc;
  border-radius: 4px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  margin: 0 auto;
}

.info-modal-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 0 13px;
  background: #f5f6f7;
}

.info-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  color: #3a3a3a;
  flex: 1 1 auto;
  min-width: 0;
}

.info-modal-close {
  border: 0;
  background: transparent;
  color: #7f7f7f;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
}

.info-modal-body {
  padding: 14px 13px 10px;
}

.info-modal-body p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #444;
}

.captcha-card {
  width: 286px;
  max-width: 100%;
  min-height: 59px;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  background: #f9f9f9;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.captcha-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.captcha-check {
  width: 22px;
  height: 22px;
  border: 2px solid #9c9c9c;
  background: #fff;
  position: relative;
  border-radius: 2px;
}

.captcha-card.is-checking .captcha-check {
  border-color: #c9d8f4;
}

.captcha-card.is-checking .captcha-check::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 3px solid #d7e6fd;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: captcha-spin 0.8s linear infinite;
}

.captcha-input:checked + .captcha-check::after,
.captcha-card.is-verified .captcha-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  width: 7px;
  height: 13px;
  border-right: 3px solid #34a853;
  border-bottom: 3px solid #34a853;
  transform: rotate(45deg);
}

.captcha-text {
  font-size: 14px;
  color: #333;
  align-self: center;
}

.captcha-brand {
  display: grid;
  justify-items: center;
  gap: 1px;
  color: #888;
}

.captcha-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5d8ef6, #1e5fd3);
  position: relative;
}

.captcha-logo::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 3px solid #fff;
  border-left-color: transparent;
  border-radius: 50%;
}

.captcha-brand span {
  font-size: 9px;
  line-height: 1;
}

.captcha-brand small {
  font-size: 8px;
  line-height: 1;
}

.info-modal-footer {
  padding: 12px 13px 12px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #ececec;
}

.info-modal-action {
  min-width: 74px;
  height: 36px;
  border: 0;
  border-radius: 3px;
  background: #4da3ff;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.info-modal-action:disabled {
  background: #cfd8e6;
  color: #fff;
  cursor: not-allowed;
}

@keyframes captcha-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  .info-modal {
    width: min(100%, 360px);
    max-width: 360px;
    margin-top: 14px;
  }

  .info-modal-header {
    min-height: 48px;
    padding: 0 10px 0 12px;
  }

  .info-modal-header h2 {
    font-size: 16px;
    line-height: 1.2;
  }

  .info-modal-body {
    padding: 12px;
  }

  .info-modal-body p {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .captcha-card {
    width: 100%;
    min-height: 56px;
    grid-template-columns: 24px 1fr auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .captcha-check {
    width: 18px;
    height: 18px;
  }

  .captcha-card.is-checking .captcha-check::before {
    border-width: 2px;
  }

  .captcha-input:checked + .captcha-check::after,
  .captcha-card.is-verified .captcha-check::after {
    left: 4px;
    top: -1px;
    width: 6px;
    height: 11px;
  }

  .captcha-text {
    font-size: 11px;
  }

  .captcha-brand span {
    font-size: 9px;
  }

  .captcha-brand small {
    font-size: 7px;
  }

  .info-modal-footer {
    padding: 0 12px 12px;
  }

  .info-modal-action {
    min-width: 84px;
    height: 32px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    min-height: 74px;
    padding: 10px 0;
  }

  .top-links {
    gap: 12px;
    font-size: 15px;
  }

  h1 {
    font-size: 28px;
  }

  .notice {
    margin-top: 22px;
    font-size: 16px;
  }

  .certificate-summary {
    flex-wrap: wrap;
    gap: 18px 28px;
  }

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

  .viewer-toolbar {
    flex-direction: row;
    justify-content: center;
    padding: 18px 0 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 18px, 1110px);
  }

  .topbar {
    padding-top: 8px;
  }

  .topbar-inner {
    min-height: 88px;
    padding: 8px 0 10px;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .brand {
    width: auto;
  }

  .brand-logo {
    width: 234px;
  }

  .mobile-menu {
    display: inline-flex;
    margin-left: auto;
    width: 56px;
    height: 40px;
    padding: 4px 12px;
  }

  .top-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 6px 6px 2px;
    font-size: 17px;
  }

  .topbar.menu-open .top-links {
    display: flex;
  }

  .top-links a {
    gap: 8px;
    color: #1a3558;
    font-size: 16px;
    line-height: 1;
  }

  .top-links .icon {
    width: 18px;
    height: 18px;
    color: #20395f;
  }

  .top-links .icon-search::before {
    width: 9px;
    height: 9px;
    border-width: 3px;
    top: 0;
    left: 0;
  }

  .top-links .icon-search::after {
    width: 8px;
    height: 3px;
    right: 0;
    bottom: 1px;
  }

  .top-links .icon-scale::before {
    width: 14px;
    height: 2px;
    top: 2px;
    left: 2px;
  }

  .top-links .icon-scale::after {
    width: 2px;
    height: 12px;
    left: 8px;
    top: 1px;
    box-shadow: -6px 7px 0 0 currentColor, 6px 7px 0 0 currentColor;
  }

  .top-links .icon-book::before,
  .top-links .icon-book::after {
    width: 6px;
    height: 13px;
    border-width: 2px;
  }

  .top-links .icon-at::before {
    font-size: 20px;
    inset: -2px 0 0 0;
  }

  .page {
    padding: 10px 0 18px;
  }

  h1 {
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 8px;
    padding: 0 8px 8px;
  }

  .details-strip {
    margin: 0 8px;
  }

  .meta-row,
  .table-row {
    grid-template-columns: 116px 1fr;
    font-size: 15px;
    line-height: 1.35;
  }

  .label,
  .table-label {
    font-size: 15px;
  }

.table-value,
.value {
  font-size: 14px;
}

  .notice {
    margin: 18px 8px 12px;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.45;
  }

  .notice-icon {
    width: 13px;
    min-width: 13px;
    height: 16px;
    margin: 2px -4px 0 0;
  }

  .seal-banner {
    font-size: 15px;
    padding: 4.8px 8px;
    margin: 0 8px;
  }

  .table-row {
    min-height: 34px;
    margin: 0 8px;
  }

  .table-label,
  .table-value {
    padding: 4.8px;
  }

  .seal-total {
    justify-content: flex-end;
    text-align: right;
    font-size: 15px;
    min-height: 34px;
    margin: 0 8px;
    padding: 4.8px;
  }

  .notice-bottom {
    margin-top: 12px;
  }

  .notice p {
    white-space: normal;
  }

  .footer p {
    font-size: 14px;
    padding: 14px 0 16px;
  }

  .certificate-topbar {
    padding: 10px;
  }

  .certificate-topbar-inner {
    gap: 10px;
  }

  .certificate-back {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .certificate-url {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .certificate-summary {
    justify-content: flex-start;
    padding: 16px 14px 10px;
  }

  .certificate-summary h1 {
    width: 100%;
    font-size: 18px;
  }

  .certificate-summary-item span,
  .certificate-summary-item strong {
    font-size: 16px;
  }

  .viewer-toolbar {
    gap: 12px;
  }

  .viewer-toolbar button {
    width: 54px;
    height: 54px;
    font-size: 24px;
  }

  .viewer-stage {
    padding: 14px 10px 20px;
  }

  .document-sheet {
    min-height: 640px;
    padding: 16px 14px 20px;
  }

  .document-content {
    padding: 16px 12px 80px;
    font-size: 13px;
  }

  .document-watermark {
    top: 180px;
    font-size: 34px;
  }
}

@media (max-width: 400px) {
  .notice br {
    display: none;
  }

  .notice {
    padding: 12px 12px;
  }

  .notice p,
  .notice a {
    font-size: 14px;
    line-height: 1.45;
  }
}
