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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.search-box {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: #f9fafb;
}

.search-box input:focus {
  border-color: #3b82f6;
  background: #fff;
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

/* Main */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: #374151;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.card-name {
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  color: #1f2937;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  z-index: 10;
}

.modal-close:hover {
  background: #e5e7eb;
}

.modal-main-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
  border-radius: 16px 16px 0 0;
}

.modal-body {
  padding: 24px;
}

.modal-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111;
}

.modal-desc {
  font-size: 1rem;
  color: #4b5563;
  margin-bottom: 24px;
  white-space: pre-line;
}

.extra-images-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #374151;
}

.extra-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.extra-images img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.extra-images img:hover {
  opacity: 0.85;
}

/* No result */
.no-result {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 1.1rem;
  display: none;
}

/* Footer */
footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 28px 20px;
  text-align: center;
  font-size: 0.95rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

.footer-inner strong {
  color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: 100%;
  }
  .modal-name {
    font-size: 1.35rem;
  }
}
