:root {
  --blue-950: #071b42;
  --blue-900: #0b2454;
  --blue-800: #103471;
  --blue-700: #164b9e;
  --blue-600: #1769e0;
  --blue-500: #2c7df0;
  --blue-100: #e8f1ff;
  --blue-50: #f3f7ff;
  --ink: #14213d;
  --muted: #6d7b95;
  --line: #e4eaf3;
  --paper: #f4f7fb;
  --card: #ffffff;
  --green: #16a36a;
  --green-soft: #e5f8f0;
  --amber: #e58a08;
  --amber-soft: #fff4dc;
  --purple: #7857d8;
  --purple-soft: #f1edff;
  --red: #e14848;
  --red-soft: #ffeded;
  --shadow: 0 18px 48px rgba(12, 39, 88, 0.08);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

/* Public delivery album — neutral event presentation */
.gallery-reference {
  min-width: 320px;
  color: #222;
  background: #f4f4f5;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
}

.album-splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #101828;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.album-splash.dismissed {
  visibility: hidden;
  opacity: 0;
}

.album-splash-image,
.album-splash-shade {
  position: absolute;
  inset: 0;
}

.album-splash-image {
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
}

.album-splash-shade {
  background:
    linear-gradient(180deg, rgba(8, 18, 38, 0.25), rgba(7, 15, 31, 0.78)),
    linear-gradient(90deg, rgba(12, 37, 85, 0.24), transparent);
}

.album-splash-content {
  position: relative;
  width: min(86vw, 680px);
  padding: 56px 30px;
  text-align: center;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.36);
}

.album-splash-content p {
  margin: 0 0 19px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

.album-splash-content h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.16;
}

.album-splash-content span {
  display: block;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.album-splash-content button {
  min-width: 148px;
  margin-top: 38px;
  padding: 12px 28px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.album-notice {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(40px, calc((100vw - 1440px) / 2));
  color: #4c5565;
  background: #edf2fb;
  font-size: 12px;
}

.album-notice button {
  padding: 5px 11px;
  color: #3b74de;
  border: 0;
  background: transparent;
  font-weight: 700;
}

.album-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  background: #fff;
}

.album-overview {
  display: grid;
  grid-template-columns: minmax(420px, 42%) minmax(0, 1fr);
  gap: 34px;
  padding: 34px 40px 28px;
}

.album-cover {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  background: #e6e9ef;
  cursor: zoom-in;
}

.album-cover-image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: transform 0.35s ease;
}

.album-cover:hover .album-cover-image {
  transform: scale(1.02);
}

.album-cover-search {
  position: absolute;
  top: 16px;
  right: 17px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  font-size: 23px;
}

.album-summary {
  min-width: 0;
  padding: 2px 0;
}

.album-summary h1 {
  max-width: 760px;
  margin: 0 0 14px;
  color: #202124;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.album-count {
  margin: 0 0 19px;
  color: #4f7bd9;
  font-size: 14px;
}

.album-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #3f434b;
  font-size: 14px;
}

.album-summary dl div {
  display: flex;
  gap: 8px;
}

.album-summary dt,
.album-summary dd {
  margin: 0;
}

.album-introduction {
  max-width: 720px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid #eceef2;
}

.album-introduction strong {
  color: #30343b;
  font-size: 14px;
}

.album-introduction p {
  margin: 8px 0 0;
  color: #717782;
  font-size: 13px;
  line-height: 1.7;
}

.album-controls {
  min-height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid #dddfe4;
  background: #fff;
}

.album-tabs {
  display: flex;
  gap: 38px;
}

.album-tab {
  position: relative;
  min-height: 62px;
  padding: 0;
  color: #4d5159;
  border: 0;
  background: transparent;
  font-size: 15px;
}

.album-tab.active {
  color: #3477e5;
  font-weight: 700;
}

.album-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 2px;
  background: #3477e5;
}

.album-sort {
  margin-bottom: 14px;
  padding: 8px 12px;
  color: #666b74;
  border: 1px solid #e1e3e8;
  border-radius: 3px;
  background: #fff;
  font-size: 12px;
}

.album-date-bar {
  display: flex;
  gap: 18px;
  min-height: 65px;
  align-items: center;
  padding: 0 40px;
  overflow-x: auto;
  border-bottom: 1px solid #eceef1;
  background: #fff;
  scrollbar-width: none;
}

.album-date-bar::-webkit-scrollbar {
  display: none;
}

