:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  text-align: center;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent);
}

header p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 6px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-header .badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg);
}

.section-header .badge.green {
  background: var(--accent-green);
}

.section-header .badge.orange {
  background: var(--accent-orange);
}

.section-header .badge.gray {
  background: var(--text-dim);
  color: var(--bg);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  flex: 1;
}

.section-count {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.image-grid img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.image-grid img:hover {
  opacity: 0.85;
}

.placeholder-box {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
}

.placeholder-box p {
  font-size: 0.95rem;
}

.count-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.count-form label {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.count-form input[type="number"] {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.count-form button {
  padding: 6px 18px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.count-form button:hover {
  opacity: 0.85;
}

.count-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.count-form .msg {
  font-size: 0.82rem;
  color: var(--accent-green);
}

.count-form .msg.error {
  color: #f85149;
}

footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
}

.lightbox.show {
  display: flex;
}

@media (max-width: 640px) {
  .image-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 1.3rem;
  }
  .section-card {
    padding: 20px 16px;
  }
}
