/* 전체 작품 · 검색 결과 (v2) */

.page-head { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.page-sub { color: var(--text-3); font-size: 14px; }
.page-sub strong { color: var(--text); }

/* ---------- 필터 ---------- */
.filters { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: var(--topbar-h); z-index: 15; padding: 10px 0; background: var(--bg); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); }
.segmented label, .segmented a { position: relative; }
.segmented input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented span, .segmented a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-3); cursor: pointer;
}
.segmented input:checked + span, .segmented a[aria-current="true"] { background: var(--bg-elev-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.segmented input:focus-visible + span, .choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-group { display: inline-flex; gap: 6px; }
/* 숨긴 input 이 가로 스크롤 영역 밖으로 빠져나가 페이지 폭을 넓히지 않도록 기준을 칩 안에 둔다 */
.choice { position: relative; }
.choice span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-2); background: var(--bg-elev); border: 1px solid var(--line); white-space: nowrap;
}
.choice span:hover { color: var(--text); background: var(--bg-hover); }
.choice input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.choice-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.choice-scroll::-webkit-scrollbar { display: none; }
.choice-scroll .choice { flex: none; }
.browse-results { margin-top: 12px; }
.browse-results.is-loading .grid { opacity: .5; transition: opacity .15s ease; }

/* ---------- 검색 ---------- */
/* 검색 페이지에는 큰 검색창이 있으므로 상단바 검색창은 자리만 남기고 숨긴다 */
.is-search .topbar .search { visibility: hidden; }
.search-hero { display: flex; gap: 10px; margin-top: 20px; max-width: 760px; }
.search-box-lg { flex: 1; height: 52px; padding: 0 18px; font-size: 16px; }
.search-box-lg .icon { width: 22px; height: 22px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.result-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; word-break: keep-all; overflow-wrap: anywhere; }
.result-title span { color: var(--brand); }
.result-title strong { color: var(--text-2); font-weight: 700; margin-left: 4px; }
.segmented-links a { text-decoration: none; }

.author-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-top: 16px; }
.author-strip::-webkit-scrollbar { display: none; }
.author-chip { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); }
.author-chip:hover { border-color: var(--text-3); }
.author-chip strong { display: block; font-size: 14px; }
.author-chip small { display: block; font-size: 12px; color: var(--text-3); }

.result-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.result { display: flex; gap: 14px; padding: 10px; border-radius: var(--radius); }
.result:hover { background: var(--bg-elev); }
.result-cover { position: relative; flex: none; width: 84px; aspect-ratio: 3 / 4; border-radius: var(--radius-s); overflow: hidden; background: var(--skeleton); }
.result-cover img { width: 100%; height: 100%; object-fit: cover; }
.result-cover .badge { position: absolute; top: 6px; left: 6px; }
.result-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.result-name { font-size: 16px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-author { font-size: 13px; color: var(--text-2); }
.result-snippet { font-size: 13px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.result-meta .pill { height: 22px; padding: 0 8px; font-size: 11px; }
.result-meta .star { color: var(--gold); }
mark.hl { background: var(--brand-weak); color: var(--brand); border-radius: 3px; padding: 0 1px; }

.empty-state.small { min-height: 0; padding: 48px 16px 8px; }
.empty-state.small h2 { font-size: 18px; font-weight: 800; }

.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-item { display: inline-flex; align-items: center; height: 36px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); overflow: hidden; }
.recent-item a { padding: 0 6px 0 14px; font-size: 14px; color: var(--text); line-height: 34px; }
.recent-item button { width: 30px; height: 34px; color: var(--text-3); font-size: 16px; }
.recent-item button:hover { color: var(--text); }

.genre-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.genre-tile {
  display: flex; align-items: center; justify-content: center; height: 56px; border-radius: var(--radius);
  font-weight: 700; background: var(--bg-elev); border: 1px solid var(--line); color: var(--text);
}
.genre-tile:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 반응형 ---------- */
@media (max-width: 1023px) {
  .result-list { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .page-title { font-size: 22px; }
  .filters { margin: 12px calc(var(--gutter) * -1) 0; padding: 8px var(--gutter); }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row > * { flex: none; }
  .search-hero { gap: 8px; }
  .search-hero .btn { padding: 0 16px; }
  .search-box-lg { height: 48px; padding: 0 14px; font-size: 15px; }
  .result-title { font-size: 18px; }
  .result { padding: 8px 2px; }
  .result-cover { width: 72px; }
  .genre-tiles { grid-template-columns: repeat(3, 1fr); }
}