.album-date-chip {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 41px;
  padding: 8px 16px;
  color: #6e737c;
  border: 0;
  border-radius: 7px;
  background: #f5f5f6;
  font-size: 13px;
}

.album-date-chip.active {
  color: #3f74d8;
  background: #eaf0ff;
}

.album-photos {
  min-height: 460px;
  padding: 24px 40px 54px;
  background: #f5f5f6;
}

.gallery-reference .gallery-grid {
  column-count: 4;
  column-gap: 14px;
}

.gallery-reference .photo {
  margin-bottom: 14px;
  border-radius: 0;
  box-shadow: none;
}

.gallery-reference .gallery-loading {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.album-tools {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid #e1e4e9;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px rgba(25, 35, 55, 0.13);
}

.album-tools button {
  min-width: 68px;
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 6px 9px;
  color: #535a66;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.album-tools button span {
  font-size: 20px;
}

.album-tools .album-slideshow {
  min-width: 108px;
  display: flex;
  gap: 8px;
  justify-content: center;
  color: #fff;
  border-radius: 3px;
  background: #3477e5;
  font-size: 13px;
}

.album-footer {
  padding: 30px 20px 92px;
  color: #a0a4ad;
  background: #f4f4f5;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.user-card {
  padding: 20px;
  border: 1px solid #e1e7f0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 39, 78, 0.05);
}

.user-card.inactive {
  opacity: 0.6;
}

.user-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-main div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-card-main strong,
.user-card-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-main span {
  color: #7b879a;
  font-size: 12px;
}

.user-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, #164b9e, #2c7df0);
  font-size: 18px;
  font-weight: 800;
}

.user-role-list {
  min-height: 56px;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

.user-role-list span {
  padding: 5px 9px;
  color: #2361bd;
  border-radius: 999px;
  background: #eaf2ff;
  font-size: 11px;
  font-weight: 700;
}

.user-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #edf0f5;
}

.user-enabled,
.user-disabled {
  font-size: 11px;
  font-weight: 750;
}

.user-enabled {
  color: #0a8a5b;
}

.user-disabled {
  color: #a26a22;
}

.role-picker {
  display: grid;
  gap: 10px;
  margin: 17px 0;
  padding: 16px;
  border: 1px solid #dfe6f0;
  border-radius: 14px;
}

.role-picker legend {
  padding: 0 7px;
  color: #34435a;
  font-weight: 800;
}

.role-picker label,
.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #526078;
  font-size: 13px;
}

.role-picker input,
.switch-row input {
  width: 17px;
  height: 17px;
}

.role-portal {
  min-height: 100vh;
  background: #f4f7fb;
}

.role-portal-top {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  color: #172642;
  border-bottom: 1px solid #dfe6f0;
  background: #fff;
}

