/* 培训成果实景照片墙：双模板图文卡片 + 高清压缩上传 + 详情灯箱（零内联样式兼容 strict CSP） */

.gallery-panel {
  overflow: visible;
}

.gallery-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.gallery-panel-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.gallery-panel-head p {
  margin: 0;
  font-size: 0.84rem;
  color: #64748b;
}

.gallery-empty {
  padding: 34px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #475569;
  background: #f8fafc;
}

.gallery-empty p {
  margin: 0;
  max-width: 560px;
  line-height: 1.6;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gallery-select {
  min-width: 220px;
  max-width: 320px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
}

.gallery-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #e2e8f0;
}

.gallery-pill-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.gallery-pill-btn.is-active {
  background: #ffffff;
  color: #1736b5;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.gallery-stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #475569;
}

.gallery-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  background: #f1f5f9;
}

.gallery-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(23, 54, 181, 0.12);
}

/* ===== 模板 A：横版宽幅纯净大图卡（顶部抬头 + 无遮罩大图 + 底部摘要操作栏） ===== */
@media (min-width: 920px) {
  .gallery-card.is-landscape {
    grid-column: span 2;
  }
}

.gallery-card.is-landscape {
  border-color: #dbe4f5;
  box-shadow: 0 12px 32px rgba(23, 54, 181, 0.08);
}

.gallery-land-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 12px;
}

.gallery-land-head-main {
  min-width: 0;
}

.gallery-land-title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.gallery-land-sub {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.gallery-land-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  max-height: 390px;
  border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
}

.gallery-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-photo-img {
  transform: scale(1.02);
}

.gallery-corner-chip {
  position: absolute;
  top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.gallery-corner-chip.is-right {
  right: 10px;
}

.gallery-corner-chip.is-left {
  left: 10px;
}

.gallery-land-bottom {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 12px 6px 2px;
  gap: 8px;
}

.gallery-land-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-land-bottom .gallery-tag-row {
  margin-bottom: 0;
}

.gallery-land-foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gallery-land-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 7px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 0.8125rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #e8f0fe;
  color: #1248b8;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.gallery-land-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.gallery-blue-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #0d5bd9;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.gallery-blue-cta:hover {
  background: #0b4bb5;
}

/* ===== 模板 B：竖版精装纯净白卡（顶部无遮挡大图 + 下方标题与标签） ===== */
.gallery-port-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.25;
  border-radius: 15px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
}

.gallery-port-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px 6px 4px;
}

.gallery-port-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.gallery-port-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.gallery-outline-pill {
  flex: 0 0 auto;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 600;
}

.gallery-outline-pill.is-live {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.gallery-outline-pill.is-done {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.gallery-port-sub {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.gallery-port-desc {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.gallery-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.73rem;
  font-weight: 500;
}

.gallery-tag-chip.is-company {
  background: #eef2ff;
  color: #3730a3;
}

.gallery-port-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

.gallery-port-metric {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.gallery-port-metric small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.gallery-dark-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  padding: 7px 8px 7px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gallery-dark-cta:hover {
  background: #1e293b;
}

.gallery-arrow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ===== 上传 / 编辑弹窗 & 高清大图灯箱 ===== */
.showcase-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.showcase-dialog::backdrop,
.showcase-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.showcase-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
}

.showcase-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.showcase-dialog-head h2 {
  margin: 0;
  font-size: 1.08rem;
  color: #0f172a;
}

.showcase-dialog-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.showcase-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.showcase-dropzone {
  border: 2px dashed #93c5fd;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.showcase-dropzone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.showcase-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.showcase-preview-box {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.showcase-preview-box.is-hidden {
  display: none;
}

.showcase-preview-thumb {
  width: 180px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
}

.showcase-compress-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.8rem;
  font-weight: 600;
}

.showcase-template-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.showcase-tpl-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
}

.showcase-tpl-option.is-selected {
  border-color: #1736b5;
  background: #eff6ff;
}

.showcase-tpl-option strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
}

.showcase-tpl-option small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

.showcase-chip-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.showcase-chip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.showcase-chip-head strong {
  font-size: 0.85rem;
  color: #0f172a;
}

.showcase-chip-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
}

.showcase-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.78rem;
  cursor: pointer;
}

.showcase-toggle-chip.is-cohort-hit {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.showcase-toggle-chip.is-selected {
  border-color: #1736b5;
  background: #1736b5;
  color: #ffffff;
}

.showcase-company-input-row {
  display: flex;
  gap: 8px;
}

.showcase-company-input-row input {
  flex: 1 1 auto;
}

.showcase-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ===== 大图灯箱 ===== */
.showcase-lightbox {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.42);
  overflow: hidden;
}

.lightbox-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 1fr);
  max-height: calc(100vh - 28px);
  background: #ffffff;
}

@media (max-width: 820px) {
  .lightbox-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.lightbox-stage {
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: calc(100vh - 28px);
  padding: 12px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100vh - 60px);
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-aside {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lightbox-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
}

.lightbox-close {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
}

.lightbox-meta-grid {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
}

.lightbox-meta-item {
  display: grid;
  gap: 2px;
}

.lightbox-meta-item span {
  color: #64748b;
  font-size: 0.75rem;
}

.lightbox-meta-item strong {
  color: #0f172a;
  font-weight: 600;
}

.lightbox-caption {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
}

.lightbox-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.lightbox-delete-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gallery-status-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
}

.gallery-status-error.is-hidden {
  display: none;
}

.field-caption {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
