/*
 * Generate Center 管理后台样式
 * 使用 Propshaft 直接服务，无预编译步骤。
 */

:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --color-bg: #f4f5f9;
  --color-surface: #ffffff;
  --color-surface-soft: #f9fafb;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-text: #111827;
  --color-text-soft: #6b7280;
  --color-primary: #4f46e5;
  --color-primary-soft: #eef2ff;
  --color-primary-strong: #4338ca;
  --color-accent: #0ea5e9;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 全局隐藏属性优先级修复 —— 确保 [hidden] 永远不显示 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef0f7 0%, #f5f6fb 100%);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
}

/* —— 顶部导航 —— */
.app-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.app-nav-links {
  display: inline-flex;
  gap: 4px;
  background: var(--color-surface-soft);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

.app-nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--color-text-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-nav-link:hover {
  color: var(--color-text);
}

.app-nav-link.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* —— 主区域 —— */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-description {
  margin: 8px 0 0;
  color: var(--color-text-soft);
  font-size: 14px;
}

.action-row {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* —— 标签栏 —— */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--color-surface);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--color-text-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab:hover {
  color: var(--color-text);
}

.tab-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* —— 卡片 —— */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.card + .card {
  margin-top: 20px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.card h3 {
  margin: 20px 0 10px;
  font-size: 15px;
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* —— 统计 —— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  color: var(--color-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* —— 按钮 —— */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease,
    box-shadow 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.button-primary:hover {
  background: var(--color-primary-strong);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.button-secondary:hover {
  background: var(--color-surface-soft);
  border-color: var(--color-text-soft);
}

.button-ghost {
  background: transparent;
  color: var(--color-primary);
}

.button-ghost:hover {
  background: var(--color-primary-soft);
}

.button-danger {
  background: #fff;
  color: var(--color-danger);
  border-color: #fecaca;
}

.button-danger:hover {
  background: #fef2f2;
}

.button-small {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* —— 任务列表卡片 —— */
.task-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.tasks-auto-refresh-hint {
  margin: 4px 0 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary, #2563eb);
  border: 1px dashed rgba(37, 99, 235, 0.35);
  font-size: 13px;
}

.task-card {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 20px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
}

.task-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  overflow: hidden;
  min-height: 130px;
}

.task-card-media img,
.task-card-media video {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
}

.task-card-media .task-card-media-image {
  cursor: zoom-in;
  transition: object-fit 0s, transform 0.25s ease, max-height 0.25s ease;
}

.task-card-media:hover .task-card-media-image {
  object-fit: contain;
  max-height: 260px;
  background: #0b1020;
}

.task-card-media:hover {
  background: #0b1020;
}

.task-card-media audio {
  width: 100%;
  padding: 0 8px;
}

/* 多图网格预览：在同一张卡片内并排多个子任务的结果。 */
.task-card-media-grid {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 4px;
}

.task-card-media-grid:not(.is-multi) {
  grid-template-columns: 1fr;
}

.task-card-media-grid.is-multi[data-image-count="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.task-card-media-grid.is-multi[data-image-count="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.task-card-media-grid.is-multi[data-image-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.task-card-media-grid.is-multi:not([data-image-count="2"]):not([data-image-count="3"]):not([data-image-count="4"]) {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  grid-auto-rows: 80px;
}

.task-card-media-grid img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 4px;
}

.task-card-media-grid.is-multi {
  min-height: 180px;
  padding: 4px;
}

.task-card-media-grid.is-multi img {
  cursor: zoom-in;
  transition: transform 0.15s ease;
}

.task-card-media-grid.is-multi img:hover {
  transform: scale(1.02);
}

.task-card-batch {
  border: 1px solid var(--color-border);
  position: relative;
}

.task-card-batch::before {
  content: "批次";
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.task-card-actions-detail {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* 批次详情页的顶部 Tab 切换器 */
.batch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px 0;
  padding: 8px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.batch-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.batch-tab:hover {
  background: var(--color-surface-soft);
}

.batch-tab.is-active {
  background: var(--color-primary, #2563eb);
  color: #fff;
  border-color: var(--color-primary, #2563eb);
}

.batch-tab.is-active .status-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.batch-tab-index {
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.batch-tab-id {
  color: var(--color-text-soft);
}

.batch-tab.is-active .batch-tab-id {
  color: rgba(255, 255, 255, 0.85);
}

.batch-task-panel[hidden] {
  display: none;
}

.task-card-placeholder {
  color: var(--color-text-soft);
  font-size: 13px;
  padding: 24px 12px;
  text-align: center;
  line-height: 1.5;
}

.task-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-soft);
}

.task-card-id {
  font-weight: 700;
  color: var(--color-text);
}

.task-card-prompt {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 120px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-soft);
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}

/* —— 状态徽章 —— */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pending {
  background: #ede9fe;
  color: #6d28d9;
}

/* —— 表单 —— */
.form-card {
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field > label {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="file"],
.field select,
.field textarea {
  padding: 11px 13px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  font: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}

.checkbox-field > label {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.voice-source-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  width: fit-content;
}

.voice-source-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.voice-source-tab input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  position: absolute;
}

.voice-source-tab:has(input[type="radio"]:checked) {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.voice-preview {
  width: 100%;
  margin-top: 8px;
}

.form-hint {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.form-hint code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  font-size: 12px;
}

/* —— 多图上传器 —— */
.image-uploader {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-uploader .image-uploader-input {
  /* 隐藏原生 file input，仅保留表单提交能力。
     使用复合选择器以覆盖 .field input[type="file"] 的默认边框。 */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.image-uploader-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  min-height: 120px;
}

.image-uploader-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  color: var(--color-text-soft);
  font-size: 13px;
  text-align: center;
}

.image-uploader-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  box-shadow: var(--shadow-sm);
}

.image-uploader-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-uploader-thumb-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 8px 6px;
  font-size: 11px;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-uploader-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.05s ease;
}

.image-uploader-thumb-remove:hover {
  background: var(--color-danger);
}

.image-uploader-thumb-remove:active {
  transform: scale(0.94);
}

.image-uploader-thumb-existing {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), var(--shadow-sm);
}

.image-uploader-thumb-index {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  user-select: none;
}

.image-uploader-thumb-existing .image-uploader-thumb-index {
  background: rgba(37, 99, 235, 0.92);
}

.image-uploader-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.image-uploader-status {
  margin: 0;
  font-size: 12px;
}

/* 联动禁用样式：组图模式=关闭 时的 max_images */
.field input.is-disabled,
.field input[disabled] {
  background: var(--color-surface-soft);
  color: var(--color-text-soft);
  cursor: not-allowed;
}

.error-panel {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.error-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.error-panel ul {
  margin: 0;
  padding-left: 20px;
}

/* —— 详情页 —— */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.detail-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.detail-list dt {
  color: var(--color-text-soft);
  font-weight: 600;
  font-size: 13px;
}

.detail-list dd {
  margin: 0;
  font-size: 14px;
  word-break: break-all;
}

.attachment-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-list li {
  padding: 10px 12px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.media-preview {
  width: 100%;
  margin-top: 12px;
}

.media-preview img,
.media-preview video,
.media-preview audio {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.json-block {
  overflow-x: auto;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
  max-height: 320px;
}

/* —— Flash 消息 —— */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.flash-notice {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.flash-alert {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

@media (max-width: 960px) {
  .detail-grid,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-card-media {
    max-height: 220px;
  }

  .task-card-actions {
    flex-direction: row;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .app-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .app-nav-links {
    overflow-x: auto;
    width: 100%;
  }
}

/* ====== Lightbox 全局图片预览 ====== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 22, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 32px;
  cursor: zoom-out;
  animation: lightbox-fade 0.18s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: min(100%, 1600px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-close:active {
  transform: scale(0.94);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
  z-index: 1001;
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-nav-prev {
  left: 22px;
}

.lightbox-nav-next {
  right: 22px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.94);
}

.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.lightbox-counter[hidden] {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
