:root {
  --bg: #fff8f6;
  --bg-accent: #ffeef0;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #3f3550;
  --muted: #7a708d;
  --line: rgba(160, 136, 182, 0.18);
  --shadow: 0 18px 40px rgba(149, 126, 163, 0.14);
  --shadow-strong: 0 24px 55px rgba(149, 126, 163, 0.18);
  --accent: #d69ab1;
  --accent-2: #c5b3e6;
  --accent-3: #f8d7c9;
  --button-text: #3f3550;
}

body.dark {
  --bg: #221d2f;
  --bg-accent: #2f2742;
  --surface: rgba(49, 42, 67, 0.9);
  --surface-strong: #352d49;
  --text: #f8f1ff;
  --muted: #cabfda;
  --line: rgba(219, 197, 255, 0.12);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 24px 55px rgba(0, 0, 0, 0.34);
  --accent: #efb0c7;
  --accent-2: #bda7ff;
  --accent-3: #f4c9af;
  --button-text: #201a2b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--bg-accent) 0%, transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, #fffdfc 100%);
  transition: background 0.25s ease, color 0.25s ease;
}

body.dark {
  background:
    radial-gradient(circle at top left, #3a3151 0%, transparent 36%),
    linear-gradient(180deg, #211c2e 0%, #181420 100%);
}

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 20px 0;
}

.topbar-card {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
  backdrop-filter: blur(10px);
}

.topbar-left h1 { margin: 4px 0 6px; font-size: 2rem; }
.subtitle { margin: 0; color: var(--muted); line-height: 1.5; }

.eyebrow, .panel-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

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

.icon-btn, .icon-link {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: var(--button-text);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
}

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.2));
  border: 1px solid var(--line);
}

.topbar-badge span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  height: 24px;
}

.topbar-badge div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar-badge strong { display: block; font-size: 0.9rem; }
.topbar-badge small { display: block; font-size: 0.75rem; color: var(--muted); }

.page-wrap, .login-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px;
}

.panel-card, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
  backdrop-filter: blur(10px);
}

.panel-card { padding: 24px; }

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

.panel-head h2 { margin: 6px 0 0; font-size: 1.7rem; }

.refresh-link {
  text-decoration: none;
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.month-group {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.card img {
  width: 100%;
  height: 240px;
  display: block;
  object-fit: cover;
  background: #ece7f4;
}

.card-copy { padding: 14px 16px 18px; }
.card-title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.card-caption { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.95rem; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(31, 23, 41, 0.92);
  padding: 24px;
}

.lightbox.open { display: flex; }
.lightbox-figure { margin: 0; width: min(100%, 1100px); text-align: center; }

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}

.lightbox figcaption {
  color: #fff8ff;
  margin-top: 16px;
  font-size: 1rem;
  line-height: 1.5;
}

.lightbox-close, .lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 999px;
  font-size: 1.8rem;
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  max-width: 560px;
  margin: 8vh auto 0;
  padding: 28px;
}

.login-card h1 { margin: 8px 0 8px; font-size: 2rem; }
.login-card label { display: block; margin: 18px 0 8px; font-weight: 700; }

.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  background: var(--surface-strong);
  color: var(--text);
}

.login-card button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--button-text);
  box-shadow: var(--shadow);
}

.error-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 223, 228, 0.85);
  color: #8d2c49;
  font-weight: 700;
}

body.dark .error-message {
  background: rgba(110, 42, 72, 0.4);
  color: #ffd6e4;
}

.back-card {
  max-width: 260px;
  margin: 16px auto 0;
  padding: 14px 16px;
  text-align: center;
}

.back-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  text-decoration: none;
  font-weight: 700;

  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));

  padding: 10px 16px;
  border-radius: 999px;

  box-shadow: var(--shadow);
  border: none;

  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.back-card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.back-home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 700px) {
  .topbar-wrap { padding: 16px 16px 0; }

  .topbar-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border-radius: 24px;
  }

  .topbar-left h1 { font-size: 1.6rem; }
  .page-wrap, .login-shell { padding: 16px; }
  .panel-card, .login-card { border-radius: 24px; }

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

  .card img { height: 180px; }
  .login-row { grid-template-columns: 1fr; }
  .lightbox { padding: 14px; }
  .lightbox img { max-height: 70vh; }
  .lightbox-nav { width: 46px; height: 46px; }
  .panel-head { flex-direction: column; align-items: flex-start; }

  .back-card {
    max-width: 220px;
    padding: 12px 14px;
  }
}

.back-card-link:visited {
  color: var(--button-text);
}
