/* ============ 前端展示页样式 ============ */

.gallery-header {
  background: #0f2d33;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.brand {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-entry {
  margin-left: auto;
  color: #b8cdd0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

.admin-entry:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Tab 栏（公共） */
.tab-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
}

.tab {
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

/* 一级：居家 / 院线 */
.tab-bar-group {
  background: #0f2d33;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 10px;
}

.tab-group {
  color: #b8cdd0;
  padding: 8px 34px;
  border-radius: 20px;
  font-size: 15px;
}

.tab-group:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.tab-group.active {
  background: #0e7c86;
  color: #fff;
}

/* 二级：视频 / 图片 / 其他 */
.tab-bar-type {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 53px;
  z-index: 49;
}

.tab-bar-type .tab:hover {
  background: var(--bg);
}

.tab-bar-type .tab.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* 主区域 */
.gallery-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* 显式列数，避免 auto-fit 在窄屏误算 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* 视频卡片 */
.video-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d1f24;
}

.video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 25, 30, 0.25);
  transition: background 0.15s;
}

.video-card:hover .play-overlay {
  background: rgba(10, 25, 30, 0.4);
}

.play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(14, 124, 134, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-meta {
  padding: 11px 13px;
}

.card-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.card-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 图片卡片 */
.image-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.image-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.image-thumb {
  aspect-ratio: 1 / 1;
  background: #eef1f4;
}

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

/* 其他文件列表 */
.other-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.other-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.other-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.other-info {
  flex: 1;
  min-width: 0;
}

.other-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.other-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.other-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* 视频弹层 */
.video-modal-body {
  width: 100%;
  max-width: 960px;
}

#player {
  width: 100%;
  max-height: 78vh;
  background: #000;
  border-radius: 10px;
  display: block;
}

.video-modal-title,
.lightbox-title {
  color: #dce6e8;
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 图片灯箱 */
.lightbox-body {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
}

#lightboxImg {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
}

.modal-close {
  position: fixed;
  top: 22px;
  right: 26px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

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

#imgPrev { left: 24px; }
#imgNext { right: 24px; }

/* 响应式 */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gallery-main { padding: 18px 14px 40px; }
  .header-inner { padding: 0 14px; }
  .tab-bar-type .tab { padding: 8px 14px; }
  .tab-group { padding: 8px 24px; }
  .tab-bar-type { top: 49px; }
  .admin-entry span { display: none; }
  .lightbox-nav { width: 42px; height: 42px; }
  #imgPrev { left: 8px; }
  #imgNext { right: 8px; }
  .other-actions .btn { padding: 6px 10px; }
}

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}
