@charset "UTF-8";

/* Final layout adjustments. Load after portal.css. */
:root { --sans: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif; --serif: var(--sans); }
body, button, input, textarea, select { font-family: var(--sans); }
html, body { max-width: 100%; overflow-x: clip; }
body { min-width: 0; }
#portal-layout, #portal-home { min-width: 0; }
.wrap { min-width: 0; }
.site-header, .brand, .collection-heading, .collection-tools { min-width: 0; }
.site-header { gap: 18px; }
.brand { flex-shrink: 1; }
.brand>span { min-width: 0; }
.brand strong, .admin-link, .portal-shortcuts .shortcut strong,
.mobile-nav a, .mobile-nav button, .filters button,
.viewer-page-header button, .view-modes button, .view-actions button {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.admin-link { flex-shrink: 0; }
.portal-hero-copy { max-width: none; width: 100%; }
.portal-banner h1 {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.55;
  letter-spacing: 1.5px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.portal-banner h1>span { display: block; flex-shrink: 0; color: inherit; }
.portal-hero-copy .portal-institution {
  width: max-content;
  max-width: 100%;
  font-size: 15px;
  letter-spacing: .2px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.portal-shortcuts { align-items: start; }
.portal-shortcuts .shortcut { min-width: 0; }
.collection { padding-top: 18px; }
.collection-heading { margin-bottom: 20px; }
.collection-heading h2 { white-space: nowrap; overflow-wrap: normal; }
.collection-tools { gap: 20px; }
.filters { min-width: 0; }
.search { min-width: 0; }
.search input { min-width: 0; }
.collection-grid { min-width: 0; }
.collection-card { min-width: 0; max-width: 100%; }
.card-body { min-width: 0; padding: 16px 18px 18px; }
.card-body h3 {
  width: 100%;
  max-width: 100%;
  font-size: 20px;
  line-height: 1.6;
  letter-spacing: .2px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.site-footer { min-width: 0; }
.site-footer>a { white-space: nowrap; }
.about-copy { min-width: 0; }
.about-copy h3 { word-break: keep-all; overflow-wrap: normal; }

.viewer-page { max-width: 100%; min-width: 0; }
.viewer-page-header { flex-wrap: nowrap; gap: 20px; }
.viewer-page-header button { flex: 0 0 auto; }
.viewer-page-header button span { white-space: nowrap; }
.viewer-page-title { flex: 1 1 auto; min-width: 0; }
.viewer-page-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.viewer-page .exhibit-info {
  top: 30px;
  left: 30px;
  width: calc(100% - 115px);
  max-width: 700px;
  min-width: 0;
}
.viewer-page .exhibit-info h2 {
  display: block;
  max-width: 100%;
  margin: 0;
  font-size: clamp(18px, 2.4vw, 30px);
  line-height: 40px;
  letter-spacing: .4px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-page .viewer-top { top: 30px; right: 30px; left: auto; }
.viewer-page .music-button { flex-shrink: 0; }
.viewer-page .view-modes button { font-size: 14px; }
.loading-overlay { padding-inline: 16px; }
.loading-card { width: clamp(258px, 38vw, 340px); max-width: 100%; }
.loading-heading { display: flex; flex-wrap: nowrap; align-items: center; min-width: 0; gap: 14px; }
.loading-overlay #load-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  letter-spacing: .2px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loading-overlay #load-percent {
  flex: 0 0 4ch;
  width: 4ch;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}
.viewer-page .exhibit-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
  padding-inline: 30px;
  min-width: 0;
}
.viewer-page .danmaku-form {
  display: flex;
  flex: 1 1 280px;
  max-width: 540px;
  min-width: 0;
  gap: 9px;
}
.danmaku-form input { width: 0; flex: 1 1 auto; min-width: 0; }
.danmaku-form button { flex: 0 0 auto; white-space: nowrap; }
.viewer-page .social-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: auto;
  min-width: 0;
  gap: 22px;
}
.viewer-page .social-actions button, .viewer-page .view-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  font-size: 14px;
}
.view-count>span, #like-count { font-variant-numeric: tabular-nums; }
dialog { max-width: calc(100% - 28px); }
.dialog .form-row, .dialog form, .dialog label { min-width: 0; }
.dialog p, .dialog label, .dialog small { overflow-wrap: anywhere; }
.dialog .button { white-space: nowrap; }
.admin-row { min-width: 0; }
.admin-row>div:first-child { min-width: 0; }
.admin-row strong { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .viewer-page .exhibit-bottom { gap: 18px; padding-inline: 22px; }
  .viewer-page .social-actions { gap: 15px; }
  .viewer-page .exhibit-info { left: 24px; width: calc(100% - 105px); }
  .viewer-page .viewer-top { right: 24px; }
  .about-inner { grid-template-columns: 1fr; }
  .about-copy { border-top: 1px solid #decfb4; padding-top: 20px; }
  .about-copy h3 { font-size: 15px; line-height: 1.9; }
}

@media (max-width: 760px) {
  .portal-banner h1 { font-size: 35px; }
  .card-body h3 { font-size: 18px; }
  .viewer-page-header { gap: 13px; }
  .viewer-page .exhibit-bottom {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  }
  .viewer-page .danmaku-form { flex: 0 0 100%; max-width: none; }
  .viewer-page .social-actions { flex: 0 0 100%; width: 100%; justify-content: space-between; gap: 12px; }
  .loading-overlay { padding-bottom: 155px; }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .site-header { gap: 10px; }
  .brand strong { font-size: 21px; }
  .admin-link { font-size: 14px; padding: 7px 10px; }
  .admin-link span { margin-left: 4px; }
  .portal-banner { padding: 27px 23px; min-height: 270px; }
  .portal-hero-copy { max-width: none; padding-top: 0; }
  .portal-banner h1 { flex-direction: column; align-items: flex-start; font-size: clamp(28px, 7.7vw, 35px); line-height: 1.55; letter-spacing: 1px; }
  .portal-hero-copy .portal-institution {
    font-size: clamp(12px, 3.45vw, 14px);
    letter-spacing: 0;
    line-height: 1.85;
    margin: 16px 0 19px;
  }
  .portal-hero-copy>.button { font-size: 14px; min-height: 40px; padding: 9px 16px; gap: 18px; }
  .portal-shortcuts { padding-block: 23px 22px; }
  .portal-shortcuts .shortcut strong { font-size: 14px; letter-spacing: .2px; }
  .collection { padding-top: 12px; padding-bottom: 28px; }
  .collection-heading { margin-bottom: 14px; }
  .collection-heading h2 { font-size: 25px; line-height: 1.5; }
  .collection-tools { gap: 12px; margin-bottom: 17px; }
  .filters { gap: 10px; }
  .filters button { font-size: 14px; padding: 9px 0 11px; }
  .filters button span { display: none; }
  .search { min-height: 40px; height: 40px; }
  .search input { font-size: 14px; }
  .search svg { width: 16px; height: 16px; }
  .collection-grid { gap: 12px; }
  .card-body { padding: 12px 11px 14px; }
  .card-body h3 { font-size: 16px; line-height: 1.6; letter-spacing: 0; }
  .about-inner { gap: 22px; }
  .about-copy h3 { font-size: clamp(12px, 3.45vw, 14px); white-space: nowrap; line-height: 1.85; }
  .site-footer { gap: 12px; }
  .site-footer>a:last-child { font-size: 14px; }
  .mobile-nav a, .mobile-nav button { font-size: 14px; gap: 5px; }
  .mobile-nav { padding-block: 9px calc(8px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .viewer-page-header { padding-inline: 12px; gap: 9px; min-height: 65px; }
  .viewer-page-header button { font-size: 14px; padding: 8px 9px; gap: 6px; min-height: 40px; }
  .viewer-page-title strong { font-size: 14px; letter-spacing: .2px; }
  .viewer-page .exhibit-info { top: 22px; left: 18px; width: calc(100% - 94px); max-width: 700px; }
  .viewer-page .exhibit-info h2 { font-size: clamp(18px, 5.1vw, 25px); line-height: 40px; letter-spacing: .1px; }
  .viewer-page .viewer-top { top: 22px; right: 18px; }
  .viewer-page .viewer-toolbar { left: 16px; right: 16px; }
  .viewer-page .view-modes button { font-size: 14px; min-height: 39px; gap: 6px; }
  .viewer-page .view-modes svg { width: 16px; height: 16px; }
  .viewer-page .view-actions button { min-width: 40px; min-height: 36px; }
  .viewer-page .view-actions svg { width: 16px; height: 16px; }
  .loading-card { width: min(300px, 100%); padding: 13px 15px 15px; }
  .loading-heading { gap: 10px; }
  .loading-overlay #load-label, .loading-overlay #load-percent { font-size: 14px; }
  .viewer-page .exhibit-bottom { padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); min-height: 116px; gap: 10px; }
  .viewer-page .danmaku-form { width: 100%; flex: 0 0 100%; max-width: none; gap: 8px; }
  .danmaku-form input { font-size: 16px; min-height: 40px; padding: 9px 13px; }
  .danmaku-form button { font-size: 14px; min-height: 40px; padding: 9px 17px; }
  .viewer-page .social-actions { width: 100%; flex: 0 0 100%; gap: 10px; }
  .viewer-page .social-actions button, .viewer-page .view-count { font-size: 14px; gap: 5px; min-height: 30px; }
  .viewer-page .social-actions svg { width: 16px; height: 16px; }
  .viewer-page .view-count>span, .viewer-page #like-count { max-width: 5.5ch; overflow: hidden; text-overflow: ellipsis; }
  .loading-overlay { padding-bottom: 165px; }
  .dialog p, .dialog label, .dialog small { white-space: normal; }
}

@media (max-width: 370px) {
  .wrap { width: calc(100% - 26px); }
  .portal-banner { padding-inline: 18px; }
  .brand strong { font-size: 20px; }
  .brand img { width: 30px; height: 30px; }
  .admin-link { padding-inline: 8px; }
  .portal-shortcuts .shortcut strong { font-size: 14px; letter-spacing: 0; }
  .filters { gap: 7px; }
  .filters button { font-size: 14px; }
  .card-body { padding-inline: 9px; }
  .card-body h3 { font-size: 16px; }
  .viewer-page-header { gap: 7px; padding-inline: 10px; }
  .viewer-page-header button { padding-inline: 8px; gap: 4px; }
  .viewer-page-title strong { font-size: 14px; }
  .viewer-page .exhibit-bottom { padding-inline: 12px; }
  .viewer-page .social-actions { gap: 7px; }
  .viewer-page .social-actions button, .viewer-page .view-count { font-size: 14px; gap: 4px; }
  .viewer-page .view-count>span, .viewer-page #like-count { max-width: 4ch; }
  .site-footer .footer-brand strong { font-size: 16px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .viewer-page-header { min-height: 49px; padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .viewer-page .exhibit-info { top: 15px; left: 22px; width: calc(100% - 105px); }
  .viewer-page .viewer-top { top: 15px; right: 22px; }
  .viewer-page .exhibit-info h2 { font-size: 22px; line-height: 36px; }
  .viewer-page .exhibit-bottom { min-height: 54px; flex-wrap: nowrap; padding: 7px 20px calc(7px + env(safe-area-inset-bottom)); gap: 18px; }
  .viewer-page .danmaku-form { flex: 1 1 200px; width: auto; }
  .viewer-page .social-actions { flex: 0 0 auto; width: auto; gap: 14px; }
  .danmaku-form input, .danmaku-form button { min-height: 35px; }
  .loading-overlay { padding-bottom: 75px; }
}
/* Bottom navigation removed by request. */ body{padding-bottom:0}.toast{bottom:28px}

/* The collection follows the hero directly, with one title and search row. */
#portal-home>.collection { padding-top: 56px; padding-bottom: 56px; }
.collection>.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 28px;
  margin: 0 0 28px;
}
.collection>.collection-heading>h2 { flex: 0 0 auto; margin: 0; font-size: 30px; line-height: 1.5; }
.collection-heading>.search {
  flex: 0 1 320px;
  width: clamp(280px, 28vw, 320px);
  max-width: none;
  min-width: 0;
  height: 44px;
  padding: 0 15px;
  margin: 0;
  border-radius: 11px;
}
.collection-heading>.search input { flex: 1 1 auto; min-width: 0; width: 100%; font-size: 14px; padding-block: 10px; }
.collection-heading>.search svg { width: 17px; height: 17px; }
.collection>.collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.collection-card>.card-art { position: relative; height: auto; min-height: 0; aspect-ratio: 4 / 3; }
.collection-card>.card-art>img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collection-card .card-body { padding: 17px 18px 19px; }
.collection-card .card-body h3 { font-size: 20px; line-height: 1.6; }
#portal-home>.about-section { margin-top: 0; }

@media (max-width: 900px) {
  #portal-home>.collection { padding-top: 46px; padding-bottom: 48px; }
  .collection>.collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

@media (max-width: 600px) {
  #portal-home>.collection { padding-top: 36px; padding-bottom: 40px; }
  .collection>.collection-heading { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 20px; }
  .collection>.collection-heading>h2 { font-size: 25px; line-height: 1.5; }
  .collection-heading>.search { flex: 0 0 auto; width: 100%; max-width: none; height: 43px; padding-inline: 13px; }
  .collection-heading>.search input { font-size: 14px; }
  .collection>.collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .collection-card .card-body { padding: 12px 11px 14px; }
  .collection-card .card-body h3 { font-size: 16px; line-height: 1.6; }
}

@media (max-width: 370px) {
  .collection>.collection-grid { gap: 10px; }
  .collection-card .card-body { padding-inline: 9px; }
}
