.site-body {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(circle at top, rgba(85, 146, 255, 0.22), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0c1728 45%, #070d17 100%);
  color: #f3f7ff;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", sans-serif;
  overflow: hidden;
}

.site-body .lightbox {
  z-index: 90;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  transition: opacity 0.35s ease;
}

.site-sidebar-zone {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 100vh;
  height: 100dvh;
  z-index: 60;
}

.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 65;
  width: min(320px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  padding: 18px;
  transform: translateX(calc(-100% - 18px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.site-shell.sidebar-open .site-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.site-sidebar-panel {
  height: 100%;
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: rgba(10, 16, 30, 0.52);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  overflow: hidden;
}

.site-sidebar-head h2,
.site-empty-card h2,
.browser-copy h1 {
  margin: 0;
}

.site-sidebar-note,
.site-empty-card p,
.browser-text,
.browser-tip {
  margin: 12px 0 0;
  color: rgba(233, 241, 255, 0.78);
}

.site-sidebar-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.site-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(243, 247, 255, 0.88);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.site-sidebar-link:hover,
.site-sidebar-link:focus-visible {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.site-sidebar-link.active {
  background: linear-gradient(135deg, rgba(105, 153, 255, 0.38), rgba(122, 228, 255, 0.2));
  border-color: rgba(135, 194, 255, 0.44);
  color: #ffffff;
}

.site-sidebar-link strong,
.site-sidebar-meta strong,
.browser-stat strong,
.browser-footer-card strong {
  font-size: 14px;
  font-weight: 600;
}

.site-sidebar-meta code,
.site-empty-card code {
  font-family: "SF Mono", "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
}

.site-sidebar-footer {
  display: grid;
  gap: 12px;
}

.site-sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(243, 247, 255, 0.84);
}

.site-admin-link,
.site-logout-button,
.site-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-admin-link:hover,
.site-logout-button:hover,
.site-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.site-logout-button,
.site-sidebar-toggle {
  width: 100%;
  padding: 0 18px;
}

.site-sidebar-toggle {
  position: fixed;
  top: 22px;
  left: 20px;
  z-index: 70;
  display: none;
  width: auto;
  min-width: 72px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.site-flash-list {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 75;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.site-flash-list .flash {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  backdrop-filter: blur(18px);
}

.site-shell.is-idle .browser-window,
.site-shell.is-idle .site-sidebar,
.site-shell.is-idle .site-sidebar-toggle,
.site-shell.is-idle .site-flash-list {
  opacity: 0;
  pointer-events: none;
}

.site-shell.is-idle .browser-window {
  transform: scale(1.02);
}

.site-main {
  position: relative;
  height: 100vh;
  height: 100dvh;
}

.site-home {
  position: relative;
  height: 100vh;
  height: 100dvh;
  padding: 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.site-home::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: -2;
  transform: scale(1.03);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 181, 129, 0.42), transparent 28%),
    linear-gradient(135deg, #16305b 0%, #355d8d 42%, #0f1a2c 100%);
}

.site-home.has-cover::before {
  background:
    linear-gradient(180deg, rgba(6, 10, 20, 0.16), rgba(4, 8, 16, 0.74)),
    var(--cover-image) center / cover no-repeat;
  filter: saturate(0.96) brightness(0.9);
}

.site-home::after {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: -2;
  transform: scale(1.03);
  opacity: 0;
  transition: opacity 2.2s ease-in-out;
  background:
    linear-gradient(180deg, rgba(6, 10, 20, 0.16), rgba(4, 8, 16, 0.74)),
    var(--next-cover-image) center / cover no-repeat;
  filter: saturate(0.96) brightness(0.9);
  pointer-events: none;
  will-change: opacity;
}

.site-home.is-cover-transition::after {
  opacity: 1;
}

.site-home-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 120%, rgba(255, 167, 86, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  z-index: -1;
}

.browser-window {
  position: relative;
  width: min(1160px, calc(100vw - 76px));
  height: calc(100vh - 48px);
  padding: 22px 24px 24px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 11, 23, 0.34);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.browser-content {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: 32px;
  align-items: stretch;
  min-height: 0;
}

.site-empty-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.browser-content-single {
  min-height: 0;
  height: 100%;
}

.browser-content-gallery-only {
  grid-template-columns: 1fr;
}

.site-gallery-panel {
  height: 100%;
  min-height: 0;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: calc((100% - 48px) / 3);
  gap: 24px;
  align-content: start;
  height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.site-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: center;
  border-radius: 30px;
}

.site-tile:hover {
  opacity: 1;
}

.site-tile:active {
  transform: none;
}

.site-tile-media {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-tile:hover .site-tile-media,
.site-tile:focus-visible .site-tile-media {
  transform: translateY(-4px);
  box-shadow: 0 28px 42px rgba(0, 0, 0, 0.32);
}

.site-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-empty-card {
  min-height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
}

@media (max-width: 1100px) {
  .browser-content {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .site-home {
    padding:
      max(16px, env(safe-area-inset-top))
      16px
      max(16px, env(safe-area-inset-bottom))
      16px;
  }

  .browser-window {
    width: 100%;
    height: 100%;
    padding: 14px;
    border-radius: 28px;
  }

  .site-gallery-panel {
    padding: 14px;
  }

  .site-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: calc((100% - 14px) / 2);
    gap: 14px;
  }

  .site-sidebar-zone {
    display: none;
  }

  .site-sidebar-toggle {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .site-sidebar {
    width: min(320px, calc(100vw - 12px));
    padding:
      max(12px, env(safe-area-inset-top))
      8px
      max(12px, env(safe-area-inset-bottom))
      12px;
  }

  .site-sidebar-toggle {
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    min-width: 64px;
  }

  .site-flash-list {
    top: 72px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .site-gallery-panel {
    height: 100%;
    padding: 12px;
  }

  .site-gallery-grid {
    gap: 12px;
    grid-auto-rows: calc((100% - 12px) / 2);
  }

  .site-tile-media {
    border-radius: 22px;
  }
}