.role-portal-top div {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.role-portal-top strong {
  font-size: 18px;
}

.role-portal-top span {
  color: #8390a3;
  font-size: 12px;
}

.role-portal-main {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

.role-event-grid {
  margin-top: 24px;
}

.role-event-cover {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 80% 20%, rgba(88, 170, 255, 0.6), transparent 30%),
    linear-gradient(135deg, #0a2a63, #236fe0);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

@media (max-width: 760px) {
  .album-notice {
    min-height: 38px;
    padding: 0 14px;
    font-size: 10px;
  }

  .album-overview {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 14px 14px 23px;
  }

  .album-cover {
    min-height: 0;
    aspect-ratio: 18 / 9;
  }

  .album-summary h1 {
    margin-bottom: 9px;
    font-size: 27px;
  }

  .album-introduction {
    margin-top: 16px;
  }

  .album-controls {
    min-height: 57px;
    padding: 0 14px;
  }

  .album-tabs {
    gap: 31px;
  }

  .album-tab {
    min-height: 56px;
  }

  .album-date-bar {
    min-height: 58px;
    gap: 10px;
    padding: 0 14px;
  }

  .album-date-chip {
    min-width: 72px;
    min-height: 37px;
  }

  .album-photos {
    padding: 10px 7px 40px;
  }

  .gallery-reference .gallery-grid {
    column-count: 2;
    column-gap: 7px;
  }

  .gallery-reference .photo {
    margin-bottom: 7px;
  }

  .gallery-reference .gallery-loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .album-tools {
    right: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: max-content;
    transform: translateX(50%);
  }

  .album-tools button:not(.album-slideshow) {
    display: none;
  }

  .album-splash-content {
    align-self: end;
    padding-bottom: max(92px, calc(env(safe-area-inset-bottom) + 70px));
  }

  .album-splash-content h1 {
    font-size: 38px;
  }

  .album-splash-content span {
    font-size: 13px;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }

  .role-portal-main {
    width: min(92vw, 680px);
    padding-top: 28px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(145deg, #4a9bff 0%, #1769e0 56%, #0b367d 100%);
  box-shadow: 0 7px 17px rgba(23, 105, 224, 0.28);
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 9px;
  top: 9px;
  border: 3px solid #fff;
  border-radius: 5px;
  transform: rotate(45deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 15px;
  top: 15px;
  border-radius: 50%;
  background: #fff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-500), var(--blue-800));
  font-size: 13px;
  font-weight: 800;
}

.shell {
  width: min(1220px, calc(100vw - 48px));
  margin: 40px auto 72px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 26px;
  align-items: stretch;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1;
  letter-spacing: -0.055em;
}

h2 {
  letter-spacing: -0.035em;
}

.eyebrow {
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.primary,
.secondary,
.ghost,
.danger,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 750;
  text-decoration: none;
  transition: 0.18s ease;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.2);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 23px rgba(23, 105, 224, 0.27);
}

.secondary {
  color: var(--blue-700);
  background: var(--blue-100);
}

.secondary:hover,
.ghost:hover {
  background: #dce9fc;
}

.ghost {
  color: var(--ink);
  background: #f4f6f9;
  border: 1px solid var(--line);
}

.danger {
  color: var(--red);
  background: var(--red-soft);
}

.small-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #4c5c78;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(44, 125, 240, 0.12);
}

.flow {
  display: grid;
  gap: 17px;
}

.flow-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
}

.flow-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue-600);
  background: var(--blue-100);
  font-weight: 900;
}

.flow-item strong {
  display: block;
  margin: 2px 0 5px;
}

.flow-item span {
  color: var(--muted);
}

.result {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border-radius: 13px;
  color: #126b4d;
  background: var(--green-soft);
}

.result a {
  color: inherit;
  font-weight: 800;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(500px, 1.15fr);
  background: #fff;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 100px);
}

.login-panel .brand {
  margin-bottom: 60px;
}

.login-form {
  width: min(410px, 100%);
}

.login-form h1 {
  font-size: 43px;
}

.login-form .field {
  margin-top: 17px;
}

.login-submit {
  width: 100%;
  margin-top: 23px;
}

.login-error {
  min-height: 18px;
  margin: 13px 0 -7px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.45;
}

.login-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: end;
  margin: 16px;
  padding: clamp(36px, 6vw, 76px);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 70% 22%, rgba(100, 177, 255, 0.55), transparent 22%),
    radial-gradient(circle at 15% 80%, rgba(31, 99, 202, 0.7), transparent 27%),
    linear-gradient(145deg, #071a43 0%, #0c3272 48%, #1769e0 100%);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.login-visual::before {
  width: 420px;
  height: 420px;
  right: -110px;
  top: -100px;
}

.login-visual::after {
  width: 620px;
  height: 620px;
  right: -210px;
  top: -200px;
}

.login-copy {
  position: relative;
  z-index: 1;
  width: min(590px, 100%);
}

