:root {
  --bg: #0a0b10;
  --panel: rgba(20, 22, 30, 0.65);
  --panel-solid: #13151f;
  --card-bg: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.10);
  --line-light: rgba(255, 255, 255, 0.18);
  --line-active: rgba(107, 167, 224, 0.6);
  --text: #eef0f4;
  --muted: #9aa0ad;
  --faint: #6b7180;
  --a1: #6ba7e0;
  --a2: #b07ce8;
  --a3: #52e0c4;
  --accent-glow: rgba(107, 167, 224, 0.25);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 极光流光背景 (与主站 photograph.de5.net 统一) */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(107, 167, 224, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(176, 124, 232, 0.16), transparent 55%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

.b1 { width: 480px; height: 480px; background: #3b6fd4; top: -100px; left: 5%; animation-delay: 0s; }
.b2 { width: 420px; height: 420px; background: #8a4fd0; bottom: -100px; right: 4%; animation-delay: -7s; }
.b3 { width: 350px; height: 350px; background: #1fae9a; top: 40%; left: 50%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(35px, -25px) scale(1.06); }
  66% { transform: translate(-25px, 20px) scale(0.96); }
}

/* 微弱几何网格 */
.grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* 顶部导航 Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(10, 11, 16, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  display: grid;
  place-items: center;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 167, 224, 0.35);
  font-size: 16px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(100deg, var(--a1), var(--a2) 65%, var(--a3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.7);
}

.nav-btn {
  text-decoration: none;
  font-size: 12px;
  color: var(--text);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-light);
}

/* 主内容容器 */
.container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* 控制栏 (人物Tabs + 搜索排序) */
.control-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 16px 40px -15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 分组标签栏 */
.category-tabs-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

.tab-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-light);
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(107, 167, 224, 0.3), rgba(176, 124, 232, 0.3));
  border-color: var(--line-active);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.tab-badge {
  font-size: 11px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

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

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 34px 0 36px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--a1);
  box-shadow: 0 0 0 3px rgba(107, 167, 224, 0.2);
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--faint);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

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

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrapper select {
  height: 38px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.select-wrapper select:hover {
  border-color: var(--line-light);
}

.select-wrapper select option {
  background: var(--panel-solid);
  color: var(--text);
}

.action-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* 分组描述卡片 */
.group-info-card {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(107, 167, 224, 0.06);
  border: 1px solid rgba(107, 167, 224, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-info-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--a1);
}

.group-info-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* 画廊瀑布流网格布局 */
.gallery-wrapper {
  position: relative;
  min-height: 400px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}

/* 图片卡片设计 */
.gallery-card {
  position: relative;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: var(--line-active);
  box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.8), 0 0 16px var(--accent-glow);
}

/* 卡片缩略图容器 */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.card-media img[loading] {
  opacity: 0;
}

.card-media img.loaded {
  opacity: 1;
}

.gallery-card:hover .card-media img {
  transform: scale(1.04);
}

/* 缩略图角标 */
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.badge-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 11, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.badge-ext {
  font-weight: 600;
  text-transform: uppercase;
  color: var(--a3);
}

.badge-prompt {
  background: rgba(176, 124, 232, 0.25);
  border-color: rgba(176, 124, 232, 0.5);
  color: #e4c7ff;
}

/* 卡片信息区 */
.card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(10, 11, 16, 0.4);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
}

.card-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.card-prompt-snippet {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--muted);
}

/* 全屏灯箱 (Lightbox) 交互设计 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-container {
  position: relative;
  z-index: 10;
  width: 96vw;
  height: 94vh;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line-light);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

/* 灯箱顶部 */
.lightbox-header {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 22, 30, 0.6);
}

.lightbox-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.lightbox-idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--a1);
  background: rgba(107, 167, 224, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

.lightbox-filename {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  text-decoration: none;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line-light);
}

.tool-btn.close-btn {
  font-size: 16px;
  padding: 4px 10px;
  color: var(--muted);
}

.tool-btn.close-btn:hover {
  color: #ff5f56;
}

/* 灯箱主体展示区 */
.lightbox-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

.lightbox-image-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  user-select: none;
  transition: opacity 0.2s ease;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 22, 30, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-light);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
}

.nav-arrow:hover {
  background: rgba(107, 167, 224, 0.3);
  border-color: var(--a1);
  transform: translateY(-50%) scale(1.08);
}

.nav-arrow.prev { left: 16px; }
.nav-arrow.next { right: 16px; }

/* 灯箱底部详细面板 */
.lightbox-footer {
  max-height: 220px;
  overflow-y: auto;
  padding: 14px 20px;
  background: rgba(16, 18, 25, 0.95);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.meta-tag.model-tag {
  color: var(--a3);
  border-color: rgba(82, 224, 196, 0.3);
  background: rgba(82, 224, 196, 0.08);
}

/* 提示词区域 */
.lightbox-prompt-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prompt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--a2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-prompt-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-prompt-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.prompt-body {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 80px;
  overflow-y: auto;
}

.source-body {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
  white-space: pre-wrap;
}

/* 旋转加载动画 */
.loading-spinner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--a1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .container { padding: 16px 12px 40px; }
  .control-panel { padding: 14px 14px; gap: 12px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .filter-actions { justify-content: space-between; }
  .lightbox-container { width: 100vw; height: 100vh; border-radius: 0; }
  .nav-arrow { width: 36px; height: 36px; font-size: 20px; }
  .nav-arrow.prev { left: 8px; }
  .nav-arrow.next { right: 8px; }
}
