/* Agent Card Component */
.agent-card {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
  animation: appear 0.45s both;
  animation-delay: var(--delay);
}

.agent-card:hover {
  transform: translateY(-5px);
  box-shadow: 6px 7px 0 var(--ink);
}

.agent-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.agent-art.placeholder {
  display: grid;
  place-items: center;
}

/* Card image cover */
.card-cover {
  position: relative;
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agent-art.image-load-failed::after {
  content: "图片暂不可用";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font: 11px "Noto Sans SC", sans-serif;
}

.art-label {
  position: absolute;
  z-index: 2;
  right: 15px;
  bottom: 15px;
  color: #fff;
  font: 9px "DM Mono", monospace;
  letter-spacing: 1.2px;
}

.card-body {
  padding: 12px 14px 12px;
}

.card-meta {
  font: 10px "DM Mono", "Noto Sans SC", monospace;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-category-tag {
  font: 600 11px "DM Mono", "Noto Sans SC", monospace;
  color: var(--ink);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tag {
  font: 600 10px "Noto Sans SC", sans-serif;
  color: var(--muted);
  background: var(--navy-soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
}

.badge-container {
  display: inline-flex;
  gap: 6px;
}

.tag-badge {
  background: var(--navy-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 11px;
  padding: 5px 10px;
}

.card-like-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 2px 7px;
  font: 600 11px "DM Mono", monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  transition: all 0.2s;
  z-index: 2;
  position: relative;
}

.card-like-btn:hover,
.card-like-btn.liked {
  border-color: var(--ink);
  background: var(--orange-soft);
  color: var(--ink);
}

.card-like-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(1);
  background: #f5f4ed;
  border-color: var(--line);
  color: var(--muted);
}

.card-like-btn.is-disabled:hover {
  background: #f5f4ed;
  border-color: var(--line);
  color: var(--muted);
}

.card-body h3 {
  font-size: 17px;
  margin: 7px 0 3px;
  line-height: 1.25;
}

.card-body p {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-stats {
  display: flex;
  gap: 10px;
  font: 500 11px "DM Mono", "Noto Sans SC", monospace;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.card-detail-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.card-detail-link:hover .card-stats,
.card-detail-link:hover .card-footer {
  color: var(--ink);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.card-author {
  font: 600 11px "Noto Sans SC", sans-serif;
  color: var(--muted);
}

.card-arrow {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.card-detail-link:hover .card-arrow {
  border-bottom-color: var(--ink);
}

.card-arrow b {
  font-size: 14px;
  margin-left: 5px;
}

.secondary-action {
  background: #fff;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 700 13px "Noto Sans SC", sans-serif;
  padding: 13px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.secondary-action:hover,
.secondary-action.liked {
  background: var(--orange-soft);
  border-color: var(--ink);
}

#detail-like-btn,
.like-action {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
}

.secondary-action.is-disabled,
.secondary-action[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(1);
  background: #f5f4ed !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}

.secondary-action.is-disabled:hover,
.secondary-action[aria-disabled="true"]:hover {
  background: #f5f4ed !important;
  border-color: var(--line) !important;
}

#detail-like-btn:hover,
.like-action:hover {
  background: rgba(27, 54, 93, 0.06);
  border-color: var(--ink);
  color: var(--ink);
}

#detail-like-btn.liked,
.like-action.liked {
  background: rgba(27, 54, 93, 0.08);
  border-color: var(--ink);
  color: var(--ink);
}

/* Sort & Heading */
.heading-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sort-select {
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font: 600 12px "Noto Sans SC", sans-serif;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

/* Multi-row Structured Filter Panel */
.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #ffffff;
  padding: 18px;
  align-self: start;
}

.filter-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.filter-label {
  font: 700 12px "DM Mono", "Noto Sans SC", monospace;
  color: var(--ink);
}

.filter-panel-title {
  font: 700 13px "Noto Sans SC", sans-serif;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 600 12px "Noto Sans SC", Manrope, sans-serif;
  padding: 5px 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.filter.selected {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--lime);
}

.filter-count {
  margin-left: 5px;
  color: var(--muted);
  font: 500 10px "DM Mono", monospace;
}

.filter.selected .filter-count {
  color: var(--ink);
}

/* Badges for Detail Page */
.detail-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  font: 600 12px "DM Mono", "Noto Sans SC", monospace;
  padding: 5px 12px;
  border: 1px solid var(--ink);
  display: inline-block;
  border-radius: 999px;
}

.badge.category-badge {
  background: var(--lime);
  color: var(--ink);
}

.badge.industry-badge {
  background: #fff;
  color: var(--ink);
}

.badge.author-badge {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.badge.author-badge a {
  color: #fff;
  text-decoration: none;
}

.badge.author-badge a:hover {
  text-decoration: underline;
}

/* Multi-image Preview Gallery Component */
.detail-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  justify-self: end;
}

.main-preview-frame {
  border: 1px solid var(--ink);
  background: #fff;
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

.gallery-control {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(24, 35, 28, 0.74);
  color: #fff;
  font: 500 22px "DM Mono", monospace;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.main-preview-frame:hover .gallery-control,
.gallery-control:focus-visible {
  opacity: 1;
}

.gallery-control:hover {
  background: var(--ink);
}

.gallery-control.previous {
  left: 12px;
}

.gallery-control.next {
  right: 12px;
}

.gallery-title {
  margin: 0;
  color: var(--muted);
  font: 600 13px "Noto Sans SC", sans-serif;
}

.gallery-meta {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto 44px;
  align-items: center;
  gap: 16px;
  min-height: 24px;
}

.gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.gallery-dot.active {
  background: var(--ink);
}

.gallery-count {
  color: var(--muted);
  font: 11px "DM Mono", monospace;
  text-align: right;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .agent-card {
    display: grid;
    grid-template-columns: 132px 1fr;
  }
  .agent-art {
    height: auto;
    aspect-ratio: auto;
    min-height: 169px;
  }
  .card-body {
    padding: 14px;
  }
  .card-body h3 {
    font-size: 17px;
    margin: 8px 0 4px;
  }
  .card-body p {
    font-size: 12px;
    min-height: 0;
  }
  .card-footer {
    margin-top: 10px;
  }
  .art-label {
    display: none;
  }
  .gallery-control {
    opacity: 1;
  }
}
.auth-controls { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.auth-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.auth-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: #e8edf3; color: #334155; flex-shrink: 0; }
.auth-controls > span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-controls button { padding: 7px 10px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.auth-controls button:disabled { opacity: .5; cursor: default; }
.auth-controls { position: relative; }
.auth-controls .auth-avatar-button { border: 0; padding: 4px; border-radius: 50%; display: inline-flex; }
.auth-avatar-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.auth-dropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 100; width: 210px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid #dce2e8; border-radius: 12px; background: #fff; color: #334155; box-shadow: 0 8px 28px #172b4d26; }
.auth-dropdown[hidden] { display: none; }
.auth-user-name { display: block; padding: 10px; border-bottom: 1px solid #e8edf3; margin-bottom: 4px; overflow-wrap: anywhere; font-weight: 600; }
.auth-dropdown a, .auth-dropdown button { display: block; width: 100%; box-sizing: border-box; padding: 10px; text-align: left; border: 0; border-radius: 6px; color: inherit; font: inherit; text-decoration: none; }
.auth-dropdown a:hover, .auth-dropdown button:hover { background: #f1f5f9; }
.primary-action.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(1);
  background: #8b98a9 !important;
  border-color: #8b98a9 !important;
  pointer-events: auto !important;
}
.primary-action.is-disabled:hover {
  transform: none !important;
}
