@media (max-width: 1000px) {
  .catalog {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 25px !important;
  }
  .sidebar,
  .catalog-content,
  .cards {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .catalog {
    display: block !important;
  }
  .sidebar {
    margin-bottom: 28px;
  }
  .cards {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .group-title {
    grid-column: 1 !important;
  }
}

.contact-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.contact-launcher {
  position: relative;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #1972f5;
  box-shadow: 0 10px 30px rgba(25, 114, 245, 0.3);
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.contact-launcher:hover {
  transform: translateY(-2px);
  background: #1265df;
}
.contact-launcher span {
  position: relative;
  width: 31px;
  height: 23px;
  border-radius: 4px;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}
.contact-launcher span::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: -5px;
  border-width: 5px 0 0 7px;
  border-style: solid;
  border-color: transparent transparent transparent white;
}
.contact-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 460px;
  padding: 25px 28px 24px;
  border: 1px solid #eaecf5;
  border-radius: 28px;
  background: white;
  box-shadow: 0 20px 55px rgba(16, 24, 40, 0.18);
  transform: translateY(12px) scale(0.98);
  transform-origin: right bottom;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.contact-panel.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.contact-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.contact-head h2 {
  margin: 0;
  color: #030d26;
  font-size: 21px;
  line-height: 1.25;
}
.contact-head p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 14px;
}
.contact-head p i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 5px 1px 0;
  border-radius: 50%;
  background: #fdb022;
}
.contact-head > button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #a4a8af;
  color: white;
  font-size: 25px;
  line-height: 1;
}
.contact-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 10px;
  margin-top: 24px;
}
.contact-actions button {
  min-width: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 28px;
  font-size: 16px;
  font-weight: 800;
}
.contact-primary {
  background: #1972f5;
  color: white;
}
.contact-primary:hover {
  background: #1265df;
}
.contact-secondary {
  background: #dbe3ec;
  color: #242f47;
}
.contact-secondary:hover {
  background: #cfd9e5;
}
.chat-symbol {
  width: 25px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: white;
  color: #1972f5;
  font-size: 16px;
  line-height: 0.8;
}
.search-symbol {
  position: relative;
  width: 23px;
  height: 23px;
  border: 4px solid #242f47;
  border-radius: 50%;
}
.search-symbol::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -5px;
  width: 10px;
  height: 4px;
  background: #242f47;
  transform: rotate(45deg);
  border-radius: 2px;
}
.feedback-form {
  margin-top: 22px;
}
.feedback-form label {
  display: block;
  margin-top: 13px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}
.feedback-form input,
.feedback-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #dcdfea;
  border-radius: 8px;
  outline: 0;
  color: #242f47;
  resize: vertical;
}
.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: #1972f5;
  box-shadow: 0 0 0 3px rgba(25, 114, 245, 0.1);
}
.feedback-form > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 13px;
}
.feedback-form button,
.author-contact button {
  padding: 9px 14px;
  border: 1px solid #dcdfea;
  border-radius: 8px;
  background: white;
  color: #344054;
  font-weight: 700;
}
.feedback-form button[type="submit"] {
  border-color: #1972f5;
  background: #1972f5;
  color: white;
}
.feedback-form small {
  display: block;
  margin-top: 12px;
  color: #98a2b3;
  font-size: 10px;
}
.author-contact {
  margin-top: 20px;
  text-align: center;
}
.author-contact img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
}
.author-contact h3 {
  margin: 12px 0 5px;
  color: #242f47;
}
.author-contact p {
  max-width: 310px;
  margin: 0 auto 14px;
  color: #667085;
  font-size: 13px;
}

@media (max-width: 640px) {
  .contact-widget {
    right: 12px;
    bottom: 12px;
  }
  .contact-launcher {
    width: 56px;
    height: 56px;
  }
  .contact-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 80px;
    width: auto;
    padding: 22px 20px;
    border-radius: 20px;
  }
  .contact-actions {
    grid-template-columns: 1fr;
  }
  .contact-actions button {
    height: 52px;
  }
}

