/* ============================================================
   班级照片墙 — 样式
   深色全屏画布 / 无缝拼图 / 悬浮玻璃工具栏 / 响应式
   ============================================================ */

:root {
  --bg: #0d0f12;
  --bg-elev: #14181e;
  --surface: rgba(22, 26, 33, 0.72);
  --surface-solid: #161a21;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ecf1;
  --text-dim: #9aa3af;
  --text-faint: #6d7682;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.16);
  --violet: #7c5cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-float: 0 10px 34px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
}

/* ---------- 背景 ---------- */
.bg-layer {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 720px at 16% -12%, rgba(91, 140, 255, 0.17), transparent 62%),
    radial-gradient(1000px 780px at 94% 4%, rgba(124, 92, 255, 0.13), transparent 60%),
    radial-gradient(900px 620px at 52% 116%, rgba(52, 211, 153, 0.07), transparent 66%),
    linear-gradient(180deg, #0e1115 0%, #0d0f12 52%, #0b0d10 100%);
  z-index: 0;
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---------- 图标 ---------- */
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-lg {
  width: 28px;
  height: 28px;
}

.icon-xl {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}

/* ---------- 画布 / 无缝照片 ---------- */
.stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  outline: none;
}

.stage.is-panning {
  cursor: grabbing;
}

.stage:focus-visible {
  outline: 2px solid rgba(91, 140, 255, 0.55);
  outline-offset: -3px;
}

.canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
  font-size: 0;
  line-height: 0;
  backface-visibility: hidden;
}

.canvas.is-animating {
  transition: transform 0.26s var(--ease-out);
}

/* 照片块：绝对定位、零圆角、零间距 —— 无缝的关键 */
.ph {
  position: absolute;
  overflow: hidden;
  background: #15191f;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  outline: none;
  cursor: zoom-in;
  contain: layout paint style;
}

.ph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* 极轻微外扩，杜绝小数缩放下的 1px 缝隙（视觉上不可察觉） */
  transform: scale(1.0025);
  transform-origin: center;
  transition: opacity 0.32s ease, filter 0.18s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.ph--loaded img {
  opacity: 1;
}

/* 等比例瀑布流 / 近方形 1:1：块宽高比=原图比例，contain 保证任何舍入误差下都不裁剪照片 */
.canvas[data-layout-mode="masonry"] .ph img,
.canvas[data-layout-mode="square"] .ph img {
  object-fit: contain;
}

.ph:hover img {
  filter: brightness(1.06);
}

/* 骨架占位：中性深色微光，不闪白 */
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #14181e 18%, #1c222a 38%, #14181e 58%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.ph--loaded::before {
  opacity: 0;
  animation: none;
}

.ph--failed::before {
  animation: none;
  background: linear-gradient(160deg, #1a1f26, #12161b);
}

.ph--failed::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.022) 0 10px,
    transparent 10px 20px
  );
  pointer-events: none;
}

.ph-fail {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 8px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  background: rgba(13, 15, 18, 0.35);
}

.ph--failed .ph-fail {
  display: grid;
}

.ph-actions {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 3;
}

.ph:hover .ph-actions,
.ph:focus-within .ph-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.ph-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(13, 16, 20, 0.66);
  backdrop-filter: blur(8px);
  color: #f2f5f9;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ph-action:hover {
  background: rgba(30, 38, 50, 0.9);
  transform: translateY(-1px);
}

.ph:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(91, 140, 255, 0.85);
  z-index: 3;
}

.ph--enter {
  animation: phEnter 0.5s var(--ease-out) both;
}

.ph--spotlight {
  animation: spotlight 2.6s ease both;
  z-index: 2;
}

@media (hover: none) {
  .ph-actions {
    display: none;
  }
}

/* ---------- 顶部工具栏 ---------- */
.toolbar {
  position: fixed;
  z-index: 40;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  max-width: 1180px;
  margin-inline: auto;
}

.toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 7px 8px 7px 13px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(26, 30, 37, 0.82), rgba(16, 19, 24, 0.74));
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--shadow-float);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #5b8cff, #7c5cff 58%, #4f6cff);
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-logo svg {
  width: 21px;
  height: 21px;
  fill: rgba(255, 255, 255, 0.94);
  stroke: none;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.meta-sep {
  width: 1px;
  height: 9px;
  background: var(--stroke-strong);
}

.meta-online {
  color: #8fe0c0;
}

.meta-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b9c8ff;
  font-weight: 500;
}