.login-copy h2 {
  margin-bottom: 18px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.login-copy p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.login-stat {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.login-stat strong {
  display: block;
  margin-bottom: 5px;
  font-size: 22px;
}

/* Admin application shell */
.admin-body {
  background: #f4f7fb;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 25px 17px 18px;
  color: #d6e3fb;
  background: linear-gradient(180deg, var(--blue-950), #0a285d 64%, #0d3474);
}

.sidebar .brand {
  padding: 0 9px 26px;
  color: #fff;
}

.sidebar .brand small {
  color: #91a9d2;
}

.nav-label {
  margin: 12px 12px 7px;
  color: #718dbd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 0 12px;
  color: #abc0e3;
  border-radius: 11px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(87, 145, 241, 0.17);
}

.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #a8c9ff;
  background: rgba(117, 166, 246, 0.12);
  font-size: 13px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 11px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.sidebar-user small {
  display: block;
  margin-top: 2px;
  color: #7994c2;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 24;
  backdrop-filter: blur(16px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb strong {
  color: var(--ink);
}

.admin-content {
  padding: 28px 30px 54px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin-bottom: 7px;
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.page-heading p {
  margin: 0;
  font-size: 14px;
}

.heading-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(20, 49, 95, 0.04);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  right: -28px;
  top: -28px;
  border-radius: 50%;
  background: var(--blue-100);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin-top: 9px;
  font-size: 29px;
  letter-spacing: -0.04em;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  width: min(270px, 36vw);
  min-height: 38px;
}

.status-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 11px;
  background: #edf1f7;
  overflow-x: auto;
}

.status-tab {
  min-height: 32px;
  padding: 6px 12px;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.status-tab.active {
  color: var(--blue-700);
  background: #fff;
  box-shadow: 0 2px 8px rgba(19, 49, 99, 0.08);
}

.bulk-bar {
  position: sticky;
  top: 81px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 14px;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(120deg, var(--blue-900), var(--blue-700));
  box-shadow: 0 12px 30px rgba(8, 42, 98, 0.22);
}

.bulk-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-actions button {
  min-height: 31px;
  padding: 6px 10px;
  color: #e9f2ff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 700;
}

.bulk-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.empty-card {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 35px;
  text-align: center;
  border: 1px dashed #cbd6e8;
  border-radius: 17px;
  background: #fff;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--blue-600);
  border-radius: 18px;
  background: var(--blue-100);
  font-size: 25px;
}

/* Event dashboard */
.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(14, 44, 94, 0.045);
  transition: 0.18s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(14, 44, 94, 0.1);
}

.event-cover {
  position: relative;
  height: 130px;
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 17%, rgba(105, 180, 255, 0.78), transparent 19%),
    linear-gradient(130deg, #0a2457, #1769e0);
}

.event-cover::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -15px;
  bottom: -48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.event-cover small {
  color: #acd0ff;
}

.event-cover h3 {
  margin: 22px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.event-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.event-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55e8a8;
}

.event-card-body {
  padding: 17px;
}

.event-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 15px;
}

.event-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.event-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.event-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.event-links > * {
  min-width: 0;
}

.event-links .primary {
  grid-column: 1 / -1;
}

/* Photo workbench */
.photo-work-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}

.work-photo {
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #dfe6f0;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.work-photo.selected {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(44, 125, 240, 0.15);
}

.work-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: 0.25s ease;
}

.work-photo:hover img {
  transform: scale(1.035);
}

.photo-check {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: transparent;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 7px;
  background: rgba(12, 31, 69, 0.36);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 900;
}

.work-photo.selected .photo-check {
  color: #fff;
  border-color: var(--blue-500);
  background: var(--blue-500);
}

.status-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 5px 7px;
  color: #fff;
  border-radius: 7px;
  background: rgba(7, 27, 66, 0.75);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 750;
}

.status-badge[data-status="featured"] {
  background: rgba(120, 87, 216, 0.92);
}

.status-badge[data-status="retouching"] {
  background: rgba(229, 138, 8, 0.94);
}

.status-badge[data-status="review"] {
  background: rgba(25, 123, 190, 0.94);
}

.status-badge[data-status="published"] {
  background: rgba(22, 163, 106, 0.94);
}

.status-badge[data-status="hidden"] {
  background: rgba(77, 88, 105, 0.93);
}

.photo-meta {
  position: absolute;
  inset: auto 0 0;
  padding: 26px 9px 8px;
  color: #fff;
  background: linear-gradient(transparent, rgba(4, 17, 44, 0.78));
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.18s;
}

.work-photo:hover .photo-meta {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 380px);
  background: rgba(3, 13, 35, 0.78);
  backdrop-filter: blur(8px);
}

.detail-preview {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 35px;
}

.detail-preview img {
  max-width: 100%;
  max-height: calc(100vh - 70px);
  border-radius: 11px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.42);
}

.detail-panel {
  overflow-y: auto;
  padding: 25px;
  background: #fff;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: start;
  margin-bottom: 22px;
}

.detail-head h3 {
  margin-bottom: 5px;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 20px 0;
  border-top: 1px solid var(--line);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.retouch-box {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--blue-50);
}

.retouch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.retouch-head strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.retouch-head span {
  display: block;
  font-size: 11px;
}

