* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111827;
  background: #0b1020;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

h1 {
  margin: 0;
  font-size: 26px;
  color: #f9fafb;
}

.subtitle {
  margin: 6px 0 0;
  color: rgba(249, 250, 251, 0.78);
}

.credit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.credit a {
  color: rgba(249, 250, 251, 0.9);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.credit a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.controls {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  color: rgba(249, 250, 251, 0.86);
}

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #f9fafb;
}

button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: #22c55e;
  color: #052e12;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

.error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: rgba(254, 226, 226, 0.95);
}

.meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(249, 250, 251, 0.82);
}

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}

.imgLink {
  display: block;
  line-height: 0;
}

img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.cardBody {
  padding: 12px 12px 14px;
  display: grid;
  gap: 8px;
}

.tags {
  color: rgba(249, 250, 251, 0.86);
  font-weight: 600;
  font-size: 14px;
}

.byline {
  color: rgba(249, 250, 251, 0.76);
  font-size: 13px;
}

.byline a {
  color: rgba(147, 197, 253, 0.95);
  text-decoration: none;
}

.byline a:hover {
  text-decoration: underline;
}

.pager {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(249, 250, 251, 0.92);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.downloadDialog {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  background: rgba(17, 24, 39, 0.95);
  color: rgba(249, 250, 251, 0.92);
}

.downloadDialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.downloadDialogForm {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.downloadDialogTitle {
  margin: 0;
  font-size: 18px;
}

.downloadDialogInput {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(249, 250, 251, 0.95);
}

.downloadDialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.downloadDialogBtn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(249, 250, 251, 0.92);
  cursor: pointer;
  font-weight: 700;
}

.downloadDialogBtn.primary {
  background: #22c55e;
  border-color: #22c55e;
  color: #052e12;
}

.downloadDialogBtn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.downloadDialogBtn.primary:hover {
  filter: brightness(0.95);
}

.downloadDialogError {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: rgba(254, 226, 226, 0.95);
}