.meta-mode::before {
  content: "";
  width: 1px;
  height: 9px;
  background: var(--stroke-strong);
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6d7682;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.conn[data-state="online"] .conn-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  animation: pulseDot 2.6s ease infinite;
}

.conn[data-state="online"] .conn-text {
  color: #86dfba;
}

.conn[data-state="reconnecting"] .conn-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.conn[data-state="reconnecting"] .conn-text {
  color: #f4cf7c;
}

.conn[data-state="offline"] .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.conn[data-state="offline"] .conn-text {
  color: #f5a3a3;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--stroke);
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--stroke-strong);
}

.btn-primary {
  background: linear-gradient(180deg, #6f97ff, #4d7cff);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 6px 18px rgba(77, 124, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #82a4ff, #5b88ff);
}

.btn-accent {
  background: linear-gradient(180deg, #8b6bff, #6a4cff);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 6px 18px rgba(106, 76, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-accent:hover {
  background: linear-gradient(180deg, #9a7dff, #7859ff);
}

.btn-icon {
  width: 40px;
  padding: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

/* 下载整图 主按钮 + 尺寸下拉 */
.split {
  position: relative;
  display: flex;
  align-items: stretch;
}

.split .btn-download {
  border-radius: 11px 0 0 11px;
  padding-right: 11px;
}

.split .btn-caret {
  width: 32px;
  padding: 0;
  border-radius: 0 11px 11px 0;
  border-left: 1px solid rgba(0, 0, 0, 0.22);
}

.split .btn-caret .icon {
  width: 16px;
  height: 16px;
}

.menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  min-width: 196px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke-strong);
  background: rgba(22, 26, 33, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.14s ease both;
}

.menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  transition: background 0.12s ease;
}

.menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.menu button[aria-checked="true"] {
  background: rgba(91, 140, 255, 0.16);
}

.menu button[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  right: 16px;
  color: var(--accent);
  font-size: 12px;
}

.menu button {
  position: relative;
}

.menu button small {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
}

/* ---------- 右下缩放控件 ---------- */
.zoom {
  position: fixed;
  z-index: 36;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(18, 22, 28, 0.74);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}

.zoom-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.zoom-btn:active {
  transform: scale(0.94);
}

.zoom-fit {
  border-top: 1px solid var(--stroke);
  border-radius: 0 0 10px 10px;
  margin-top: 2px;
}

/* ---------- 底部手势提示 ---------- */
.stage-hint {
  position: fixed;
  z-index: 20;
  left: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(16, 20, 26, 0.6);
  backdrop-filter: blur(12px);
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
}

.hint-mobile {
  display: none;
}

/* ---------- 空墙引导 ---------- */
.empty {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 20px 40px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: fadeIn 0.4s ease both;
}

.empty::-webkit-scrollbar {
  display: none;
}

.empty-card {
  width: 100%;
  max-width: 580px;
  padding: 30px 28px 26px;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.empty-tiles {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 7px;
  height: 76px;
  margin-bottom: 18px;
}

.empty-tiles span {
  display: block;
  border-radius: 7px;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.34), rgba(124, 92, 255, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.09);
  animation: tileFloat 4.6s ease-in-out infinite;
}

.empty-tiles span:nth-child(1) {
  width: 48px;
  height: 42px;
  animation-delay: 0s;
  opacity: 0.75;
}
.empty-tiles span:nth-child(2) {
  width: 58px;
  height: 60px;
  animation-delay: 0.35s;
}
.empty-tiles span:nth-child(3) {
  width: 66px;
  height: 48px;
  animation-delay: 0.7s;
  opacity: 0.85;
}
.empty-tiles span:nth-child(4) {
  width: 54px;
  height: 66px;
  animation-delay: 1.05s;
}
.empty-tiles span:nth-child(5) {
  width: 44px;
  height: 38px;
  animation-delay: 1.4s;
  opacity: 0.6;
}

.empty-title {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.empty-sub {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.65;
}

.empty-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin-top: 20px;
  padding: 22px 18px;
  border-radius: 16px;
  border: 1.5px dashed rgba(91, 140, 255, 0.45);
  background: rgba(91, 140, 255, 0.07);
  color: var(--text);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.empty-drop .icon {
  color: var(--accent);
  margin-bottom: 2px;
}

.empty-drop strong {
  font-size: 15px;
  font-weight: 600;
}

.empty-drop span {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.empty-drop:hover {
  border-color: rgba(91, 140, 255, 0.8);
  background: rgba(91, 140, 255, 0.13);
  transform: translateY(-1px);
}

.empty-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.empty-steps li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.32);
  color: #a9c1ff;
  font-size: 11.5px;
  font-weight: 650;
}

.empty-steps strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.empty-steps p {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.empty-mode-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- 上传进度面板 ---------- */
.upload-panel {
  position: fixed;
  z-index: 45;
  top: calc(80px + env(safe-area-inset-top, 0px));
  left: 16px;
  width: 336px;
  max-height: min(46vh, 380px);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(18, 22, 28, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
  animation: panelIn 0.22s var(--ease-out) both;
}

.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
}

.upload-summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upload-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.upload-name {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.upload-pct {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.upload-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.18s ease;
}

.upload-item[data-status="done"] .upload-bar span {
  background: linear-gradient(90deg, #34d399, #22c55e);
}

.upload-item[data-status="fail"] .upload-bar span {
  background: var(--danger);
}

.upload-item[data-status="fail"] .upload-pct {
  color: #f5a3a3;
}

.upload-note {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.upload-item[data-status="preparing"] .upload-pct {
  color: #a9c1ff;
}

.upload-item[data-status="verifying"] .upload-pct {
  color: #f4cf7c;
}

.upload-item[data-status="preparing"] .upload-bar span,
.upload-item[data-status="verifying"] .upload-bar span {
  width: 100% !important;
  background: linear-gradient(
    90deg,
    rgba(91, 140, 255, 0.22),
    var(--accent),
    rgba(91, 140, 255, 0.22)
  );
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  z-index: 80;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: min(92vw, 430px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--stroke-strong);
  border-left: 3px solid var(--accent);
  background: rgba(24, 29, 36, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}

.toast.is-in {
  opacity: 1;
  transform: none;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast--success {
  border-left-color: var(--ok);
}
.toast--error {
  border-left-color: var(--danger);
}
.toast--warn {
  border-left-color: var(--warn);
}
.toast--info {
  border-left-color: var(--accent);
}

.toast-text {
  flex: 1;
  min-width: 0;
}

.toast-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* ---------- 拖拽投放层 ---------- */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 12, 15, 0.7);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.drop-overlay::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(91, 140, 255, 0.6);
  border-radius: 22px;
  pointer-events: none;
}

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 40px;
  border-radius: 18px;
  border: 1px solid var(--stroke-strong);
  background: rgba(24, 30, 40, 0.9);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.drop-inner .icon {
  color: var(--accent);
}

.drop-inner strong {
  font-size: 17px;
  font-weight: 620;
}

.drop-inner span {
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ---------- 大图预览 ---------- */
.preview {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}

.preview-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 10, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: previewMaskIn 0.22s ease both;
}

.preview-figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: -moz-fit-content;
  width: fit-content;
  min-width: min(540px, 92vw);
  max-width: min(1080px, 100%);
  animation: previewIn 0.22s var(--ease-out) both;
  outline: none;
}

.preview-figure:focus,
.preview-figure:focus-visible {
  outline: none;
}

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #101317;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.18s var(--ease-out);
  will-change: transform;
}

.preview-stage.is-dragging img {
  transition: none;
}

.preview-hint {
  display: none;
  margin-top: -4px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  background: rgba(18, 22, 28, 0.8);
  backdrop-filter: blur(10px);
  color: var(--text);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.preview-nav:hover {
  background: rgba(40, 48, 60, 0.9);
}

.preview-nav:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.preview-prev {
  left: -8px;
}

.preview-next {
  right: -8px;
}

.preview-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(16px);
  animation: previewInfoIn 0.3s 0.04s var(--ease-out) both;
}

.preview-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
}

.preview-uploader {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34vw;
}

.preview-time {
  color: var(--text-dim);
  font-size: 12px;
}

.preview-index {
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.preview-actions .btn {
  height: 38px;
}

/* ---------- 弹窗（帮助 / 昵称） ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 11, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--stroke-strong);
  background: linear-gradient(180deg, #1b2027, #151a20);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.22s var(--ease-out) both;
}

.modal-title {
  font-size: 18px;
  font-weight: 650;
}

.modal-desc {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.help-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.help-list strong {
  flex: none;
  width: 64px;
  color: #b9c8ff;
  font-weight: 600;
}

.help-list span {
  color: var(--text-dim);
}

.help-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: #e5c98b;
  font-size: 12px;
  line-height: 1.6;
}

.field-label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.field-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field-input::placeholder {
  color: var(--text-faint);
}

.field-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  background: rgba(91, 140, 255, 0.08);
}

.field-error {
  margin-top: 7px;
  color: #f5a3a3;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

/* ---------- 合成加载 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 11, 0.78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.dialog-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  padding: 30px 26px;
  border-radius: 20px;
  border: 1px solid var(--stroke-strong);
  background: linear-gradient(180deg, #1b2027, #151a20);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: modalIn 0.2s var(--ease-out) both;
}

.dialog-title {
  font-size: 17px;
  font-weight: 650;
}

.dialog-desc {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.65;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
  flex: none;
}

.spinner-lg {
  width: 34px;
  height: 34px;
  border-width: 3px;
  margin-bottom: 4px;
}

/* ---------- 首次加载 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 13px;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

/* ---------- 动画 ---------- */
@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.06);
  }
}

@keyframes phEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spotlight {
  0% {
    box-shadow: inset 0 0 0 0 rgba(91, 140, 255, 0);
  }
  14% {
    box-shadow: inset 0 0 0 3px rgba(91, 140, 255, 0.95), inset 0 0 54px rgba(91, 140, 255, 0.25);
  }
  72% {
    box-shadow: inset 0 0 0 3px rgba(91, 140, 255, 0.55), inset 0 0 30px rgba(91, 140, 255, 0.1);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(91, 140, 255, 0);
  }
}

@keyframes tileFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes previewIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes previewMaskIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes previewImgIn {
  from {
    opacity: 0.35;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes previewInfoIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.preview-img-in {
  animation: previewImgIn 0.32s var(--ease-out) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 工具栏「班级墙」按钮 ---------- */
.btn-messages {
  position: relative;
}

.btn-messages .icon {
  color: #c9d6ff;
}

.btn-messages:hover .icon {
  color: #fff;
}

.messages-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff5d6c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 93, 108, 0.45);
  pointer-events: none;
}

/* ---------- 班级墙留言抽屉 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 76;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease both;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 100%);
  height: var(--drawer-vh, 100dvh);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(24, 28, 36, 0.985), rgba(13, 16, 21, 0.985));
  border-left: 1px solid var(--stroke-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: drawerIn 0.24s var(--ease-out) both;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid var(--stroke);
}

.drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.drawer-count {
  font-size: 12px;
  color: var(--text-dim);
}

.drawer-close {
  margin-left: auto;
  width: 40px;
  height: 40px;
  flex: none;
}

.drawer-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.messages-list {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.message-item {
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.045);
  animation: messageIn 0.3s var(--ease-out) both;
}

.message-item--new {
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.16);
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.message-author {
  font-size: 12.5px;
  font-weight: 600;
  color: #b9c8ff;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

.message-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.messages-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.messages-empty strong {
  color: var(--text-dim);
  font-size: 14.5px;
}

.messages-empty span {
  font-size: 12.5px;
}

.messages-compose {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--stroke);
  background: rgba(13, 16, 20, 0.6);
}

.compose-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-author {
  width: 132px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.compose-author:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  background: rgba(91, 140, 255, 0.07);
}

.compose-counter {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.compose-counter.is-warn {
  color: var(--warn);
}

.compose-text {
  width: 100%;
  min-height: 62px;
  max-height: 138px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  resize: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.compose-text:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  background: rgba(91, 140, 255, 0.07);
}

.compose-text::placeholder {
  color: var(--text-faint);
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-hint {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-hint.is-error {
  color: #f5a3a3;
}

.compose-hint.is-ok {
  color: #8fe0c0;
}

.compose-actions .btn {
  height: 40px;
  min-width: 88px;
}

@keyframes drawerIn {
  from {
    opacity: 0.5;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .toolbar {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
  }

  .toolbar-main {
    min-height: 52px;
    padding: 5px 6px 5px 10px;
    border-radius: 14px;
    gap: 6px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .brand-logo svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-meta {
    font-size: 10.5px;
    gap: 5px;
  }

  .conn-text {
    display: none;
  }

  .meta-online {
    font-size: 10.5px;
  }

  .meta-mode {
    font-size: 10.5px;
    gap: 5px;
  }

  .empty-mode-note {
    margin-top: 12px;
    padding-top: 12px;
    font-size: 11px;
  }

  .toolbar-actions {
    gap: 6px;
  }

  .btn-messages {
    width: 44px;
    padding: 0;
  }

  .btn-messages .btn-text {
    display: none;
  }

  .messages-badge {
    top: -6px;
    right: -3px;
  }

  .drawer-panel {
    width: 100%;
    border-left: 0;
  }

  .drawer-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .drawer-close {
    width: 44px;
    height: 44px;
  }

  .messages-list {
    padding: 10px 12px 16px;
    gap: 10px;
  }

  .message-item {
    padding: 10px 12px;
  }

  .compose-author {
    height: 44px;
    font-size: 16px;
  }

  .compose-text {
    min-height: 68px;
    font-size: 16px;
  }

  .compose-actions .btn {
    height: 44px;
    min-width: 96px;
  }

  .btn {
    height: 44px;
    padding: 0 11px;
    font-size: 13px;
    border-radius: 10px;
  }

  .btn-icon {
    width: 44px;
  }

  .split .btn-download {
    padding-right: 9px;
  }

  .split .btn-download .icon {
    display: none;
  }

  .split .btn-caret {
    width: 44px;
    height: 44px;
  }

  .split .btn-caret .icon {
    width: 15px;
    height: 15px;
  }

  .menu {
    top: calc(100% + 10px);
    min-width: 180px;
  }

  .zoom {
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 5px;
    gap: 4px;
  }

  .zoom-btn {
    width: 44px;
    height: 44px;
  }

  .stage-hint {
    left: 10px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    font-size: 10.5px;
  }

  .hint-desktop {
    display: none;
  }

  .hint-mobile {
    display: inline;
  }

  .empty {
    padding: calc(74px + env(safe-area-inset-top, 0px)) 12px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .empty-card {
    padding: 22px 16px 20px;
    border-radius: 18px;
  }

  .empty-tiles {
    height: 58px;
    gap: 5px;
    margin-bottom: 14px;
  }

  .empty-tiles span:nth-child(1) {
    width: 38px;
    height: 32px;
  }
  .empty-tiles span:nth-child(2) {
    width: 44px;
    height: 44px;
  }
  .empty-tiles span:nth-child(3) {
    width: 50px;
    height: 36px;
  }
  .empty-tiles span:nth-child(4) {
    width: 40px;
    height: 48px;
  }
  .empty-tiles span:nth-child(5) {
    width: 34px;
    height: 28px;
  }

  .empty-title {
    font-size: 20px;
  }

  .empty-sub {
    font-size: 12.5px;
  }

  .empty-drop {
    margin-top: 16px;
    padding: 18px 14px;
  }

  .empty-drop strong {
    font-size: 14px;
  }

  .empty-steps {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .empty-steps p {
    margin-top: 1px;
  }

  .upload-panel {
    top: calc(68px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 42vh;
  }

  .toasts {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }

  .toast {
    font-size: 12.5px;
  }

  .preview {
    padding: 10px calc(10px + env(safe-area-inset-right, 0px))
      calc(10px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
    touch-action: none;
  }

  .preview-stage {
    touch-action: none;
  }

  .preview-stage img {
    max-height: 58vh;
  }

  .preview-hint {
    display: block;
  }

  .preview-nav {
    width: 48px;
    height: 48px;
    background: rgba(14, 18, 24, 0.72);
  }

  .preview-nav .icon {
    width: 20px;
    height: 20px;
  }

  .preview-prev {
    left: 6px;
  }

  .preview-next {
    right: 6px;
  }

  .preview-info {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .preview-uploader {
    max-width: 50vw;
  }

  .preview-actions .btn {
    flex: 1;
    height: 44px;
  }

  .modal-card {
    padding: 20px;
    border-radius: 16px;
  }

  .modal-title {
    font-size: 16.5px;
  }

  .drop-inner {
    padding: 26px 22px;
  }

  .drop-inner strong {
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  #helpBtn {
    display: none;
  }
}

@media (max-width: 430px) {
  .meta-mode {
    display: none;
  }
}

@media (max-width: 480px) {
  .btn-upload .btn-text {
    display: none;
  }

  .btn-upload {
    width: 44px;
    padding: 0;
  }

  #helpBtn {
    display: none;
  }

  .brand-title {
    font-size: 13.5px;
  }
}

@media (max-width: 360px) {
  .split .btn-download .btn-text {
    display: none;
  }

  .split .btn-download {
    width: 44px;
    padding: 0;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .empty-tiles {
    display: none;
  }

  .empty-card {
    padding: 16px;
  }

  .empty-steps {
    display: none;
  }

  .stage-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   SPEC 3.12–3.15：视频 / 评论 / 删除申请 / 墙面气泡贴纸
   ============================================================ */

/* ---------- 视频墙块角标 ---------- */
.ph-video {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.ph-video-icon {
  font-size: 9px;
  line-height: 1;
}

.ph--video .ph--duration,
.ph-duration {
  line-height: 1.2;
}

.ph-comments {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.ph-comment-icon {
  font-size: 10px;
  line-height: 1;
}

/* ---------- 上传面板：视频标记 ---------- */
.upload-kind {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.18);
  color: #c9bbff;
  font-size: 10px;
  line-height: 1.6;
}

/* ---------- 预览：视频 / 评论区 ---------- */
.preview-video {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.preview-figure {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.preview-stage img {
  max-height: 56vh;
}

.preview--video .preview-hint {
  display: none;
}

.preview-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(22, 27, 34, 0.92);
  text-align: left;
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.comments-count {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 500;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.comment-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.comment-author {
  color: #cfe0ff;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-time {
  flex: none;
  color: var(--text-faint);
  font-size: 10.5px;
}

.comment-text {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.comments-empty {
  margin: 2px 0 4px;
  color: var(--text-faint);
  font-size: 12px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(9, 12, 16, 0.65);
  color: var(--text);
  font-size: 13px;
}

.comment-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.16);
}

.comment-counter {
  flex: none;
  color: var(--text-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.comment-form .btn {
  flex: none;
  height: 36px;
  min-width: 64px;
}

.comment-hint {
  min-height: 0;
  color: var(--text-faint);
  font-size: 11.5px;
}

.comment-hint.error {
  color: var(--danger);
}

.comment-hint.ok {
  color: var(--ok);
}

.field-textarea {
  height: auto;
  min-height: 76px;
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}

/* ---------- 墙面气泡 / 表情贴纸 ---------- */
.sticker-fab {
  position: fixed;
  right: 18px;
  bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  z-index: 65;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8cff, #8b5cff);
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 14px 34px rgba(91, 140, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.sticker-fab:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.sticker-card {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

.sticker-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.sticker-tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
}

.sticker-tab.is-active {
  background: rgba(91, 140, 255, 0.2);
  color: #fff;
}

.sticker-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sticker-colors {
  display: flex;
  gap: 9px;
}

.sticker-color {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: var(--c, #fff);
  cursor: pointer;
}

.sticker-color.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.45);
}

.sticker-emojis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.sticker-emoji-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 19px;
  cursor: pointer;
}

.sticker-emoji-btn:hover {
  background: rgba(91, 140, 255, 0.18);
  border-color: rgba(91, 140, 255, 0.4);
}

.sticker-emoji-clear {
  grid-column: span 2;
  height: 100%;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11.5px;
}

.sticker-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--stroke);
}

.sticker-preview.bubble,
.sticker.bubble {
  display: inline-block;
  max-width: 520px;
  padding: 14px 22px;
  border-radius: 999px 999px 999px 10px;
  background: var(--c, #fff);
  color: #1a1f26;
  font-size: 34px;
  font-weight: 650;
  line-height: 1.25;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  overflow-wrap: anywhere;
}

.sticker-preview.emoji {
  font-size: 54px;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.sticker-preview {
  transform-origin: left center;
}

.sticker-preview.bubble {
  font-size: 22px;
  padding: 9px 15px;
  max-width: 100%;
}

.sticker-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

.sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: stickerIn 0.34s var(--ease-out) both, stickerFloat 5.6s ease-in-out 0.34s infinite;
}

.sticker--emoji {
  font-size: 78px;
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
  white-space: pre;
}

.sticker--text.bubble {
  max-width: 560px;
  white-space: pre-wrap;
}

.sticker.is-temp {
  opacity: 0.7;
}

.sticker-ghost {
  position: fixed;
  z-index: 95;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  animation: none;
  max-width: 280px;
  font-size: 18px;
  padding: 9px 15px;
  touch-action: none;
}

.sticker-ghost.is-dragging {
  cursor: grabbing;
  opacity: 0.9;
}

.sticker-ghost.sticker--emoji {
  font-size: 46px;
  padding: 0;
}

@keyframes stickerIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes stickerFloat {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -6px;
  }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 768px) {
  .preview-stage img {
    max-height: 46vh;
  }

  .preview-video {
    max-height: 44vh;
  }

  .preview-figure {
    min-width: 0;
    width: 100%;
  }

  .comments-list {
    max-height: 118px;
  }

  .comment-input {
    height: 40px;
    font-size: 14px;
  }

  .comment-form .btn {
    height: 40px;
  }

  .sticker-fab {
    right: 12px;
    bottom: calc(182px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
  }

  .sticker-emojis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .sticker--emoji {
    font-size: 64px;
  }

  .sticker--text.bubble {
    max-width: 420px;
    font-size: 30px;
    padding: 11px 18px;
  }
}

/* 墙面文字/贴纸：可整体隐藏 */
.sticker-layer.is-hidden {
  display: none !important;
}

/* 文字气泡改成半透明，避免挡住照片 */
.sticker-preview.bubble,
.sticker.bubble {
  background: color-mix(in srgb, var(--c, #ffffff) 62%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px) saturate(1.15);
  -webkit-backdrop-filter: blur(5px) saturate(1.15);
}

.sticker-preview.emoji {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.sticker--emoji {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

/* 移动端隐藏文字/贴纸按钮：悬浮在「+」上方，避免工具栏拥挤 */
.sticker-toggle-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: calc(228px + env(safe-area-inset-bottom, 0px));
  z-index: 65;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #5b6678;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sticker-toggle-fab .icon {
  width: 20px;
  height: 20px;
}
.sticker-toggle-fab.is-off {
  color: #b7791f;
  background: rgba(255, 248, 235, 0.96);
  border-color: rgba(183, 121, 31, 0.28);
}
@media (max-width: 768px) {
  #stickersToggleBtn {
    display: none;
  }
  .sticker-toggle-fab {
    display: grid;
  }
}


/* ============================================================
   音乐点歌
   ============================================================ */
.btn-music {
  position: relative;
}

.btn-music.is-playing {
  color: #9ec1ff;
  border-color: rgba(91, 140, 255, 0.5);
  background: rgba(91, 140, 255, 0.12);
}

.music-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b8cff, #8b5cff);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.music-panel {
  width: min(460px, 100%);
}

.music-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.music-now {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.music-now-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-disc {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, #5b8cff, #8b5cff);
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.35);
}

.music-now-info {
  min-width: 0;
  flex: 1;
}

.music-now-info strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-now-info span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.music-ctrl {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.music-ctrl:hover {
  background: rgba(255, 255, 255, 0.12);
}

.music-ctrl:active {
  transform: scale(0.94);
}

.music-play {
  width: 46px;
  height: 46px;
  border: 0;
  background: linear-gradient(135deg, #5b8cff, #8b5cff);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 22px rgba(91, 140, 255, 0.4);
}

.music-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.music-time {
  min-width: 32px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.music-seek {
  flex: 1;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.music-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-search-form {
  display: flex;
  gap: 8px;
}

.music-search-input {
  flex: 1;
  height: 40px;
  font-size: 13.5px;
}

.music-hint {
  min-height: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}

.music-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 2px;
}

.music-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.music-result-main {
  flex: 1;
  min-width: 0;
}

.music-result-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-result-meta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-result-add {
  flex: none;
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.music-queue-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

.music-queue {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.music-queue-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.music-queue-item.is-current {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(91, 140, 255, 0.12);
}

.music-queue-index {
  width: 20px;
  flex: none;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.music-queue-item.is-current .music-queue-index {
  color: var(--accent);
  font-weight: 700;
}

.music-queue-main {
  flex: 1;
  min-width: 0;
}

.music-queue-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-queue-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-queue-dur {
  flex: none;
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .btn-music .btn-text {
    display: none;
  }

  .btn-music {
    width: 44px;
    padding: 0;
  }
}
