/* ============================================================
   103班：素养领军班 · 班级图库样式
   缩略图网格 + 下载按钮 + 灯箱
   ============================================================ */

/* ====- 上传区 ---- */
/* hidden 属性默认是 display:none,但下面 .g-up 的 display:flex 会把它盖掉,
   导致「没权限的人也能看到上传框」。补一条强制隐藏,让权限开关真正生效 */
.g-up[hidden] { display: none; }
.g-up {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--glass-surface);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--glass-rim);
}
.g-up input[type="text"] {
  flex: 1;
  min-width: 190px;
  padding: 9px 13px;
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  background: var(--chip);
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
}
.g-up input[type="text"]:focus { border-color: var(--gold-line); }
/* 画质档位下拉 */
.g-sel {
  flex: none;
  padding: 9px 12px;
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  background: var(--chip);
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
}
.g-sel:focus { border-color: var(--gold-line); }
/* 下拉里的选项在 Windows 上默认白底黑字,显式给个深色底免得浅色皮肤下看不清 */
.g-sel option { background: #0e1422; color: #eef2f8; }
.g-pick {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  color: inherit;
  background: var(--chip);
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}
.g-pick input[type="file"] { display: none; }
.g-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 12px;
  color: #0b0f1a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.g-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.g-hint { font-size: 0.76rem; color: var(--muted); letter-spacing: 0.02em; }
.g-err { color: #e5484d; }

/* 上传进度条 */
.g-prog {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 18px;
  padding: 0 2px;
}
.g-prog[hidden] { display: none; }
.g-prog i {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: var(--chip);
  overflow: hidden;
  position: relative;
  display: block;
}
.g-prog i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width 0.1s linear;
}
/* 进度条本身用 JS 改 #g-prog-bar 的 width,这里只兜底样式 */
#g-prog-bar { position: relative; display: block; width: 0; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.g-prog span { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

/* 卡片底部操作条:名字单独一行,保存/删除跟在下面一行 */
.gal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
/* 卡片里的下载画质下拉:小一号,和保存/删除同一行,窄屏自动折行 */
.gal-sel {
  flex: none;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--glass-brd);
  border-radius: 999px;
  background: var(--chip);
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.72rem;
  cursor: pointer;
  outline: none;
}
.gal-sel:focus { border-color: var(--gold-line); }
.gal-sel option { background: #0e1422; color: #eef2f8; }
.gal-del {
  flex: none;
  padding: 6px 10px;
  border: 1px solid rgba(229, 72, 77, 0.7);
  background: rgba(229, 72, 77, 0.14);
  color: #ff8b90;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
}
.gal-del:hover { background: rgba(229, 72, 77, 0.28); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gallery-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  border-radius: 18px;
  font-size: 0.9rem;
  color: var(--faint);
}

/* 玻璃相框:照片内缩 6px,四周露出一圈模糊玻璃 */
.gal-item {
  position: relative;
  margin: 0;
  padding: 6px;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--glass-surface);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--glass-rim);
  transition: transform 0.25s, color 0.6s ease,
    background-color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.gal-item:hover { transform: scale(1.02); border-color: var(--gold-line); }

.gal-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  transition: transform 0.4s;
}
.gal-item:hover img { transform: scale(1.05); }

.gal-item figcaption {
  /* 独立底栏:放在图片正下方,不再绝对定位压在图上(压在图上会被纹理挡住看不清) */
  position: static;
  display: block;
  padding: 10px 8px 4px;
  font-size: 0.84rem;
  color: var(--text);
  background: none;
  opacity: 1;
  transition: color 0.6s ease;
}

.gal-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 600;
}

/* 上传者:标题下面一行小灰字 */
.gal-author {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* 保存按钮:小金药丸,触屏上 hover 不到也能点(现在是 <button>,补上按钮的默认样式重置) */
.gal-dl {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0b0f1a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s;
}
.gal-dl:disabled { opacity: 0.6; cursor: progress; }
.gal-dl:hover { filter: brightness(1.08); }

/* 手机:网格缩成两列,按钮小一号 */
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gal-item figcaption { padding: 9px 6px 2px; }
  .gal-dl { padding: 5px 10px; font-size: 0.74rem; }
}

