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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

header h1 {
  font-size: 2rem;
  color: #16213e;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.05rem;
  color: #555;
  max-width: 700px;
  margin: 0 auto;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: #16213e;
  color: #16213e;
}

.filter-btn.active {
  background: #16213e;
  color: #fff;
  border-color: #16213e;
}

.search-box {
  width: 100%;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #16213e;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

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

.card-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.85rem;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.card-image .placeholder {
  text-align: center;
  padding: 1rem;
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-id {
  font-size: 0.75rem;
  color: #999;
  font-weight: 600;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #16213e;
}

.card-category {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: #e8f0fe;
  color: #16213e;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.card-usecase {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.prompt-container {
  position: relative;
  margin-top: auto;
}

.prompt-box {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  font-size: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.7rem;
  background: #45475a;
  color: #cdd6f4;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #585b70;
}

.copy-btn.copied {
  background: #a6e3a1;
  color: #1e1e2e;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #888;
  font-size: 0.85rem;
  border-top: 1px solid #e8e8e8;
}

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

@media (max-width: 640px) {
  header h1 {
    font-size: 1.4rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .gallery {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
  .controls {
    padding: 0.75rem 1rem;
  }
  .filter-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
}
