/* AI追光 — 提示词展示页共享样式
   被 gallery/image-prompts.html 和 gallery/video-prompts.html 引用 */

:root {
  --bg: #070810;
  --bg-2: #111318;
  --bg-3: #16181f;
  --bg-4: #1c1e27;
  --bg-5: #1c1e27;
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.12);
  --fg: rgba(255,255,255,0.95);
  --fg-2: rgba(255,255,255,0.65);
  --fg-3: rgba(255,255,255,0.45);
  --gold: #f5c842;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Noto Sans SC', 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ─── 顶部:返回首页按钮 + 页面标题 ─── */
.pg-page-top {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(7,8,16,0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.pg-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  transition: all 200ms cubic-bezier(0.22,1,0.36,1);
}
.pg-back-link:hover {
  background: rgba(245,200,66,0.10);
  border-color: rgba(245,200,66,0.4);
  color: var(--gold);
  transform: translateX(-2px);
}
.pg-back-link svg { transition: transform 200ms; }
.pg-back-link:hover svg { transform: translateX(-3px); }
.pg-page-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.pg-page-title-en {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

/* ─── 主容器 ─── */
.pg-page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.pg-page-intro {
  margin-bottom: 32px;
}
.pg-page-intro h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.pg-page-intro p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 640px;
  margin: 0;
}

/* ─── 网格 ─── */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pg-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ───── 10 列紧凑缩略图模式 ───── */
.pg-grid.cols-10 {
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
}
.pg-grid.cols-10 .pg-item {
  aspect-ratio: 1 / 1;       /* 严格 1:1 */
  border-radius: 10px;
  overflow: visible;          /* 让 info 可以溢出到下方 */
  background: transparent;
  border: none;
  padding: 0;
}
.pg-grid.cols-10 .pg-item picture,
.pg-grid.cols-10 .pg-item > img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  transition: all 220ms cubic-bezier(0.22,1,0.36,1);
}
.pg-grid.cols-10 .pg-item:hover picture,
.pg-grid.cols-10 .pg-item:hover > img {
  border-color: rgba(245,200,66,0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -10px rgba(0,0,0,0.55),
              0 0 24px -6px rgba(245,200,66,0.18);
}
/* 缩略图模式下取消 picture img 的二次 scale(避免双重 transform 失真)*/
.pg-grid.cols-10 .pg-item:hover picture img {
  transform: none;
}
/* 在缩略图模式下,文字浮出到卡片下方 */
.pg-grid.cols-10 .pg-item-info {
  position: static;
  background: none;
  padding: 8px 2px 0;
  margin-top: 6px;
  gap: 2px;
}
.pg-grid.cols-10 .pg-item-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-grid.cols-10 .pg-item-meta {
  font-size: 9px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,0.45);
}
/* 缩略图模式下的角标(▶ 或 ♪)更小一点 */
.pg-grid.cols-10 .pg-item::after {
  width: 22px !important;
  height: 22px !important;
  top: 6px !important;
  right: 6px !important;
  font-size: 9px !important;
}

.pg-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: all 220ms cubic-bezier(0.22,1,0.36,1);
}
.pg-item:hover {
  border-color: rgba(245,200,66,0.4);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -10px rgba(0,0,0,0.5);
}
.pg-item img, .pg-item picture {
  width: 100%; height: 100%;
  display: block;
}
.pg-item picture img {
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.22,1,0.36,1);
}
.pg-item:hover picture img { transform: scale(1.05); }
.pg-item-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(7,8,16,0.85));
  display: flex; flex-direction: column; gap: 3px;
}
.pg-item-label {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: #fff;
}
.pg-item-meta {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
}
/* 视频角标 */
.pg-item[data-prompt-key^="vid-"]::after {
  content: '▶';
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7,8,16,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--gold);
  font-size: 11px;
  padding-left: 2px;
}
/* "可在线播放" 金色高亮角标(视频 + 音乐通用) */
.pg-item.pg-item-has-video::after {
  content: '▶' !important;
  background: rgba(245,200,66,0.95) !important;
  border-color: var(--gold) !important;
  color: #1a0e00 !important;
  box-shadow: 0 0 16px rgba(245,200,66,0.4) !important;
}

/* ─── Modal(同首页样式) ─── */
.pg-modal[hidden] { display: none !important; }
.pg-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: pgFadeIn 200ms ease;
}
@keyframes pgFadeIn { from { opacity: 0; } to { opacity: 1; } }
.pg-modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}
.pg-modal-card {
  position: relative;
  width: 100%; max-width: 1080px;
  max-height: calc(100vh - 48px);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  animation: pgScaleIn 240ms cubic-bezier(0.22,1,0.36,1);
}
@keyframes pgScaleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pg-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 36px; height: 36px;
  background: rgba(7,8,16,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: all 180ms;
}
.pg-modal-close:hover {
  background: rgba(255,77,109,0.2);
  border-color: rgba(255,77,109,0.4);
}
.pg-modal-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  max-height: calc(100vh - 48px);
}
.pg-modal-media {
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 16px;
  min-height: 320px;
}
.pg-modal-media img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;       /* 保持原比例,完整显示 */
  cursor: zoom-in;            /* 提示可以放大 */
  border-radius: 4px;
  transition: transform .2s ease;
}
.pg-modal-media img:hover { transform: scale(1.02); }

