.honor-hall,
.honor-hall__portal {
  --hh-page: var(--global-bg);
  --hh-surface: var(--card-bg);
  --hh-surface-muted: color-mix(in srgb, var(--card-bg) 94%, var(--font-color) 6%);
  --hh-text: var(--font-color);
  --hh-muted: color-mix(in srgb, var(--font-color) 72%, transparent);
  --hh-border: var(--hr-border);
  --hh-accent: var(--text-highlight-color);
  --hh-accent-contrast: var(--btn-color);
  --hh-button: var(--btn-bg);
  --hh-shadow: var(--card-box-shadow);
  color: var(--hh-text);
}

.honor-hall-noscript {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-left: 4px solid var(--text-highlight-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--font-color);
  font-size: 1em;
}

.honor-hall {
  position: relative;
  width: 100%;
  color: var(--hh-text);
  font-size: 16px;
  line-height: 1.7;
}

.honor-hall,
.honor-hall *,
.honor-hall__portal,
.honor-hall__portal * {
  box-sizing: border-box;
}

.honor-hall button,
.honor-hall input,
.honor-hall__portal button {
  font: inherit;
}

.honor-hall button,
.honor-hall__portal button {
  color: var(--hh-text);
  cursor: pointer;
}

.honor-hall button:focus-visible,
.honor-hall input:focus-visible,
.honor-hall__portal button:focus-visible,
.honor-hall__portal [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hh-accent) 48%, transparent);
  outline-offset: 3px;
}

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

.honor-hall__search-panel {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px 24px;
  align-items: center;
  margin-bottom: 42px;
  padding: 22px;
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  background: var(--hh-surface-muted);
}

.honor-hall__search-panel h2 {
  margin: 0;
  color: var(--hh-text);
  font-size: 1.4em;
  line-height: 1.25;
}

.honor-hall__search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
}

.honor-hall__search-form input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--hh-border);
  border-radius: 8px;
  outline: 0;
  background: var(--hh-surface);
  color: var(--hh-text);
  font-size: 1em;
}

.honor-hall__search-form input::placeholder {
  color: var(--hh-muted);
  opacity: 1;
}

.honor-hall__search-form input:focus {
  border-color: var(--hh-accent);
}

.honor-hall__search-form button,
.honor-hall__result-bar button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--hh-button);
  border-radius: 8px;
  background: var(--hh-button);
  color: var(--hh-accent-contrast);
  font-weight: 700;
}

.honor-hall__search-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.honor-hall__privacy-note {
  grid-column: 2;
  margin: 0;
  color: var(--hh-muted);
  font-size: 1em;
}

.honor-hall__result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 40px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hh-border);
}

.honor-hall__result-bar[hidden] {
  display: none;
}

.honor-hall__result-message {
  margin: 0;
  color: var(--hh-text);
  font-size: 1.1em;
  font-weight: 650;
}

.honor-hall__result-bar button {
  min-height: 46px;
  background: transparent;
  color: var(--hh-accent);
}

.honor-hall__activity + .honor-hall__activity {
  margin-top: 52px;
}

.honor-hall__activity-title {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hh-border);
  color: var(--hh-text);
  font-size: 1.55em;
  font-weight: 720;
  line-height: 1.25;
}

.honor-hall__certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.honor-hall__certificate {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hh-border);
  border-radius: 10px;
  background: var(--hh-surface);
  box-shadow: var(--hh-shadow);
  text-align: left;
}

.honor-hall__certificate:hover {
  border-color: var(--hh-accent);
}

.honor-hall__certificate-image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.414 / 1;
  padding: 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--hh-border);
  background: var(--hh-surface-muted);
}

.honor-hall__certificate-image-wrap > * {
  grid-area: 1 / 1;
}

.honor-hall__certificate-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.honor-hall__certificate-image-status {
  z-index: 1;
  max-width: calc(100% - 32px);
  color: var(--hh-muted);
  font-size: 1em;
  text-align: center;
}

