:root {
  color-scheme: light;
  --paper: #f5f1e7;
  --card: #fffcf5;
  --forest: #17392e;
  --text: #20332b;
  --muted: #526257;
  --rule: #d9d3c3;
  --display: 'Songti SC', 'Noto Serif CJK SC', 'STSong', SimSun, serif;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0%, #fcf8ef 2%, var(--paper) 70%);
  min-height: 100svh;
  border-top: 5px solid var(--forest);
}

.page { width: min(100% - 36px, 470px); margin: 0 auto; padding-block: clamp(38px, 11vh, 108px) 52px; }
.claim-shell {
  position: relative;
  padding: clamp(23px, 6vw, 41px);
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 35px #40331d12;
}
.claim-shell::before { content: ''; position: absolute; width: 52px; height: 4px; left: clamp(23px, 6vw, 41px); top: -1px; background: #ad643b; }
.class-label { margin: 0 0 8px; color: var(--forest); font-size: .92rem; font-weight: 650; letter-spacing: .12em; }
h1 { margin: 0; font: bold clamp(2rem, 8.5vw, 2.8rem)/1.25 var(--display); color: var(--forest); letter-spacing: .02em; }
.claim-heading > p:last-child { margin: 13px 0 27px; line-height: 1.6; color: var(--muted); }
.claim { display: grid; border-top: 1px solid var(--rule); padding-top: 21px; }
label { display: block; margin-bottom: 8px; font-size: .93rem; font-weight: 650; }
input {
  margin: 0 0 19px; width: 100%; height: 50px;
  border-radius: 3px; border: 1px solid #9d9c88; background: #fffefa;
  color: var(--text); padding: 0 12px; font: inherit; font-size: 1rem;
}
input::placeholder { color: #64675d; }
:focus-visible { outline: 3px solid #a55330; outline-offset: 3px; }
.privacy, .save-hint { color: var(--muted); font-size: .84rem; line-height: 1.65; }
.privacy { margin: -2px 0 20px; }
.form-error { background: #faeae2; color: #81361e; margin: 0 0 18px; padding: 10px 12px; line-height: 1.5; font-size: .92rem; }
.button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 50px; gap: 8px;
  color: #fffefa; background: var(--forest); text-decoration: none; text-align: start;
  border: 0; border-radius: 3px; padding: 12px 16px; font: inherit; font-weight: 650; cursor: pointer;
}
.button:hover { background: #245142; }
.button[hidden] { display: none; }
.button span { font-size: 1.25rem; }
.demo-accounts { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; color: var(--muted); margin: 17px 0 0; font-size: .78rem; }
.demo-accounts dd { margin: 0; }
.demo-accounts code { user-select: all; }
.albums { width: min(100% - 32px, 960px); padding-top: clamp(26px, 5vw, 56px); }
.gallery-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 21px; padding-bottom: 17px; }
.gallery-count { color: var(--muted); margin: 10px 0 0; font-size: .91rem; line-height: 1.5; }
.leave, .photo-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--forest); background: transparent; border: 0; font: inherit; font-size: .88rem; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; cursor: pointer; }
.leave { padding-inline: 5px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.print { min-width: 0; padding: 5px; border: 1px solid var(--rule); background: var(--card); }
.print-image { display: block; aspect-ratio: 4 / 5; background: #e7e5d9; }
.print-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.print-save { display: flex; justify-content: center; align-items: center; min-height: 44px; color: var(--forest); font-size: .87rem; font-weight: 650; text-decoration: none; }
.print-save:hover { text-decoration: underline; }
.photo-nav { display: flex; align-items: center; justify-content: space-between; color: var(--muted); margin-bottom: 10px; }
.save-panel { max-width: 440px; margin: 0 auto 12px; }
.save-hint { margin: 8px 0 0; }
.full-photo { margin: 0 auto 13px; display: grid; place-items: center; padding: 7px; background: var(--card); border: 1px solid var(--rule); }
.full-photo img { display: block; width: auto; max-width: 100%; max-height: 72vh; object-fit: contain; }
.photo-file { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--muted); text-underline-offset: 3px; font-size: .87rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (min-width: 620px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
