﻿/* ============================================================
   content-gallery.css — 鎏金相册 · 记忆宫
   设计方向：暗金+米白双调 · 相册封面鎏金描边 · 宣纸质感
   ============================================================ */

/* ---------- Stats 条（改为卡片式） ---------- */
.stats-bar {
  display: flex;
  gap: 16px;
  margin: 16px 0 20px;
}
.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: linear-gradient(180deg, #FFFDF4, #F8F0D8);
  border: 1px solid #D4BE8A;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,235,180,0.6);
}
.stat-num {
  font-family: KaiTi, "楷体", "STKaiti", serif;
  font-size: 32px;
  font-weight: 700;
  color: #8B4513;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,245,200,0.7);
}
.stat-lbl {
  margin-top: 4px;
  font-size: 12px;
  color: #8B5E3C;
  letter-spacing: 2px;
}

/* ---------- 存储进度条 ---------- */
.storage-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: #FBF8F0;
  border: 1px solid #E2D7BE;
  border-radius: 6px;
  font-size: 12px;
  color: #6B4423;
}
.storage-bar-wrap {
  flex: 1;
  height: 6px;
  background: #E8DFC8;
  border-radius: 3px;
  overflow: hidden;
}
.storage-bar {
  height: 100%;
  background: linear-gradient(90deg, #C9A565, #8B5E3C);
  border-radius: 3px;
  transition: width 0.6s;
}

/* ---------- 相册卡片网格 ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 4px;
}
.album-card {
  position: relative;
  background: #FFFDF4;
  border: 1.5px solid #D4BE8A;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s;
  box-shadow: 0 2px 8px rgba(139,94,60,0.1);
  animation: albumFadeIn 0.5s ease both;
}
@keyframes albumFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(139,94,60,0.22), 0 0 0 1px rgba(212,165,116,0.5);
  border-color: #B8984A;
}
/* 鎏金描边光效（hover） */
.album-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212,165,116,0) 40%, rgba(212,165,116,0.18) 50%, rgba(212,165,116,0) 60%);
  background-size: 200% 200%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.album-card:hover::before {
  opacity: 1;
  animation: goldShine 1.8s ease;
}
@keyframes goldShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 封面 */
.album-cover {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #F8E8C4, #E8D4A0);
  overflow: hidden;
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.album-card:hover .album-cover img {
  transform: scale(1.06);
}
.album-cover::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
}
.album-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}

/* 内容区 */
.album-body {
  padding: 14px 16px 18px;
}
.album-name {
  font-size: 16px;
  font-weight: 700;
  color: #3D2816;
  margin-bottom: 4px;
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-sub {
  font-size: 12px;
  color: #8B5E3C;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.album-desc {
  font-size: 12px;
  color: #9A7A5B;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 操作按钮（hover 才显示） */
.album-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.22s;
}
.album-card:hover .album-actions {
  opacity: 1;
  transform: translateY(0);
}
.act-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #6B4423;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.18s;
}
.act-btn:hover { background: #C9A565; color: #FFF; transform: scale(1.1); }
.act-btn.del:hover { background: #B83A1A; }

/* ---------- 新建相册按钮（加在 toolbar 里） ---------- */
.gal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  gap: 12px;
}
.gal-toolbar .gal-tool-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------- 照片网格弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12002;
  animation: modalFade 0.2s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: #FFFDF4;
  border: 1.5px solid #D4BE8A;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-album { width: 420px; }
.modal-photo { width: 85vw; max-width: 1100px; }
.modal-upload { width: 500px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(90deg, #FFFDF4, #F8F0D8);
  border-bottom: 1px solid #E2D7BE;
}
.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #3D2816;
  letter-spacing: 1px;
}
.modal-header-right { display: flex; align-items: center; gap: 10px; }
.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  font-size: 20px;
  color: #8B5E3C;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.18s;
}
.modal-close:hover { background: #E8DFC8; color: #B83A1A; transform: rotate(90deg); }

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 20px;
  background: #FBF8F0;
  border-top: 1px solid #E2D7BE;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单 */
.mf-label {
  display: block;
  font-size: 12px;
  color: #8B5E3C;
  margin: 10px 0 4px;
  letter-spacing: 1px;
}
.mf-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #D4BE8A;
  border-radius: 6px;
  background: #FFFDF4;
  color: #3D2816;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mf-input:focus {
  outline: none;
  border-color: #B8984A;
  box-shadow: 0 0 0 3px rgba(212,165,116,0.2);
}

