:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #17241d;
  background: #f5f7f3;
  --accent: #246344;
  --muted: #52615a;
  --border: #c6d0c8;
  --paper: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, .gallery:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { width: min(75%, 1190px); margin-inline: auto; }
.topbar { display: flex; align-items: center; min-height: 103px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 17px; text-decoration: none; font-size: 29px; font-weight: 750; }
.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--accent);
  color: var(--paper);
}
.brand-icon svg { width: 66%; height: 66%; }
.content { padding-block: 48px 44px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(34px, 3.8vw, 60px); line-height: 1.2; letter-spacing: -.025em; }
.intro { margin: 11px 0 38px; font-size: clamp(16px, 1.65vw, 25px); }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(230px, 18.7vw, 297px);
  padding: 22px;
  border: 1.5px dashed #68a184;
  border-radius: 16px;
  background: #e6f2e9;
  text-align: center;
}
.drop-zone.is-dragging { border-color: var(--accent); background: #d9ecdf; }
.icon { display: block; }
.icon svg { display: block; width: 100%; height: 100%; }
.upload-icon { width: clamp(44px, 4.3vw, 68px); height: clamp(44px, 4.3vw, 68px); color: var(--accent); }
.drop-zone h2 { margin: 8px 0 15px; font-size: clamp(21px, 2.05vw, 33px); font-weight: 720; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  font-weight: 670;
  line-height: 1.35;
}
.button:hover:not(:disabled) { background: #1d5138; }
.drop-zone .button { min-width: clamp(128px, 11vw, 175px); font-size: clamp(17px, 1.5vw, 24px); }
.button-secondary { background: var(--paper); border-color: var(--border); color: var(--accent); }
.button-secondary:hover:not(:disabled) { background: #edf5ef; }
.formats { margin-top: 13px; color: var(--muted); font-size: clamp(14px, 1.4vw, 22px); }

.feedback { margin-top: 15px; color: var(--accent); }
.feedback.is-error { color: #922b27; }
.result { display: flex; gap: 8px; margin-top: 8px; }
.result input { min-width: 0; flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: #17241d; background: var(--paper); }
.result button { flex-shrink: 0; }
.recent { margin-top: clamp(28px, 3vw, 48px); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(21px, 2vw, 32px); }
.count { color: var(--muted); font-size: clamp(15px, 1.45vw, 23px); font-variant-numeric: tabular-nums; }
.gallery {
  max-height: 450px;
  max-height: min(57dvh, 450px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #a2afa5;
  border-radius: 15px;
  background: var(--paper);
}
.empty { min-height: clamp(150px, 14vw, 225px); display: grid; align-content: center; justify-items: center; row-gap: 9px; color: var(--muted); font-size: clamp(16px, 1.6vw, 25px); }
.picture-icon { width: clamp(45px, 4.7vw, 75px); height: clamp(45px, 4.7vw, 75px); color: #7a8880; }
.image-grid { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(125px, 100%), 1fr)); gap: 12px; }
.tile { overflow: hidden; border: 1px solid #dde6de; border-radius: 8px; }
.thumbnail { display: grid; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #ecf1ed; }
.thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.tile-copy { display: block; width: 100%; min-height: 34px; padding: 4px; border: 0; background: var(--paper); color: var(--accent); font-size: 13px; }
.tile-copy:hover { background: #edf5ef; }
.preview { width: max-content; max-width: min(92vw, 1050px); max-height: 94dvh; padding: 12px; border: 0; border-radius: 12px; background: var(--paper); }
.preview::backdrop { background: rgb(23 36 29 / .68); }
.preview-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.preview img { display: block; max-width: 100%; max-height: 75dvh; object-fit: contain; }

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { min-height: 66px; }
  .brand { gap: 10px; font-size: 19px; }
  .brand-icon { width: 35px; }
  .content { padding-block: 32px; }
  .intro { margin-bottom: 23px; }
  .section-head { margin-bottom: 12px; }
  .gallery { max-height: 390px; max-height: min(55dvh, 390px); }
}