.resource-card {
  cursor: pointer;
}
.resource-card > .compact-resource-video {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  margin: 0 0 14px;
  border-radius: 2px;
  background: #f2f4f8;
  object-fit: cover;
}
.resource-card:focus-visible {
  outline: 3px solid rgba(25, 114, 245, 0.32);
  outline-offset: 3px;
  border-color: #1972f5;
}
body.modal-open {
  overflow: hidden;
}

.resource-modal {
  width: min(calc(100% - 32px), 560px);
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #20243a;
  overflow: visible;
}
.resource-modal::backdrop {
  background: rgba(5, 10, 29, 0.68);
  backdrop-filter: blur(5px);
}
.resource-modal-shell {
  position: relative;
  padding: 34px;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}
.resource-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f9;
  color: #596076;
  font-size: 25px;
  line-height: 1;
}
.resource-modal-close:hover {
  background: #e7ecf5;
  color: #20243a;
}
.resource-modal-icon img,
.resource-modal-icon .letter-logo {
  width: 64px;
  height: 64px;
  margin: 0 0 20px;
  border-radius: 8px;
}
.resource-modal-type {
  margin: 0 0 8px;
  color: #4d7ff0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.resource-modal h2 {
  margin: 0;
  padding-right: 42px;
  color: #080f2b;
  font-size: 30px;
  line-height: 1.25;
}
.resource-modal-description {
  margin: 14px 0 24px;
  color: #697087;
  font-size: 15px;
  line-height: 1.7;
}
.resource-modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f6f8fc;
  font-size: 12px;
}
.resource-modal-meta span {
  color: #8a91a1;
}
.resource-modal-meta strong {
  color: #344054;
  text-align: right;
}
.resource-modal-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 17px;
  border-radius: 8px;
  background: #4d7ff0;
  color: #fff;
  font-weight: 800;
}
.resource-modal-link:hover {
  background: #376ce5;
}
.resource-modal-link[hidden] {
  display: none;
}

@media (max-width: 1000px) {
  .header-actions #openSearch {
    display: inline-flex;
    padding: 7px 8px;
    color: #344054;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .resource-modal {
    width: calc(100% - 24px);
  }
  .resource-modal-shell {
    padding: 26px 22px 22px;
  }
  .resource-modal-close {
    top: 14px;
    right: 14px;
  }
  .resource-modal h2 {
    font-size: 25px;
  }
  .resource-modal-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .resource-modal-meta strong {
    text-align: left;
  }
}

@media (min-width: 1001px) {
  .header {
    gap: 18px;
    padding-left: 28px;
    padding-right: 28px;
  }
  .desktop-nav {
    min-width: 0;
    gap: 0;
  }
  .desktop-nav a {
    padding: 8px 7px;
    font-size: 12px;
    white-space: nowrap;
  }
  .header-actions {
    flex: 0 0 auto;
  }
  .header-actions .plain-button {
    padding-left: 8px;
    padding-right: 8px;
  }
  .primary-button {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13px;
  }
  .sidebar {
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #d7deea transparent;
  }
}

.tag-filter-section[hidden] {
  display: none;
}
.tag-filters {
  display: grid;
  gap: 5px;
}
.tag-filter {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #596076;
  text-align: left;
  font-size: 13px;
}
.tag-filter:hover {
  border-color: #dbe5f7;
  background: #f7faff;
  color: #376ce5;
}
.tag-filter.active {
  border-color: #cddcff;
  background: #edf3ff;
  color: #2f69df;
  font-weight: 800;
}
.tag-filter span {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 600;
}
.tag-filter.active span {
  color: #4d7ff0;
}