.mf-btn {
  padding: 8px 18px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.mf-btn.sm { padding: 5px 12px; font-size: 12px; }
.mf-btn.cancel { background: #E8DFC8; color: #6B4423; }
.mf-btn.cancel:hover { background: #D4BE8A; }
.mf-btn.primary {
  background: linear-gradient(180deg, #C9A565, #8B5E3C);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(139,94,60,0.3);
}
.mf-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,94,60,0.4); }
.mf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 年月筛选 */
.month-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2D7BE;
}
.month-tag {
  padding: 4px 12px;
  font-size: 12px;
  color: #8B5E3C;
  background: #FBF8F0;
  border: 1px solid #D4BE8A;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.month-tag:hover { background: #F8F0D8; }
.month-tag.active {
  background: linear-gradient(180deg, #C9A565, #8B5E3C);
  color: #FFF;
  border-color: #8B5E3C;
  box-shadow: 0 2px 6px rgba(139,94,60,0.3);
}

/* 照片网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}
.photo-cell {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #F8F0D8;
  transition: transform 0.2s;
}
.photo-cell:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.photo-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.photo-cell:hover img { transform: scale(1.08); }
.photo-cell-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #FFF;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s;
}
.photo-cell:hover .photo-cell-overlay { opacity: 1; }
.pv, .pl { display: inline-flex; gap: 2px; }
.pd-btn {
  width: 22px; height: 22px;
  border: none;
  background: rgba(255,255,255,0.9);
  color: #B83A1A;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
}
.photo-empty {
  padding: 40px;
  text-align: center;
  color: #9A7A5B;
  font-size: 14px;
}
.photo-load-more {
  text-align: center;
  padding: 12px;
  margin-top: 12px;
  color: #8B5E3C;
  cursor: pointer;
  font-size: 13px;
  border-top: 1px solid #E2D7BE;
}
.photo-load-more:hover { color: #B8984A; }

/* 大图预览 */
.photo-viewer {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-viewer img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: #FFFDF4;
}
.pv-close, .pv-prev, .pv-next {
  position: absolute;
  border: none;
  background: rgba(255,255,255,0.92);
  color: #3D2816;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2;
}
.pv-close { top: -40px; right: 0; width: 36px; height: 36px; font-size: 22px; line-height: 1; }
.pv-prev { left: -50px; width: 44px; height: 44px; font-size: 28px; }
.pv-next { right: -50px; width: 44px; height: 44px; font-size: 28px; }
.pv-close:hover, .pv-prev:hover, .pv-next:hover {
  background: #C9A565;
  color: #FFF;
  transform: scale(1.08);
}
.pv-info {
  position: absolute;
  bottom: -44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  color: #3D2816;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.pv-like {
  border: none;
  background: transparent;
  color: #B83A1A;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.pv-like:hover { color: #8B1A1A; }

/* 上传区 */
.upload-drop {
  padding: 30px;
  text-align: center;
  border: 2px dashed #D4BE8A;
  border-radius: 10px;
  background: #FBF8F0;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-drop:hover, .upload-drop.drag-over {
  border-color: #B8984A;
  background: #FFFDF4;
}
.ud-icon { font-size: 40px; margin-bottom: 8px; }
.ud-text { font-size: 13px; color: #8B5E3C; }
.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.up-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 4px;
  overflow: hidden;
}
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-status {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2px;
  font-size: 10px;
  text-align: center;
  background: rgba(0,0,0,0.6);
  color: #FFF;
}
.up-status.ok { background: rgba(4,120,87,0.8); }
.up-status.err { background: rgba(184,58,26,0.8); }
.up-done {
  margin-top: 10px;
  padding: 8px;
  background: #DCFCE7;
  color: #047857;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .pv-prev { left: 8px; }
  .pv-next { right: 8px; }
  .pv-close { top: 8px; right: 8px; }
}
