/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #0a0a0a;
  --card-bg:  #141414;
  --text:     #e0e0e0;
  --muted:    #666;
  --accent:   #fff;
  --gap:      12px;
  --cols:     3;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.site-header {
  text-align: center;
  padding: 60px 20px 40px;
  border-bottom: 1px solid #1e1e1e;
}

.site-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 8px;
}

.site-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ===== Gallery ===== */
.gallery-container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  width: 100%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  background: var(--card-bg);
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.9);
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ===== Empty State ===== */
.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 80px 0;
  font-size: 0.9rem;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.lightbox-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
  transition: opacity 0.2s;
  user-select: none;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.7;
}

.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 2.5rem;
  line-height: 1;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  line-height: 1;
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  line-height: 1;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid #1e1e1e;
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.beian a {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 0.2s;
}

.beian a:hover {
  color: var(--text);
}

.beian img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

.copyright {
  font-size: 0.75rem;
  color: #333;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  :root { --cols: 2; }
  .site-header { padding: 40px 16px 28px; }
}

@media (max-width: 560px) {
  :root { --cols: 1; --gap: 8px; }
  .site-header { padding: 30px 12px 20px; }
  .site-title { font-size: 1.5rem; }
  .gallery-container { padding: 24px 12px 60px; }
}