/* ─── 全屏原尺寸查看(点击弹窗里的图触发) ─── */
.pg-zoom-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  display: none; align-items: center; justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
}
.pg-zoom-overlay.open { display: flex; }
.pg-zoom-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  box-shadow: 0 0 80px rgba(245,200,66,0.15);
  border-radius: 4px;
  user-select: none;
}
.pg-zoom-close {
  position: fixed; top: 24px; right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  backdrop-filter: blur(10px);
}
.pg-zoom-close:hover { background: rgba(255,255,255,0.18); }
.pg-zoom-hint {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.pg-modal-body {
  padding: 32px 32px 28px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.pg-modal-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-weight: 600;
}
.pg-modal-title {
  font-size: 26px; font-weight: 800; color: #fff;
  line-height: 1.1; letter-spacing: -0.01em;
  margin: -8px 0 4px;
}
.pg-prompt-section { display: flex; flex-direction: column; gap: 8px; }
.pg-prompt-label {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Geist Mono', monospace;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--fg-3); font-weight: 600;
}
.pg-copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--fg-2);
  font-family: 'Geist Mono', monospace;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: all 180ms;
}
.pg-copy-btn:hover {
  background: rgba(245,200,66,0.15);
  border-color: rgba(245,200,66,0.4);
  color: var(--gold);
}
.pg-copy-btn.copied {
  background: rgba(140,255,170,0.12);
  border-color: rgba(140,255,170,0.4);
  color: #8cffaa;
}
.pg-prompt-text {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  color: rgba(255,255,255,0.92);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px; line-height: 1.65;
  margin: 0; white-space: pre-wrap; word-wrap: break-word;
  max-height: 260px; overflow-y: auto;
}
.pg-prompt-text.muted { color: rgba(255,255,255,0.6); }
.pg-prompt-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.pg-meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.pg-meta-chip b { color: #fff; font-weight: 600; }

/* 操作按钮区 */
.pg-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.pg-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.22,1,0.36,1);
}
.pg-action-btn:hover {
  background: rgba(245,200,66,0.10);
  border-color: rgba(245,200,66,0.45);
  color: var(--gold);
  transform: translateY(-1px);
}
.pg-action-btn.primary {
  background: linear-gradient(135deg, #f5c842 0%, #f97316 100%);
  color: #070810;
  border-color: transparent;
}
.pg-action-btn.primary:hover {
  color: #070810;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245,200,66,0.4);
}
.pg-action-btn.done {
  background: rgba(140,255,170,0.14) !important;
  border-color: rgba(140,255,170,0.4) !important;
  color: #8cffaa !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ─── "前往 AI 工具试一试" 入口栏 ─── */
.pg-ai-tools {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.pg-ai-tools-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.pg-ai-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pg-ai-tool-btn {
  --tool-color: #f5c842;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.22,1,0.36,1);
}
.pg-ai-tool-btn:hover {
  background: color-mix(in srgb, var(--tool-color) 16%, transparent);
  border-color: var(--tool-color);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px color-mix(in srgb, var(--tool-color) 40%, transparent);
}
.pg-ai-tool-btn svg:first-child {
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}
.pg-ai-tool-arrow {
  opacity: 0.45;
  margin-left: 1px;
  transition: all 200ms;
}
.pg-ai-tool-btn:hover .pg-ai-tool-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

@media (max-width: 1280px) {
  /* 10 列在普通桌面 → 8 列 */
  .pg-grid.cols-10 { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 960px) {
  .pg-grid { grid-template-columns: repeat(2, 1fr); }
  .pg-grid.cols-10 { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .pg-modal-grid { grid-template-columns: 1fr; }
  .pg-modal-media {
    aspect-ratio: auto;        /* 取消固定比例 */
    max-height: 50vh;
    padding: 12px;
    min-height: 240px;
  }
  .pg-modal-media img { max-height: calc(50vh - 24px); }
  .pg-modal-body { padding: 24px 22px; }
}
@media (max-width: 640px) {
  .pg-page-top { padding: 12px 16px; }
  .pg-page-wrap { padding: 28px 16px 60px; }
  .pg-grid, .pg-grid.cols-2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pg-grid.cols-10 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pg-grid.cols-10 .pg-item-label { font-size: 9px; }
  .pg-grid.cols-10 .pg-item-meta { font-size: 8px; }
  .pg-actions { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .pg-grid.cols-10 { grid-template-columns: repeat(3, 1fr); }
}
