:root {
  color: #172231;
  background: #f6f8fb;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input, select { font: inherit; }

button, select { cursor: pointer; }

.catalog-shell { margin: 0 auto; max-width: 1180px; padding: 30px 24px 56px; }

.catalog-header { align-items: flex-start; display: flex; gap: 30px; margin-bottom: 24px; }

.back-link { color: #315f91; font-size: 13px; padding-top: 4px; text-decoration: none; white-space: nowrap; }

.back-link:hover { color: #174a80; text-decoration: underline; }

.catalog-heading { min-width: 0; }

.eyebrow { color: #2866a5; font-size: 12px; font-weight: 700; margin: 0 0 6px; }

h1 { font-size: 28px; line-height: 1.2; margin: 0; text-wrap: balance; }

.intro { color: #506174; line-height: 1.6; margin: 8px 0 0; max-width: 65ch; }

.catalog-toolbar { align-items: end; background: #fff; border: 1px solid #d7e0ea; border-radius: 8px; display: grid; gap: 12px; grid-template-columns: minmax(280px, 1fr) 160px; padding: 14px; }

.search-field { align-items: center; background: #fff; border: 1px solid #b9c7d8; border-radius: 6px; display: flex; min-height: 42px; padding: 0 10px; }

.search-field:focus-within { border-color: #3377cb; box-shadow: 0 0 0 3px rgba(51, 119, 203, 0.14); }

.search-mark { color: #2866a5; font-size: 22px; line-height: 1; margin-right: 8px; }

.search-field input { border: 0; color: #172231; min-width: 0; outline: 0; width: 100%; }

.search-field input::placeholder { color: #64748b; }

.clear-search { background: transparent; border: 0; color: #64748b; font-size: 22px; line-height: 1; padding: 0 2px; }

.select-field { color: #506174; display: grid; font-size: 12px; font-weight: 700; gap: 5px; }

.select-field select { background: #fff; border: 1px solid #b9c7d8; border-radius: 6px; color: #172231; min-height: 42px; padding: 0 9px; }

.select-field select:focus-visible { outline: 3px solid #96c4ff; outline-offset: 1px; }

.catalog-summary { align-items: center; display: flex; justify-content: space-between; min-height: 58px; }

.catalog-summary div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 10px; }

.catalog-summary strong { color: #172231; font-size: 15px; }

.catalog-summary span { color: #64748b; font-size: 13px; }

.text-button { background: transparent; border: 0; color: #2866a5; font-size: 13px; padding: 6px 0; }

.text-button:hover { text-decoration: underline; }

.catalog-status { color: #64748b; min-height: 34px; }

.catalog-status.error { background: #fff2f2; border: 1px solid #efb4b4; border-radius: 6px; color: #a52c2c; padding: 10px 12px; }

.status-skeleton { background: #e3eaf2; border-radius: 3px; height: 10px; margin: 6px 0; width: 210px; }

.status-skeleton-short { width: 140px; }

.catalog-results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.catalog-card { background: #fff; border: 1px solid #d7e0ea; border-radius: 8px; min-width: 0; overflow: hidden; transition: border-color 160ms ease-out, box-shadow 160ms ease-out; }

.catalog-card:hover { border-color: #6f9dca; box-shadow: 0 4px 8px rgba(31, 67, 105, 0.1); }

.preview-button { background: #101923; border: 0; display: block; height: 154px; overflow: hidden; padding: 0; position: relative; width: 100%; }

.preview-button:focus-visible { outline: 3px solid #69b8f7; outline-offset: -3px; }

.preview-image { height: 100%; object-fit: contain; width: 100%; }

.preview-empty { align-items: center; color: #aab8c7; display: flex; flex-direction: column; font-size: 12px; gap: 7px; height: 100%; justify-content: center; }

.preview-empty strong { color: #e1e8ef; font-size: 24px; font-weight: 700; letter-spacing: .03em; }

.preview-kind { background: rgba(15, 23, 42, 0.78); border-radius: 4px; bottom: 8px; color: #f6f8fb; font-size: 11px; left: 8px; padding: 3px 6px; position: absolute; }

.card-body { padding: 12px 13px 13px; }

.card-name { color: #172231; display: -webkit-box; font-size: 14px; font-weight: 700; line-height: 1.45; margin: 0 0 8px; min-height: 41px; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.card-meta { color: #64748b; display: flex; flex-wrap: wrap; font-size: 12px; gap: 5px 10px; line-height: 1.5; }

.card-meta span + span::before { color: #b0bdca; content: "·"; margin-right: 10px; }

.card-state { color: #9a5b16; font-size: 12px; margin-top: 8px; }

.empty-state { background: #fff; border: 1px dashed #b9c7d8; border-radius: 8px; color: #64748b; padding: 42px 20px; text-align: center; }

.empty-state-idle { min-height: 220px; padding-top: 74px; }

.empty-state strong { color: #172231; display: block; font-size: 16px; margin-bottom: 7px; }

.pagination { align-items: center; display: flex; gap: 6px; justify-content: center; margin-top: 24px; }

.page-button { background: #fff; border: 1px solid #b9c7d8; border-radius: 5px; color: #315f91; min-height: 34px; min-width: 34px; padding: 0 9px; }

.page-button:hover:not(:disabled), .page-button[aria-current="page"] { background: #2866a5; border-color: #2866a5; color: #fff; }

.page-button:disabled { color: #a9b5c3; cursor: not-allowed; }

.preview-dialog { background: #fff; border: 1px solid #b9c7d8; border-radius: 8px; max-height: 90vh; max-width: min(920px, calc(100vw - 32px)); padding: 0; width: 920px; }

.preview-dialog::backdrop { background: rgba(15, 23, 42, 0.58); }

.dialog-close { background: #fff; border: 1px solid #b9c7d8; border-radius: 50%; color: #172231; font-size: 22px; height: 34px; line-height: 1; position: absolute; right: 12px; top: 12px; width: 34px; z-index: 1; }

.dialog-preview { background: #101923; display: block; max-height: 70vh; object-fit: contain; width: 100%; }

.dialog-details { padding: 18px 20px 20px; }

.dialog-details h2 { font-size: 18px; line-height: 1.35; margin: 0 40px 10px 0; overflow-wrap: anywhere; }

.dialog-details p { color: #64748b; font-size: 13px; margin: 4px 0; }

.sr-only { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

@media (max-width: 700px) {
  .catalog-shell { padding: 22px 16px 40px; }
  .catalog-header { display: block; }
  .back-link { display: inline-block; margin-bottom: 22px; }
  h1 { font-size: 24px; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .select-field { grid-template-columns: 76px 1fr; align-items: center; }
  .catalog-results { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card { transition: none; }
}
