.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  padding: 26px;
  border: 1px solid var(--soft-gold);
  background: var(--surface);
  transition: transform .18s, border-color .18s;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.category-card h2 {
  margin: 0 0 8px;
  color: var(--emerald);
  font: 1.45rem Georgia, serif;
}

.category-card p { color: var(--muted); }
.category-card small { color: var(--deep-emerald); }
.category-chapter-count { display: none; }
.category-links { color: var(--deep-emerald); font-weight: 650; }
.category-links a:hover { color: var(--gold); }

.category-selector {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid var(--soft-gold);
  background: var(--cream);
}

.category-selector legend {
  padding: 0 8px;
  color: var(--deep-emerald);
  font: 700 1.1rem Georgia, serif;
}

.category-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-bottom: 12px;
}

.category-choice {
  display: flex !important;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
  font-weight: 500 !important;
}

.category-choice input {
  width: auto !important;
  margin: 0 !important;
  accent-color: var(--emerald);
}
.category-samples{margin-top:34px}.category-samples .section-title{margin-bottom:14px}.category-novel-grid>.empty,.category-samples .empty{grid-column:1/-1}

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

@media (max-width: 520px) {
  body:has(.category-page)>header { position: static; top: auto; min-height: 46px; padding: 4px 4%; }
  body:has(.category-page)>header .brand { margin: 0; max-width: 100%; white-space: nowrap; overflow: visible; }
  body:has(.category-page)>header .text-brand { font-size: .9rem; line-height: 1; letter-spacing: .02em; white-space: nowrap; }
  body:has(.category-page)>header .brand-images { height: 34px; }
  body:has(.category-page)>header .brand img { max-width: 180px; max-height: 32px; }
  body:has(.category-page)>main { padding-top: 16px; padding-bottom: 24px; }
  body:has(.category-index)>main { min-height: 0; }
  .category-page { min-width: 0; max-width: 100%; }
  .category-page-head { margin-bottom: 18px; }
  .category-detail .category-page-head { margin-bottom: 12px; }
  .category-page-head h1 { margin: .2em 0; font-size: 2rem; overflow-wrap: anywhere; }
  .category-page-head p { margin: 6px 0 0; }
  .category-index .category-grid { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; max-width: 100%; }
  .category-index .category-card { flex: 0 1 auto; min-width: 0; max-width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-color: var(--gold); border-radius: 999px; color: var(--emerald); overflow: hidden; }
  .category-index .category-card:hover { transform: none; background: var(--cream); border-color: var(--emerald); }
  .category-index .category-card h2 { min-width: 0; margin: 0; font: 700 .92rem/1.2 system-ui,sans-serif; overflow-wrap: anywhere; }
  .category-index .category-card small { flex: 0 0 auto; font-size: .75rem; white-space: nowrap; }
  .category-options { grid-template-columns: 1fr; }
  .category-detail .category-page-head h1 { font-size: 1.75rem; }
  .category-novel-grid { min-width: 0; }
  .category-novel-grid>.empty { grid-column: 1/-1; }
  .category-detail .category-novel-card { display: grid; grid-template-columns: 96px minmax(0,1fr); align-items: start; min-width: 0; overflow: hidden; }
  .category-detail .category-novel-card:hover { transform: none; }
  .category-detail .category-novel-cover { width: 96px; min-width: 0; }
  .category-detail .cover { width: 96px; aspect-ratio: 2/3; background: var(--cream); }
  .category-detail .cover img { width: 100%; height: 100%; object-fit: contain; }
  .category-detail .card-body { min-width: 0; padding: 10px 12px; }
  .category-detail .card h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .category-detail .category-novel-author { display: block; margin-bottom: 4px; font-size: .72rem; overflow-wrap: anywhere; }
  .category-detail .card p { min-height: 0; margin: 0 0 5px; font-size: .76rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .category-detail .category-chapter-count { display: block; font-size: .72rem; color: var(--deep-emerald); overflow-wrap: anywhere; }
}