@media (max-width: 1000px) {
  .tag-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tag-filter {
    min-width: 0;
  }
}
@media (max-width: 640px) {
  .tag-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tag-filter {
    font-size: 12px;
  }
}

.resource-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.cards.visual-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.cards.visual-gallery .visual-resource-card {
  min-height: 390px;
  display: flex;
  padding: 0;
  border-color: #dde3ed;
  overflow: hidden;
}
.cards.visual-gallery .visual-resource-card > :is(img, video) {
  width: 100%;
  height: 220px;
  aspect-ratio: auto;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 0;
  background: #f2f4f8;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}
.cards.visual-gallery .visual-resource-card:hover > :is(img, video) {
  transform: scale(1.025);
}
.cards.visual-gallery .visual-resource-card > div {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 18px 18px 20px;
  background: #fff;
}
.cards.visual-gallery .visual-resource-card h3 {
  margin-bottom: 9px;
  font-size: 18px;
  line-height: 1.35;
}
.cards.visual-gallery .visual-resource-card p {
  font-size: 14px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
}

@media (max-width: 1000px) {
  .cards.visual-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .cards.visual-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .cards.visual-gallery .visual-resource-card {
    min-height: 410px;
  }
  .cards.visual-gallery .visual-resource-card > :is(img, video) {
    height: auto;
    aspect-ratio: 16 / 11;
  }
}
.skeleton-card {
  pointer-events: none;
}
.skeleton-card > span,
.skeleton-card i,
.skeleton-card b {
  display: block;
  border-radius: 5px;
  background: linear-gradient(90deg, #eef1f6 25%, #f8f9fc 50%, #eef1f6 75%);
  background-size: 220% 100%;
  animation: catalog-skeleton 1.3s ease-in-out infinite;
}
.skeleton-card > span {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
}
.skeleton-card i {
  width: 58%;
  height: 18px;
  margin-bottom: 15px;
}
.skeleton-card b {
  width: 100%;
  height: 12px;
  margin-top: 9px;
}
.skeleton-card b:last-child {
  width: 76%;
}
@keyframes catalog-skeleton {
  to {
    background-position-x: -220%;
  }
}
.catalog-load-error {
  grid-column: 1 / -1;
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  border: 1px dashed #d7deea;
  border-radius: 8px;
  color: #697087;
  text-align: center;
}
.catalog-load-error strong {
  color: #080f2b;
  font-size: 19px;
}
.catalog-load-error button {
  margin-top: 8px;
  padding: 9px 15px;
  border: 0;
  border-radius: 7px;
  background: #4d7ff0;
  color: #fff;
  font-weight: 800;
}
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 34px 0 0;
}
.catalog-pagination button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d7deea;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  font-weight: 700;
}
.catalog-pagination button:hover:not(:disabled) {
  border-color: #4d7ff0;
  color: #376ce5;
}
.catalog-pagination button.active {
  border-color: #4d7ff0;
  background: #4d7ff0;
  color: #fff;
}
.catalog-pagination button:disabled {
  background: #f5f7fb;
  color: #a6adbb;
  cursor: not-allowed;
}
.pagination-gap {
  padding: 0 3px;
  color: #98a2b3;
}
.pagination-jump { display:flex; align-items:center; gap:8px; margin-left:8px; }
.pagination-jump label { display:flex; align-items:center; gap:6px; color:#667085; font-size:14px; }
.pagination-jump input { width:72px; height:44px; padding:0 8px; border:1px solid #d7deea; border-radius:7px; background:#fff; color:#1f2a44; text-align:center; font:inherit; }
.catalog-pagination .pagination-jump button { width:auto; min-width:62px; padding:0 14px; background:#eef4ff; color:#2862e7; }
.guest-unlock {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 28px 22px;
  border: 1px solid #dbe5f7;
  border-radius: 10px;
  background: #f6f9ff;
  text-align: center;
}
.guest-unlock strong {
  color: #080f2b;
  font-size: 19px;
}
.guest-unlock span {
  color: #697087;
}
.guest-unlock a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 0 18px;
  border-radius: 7px;
  background: #4d7ff0;
  color: #fff;
  font-weight: 800;
}

@media (max-width: 640px) {
  .catalog-pagination {
    gap: 6px;
  }
  .catalog-pagination button {
    width: 40px;
    height: 40px;
  }
  .guest-unlock {
    padding: 24px 16px;
  }
}

.featured-libraries {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto 48px;
}
.featured-libraries-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.featured-libraries-head h2 {
  margin: 5px 0 0;
  color: #080f2b;
  font-size: 28px;
}
.featured-libraries-head p {
  max-width: 480px;
  margin: 0;
  color: #697087;
  font-size: 14px;
  text-align: right;
}
.featured-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.featured-library {
  position: relative;
  min-height: 172px;
  display: grid;
  grid-template-columns: 48px 1fr auto 34px;
  align-items: center;
  gap: 18px;
  padding: 25px;
  border: 1px solid #e5e8ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
}
.featured-library::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #4d7ff0;
}
.featured-library:hover {
  border-color: #cbd8ef;
  box-shadow: 0 12px 30px rgba(30, 48, 90, 0.08);
}
.featured-library-index {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #edf3ff;
  color: #376ce5;
  font-size: 13px;
  font-weight: 900;
}
.featured-library small {
  color: #7f8aa3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.featured-library h3 {
  margin: 3px 0 6px;
  color: #080f2b;
  font-size: 20px;
}
.featured-library p {
  margin: 0;
  color: #697087;
  font-size: 13px;
  line-height: 1.55;
}
.featured-library > strong {
  color: #080f2b;
  font-size: 25px;
  white-space: nowrap;
}
.featured-library > strong small {
  display: block;
  letter-spacing: 0;
  text-align: right;
}
.featured-library > i {
  color: #4d7ff0;
  font-size: 24px;
  font-style: normal;
}
.prompt-library::before {
  background: #35a579;
}
.prompt-library .featured-library-index {
  background: #eaf8f2;
  color: #24805f;
}
.prompt-library > i {
  color: #24805f;
}

@media (max-width: 800px) {
  .featured-libraries {
    width: calc(100% - 30px);
    margin-bottom: 34px;
  }
  .featured-libraries-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .featured-libraries-head p {
    text-align: left;
  }
  .featured-library-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .featured-library {
    grid-template-columns: 42px 1fr 24px;
    gap: 13px;
    padding: 20px 17px;
  }
  .featured-library-index {
    width: 42px;
    height: 42px;
  }
  .featured-library > strong {
    grid-column: 2;
    font-size: 20px;
  }
  .featured-library > strong small {
    display: inline;
    margin-left: 3px;
  }
  .featured-library > i {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

.catalog-notice-stack {
  width: min(calc(100% - 40px), 1180px);
  display: grid;
  gap: 12px;
  margin: 0 auto 38px;
}
.catalog-update-notice,
.resource-trust-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid #dbe5f7;
  border-radius: 8px;
  background: #f7faff;
  color: #697087;
  font-size: 13px;
}
.catalog-update-notice strong,
.resource-trust-note strong {
  flex: 0 0 auto;
  color: #24805f;
}
.catalog-update-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #43c58a;
  box-shadow: 0 0 0 5px rgba(67, 197, 138, 0.12);
}
.resource-trust-note {
  align-items: flex-start;
  background: #fff;
  line-height: 1.65;
}
.resource-trust-note a {
  color: #376ce5;
  font-weight: 700;
}

@media (max-width: 640px) {
  .catalog-notice-stack {
    width: calc(100% - 30px);
    margin-bottom: 28px;
  }
  .catalog-update-notice,
  .resource-trust-note {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }
  .catalog-update-notice span:last-child,
  .resource-trust-note span {
    flex-basis: 100%;
  }
}
