/* ===================================================================
   班级空间 · 相册
   目标：像翻相册，不像填表格。沉浸式封面 + 时间线 + 瀑布流 + 全屏看图。
   =================================================================== */

.space-page { background: var(--bg); }

/* ---------- 沉浸式封面 ---------- */
.sp-hero {
  position: relative;
  height: 238px;
  overflow: hidden;
  background: #0e1219;
  isolation: isolate;
}
@media (min-width: 600px) { .sp-hero { height: 292px; } }

.sp-hero-bg {
  position: absolute;
  inset: -34px;
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(1.3) brightness(0.78);
  transform: scale(1.1);
  opacity: 1;
  transition: opacity 0.6s ease;
}
.sp-hero.no-photo .sp-hero-bg {
  filter: none;
  transform: none;
  inset: 0;
  background-image:
    radial-gradient(120% 100% at 8% 0%, #3f7bff 0%, transparent 55%),
    radial-gradient(110% 90% at 100% 10%, #7c5cff 0%, transparent 50%),
    linear-gradient(160deg, #16233f 0%, #101725 60%, #0b0f16 100%);
}

.sp-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 16, 0.42) 0%, rgba(7, 10, 16, 0.12) 30%, rgba(7, 10, 16, 0.72) 82%, rgba(7, 10, 16, 0.9) 100%);
}
.sp-hero.no-photo .sp-hero-scrim {
  background: linear-gradient(180deg, rgba(7, 10, 16, 0.2) 0%, rgba(7, 10, 16, 0.1) 40%, rgba(7, 10, 16, 0.55) 100%);
}

.sp-hero-inner {
  position: relative;
  height: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 26px;
  display: flex;
  flex-direction: column;
}

.sp-hero-top { display: flex; align-items: center; gap: 10px; }
.sp-hero-top .spacer { flex: 1; }

.sp-orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.18s ease, background 0.18s ease;
  text-decoration: none;
  flex: none;
}
.sp-orb:active { transform: scale(0.93); background: rgba(255, 255, 255, 0.26); }
.sp-orb .ic { width: 19px; height: 19px; }

.sp-hero-txt { margin-top: auto; color: #fff; }
.sp-eyebrow {
  font-size: 11.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}
.sp-title {
  margin: 7px 0 0;
  font-size: 29px;
  line-height: 1.18;
  font-weight: 750;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}
@media (min-width: 600px) { .sp-title { font-size: 34px; } }
.sp-sub {
  margin-top: 7px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.76);
  font-variant-numeric: tabular-nums;
}

/* ---------- 内容区：压在封面上，圆角上浮 ---------- */
.sp-body {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: -22px auto 0;
  padding: 0 14px calc(120px + var(--safe-b));
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  min-height: 60vh;
}
.sp-ann { padding-top: 14px; }