.retouch-tools {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.retouch-tools > * {
  flex: 1;
}

.retouch-progress {
  min-height: 16px;
  margin: 10px 0 0;
  font-size: 11px;
}

.version-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.version-item {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px solid #dbe6f7;
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.version-item:hover {
  border-color: var(--blue-500);
}

.version-item.active {
  border-color: var(--blue-500);
  box-shadow: inset 3px 0 0 var(--blue-500);
}

.version-number {
  display: grid;
  place-items: center;
  min-height: 25px;
  color: var(--blue-700);
  border-radius: 7px;
  background: var(--blue-100);
  font-size: 11px;
  font-weight: 850;
}

.version-item strong {
  overflow: hidden;
  display: block;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-item small {
  color: var(--muted);
  font-size: 9px;
}

.version-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6px;
}

.version-actions button:disabled {
  color: var(--green);
  background: var(--green-soft);
  opacity: 1;
  cursor: default;
}

.delivery-box {
  display: grid;
  gap: 12px;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid #c7daf8;
  border-radius: 11px;
  background: #fff;
}

.delivery-box strong {
  font-size: 13px;
}

.delivery-box p {
  margin: 4px 0 7px;
  font-size: 11px;
  line-height: 1.55;
}

.delivery-link {
  overflow: hidden;
  display: block;
  color: var(--blue-700);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
}

/* Upload console */
.studio-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.studio-head h1,
.gallery-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.upload-zone {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed #bdcce2;
  border-radius: 19px;
  background: #fff;
  transition: 0.2s ease;
}

.upload-zone.drag {
  border-color: var(--blue-500);
  background: var(--blue-50);
  transform: scale(0.995);
}

.upload-zone input {
  display: none;
}

.upload-symbol {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 19px;
  color: var(--blue-600);
  background: var(--blue-100);
  font-size: 29px;
  font-weight: 900;
}

.studio-info {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
}

.info-step {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 10px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-step b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--blue-700);
  border-radius: 8px;
  background: var(--blue-100);
}

.queue {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 66px;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.queue-item strong {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
}

.progress > i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), #5aa8ff);
  transition: width 0.2s;
}

/* Public gallery */
.gallery-body {
  color: #101b30;
  background:
    radial-gradient(circle at 12% -10%, rgba(65, 139, 255, 0.12), transparent 28%),
    #f3f6fb;
}

.gallery-topbar {
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1460px) / 2));
  border-bottom-color: rgba(220, 227, 239, 0.85);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 28px rgba(16, 39, 78, 0.04);
}

.gallery-top-actions,
.gallery-live-state,
.gallery-share-button {
  display: inline-flex;
  align-items: center;
}

.gallery-top-actions {
  gap: 12px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
}

.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 163, 106, 0.12);
}

.gallery-live-state {
  gap: 8px;
  color: #5d6b83;
  font-size: 13px;
  font-weight: 750;
}

.gallery-live-state i,
.gallery-auto-note i,
.gallery-cover-badge i,
.gallery-waiting i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9aa7ba;
}

.gallery-live-state[data-state="online"] {
  color: #07845a;
}

.gallery-live-state[data-state="online"] i,
.gallery-auto-note i,
.gallery-cover-badge i,
.gallery-waiting i {
  background: #16b879;
  box-shadow: 0 0 0 5px rgba(22, 184, 121, 0.12);
}

.gallery-live-state[data-state="connecting"] i,
.gallery-live-state[data-state="reconnecting"] i {
  background: #e9a11b;
  box-shadow: 0 0 0 5px rgba(233, 161, 27, 0.12);
  animation: gallery-pulse 1.4s ease-in-out infinite;
}

.gallery-live-state[data-state="offline"] i {
  background: #e05252;
}

.gallery-share-button {
  min-height: 38px;
  gap: 7px;
  padding: 8px 14px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f82f6, #145ac7);
  box-shadow: 0 8px 20px rgba(20, 90, 199, 0.22);
  font-size: 13px;
  font-weight: 800;
}

.gallery-share-button svg,
.lightbox-download svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gallery-shell {
  width: min(1500px, 100%);
  margin: 0 auto 64px;
}

