/* Prompt 案例画廊（独立菜单，不影响现有工作台） */

.hub-feature--gallery {
  border-color: rgba(59, 99, 150, 0.22);
  background: linear-gradient(180deg, rgba(59, 99, 150, 0.07), rgba(255, 255, 255, 0.96));
}
.hub-feature--gallery .hub-feature-kicker { color: #3b6396; }
.hub-feature--gallery .hub-feature-steps li::before { background: rgba(59, 99, 150, 0.9); }

.prompt-gallery-view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.pg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.pg-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3b6396;
}
.pg-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.pg-desc {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.pg-head-actions {
  flex-shrink: 0;
}

.pg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.pg-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pg-tab.active {
  color: #fff;
  background: #3b6396;
  border-color: #3b6396;
}

.pg-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.pg-search,
.pg-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.pg-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.pg-loading,
.pg-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pg-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(40, 50, 70, 0.08);
}
.pg-card-cover {
  aspect-ratio: 1;
  background: #f0f2f5;
  overflow: hidden;
}
.pg-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 14px;
  flex: 1;
}
.pg-card-cat {
  margin: 0;
  font-size: 11px;
  color: #3b6396;
  font-weight: 600;
}
.pg-card-body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}
.pg-card-preview {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.pg-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pg-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
.pg-pager-info {
  font-size: 13px;
  color: var(--muted);
}

.pg-tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pg-tpl-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  padding: 12px;
}
.pg-tpl-cover {
  border-radius: 12px;
  overflow: hidden;
  background: #f0f2f5;
  aspect-ratio: 1;
}
.pg-tpl-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-tpl-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pg-tpl-body h3 {
  margin: 0;
  font-size: 16px;
}
.pg-tpl-body p,
.pg-tpl-body li {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.pg-tpl-body ul {
  margin: 0;
  padding-left: 16px;
}
.pg-tpl-tags {
  color: #3b6396 !important;
  font-weight: 600;
}
.pg-tpl-when strong {
  color: var(--text);
}

.pg-modal[hidden] { display: none !important; }
.pg-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 32, 0.55);
}
.pg-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  padding: 18px;
}
.pg-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.pg-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}
.pg-modal-media img {
  width: 100%;
  border-radius: 14px;
  display: block;
  background: #f3f4f6;
}
.pg-gen-result {
  margin-top: 12px;
}
.pg-gen-result p {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2e7d5f;
}
.pg-modal-main h3 {
  margin: 0 28px 6px 0;
  font-size: 20px;
  line-height: 1.3;
}
.pg-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.pg-upload-hint {
  margin: -2px 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.pg-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px dashed rgba(59, 99, 150, 0.45);
  border-radius: 12px;
  background: rgba(59, 99, 150, 0.06);
  color: #3b6396;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}
.pg-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.pg-upload:hover {
  background: rgba(59, 99, 150, 0.1);
}
.pg-source-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.pg-source-row .pg-upload {
  flex: 1;
}
.pg-catalog-btn {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}
.pg-upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.pg-upload-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f6;
}
.pg-upload-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.pg-upload-meta strong {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
}
.pg-prompt {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fafbfc;
  color: var(--text);
}
.pg-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pg-cost-hint,
.pg-gen-progress,
.pg-source {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.pg-gen-error {
  margin: 8px 0 0;
  font-size: 12px;
  color: #b42318;
}
.pg-source a {
  color: #3b6396;
}

@media (max-width: 900px) {
  .pg-toolbar {
    grid-template-columns: 1fr;
  }
  .pg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pg-tpl-grid {
    grid-template-columns: 1fr;
  }
  .pg-tpl-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .pg-modal-grid {
    grid-template-columns: 1fr;
  }
  .pg-head {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .pg-grid {
    grid-template-columns: 1fr;
  }
}