/* ---------- 滚动后浮出的迷你标题栏 ---------- */
.sp-mini {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(7px + env(safe-area-inset-top)) 14px 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(247, 248, 250, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(16, 24, 40, 0.06);
  transform: translateY(-105%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sp-mini.show { transform: none; }
.sp-mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: #eceff4;
  flex: none;
}
.sp-mini-btn .ic { width: 18px; height: 18px; }
.sp-mini-t { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.sp-mini-n { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 时间线 ---------- */
.tl-h {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 18px 4px 9px;
}
.tl-h:first-child { padding-top: 12px; }
.tl-d { font-size: 13.5px; font-weight: 700; letter-spacing: 0.2px; }
.tl-w { font-size: 11.5px; color: var(--muted); }
.tl-n {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.mason { display: flex; align-items: flex-start; gap: 7px; }
@media (min-width: 600px) { .mason { gap: 9px; } }
.mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
@media (min-width: 600px) { .mcol { gap: 9px; } }

.ph {
  width: 100%;
  margin: 0;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  background: #e8eaee;
  cursor: pointer;
  aspect-ratio: var(--ar, 1);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 16px -12px rgba(16, 24, 40, 0.3);
  animation: phIn 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@media (min-width: 600px) { .ph { border-radius: 15px; } }
@keyframes phIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

.ph img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ph:active img { transform: scale(1.025); }
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05);
  pointer-events: none;
}

.ph .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 9px 7px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(transparent, rgba(8, 11, 16, 0.66));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 空态 ---------- */
.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 46vh;
  padding: 20px 20px 40px;
}
.sp-empty-art {
  width: 108px;
  height: 96px;
  margin: 0 auto 20px;
  position: relative;
}
.sp-empty-art i {
  position: absolute;
  inset: 14px 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px -12px rgba(16, 24, 40, 0.3);
}
.sp-empty-art i:nth-child(1) { transform: rotate(-11deg) translate(-9px, 4px); opacity: 0.55; }
.sp-empty-art i:nth-child(2) { transform: rotate(7deg) translate(7px, 2px); opacity: 0.8; }
.sp-empty-art i:nth-child(3) {
  transform: none;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f7f9ff, #eef3ff);
  border-color: #dde6fb;
}
.sp-empty-art i:nth-child(3) .ic { width: 26px; height: 26px; color: #9db2e0; }
.sp-empty h3 { margin: 0 0 7px; font-size: 15px; font-weight: 700; }
.sp-empty p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

/* ---------- 游客提示 ---------- */
.sp-gate {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.sp-gate .ic { width: 16px; height: 16px; color: #b3bac6; flex: none; }
.sp-gate a { margin-left: auto; color: var(--accent); font-weight: 650; text-decoration: none; white-space: nowrap; }

/* ---------- 上传按钮 ---------- */
.sp-fab {
  position: fixed;
  right: 18px;
  bottom: calc(22px + var(--safe-b));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  z-index: 44;
  background: linear-gradient(150deg, #4a83ff 0%, #2f6bff 55%, #2358e0 100%);
  box-shadow: 0 12px 26px -10px rgba(47, 107, 255, 0.7), 0 2px 8px rgba(16, 24, 40, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
}
.sp-fab:active { transform: scale(0.92); box-shadow: 0 6px 14px -8px rgba(47, 107, 255, 0.6); }
.sp-fab .ic { width: 25px; height: 25px; stroke-width: 2; }
.sp-fab[disabled] { opacity: 0.65; }

/* 上传进度 */
.sp-prog {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(92px + var(--safe-b));
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  animation: phIn 0.25s ease both;
}
.sp-prog .bar { width: 74px; height: 3.5px; border-radius: 3px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
.sp-prog .bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: #fff; transition: width 0.28s ease; }

/* ---------- 底部选择条 ---------- */
.sp-sheet-wrap { position: fixed; inset: 0; z-index: 80; display: none; }
.sp-sheet-wrap.show { display: block; }
.sp-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 17, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.sp-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 8px 18px calc(18px + var(--safe-b));
  animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  box-shadow: 0 -8px 40px -12px rgba(16, 24, 40, 0.3);
}
@keyframes rise { from { transform: translateY(100%); } }
.sp-grab { width: 36px; height: 4px; border-radius: 3px; background: #e2e5ea; margin: 4px auto 14px; }
.sp-sheet h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.sp-sheet .sp-note { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }

.sp-strip { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 2px; scrollbar-width: none; }
.sp-strip::-webkit-scrollbar { display: none; }
.sp-strip img {
  width: 58px;
  height: 58px;
  flex: none;
  object-fit: cover;
  border-radius: 10px;
  background: #eef0f3;
  animation: phIn 0.3s ease both;
}
.sp-sheet .input { margin-bottom: 13px; }
.sp-sheet-acts { display: flex; gap: 10px; }
.sp-sheet-acts .btn { flex: 1; height: 44px; }

/* ---------- 全屏看图 ---------- */
.sp-lb { position: fixed; inset: 0; z-index: 90; background: #06080c; display: none; }
.sp-lb.show { display: block; animation: fadeIn 0.18s ease both; }

.lb-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  color: #fff;
  z-index: 3;
  background: linear-gradient(rgba(6, 8, 12, 0.6), transparent);
}
.lb-count { font-size: 12.5px; letter-spacing: 0.6px; opacity: 0.82; font-variant-numeric: tabular-nums; }
.lb-sp { flex: 1; }
.lb-x {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}
.lb-x .ic { width: 17px; height: 17px; }

.lb-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-stage img.out-l { opacity: 0; transform: translateX(-46px); }
.lb-stage img.out-r { opacity: 0; transform: translateX(46px); }
.lb-stage .lb-load {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.85s linear infinite;
  position: absolute;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lb-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: #fff;
  background: linear-gradient(transparent, rgba(6, 8, 12, 0.78) 42%, rgba(6, 8, 12, 0.94));
  z-index: 3;
}
.lb-txt { flex: 1; min-width: 0; }
.lb-cap { font-size: 14.5px; line-height: 1.5; font-weight: 500; }
.lb-cap:empty { display: none; }
.lb-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.lb-meta span { display: inline-flex; align-items: center; gap: 4px; }
.lb-meta .ic { width: 12px; height: 12px; }
.lb-act {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  flex: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.lb-act:active { transform: scale(0.93); }
.lb-act .ic { width: 17px; height: 17px; }
.lb-act.danger { background: rgba(255, 90, 90, 0.16); color: #ff9c9c; }

@media (prefers-reduced-motion: reduce) {
  .ph, .sp-empty-art i, .sp-sheet, .sp-mask, .sp-lb { animation: none !important; }
  .ph img, .lb-stage img { transition: none !important; }
}