.gallery-cover {
  position: relative;
  isolation: isolate;
  min-height: clamp(340px, 45vw, 520px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 22px 20px 0;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 17%, rgba(117, 188, 255, 0.52), transparent 23%),
    radial-gradient(circle at 67% 72%, rgba(35, 122, 236, 0.5), transparent 28%),
    linear-gradient(135deg, #071a3e 0%, #123e83 46%, #1769d9 100%);
  box-shadow: 0 26px 70px rgba(9, 38, 87, 0.2);
}

.gallery-cover::before,
.gallery-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.gallery-cover::before {
  width: 370px;
  height: 370px;
  right: -80px;
  top: -130px;
}

.gallery-cover::after {
  width: 220px;
  height: 220px;
  right: 160px;
  top: -100px;
}

.gallery-cover-image,
.gallery-cover-shade {
  position: absolute;
  inset: 0;
}

.gallery-cover-image {
  z-index: -3;
  background-position: center 35%;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s ease;
}

.gallery-cover.has-cover .gallery-cover-image {
  opacity: 1;
}

.gallery-cover-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(4, 15, 39, 0.82), rgba(4, 15, 39, 0.2) 68%),
    linear-gradient(0deg, rgba(3, 11, 30, 0.82), transparent 64%);
}

.gallery-cover-content {
  width: min(920px, 100%);
  padding: clamp(32px, 6vw, 76px);
  text-shadow: 0 2px 25px rgba(0, 0, 0, 0.22);
}

.gallery-cover-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(5, 23, 58, 0.3);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.gallery-cover h1 {
  max-width: 18ch;
  margin: 0 0 15px;
  color: #fff;
  font-size: clamp(34px, 5.8vw, 70px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.gallery-cover-content > p {
  max-width: 58ch;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.7;
}

.gallery-cover-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 700;
}

.meta-divider {
  width: 1px;
  height: 13px;
  background: rgba(255, 255, 255, 0.32);
}

.gallery-content {
  padding: 46px 20px 0;
}

.gallery-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 23px;
}

.gallery-section-head h2 {
  margin: 5px 0 0;
  color: #14213d;
  font-size: clamp(26px, 3vw, 38px);
}

.gallery-auto-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 4px 4px 0;
  color: #6a7890;
  font-size: 13px;
  font-weight: 700;
}

.gallery-auto-note i {
  width: 6px;
  height: 6px;
}

.category-bar {
  display: flex;
  gap: 8px;
  margin: -3px 0 20px;
  padding: 3px 2px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-chip {
  min-height: 38px;
  padding: 8px 17px;
  color: #66738a;
  border: 1px solid #dce4ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
  transition: 0.2s ease;
}

.category-chip.active {
  color: #fff;
  border-color: #1769e0;
  background: linear-gradient(135deg, #2d81f5, #1763d1);
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.2);
}

.gallery-grid {
  column-count: 4;
  column-gap: 12px;
}

.photo {
  --photo-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  min-height: 90px;
  margin: 0 0 12px;
  padding: 0;
  border-radius: 14px;
  background: #e1e8f2;
  break-inside: avoid;
  cursor: zoom-in;
  box-shadow: 0 7px 22px rgba(15, 38, 77, 0.07);
  transform: translateZ(0);
}

.photo::before {
  content: "";
  display: block;
  aspect-ratio: var(--photo-ratio);
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.photo.loaded img {
  opacity: 1;
}

.photo-shimmer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      100deg,
      rgba(228, 235, 244, 0) 20%,
      rgba(255, 255, 255, 0.7) 48%,
      rgba(228, 235, 244, 0) 76%
    ),
    #e4eaf2;
  background-size: 220% 100%;
  animation: gallery-shimmer 1.45s linear infinite;
}

.photo.loaded .photo-shimmer {
  opacity: 0;
  animation: none;
}

.photo-hover {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(3, 15, 38, 0.38);
  opacity: 0;
  transform: translateY(5px);
  backdrop-filter: blur(10px);
  transition: 0.22s ease;
}

.photo-hover svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.photo:hover img {
  transform: scale(1.035);
}

.photo:hover .photo-hover,
.photo:focus-visible .photo-hover {
  opacity: 1;
  transform: none;
}

.photo:focus-visible {
  outline: 3px solid rgba(44, 125, 240, 0.42);
  outline-offset: 3px;
}

.photo.image-error::after {
  content: "照片载入中";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7c899e;
  background: #e8edf4;
  font-size: 12px;
}

.photo.fresh {
  animation: arrive 0.55s ease-out;
  box-shadow: 0 0 0 3px rgba(44, 125, 240, 0.2),
    0 12px 32px rgba(15, 62, 134, 0.15);
}

.gallery-loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-skeleton {
  height: 230px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(
      100deg,
      rgba(227, 234, 244, 0) 20%,
      rgba(255, 255, 255, 0.9) 48%,
      rgba(227, 234, 244, 0) 76%
    ),
    #e3eaf3;
  background-size: 220% 100%;
  animation: gallery-shimmer 1.45s linear infinite;
}

