/* ============================================================
   公共画廊样式 — 瀑布流拼贴 + 入场动画
   暖纸设计系统
   ============================================================ */

/* --- 画廊区块 --- */
.gallery-section {
  max-width: 1200px;
  margin: 60px auto 80px;
  padding: 0 24px;
}

/* --- 标题 --- */
.gallery-head {
  text-align: center;
  padding: 40px 0 32px;
}
.gallery-head h2 {
  font-family: 'Fraunces', 'Noto Sans SC', Georgia, serif;
  font-weight: 500;
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 8px;
}
.gallery-head p {
  font-size: 14px;
  color: var(--ink-3);
  margin: 0;
}

/* --- 瀑布流网格（CSS Columns） --- */
.gallery-grid {
  column-count: 4;
  column-gap: 16px;
}
.gallery-card {
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);

  /* 入场预备 */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .5s var(--ease), transform .6s var(--spring), box-shadow .35s var(--ease);
}
.gallery-card.is-enter {
  opacity: 1;
  transform: translateY(0);
}
.gallery-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.gallery-card.is-enter:hover {
  transform: translateY(-3px);
}

/* --- 卡片图片区 --- */
.gallery-card-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.gallery-card-img img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .4s var(--ease);
}
.gallery-card:hover .gallery-card-img img {
  transform: scale(1.03);
}

/* 底部提示词遮罩 */
.gallery-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.62));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.gallery-card-prompt {
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
  min-width: 0;
}
/* 悬停复制按钮 */
.gallery-card-copy-btn {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: none; border-radius: 6px;
  background: rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s var(--ease-soft), background-color .2s var(--ease-soft), transform .3s var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.gallery-card-copy-btn svg { width: 14px; height: 14px; }
.gallery-card:hover .gallery-card-copy-btn,
.gallery-card-copy-btn:focus-visible { opacity: 1; }
.gallery-card-copy-btn:hover { background: rgba(255,255,255,.32); transform: scale(1.12); }
.gallery-card-copy-btn:active { transform: scale(.92); }
/* 移动端始终显示复制按钮 */
@media (hover: none) {
  .gallery-card-copy-btn { opacity: .85; }
}

/* --- 卡片底部昵称 --- */
.gallery-card-author {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--ink-3);
}

/* --- 加载失败占位 --- */
.gallery-card-fail {
  background: var(--card-2);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 13px;
}
.gallery-card-fail svg {
  width: 28px;
  height: 28px;
  opacity: .5;
}
.gallery-card-fail:hover {
  background: var(--paper);
  color: var(--ink-2);
}

/* --- Sentinel（无限滚动触发点） --- */
.gallery-sentinel {
  height: 20px;
}

/* --- 已到底 --- */
.gallery-end {
  text-align: center;
  padding: 32px 0 20px;
  color: var(--ink-3);
  font-size: 13px;
}

/* --- Lightbox 发布按钮（历史记录 lightbox 用） --- */
.gallery-publish-btn {
  color: var(--clay-deep) !important;
  border-color: var(--clay-line) !important;
}
.gallery-publish-btn.is-published {
  color: var(--err) !important;
  border-color: rgba(192,87,61,0.3) !important;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1100px) {
  .gallery-grid { column-count: 3; }
}
@media (max-width: 750px) {
  .gallery-grid { column-count: 2; column-gap: 10px; }
  .gallery-card { margin-bottom: 10px; }
  .gallery-section { padding: 0 12px; margin: 40px auto 60px; }
  .gallery-head { padding: 28px 0 20px; }
  .gallery-head h2 { font-size: 24px; }
  .gallery-card-overlay { padding: 20px 8px 8px; }
  .gallery-card-prompt { font-size: 11.5px; }
}
