* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0f1720;
  color: #dbe4ee;
}
header {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1.4rem; background: #16202c; border-bottom: 1px solid #223042;
}
.brand { font-weight: 700; font-size: 1.15rem; color: #6cc6ff; text-decoration: none; }
nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
nav a { color: #9fb3c8; text-decoration: none; }
nav a:hover { color: #fff; }
.who { color: #6cc6ff; font-weight: 600; }
main { max-width: 1000px; margin: 2rem auto; padding: 0 1.2rem; }
h1 { color: #fff; }
a.btn, button {
  background: #2b6cb0; color: #fff; border: 0; border-radius: 6px;
  padding: .5rem .9rem; cursor: pointer; text-decoration: none; font-size: .95rem;
  display: inline-block;
}
a.btn:hover, button:hover { background: #3182ce; }
a.btn.ghost { background: transparent; border: 1px solid #2b6cb0; color: #8fc2ef; }
button:disabled { background: #33445a; cursor: not-allowed; }
input, textarea, select {
  background: #0b1119; color: #dbe4ee; border: 1px solid #2a3a4d;
  border-radius: 6px; padding: .5rem; font-size: .95rem;
}
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #223042; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.ok { background: #1c3a2a; color: #8ff0b5; }
.flash.error { background: #3a1c1c; color: #ff9f9f; }
.card { background: #16202c; border: 1px solid #223042; border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0; }
.hint { color: #7b8ba0; font-size: .85rem; }
form.upload { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
pre { background: #0b1119; padding: .8rem; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }
code { color: #8ff0b5; }
img { max-width: 100%; border-radius: 8px; }

/* --- trang Khám phá: lưới 4 cột đều nhau --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 1.2rem;
}
.tile {
  background: #16202c; border: 1px solid #223042; border-radius: 10px;
  overflow: hidden; text-decoration: none; color: #dbe4ee;
}
.tile:hover { border-color: #2b6cb0; }
.tile img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0;
}
.tile .cap {
  display: block; padding: .5rem .6rem; font-size: .82rem; color: #9fb3c8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viewer img, .viewer video { width: 100%; max-width: 100%; }

@media (max-width: 820px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