@media (max-width: 420px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ---- 灯箱下载栏:大图下方一排,标题 + 下载原图 ---- */
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
}
.lb-bar .lightbox-caption { margin: 0; }
.lb-dl {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0b0f1a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s;
}
.lb-dl:disabled { opacity: 0.6; cursor: progress; }
.lb-dl:hover { filter: brightness(1.08); }

@media (max-width: 520px) {
  .lb-bar { flex-direction: column; flex-wrap: wrap; gap: 10px; }
}

/* ============================================================
   灯箱 + 照片评论
   图库灯箱改成「上面一张图、下面一栏评论」,
   高光照片还是只有图(没有图库主键,评论栏自动隐藏)
   ============================================================ */
.gal-lb {
  flex-direction: column;
  gap: 14px;
}
.gal-lb .lb-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}
.gal-lb .lightbox-img,
.gal-lb #lightbox-img {
  max-height: 46vh;
}

.lb-comments {
  width: min(680px, 92vw);
  max-height: 36vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: var(--glass-rim);
}
.lb-comments[hidden] { display: none; }

.lbc-head {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.lbc-list {
  flex: 1;
  min-height: 54px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}
.lbc-list::-webkit-scrollbar { width: 4px; }
.lbc-list::-webkit-scrollbar-thumb { background: var(--chip); border-radius: 4px; }
.lbc-empty {
  margin: 0;
  padding: 12px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.lbc-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.lbc-item.is-reply { margin-left: 32px; }
.lbc-av {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip);
}
.lbc-av-t {
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
}
.lbc-body { flex: 1; min-width: 0; }
.lbc-name {
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.lbc-to { color: var(--gold); }
.lbc-time { opacity: 0.7; }
.lbc-text {
  margin-top: 2px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.lbc-r {
  flex: none;
  border: none;
  background: none;
  padding: 0 2px;
  font-family: inherit;
  font-size: 0.74rem;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.75;
  transition: color 0.2s, opacity 0.2s;
}
.lbc-r:hover { color: var(--gold); opacity: 1; }
/* 回复 / 删除竖着排在右边,不挤占正文宽度 */
.lbc-acts {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.lbc-del:hover { color: #e06666; }

.lbc-reply {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--muted);
  font-size: 0.76rem;
}
.lbc-reply[hidden] { display: none; }
.lbc-reply button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.lbc-form { display: flex; flex-direction: column; gap: 8px; }
#lbc-input {
  width: 100%;
  resize: none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  background: var(--chip);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
}
#lbc-input:focus { outline: 1px solid var(--gold); }
.lbc-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.lbc-ai,
.lbc-send {
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, opacity 0.2s;
}
.lbc-ai {
  border: 1px solid var(--glass-brd);
  background: transparent;
  color: var(--gold);
}
.lbc-ai:hover { background: var(--gold-soft); }
.lbc-send {
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #0b0f1a;
}
.lbc-ai:disabled,
.lbc-send:disabled { opacity: 0.6; cursor: progress; }

.lbc-sug {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lbc-sug[hidden] { display: none; }
.lbc-sug button {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-brd);
  background: var(--chip);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lbc-sug button:hover { border-color: var(--gold); color: var(--gold); }
.lbc-msg {
  margin: 0;
  min-height: 1em;
  font-size: 0.76rem;
  color: var(--muted);
}

@media (max-width: 620px) {
  .gal-lb #lightbox-img { max-height: 40vh; }
  .lb-comments { max-height: 44vh; }
}

/* 照片 / 视频合并后的视频区标题 */
.media-head {
  margin: 56px 0 22px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.media-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.media-head p { font-size: 0.86rem; color: var(--muted); }
@media (max-width: 520px) {
  .media-head { margin-top: 42px; }
}
/* AI 助手正在思考…占位 */
.lbc-thinking { opacity: .7; }
.lbc-thinking .lbc-name,
.lbc-thinking .lbc-time { color: #8a94a6; font-style: italic; }
