:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #243247;
  background: #f5f7fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.58; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .43; }
a { color: inherit; }
:focus-visible { outline: 3px solid #6798ee; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.shell { max-width: 1180px; margin: 0 auto; padding: 25px 24px 30px; }
.site-header { display: flex; justify-content: space-between; gap: 25px; align-items: center; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 17px; }
.brand-icon { width: 66px; height: 66px; border-radius: 18px; background: #1b5db9; color: white; display: grid; place-items: center; font-size: 32px; font-weight: 800; box-shadow: 0 8px 19px #1b5db922; flex: none; }
.eyebrow { color: #1b5db9; font-size: 12px; font-weight: 760; letter-spacing: .12em; }
h1 { margin: 1px 0; letter-spacing: -.035em; font-size: clamp(29px, 4vw, 40px); line-height: 1.2; }
.intro { margin: 6px 0 0; color: #66768d; font-size: 15px; }
.header-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.phase-badge { background: #e6f0fe; color: #1c569e; border: 1px solid #c6dcfb; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.read-only { color: #75849a; font-size: 13px; }
.demo-banner { background: #fff2cd; border: 1px solid #e8c76f; padding: 12px 16px; margin-bottom: 20px; border-radius: 10px; color: #7b5819; font-size: 14px; }
.content { background: white; border-radius: 17px; border: 1px solid #e2e9f2; padding: 24px; box-shadow: 0 8px 32px #34405a08; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.section-heading h2 { font-size: 23px; margin: 0; letter-spacing: -.025em; }
.heading-dot { display: inline-block; width: 7px; height: 7px; background: #4387dc; border-radius: 50%; vertical-align: middle; margin-left: 3px; }
.section-heading p { color: #7a8697; margin: 1px 0 19px; font-size: 14px; }
.search-bar { display: grid; grid-template-columns: 1fr 190px auto; gap: 10px; }
input, select { min-width: 0; background: #fff; color: #243247; border: 1px solid #cfd9e5; border-radius: 9px; padding: 11px 13px; }
input:focus, select:focus { border-color: #6599df; }
.primary-button { color: #fff; background: #1b5db9; border: 1px solid #1b5db9; border-radius: 9px; font-weight: 700; padding: 11px 18px; text-decoration: none; }
.primary-button:hover { background: #164e99; }
.light-button { color: #1d539b; background: #fff; border: 1px solid #c0d5f3; border-radius: 9px; font-weight: 650; padding: 9px 14px; }
.light-button:hover:not(:disabled) { background: #edf4ff; }
.text-button { border: none; background: transparent; color: #5f7188; font-size: 14px; padding: 9px 10px; }
.date-filter { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 13px; }
.date-filter label { display: flex; flex-direction: column; gap: 4px; color: #6e7b8b; font-size: 13px; font-weight: 650; }
.date-filter label input { width: 174px; font-size: 14px; }
.date-filter button { font-size: 14px; }
.timezone-note { margin: 9px 0 0; color: #65758b; font-size: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 24px 0 8px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.result-count { color: #59687b; font-size: 14px; }
.mode-switch { display: flex; gap: 3px; background: #eff3f8; border-radius: 9px; padding: 3px; }
.mode-switch button { border: 0; background: transparent; color: #718198; border-radius: 7px; padding: 7px 12px; font-size: 13px; }
.mode-switch button[aria-pressed="true"] { background: white; color: #1b5db9; box-shadow: 0 1px 4px #23374b22; font-weight: 700; }
.status { color: #718198; font-size: 14px; min-height: 24px; margin: 8px 0; }
.status.error { color: #ad3535; font-weight: 600; }
.work-groups { display: flex; flex-direction: column; gap: 17px; }
.date-group { border: 1px solid #dce5f1; border-radius: 12px; overflow: hidden; }
.date-group > summary { display: flex; align-items: center; gap: 8px; color: #284b79; font-weight: 750; background: #eff5fd; padding: 10px 15px; cursor: pointer; }
.date-group > summary::marker { color: #3b77c4; }
.group-count { background: #fff; border-radius: 999px; padding: 1px 9px; color: #647b98; border: 1px solid #dae6f3; font-size: 12px; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(202px,1fr)); gap: 14px; padding: 16px; }
.work-card { border: 1px solid #e0e6ef; border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.work-card:hover { border-color: #b8d1f3; box-shadow: 0 6px 18px #17427810; }
.thumbnail { display: grid; place-items: center; width: 100%; aspect-ratio: 1.28/1; background: linear-gradient(130deg,#eff3f8,#e5ebf3); color: #8ba0b6; position: relative; border: 0; padding: 0; overflow: hidden; }
.thumbnail img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.placeholder-icon { font-size: 44px; line-height: 1; opacity: .75; }
.kind { position: absolute; right: 9px; top: 9px; background: #26374edb; color: #fff; border-radius: 5px; padding: 2px 7px; font-size: 12px; }
.card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.work-name { color: #27384f; font-weight: 740; overflow-wrap: anywhere; line-height: 1.4; margin: 0 0 8px; }
.metadata { color: #8290a2; font-size: 13px; }
.card-actions { display: flex; gap: 7px; margin-top: auto; padding-top: 13px; }
.card-actions > * { flex: 1 1 0; text-align: center; border-radius: 7px; border: 1px solid #c5d7ee; font-size: 13px; padding: 8px 6px; text-decoration: none; }
.view-btn { color: #1b5db9; background: #f1f6fd; }
.download-btn { color: #fff; background: #1b5db9; border-color: #1b5db9 !important; }
.work-list { display: flex; flex-direction: column; gap: 7px; padding: 12px; }
.work-row { border: 1px solid #e0e6ee; border-radius: 9px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-row .work-name { margin: 0; }
.row-actions { display: flex; gap: 8px; flex: none; }
.row-actions > * { padding: 7px 13px; text-decoration: none; border: 1px solid #c5d7ee; border-radius: 7px; font-size: 13px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; padding-top: 25px; font-size: 14px; color: #64748b; }
.pagination button { min-width: 100px; }
footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 12px 3px; color: #929cad; font-size: 12px; }
dialog { width: min(95vw, 650px); max-height: 92dvh; border: 0; border-radius: 17px; box-shadow: 0 24px 90px #17294370; color: #26384e; padding: 22px; }
dialog::backdrop { background: #0b1832ab; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.dialog-head h2 { font-size: 19px; margin: 0 0 12px; overflow-wrap: anywhere; }
.close-button { border: none; background: #f0f4f9; border-radius: 8px; padding: 1px 11px; font-size: 26px; color: #6d7b8c; }
.dialog-media { background: #f0f3f8; display: grid; place-items: center; min-height: 200px; max-height: 45dvh; border-radius: 10px; color: #95a5b8; overflow: hidden; }
.dialog-media img { display: block; max-height: 65dvh; max-width: 100%; object-fit: contain; }
.dialog-media video { display: block; width: 100%; max-height: 65dvh; background: #111827; object-fit: contain; }
.dialog-media:has(video) { background: #111827; }
.dialog-media { max-height: 65dvh; }
dialog { width: min(96vw, 850px); }
.dialog-description { color: #65758b; font-size: 14px; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 7px 15px; color: #485a70; font-size: 14px; }
.detail-list dt { color: #8292a7; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.link-button { display: inline-block; text-align: center; }
.subtle-note { color: #8997a7; font-size: 13px; }
@media (max-width: 760px) {
  .shell { padding: 16px 12px; }
  .content { padding: 16px 12px; }
  .site-header { align-items: flex-start; }
  .header-side { display: none; }
  .brand-icon { width: 54px; height: 54px; font-size: 28px; border-radius: 14px; }
  .brand { gap: 12px; }
  .search-bar { grid-template-columns: 1fr 145px; }
  .search-bar .primary-button { grid-column: 1 / -1; }
  .date-filter label { flex: 1 1 36%; }
  .date-filter label input { width: 100%; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 9px; padding: 9px; }
  .work-row { flex-direction: column; align-items: stretch; }
  .row-actions > * { flex: 1; text-align: center; }
}
@media (max-width: 420px) {
  .search-bar { grid-template-columns: 1fr; }
  .search-bar .primary-button { grid-column: auto; }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-actions { flex-direction: column; }
  .pagination { gap: 10px; }
  .pagination button { min-width: 0; }
}

/* China Gallery Phase 4: password deletion is hidden until explicitly enabled. */
.danger-button { color: #fff; background: #b53434; border: 1px solid #a42a2a; border-radius: 9px; padding: 9px 14px; font-weight: 650; }
.danger-button:hover:not(:disabled) { background: #942c2c; }
.delete-work-form { margin-top: 16px; padding: 14px; border: 1px solid #edb9b9; background: #fff8f8; border-radius: 10px; }
.delete-work-form p { margin: 0 0 10px; }
.delete-work-form label { display: block; font-weight: 650; margin-bottom: 6px; }
.delete-work-form input { width: 100%; }

/* China Gallery: password-protected thumbnail update. */
.poster-work-form { margin-top: 16px; padding: 14px; border: 1px solid #c4d7ee; background: #f6faff; border-radius: 10px; }
.poster-work-form p { margin: 0 0 10px; }
.poster-work-form label { display: block; font-weight: 650; margin: 10px 0 6px; }
.poster-work-form input { width: 100%; }
