/* Image-only announcements fit the visible screen without cropping or scrolling.
 * Text / mixed announcements retain their accessible content scrolling. */
.notice-modal-mask {
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.notice-modal.notice-modal--image-only {
  --notice-cover-ratio: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr) 48px;
  width: min(600px, calc(100vw - 28px), max(220px,
    calc((min(740px, calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom))) - 98px) * var(--notice-cover-ratio))));
  height: min(740px, calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)),
    calc(min(600px, calc(100vw - 28px)) / var(--notice-cover-ratio) + 98px));
  max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
}
.notice-modal--image-only .notice-modal-tabs {
  min-width: 0;
  margin-right: 0;
  padding-right: 0;
}
.notice-modal--image-only .notice-modal-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  max-height: none;
  height: 100%;
  padding: 0;
  overflow: hidden;
}
.notice-modal--image-only .notice-modal-cover,
.notice-modal--image-only .notice-modal-content img {
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0;
}
.notice-modal--image-only .notice-modal-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  line-height: 0;
}
.notice-modal--image-only .notice-modal-content :not(img) {
  display: contents;
}
.notice-modal--image-only .notice-modal-suppress {
  justify-self: center;
  align-self: center;
  margin: 0;
}
.notice-modal--image-only .notice-modal-next {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 88px;
  height: 40px;
  margin: 0;
  border-width: 1px;
  border-radius: 8px;
  z-index: 2;
}
@media (min-width: 900px) {
  html.desktop-ui .notice-modal.notice-modal--image-only:has(.notice-modal-tabs button:nth-child(2)) {
    --notice-fit-height: min(680px, calc(100dvh - 48px));
    width: min(920px, calc(100vw - 48px),
      calc(230px + (var(--notice-fit-height) - 50px) * var(--notice-cover-ratio)));
    height: max(min(320px, calc(100dvh - 48px)), min(var(--notice-fit-height),
      calc((min(920px, calc(100vw - 48px)) - 230px) / var(--notice-cover-ratio) + 50px)));
    max-height: calc(100dvh - 48px);
    grid-template-columns: 228px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  html.desktop-ui .notice-modal--image-only:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-tabs {
    margin-right: 0;
    padding: 18px 10px;
  }
  html.desktop-ui .notice-modal--image-only:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-panel {
    padding: 48px 0 0;
    overflow: hidden;
  }
  html.desktop-ui .notice-modal--image-only:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-suppress {
    justify-self: stretch;
    align-self: stretch;
    padding: 12px 18px;
  }
  html.desktop-ui .notice-modal--image-only:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-next {
    top: 7px;
    right: 8px;
    width: 88px;
    height: 40px;
  }
}

/* 关闭与当日免提示放在同一行；右上角保留明确的其他公告入口。 */
.notice-modal .notice-modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(12, 25, 46, .86);
}
.notice-modal .notice-modal-footer .notice-modal-suppress {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  background: transparent;
}
.notice-modal .notice-modal-footer .notice-modal-close,
html.desktop-ui .notice-modal:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-footer .notice-modal-close {
  position: static;
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid #45627e;
  border-radius: 8px;
  background: #1b304b;
}
.notice-modal .notice-modal-footer .notice-modal-close svg { width: 20px; height: 20px; }
.notice-modal .notice-modal-next {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 88px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid #45627e;
  border-radius: 8px;
  color: #eef5ff;
  background: #1b304b;
  font-size: 13px;
  cursor: pointer;
}
.notice-modal .notice-modal-next[hidden] { display: none; }
.notice-modal .notice-next-arrow { display: block; width: 24px; height: 24px; flex: 0 0 24px; }
.notice-modal--multiple .notice-modal-tabs { margin-right: 96px; }
.notice-modal .notice-modal-next:focus-visible,
.notice-modal .notice-modal-footer .notice-modal-close:focus-visible { outline: 2px solid #52ddb0; outline-offset: 2px; }
.notice-modal--image-only .notice-modal-footer {
  align-self: center;
  justify-self: center;
  margin: 0;
}
@media (min-width: 900px) {
  html.desktop-ui .notice-modal:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-footer {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    justify-self: stretch;
    gap: 8px;
    margin: 0;
    padding: 4px 10px;
    border-top: 1px solid #31445e;
    border-radius: 0;
    background: #12233c;
  }
  html.desktop-ui .notice-modal:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-footer .notice-modal-suppress {
    align-self: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
  }
  html.desktop-ui .notice-modal:has(.notice-modal-tabs button:nth-child(2)) .notice-modal-tabs { margin-right: 0; }
  html.desktop-ui .notice-modal .notice-modal-next { top: 7px; right: 8px; }
}