.honor-hall__certificate-image-wrap.is-loading .honor-hall__certificate-image,
.honor-hall__certificate-image-wrap.is-error .honor-hall__certificate-image {
  visibility: hidden;
}

.honor-hall__certificate-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 16px;
  align-items: center;
  padding: 15px 16px 17px;
}

.honor-hall__certificate-title {
  min-width: 0;
  color: var(--hh-text);
  font-size: 1.125em;
  line-height: 1.35;
}

.honor-hall__certificate-recipient {
  grid-column: 1;
  color: var(--hh-muted);
  font-size: 1em;
}

.honor-hall__certificate-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--hh-accent);
  font-size: 1.5em;
}

.honor-hall__activity-empty,
.honor-hall__empty p {
  margin: 0;
  color: var(--hh-muted);
  font-size: 1em;
}

.honor-hall__empty {
  padding: 38px 0;
  border-top: 1px solid var(--hh-border);
  border-bottom: 1px solid var(--hh-border);
}

.honor-hall__empty h2 {
  margin: 0 0 8px;
  color: var(--hh-text);
  font-size: 1.45em;
}

.honor-hall__portal {
  position: relative;
  z-index: 10000;
  color: var(--hh-text);
}

.honor-hall__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(8, 8, 7, 0.76);
}

.honor-hall__modal {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 2;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1240px, calc(100vw - 40px));
  height: min(920px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  background: var(--hh-surface);
  box-shadow: var(--hh-shadow);
  transform: translate(-50%, -50%);
}

.honor-hall__modal.is-open {
  display: grid;
}

.honor-hall__modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 66px;
  padding: 10px 12px 10px 22px;
  border-bottom: 1px solid var(--hh-border);
}

.honor-hall__modal-header h2 {
  margin: 0;
  color: var(--hh-text);
  font-size: 1.15em;
  line-height: 1.35;
}

.honor-hall__modal-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hh-text);
  font-size: 30px;
  line-height: 1;
}

.honor-hall__modal-close:hover {
  background: var(--hh-surface-muted);
}

.honor-hall__modal-image-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  background: var(--hh-page);
}

.honor-hall__modal-image-wrap > * {
  grid-area: 1 / 1;
}

.honor-hall__modal-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.honor-hall__modal-loading,
.honor-hall__modal-error {
  align-self: center;
  justify-self: center;
  max-width: min(520px, calc(100% - 32px));
  margin: 0;
  color: var(--hh-muted);
  font-size: 1em;
  text-align: center;
}

.honor-hall__modal-image-wrap.is-loading .honor-hall__modal-image,
.honor-hall__modal-image-wrap.is-error .honor-hall__modal-image {
  visibility: hidden;
}

.honor-hall__modal-loading[hidden],
.honor-hall__modal-error[hidden],
.honor-hall__certificate-image-status[hidden] {
  display: none;
}

body.honor-hall-scroll-lock {
  overflow: hidden;
}

@media (max-width: 820px) {
  .honor-hall__search-panel {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
    padding: 22px;
  }

  .honor-hall__privacy-note {
    grid-column: 1;
  }

  .honor-hall__certificate-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 560px) {
  .honor-hall__search-panel {
    gap: 18px;
    margin-bottom: 34px;
    padding: 18px;
  }

  .honor-hall__search-form {
    grid-template-columns: 1fr;
  }

  .honor-hall__search-form button {
    width: 100%;
  }

  .honor-hall__result-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .honor-hall__result-bar button {
    width: 100%;
  }

  .honor-hall__activity + .honor-hall__activity {
    margin-top: 48px;
  }

  .honor-hall__certificate-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .honor-hall__modal {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: none;
  }

  .honor-hall__modal-header {
    min-height: 60px;
    padding-left: 16px;
  }

  .honor-hall__modal-header h2 {
    font-size: 1.05em;
  }

  .honor-hall__modal-image-wrap {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .honor-hall *,
  .honor-hall *::before,
  .honor-hall *::after,
  .honor-hall__portal *,
  .honor-hall__portal *::before,
  .honor-hall__portal *::after {
    scroll-behavior: auto !important;
  }
}