.gallery-skeleton.tall {
  height: 320px;
}

.gallery-skeleton.wide {
  height: 185px;
}

.gallery-empty {
  display: grid;
  min-height: 350px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.gallery-state-card {
  width: min(480px, 100%);
  padding: 46px 32px;
  border: 1px solid #e0e7f1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 55px rgba(17, 42, 83, 0.06);
}

.gallery-state-card h2 {
  margin: 19px 0 10px;
  color: #16233c;
  font-size: 25px;
}

.gallery-state-card p {
  margin: 0 auto 22px;
  color: #758197;
  line-height: 1.7;
}

.gallery-state-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: auto;
  color: #2875df;
  border-radius: 20px;
  background: #eaf2ff;
  font-size: 25px;
  font-weight: 850;
}

.gallery-state-icon svg {
  width: 31px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.gallery-state-icon.warning {
  color: #d68218;
  background: #fff2dc;
}

.gallery-waiting {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #56708e;
  font-size: 12px;
  font-weight: 750;
}

.gallery-waiting i {
  width: 6px;
  height: 6px;
  animation: gallery-pulse 1.5s ease-in-out infinite;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(2, 8, 21, 0.96);
  backdrop-filter: blur(12px);
}

.lightbox-figure {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 104px);
  display: grid;
  place-items: center;
  margin: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 116px);
  border-radius: 10px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.lightbox-top {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  gap: 9px;
}

.lightbox-close,
.lightbox-nav,
.lightbox-download {
  position: absolute;
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
  font-size: 21px;
}

.lightbox-close {
  position: static;
}

.lightbox-download {
  position: static;
  width: auto;
  display: inline-flex;
  gap: 7px;
  border-radius: 22px;
  padding: 0 15px;
  font-size: 13px;
}

.lightbox-nav.prev {
  left: 25px;
}

.lightbox-nav.next {
  right: 25px;
}

.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.gallery-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 150;
  max-width: calc(100vw - 36px);
  padding: 12px 18px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(7, 23, 54, 0.9);
  box-shadow: 0 14px 36px rgba(7, 27, 66, 0.25);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 750;
}

.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 20px 48px;
  color: #44516a;
  font-size: 13px;
  font-weight: 800;
}

.gallery-footer .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.gallery-footer .brand-mark::before {
  width: 10px;
  height: 10px;
  left: 6px;
  top: 6px;
  border-width: 2px;
  border-radius: 3px;
}

.gallery-footer .brand-mark::after {
  width: 4px;
  height: 4px;
  left: 10px;
  top: 10px;
}

.gallery-footer small {
  color: #8b97aa;
  font-weight: 600;
}

@keyframes gallery-shimmer {
  to {
    background-position-x: -220%;
  }
}

@keyframes gallery-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* Modal and toast */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 18, 44, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(480px, 100%);
  padding: 25px;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(6, 27, 67, 0.25);
}

.modal-card h2 {
  margin-bottom: 7px;
}

