*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #111;
  color: #eee;
  padding: 1rem;
}

header {
  margin-bottom: 1.5rem;
}

header h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
header p  { color: #aaa; font-size: 0.9rem; }

nav.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

nav.pagination a, nav.pagination span {
  padding: 0.3rem 0.7rem;
  border: 1px solid #444;
  border-radius: 4px;
  text-decoration: none;
  color: #eee;
  font-size: 0.85rem;
}

nav.pagination a:hover { background: #333; }
nav.pagination .current { background: #555; border-color: #777; }
nav.pagination .all-link { margin-left: auto; }

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

.gallery-item a { display: block; }

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 175ms ease;
}

.gallery-item a:hover img {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75), 0 0 10px 3px rgba(255, 255, 255, 0.35);
}

.gallery-item .caption {
  font-size: 0.8rem;
  color: #aaa;
  margin-top: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-page { max-width: 900px; margin: 0 auto; }

.item-page img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1rem 0;
}

.item-meta {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 1rem;
}

.item-meta span { margin-right: 1.5rem; }

.share-wrap { display: inline-flex; align-items: center; gap: 0.4rem; }
.share-btn { background: none; border: none; cursor: pointer; padding: 0; font-size: inherit; color: inherit; }
.share-hint { font-size: 0.8rem; color: transparent; white-space: nowrap; transition: color 150ms ease; }
.share-wrap:hover .share-hint { color: #aaa; }

nav.item-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

nav.item-nav a {
  padding: 0.4rem 1rem;
  border: 1px solid #444;
  border-radius: 4px;
  text-decoration: none;
  color: #eee;
}

nav.item-nav a:hover { background: #333; }

footer { margin-top: 2rem; color: #555; font-size: 0.75rem; }

.back-link { color: inherit; text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.75rem; }
.back-hint { font-size: 0.7rem; font-weight: normal; color: transparent; white-space: nowrap; transition: color 150ms ease; }
.back-link:hover .back-hint { color: #666; }

.key-legend { position: fixed; top: 0.75rem; right: 1rem; font-size: 0.65rem; color: #ff69b4; pointer-events: none; letter-spacing: 0.02em; }
.key-legend kbd { font-family: monospace; font-style: normal; }

.generated-by { text-align: center; margin-top: 0.75rem; }
.generated-by a { color: #555; text-decoration: none; }
.generated-by a:hover { color: #888; }
