:root {
  --bg: #fff6f9;
  --bg-strong: #ffe2eb;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.74);
  --text: #39242d;
  --muted: #8c6474;
  --primary: #e83f83;
  --primary-strong: #c51f67;
  --rose: #ff7caf;
  --peach: #ffc0a7;
  --lavender: #b78cff;
  --line: rgba(232, 63, 131, 0.18);
  --shadow: 0 24px 70px rgba(197, 31, 103, 0.15);
  --radius: 8px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 192, 167, 0.34), transparent 32rem),
    linear-gradient(135deg, #fff7fa 0%, #ffe7f0 48%, #fffaf3 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(232, 63, 131, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 63, 131, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(232, 63, 131, 0.12);
  background: rgba(255, 246, 249, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.header-actions,
.gallery-toolbar,
.manage-head,
.upload-actions,
.check-row,
.gallery-stats {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0 36%, transparent 36%),
    linear-gradient(135deg, var(--rose), var(--primary));
  box-shadow: 0 10px 30px rgba(232, 63, 131, 0.24);
}

.header-actions {
  gap: 10px;
}

.soft-link,
.ghost-button,
.icon-button,
.pill-toggle,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.soft-link,
.ghost-button,
.pill-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(232, 63, 131, 0.18);
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.64);
}

.ghost-button {
  color: var(--muted);
}

.icon-button {
  display: grid;
  width: 42px;
  place-items: center;
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(232, 63, 131, 0.16);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  padding: 0 20px;
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, var(--primary), #ff6aa3);
  box-shadow: 0 16px 36px rgba(232, 63, 131, 0.25);
}

.soft-link:hover,
.ghost-button:hover,
.icon-button:hover,
.pill-toggle:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.gallery-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(36px, 7vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.gallery-stats {
  gap: 10px;
  min-width: 132px;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.gallery-stats strong {
  font-size: 34px;
  line-height: 1;
}

.gallery-stats span,
.form-message,
.drop-zone small,
.photo-meta,
.photo-card p,
.empty-state p,
.panel-copy p,
.admin-card-meta,
.admin-card textarea,
.admin-card input {
  color: var(--muted);
}

.gallery-toolbar {
  position: sticky;
  top: 82px;
  z-index: 10;
  gap: 10px;
  margin-bottom: 22px;
  padding: 10px;
  border: 1px solid rgba(232, 63, 131, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 246, 249, 0.76);
  backdrop-filter: blur(18px);
}

.search-shell {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 220px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(232, 63, 131, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-shell span {
  margin-right: 10px;
  color: var(--primary);
  font-size: 20px;
}

.pill-toggle.is-active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 14px 30px rgba(232, 63, 131, 0.22);
}

.photo-grid {
  column-count: 3;
  column-gap: 16px;
}

.photo-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(57, 36, 45, 0.1);
  cursor: zoom-in;
  break-inside: avoid;
}

.photo-card img {
  display: block;
  width: 100%;
  min-height: 220px;
  object-fit: cover;
  background: var(--bg-strong);
}

.photo-body {
  padding: 14px;
}

.photo-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.photo-card p {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.55;
}

.photo-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(232, 63, 131, 0.88);
  box-shadow: 0 10px 22px rgba(57, 36, 45, 0.16);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 36px;
  text-align: center;
  border: 1px dashed rgba(232, 63, 131, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.empty-art {
  width: 120px;
  height: 90px;
  margin-bottom: 20px;
  border: 8px solid #fff;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, transparent 50%, rgba(232, 63, 131, 0.38) 50%),
    linear-gradient(135deg, var(--peach), var(--rose));
  box-shadow: 0 22px 55px rgba(232, 63, 131, 0.18);
  transform: rotate(-4deg);
}

.lightbox {
  width: min(980px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #1d1117;
  box-shadow: 0 30px 100px rgba(20, 10, 15, 0.5);
}

.lightbox::backdrop {
  background: rgba(45, 18, 31, 0.72);
  backdrop-filter: blur(8px);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #160d12;
}

.lightbox-caption {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 22px;
  color: #fff;
}

.lightbox-caption h2 {
  margin: 0 0 6px;
}

.lightbox-caption p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.download-button,
.lightbox-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #ff6aa3);
  box-shadow: 0 12px 26px rgba(232, 63, 131, 0.2);
}

.download-button {
  margin-top: 4px;
}

.lightbox-download {
  flex: 0 0 auto;
  background: rgba(232, 63, 131, 0.92);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-size: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.admin-main {
  width: min(1120px, calc(100% - 32px));
}

.login-panel,
.admin-workspace {
  display: grid;
  gap: 18px;
}

.login-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  min-height: calc(100vh - 150px);
}

.panel-copy h1,
.upload-panel h1 {
  font-size: clamp(34px, 5vw, 66px);
}

.login-form,
.upload-panel,
.manage-panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.login-form label,
.upload-form label,
.admin-card label {
  display: grid;
  gap: 8px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(232, 63, 131, 0.2);
  border-radius: var(--radius);
  outline: 0;
  background: rgba(255, 255, 255, 0.78);
}

input {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  padding: 12px 13px;
}

input:focus,
textarea:focus {
  border-color: rgba(232, 63, 131, 0.58);
  box-shadow: 0 0 0 4px rgba(232, 63, 131, 0.1);
}

.admin-workspace {
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  align-items: start;
}

.upload-panel,
.manage-panel {
  padding: 20px;
}

.upload-panel {
  position: sticky;
  top: 96px;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.drop-zone {
  min-height: 190px;
  place-items: center;
  padding: 22px;
  text-align: center;
  border: 1px dashed rgba(232, 63, 131, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 124, 175, 0.1), rgba(183, 140, 255, 0.08)),
    rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.drop-zone.is-dragging {
  border-color: var(--primary);
  background: rgba(255, 226, 235, 0.7);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  place-items: center;
  color: #fff;
  font-size: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--lavender));
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  justify-content: flex-start;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.upload-actions {
  gap: 14px;
  flex-wrap: wrap;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
}

.form-message.is-error {
  color: #b1184f;
}

.form-message.is-success {
  color: #16805b;
}

.manage-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.manage-head h2 {
  margin: 0;
}

.count-chip {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255, 226, 235, 0.82);
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(232, 63, 131, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.admin-card img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-strong);
}

.admin-card-body {
  display: grid;
  gap: 10px;
}

.admin-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-card textarea {
  min-height: 72px;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button,
.save-button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

.save-button {
  color: #fff;
  background: var(--primary);
}

.danger-button {
  color: #b1184f;
  background: rgba(177, 24, 79, 0.1);
}

.admin-card-meta {
  margin: 0;
  font-size: 12px;
}

@media (max-width: 880px) {
  .photo-grid {
    column-count: 2;
  }

  .login-panel,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }

  .upload-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  main,
  .admin-main {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .site-header {
    min-height: 64px;
    padding-inline: 11px;
  }

  .brand {
    font-size: 16px;
  }

  .gallery-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  h1 {
    font-size: 42px;
    line-height: 1;
  }

  .gallery-toolbar {
    position: static;
    flex-wrap: wrap;
  }

  .search-shell {
    flex-basis: 100%;
  }

  .photo-grid {
    column-count: 1;
  }

  .field-grid,
  .admin-card,
  .admin-card-fields {
    grid-template-columns: 1fr;
  }

  .admin-card img {
    width: 100%;
    height: 220px;
  }

  .lightbox-caption {
    align-items: flex-start;
    flex-direction: column;
  }
}