.modal-fields {
  display: grid;
  gap: 15px;
  margin: 23px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  min-width: 230px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 13px 16px;
  color: #fff;
  border-radius: 11px;
  background: var(--blue-950);
  box-shadow: 0 16px 40px rgba(5, 26, 64, 0.25);
  font-size: 13px;
  animation: toast-in 0.25s ease-out;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1120px) {
  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-work-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    column-count: 3;
  }

  .gallery-loading {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .hero,
  .studio-layout,
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    display: block;
    padding: 13px;
    overflow: hidden;
  }

  .sidebar .brand {
    padding-bottom: 13px;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .sidebar nav {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 39px;
  }

  .admin-topbar {
    top: 0;
    width: 100%;
    max-width: 100vw;
    padding: 0 17px;
  }

  .admin-content {
    width: 100%;
    max-width: 100vw;
    padding: 21px 17px 45px;
    overflow-x: hidden;
  }

  .photo-work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-drawer {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 45vh) auto;
    overflow-y: auto;
  }

  .detail-panel {
    display: block;
    overflow: visible;
  }

  .detail-preview {
    min-height: 240px;
    padding: 16px;
  }

  .detail-preview img {
    max-height: calc(45vh - 32px);
  }

  .gallery-cover {
    min-height: 410px;
    margin-inline: 15px;
  }

  .gallery-cover-content {
    padding: 48px;
  }

  .gallery-content {
    padding-inline: 15px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(92vw, 540px);
    margin-top: 25px;
  }

  .gallery-shell {
    width: 100%;
    margin: 0 auto 36px;
  }

  .topbar {
    padding: 0 4vw;
  }

  .gallery-topbar {
    min-height: 60px;
    padding: 0 13px;
  }

  .gallery-topbar .brand {
    gap: 8px;
    font-size: 14px;
  }

  .gallery-topbar .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 10px;
  }

  .gallery-topbar .brand-mark::before {
    width: 13px;
    height: 13px;
    left: 8px;
    top: 8px;
  }

  .gallery-topbar .brand-mark::after {
    left: 13px;
    top: 13px;
  }

  .gallery-top-actions {
    gap: 9px;
  }

  .gallery-live-state {
    font-size: 11px;
  }

  .gallery-share-button {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 11px;
  }

  .topbar .muted {
    display: none;
  }

  .panel {
    padding: 21px;
  }

  .form-row,
  .studio-head,
  .page-heading,
  .gallery-hero {
    display: grid;
  }

  .page-heading {
    align-items: start;
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .stat-card {
    padding: 17px;
  }

  .heading-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heading-actions > * {
    min-width: 0;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .heading-actions .primary {
    grid-column: 1 / -1;
  }

  .page-heading > div {
    min-width: 0;
  }

  .page-heading p {
    overflow-wrap: anywhere;
  }

  .admin-topbar .top-actions .live {
    display: none;
  }

  .breadcrumb {
    min-width: 0;
  }

  .breadcrumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .photo-work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .toolbar {
    display: grid;
  }

  body[data-page="workbench"] .toolbar-group {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="workbench"] #category-filter {
    width: 100% !important;
  }

  body[data-page="workbench"] #photo-search {
    grid-column: 1 / -1;
  }

  .search-input {
    width: 100%;
  }

  .bulk-bar {
    top: 78px;
    display: grid;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .gallery-cover {
    min-height: 360px;
    margin: 10px 9px 0;
    border-radius: 21px;
    box-shadow: 0 18px 42px rgba(9, 38, 87, 0.18);
  }

  .gallery-cover-content {
    padding: 31px 25px;
  }

  .gallery-cover h1 {
    max-width: 100%;
    font-size: clamp(32px, 10vw, 46px);
  }

  .gallery-cover-content > p {
    max-width: 32ch;
    margin-bottom: 18px;
    line-height: 1.6;
  }

  .gallery-cover-meta {
    flex-wrap: wrap;
    gap: 8px 11px;
    font-size: 12px;
  }

  .gallery-content {
    padding: 34px 9px 0;
  }

  .gallery-section-head {
    align-items: center;
    margin: 0 5px 18px;
  }

  .gallery-section-head h2 {
    font-size: 27px;
  }

  .gallery-auto-note {
    max-width: 95px;
    margin: 0;
    text-align: right;
    font-size: 11px;
  }

  .category-bar {
    margin-inline: 2px;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 7px;
  }

  .photo {
    margin-bottom: 7px;
    border-radius: 9px;
  }

  .photo-hover {
    display: none;
  }

  .gallery-loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .gallery-skeleton {
    height: 170px;
    border-radius: 9px;
  }

  .gallery-skeleton.tall {
    height: 240px;
  }

  .gallery-skeleton.wide {
    height: 135px;
  }

  .gallery-skeleton:nth-child(n + 5) {
    display: none;
  }

  .gallery-empty {
    min-height: 300px;
    padding: 22px 8px;
  }

  .gallery-state-card {
    padding: 38px 22px;
    border-radius: 20px;
  }

  .lightbox-figure {
    max-width: calc(100vw - 18px);
  }

  .lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 110px);
    border-radius: 6px;
  }

  .lightbox-nav {
    top: auto;
    bottom: max(17px, env(safe-area-inset-bottom));
    min-width: 39px;
    min-height: 39px;
  }

  .lightbox-nav.prev {
    left: 18px;
  }

  .lightbox-nav.next {
    right: 18px;
  }

  .lightbox-top {
    right: 14px;
  }

  .lightbox-caption {
    display: none;
  }

  .gallery-footer {
    padding: 25px 16px 40px;
  }

  .gallery-footer small {
    display: none;
  }
}


.album-splash[hidden] { display: none !important; }
