/* ============================================================
   后台管理样式 — 暗色（复用 style.css 的 :root 设计变量）
   ============================================================ */

.admin {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
}

/* ---------- 布局：侧边栏 + 主区 ---------- */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 248px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 20;
}
.admin-brand {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.25rem;
}
.admin-brand__logo {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.1rem;
}
.admin-brand__name { font-weight: 600; letter-spacing: 0.02em; }

.admin-nav { display: flex; flex-direction: column; gap: 0.4rem; }
.admin-nav__item {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.admin-nav__item:hover:not(.is-disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.admin-nav__item.is-active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.admin-nav__ico { font-size: 1rem; }
.admin-nav__tag {
  margin-left: auto;
  font-style: normal;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}
.admin-nav__item.is-disabled { opacity: 0.55; cursor: not-allowed; }

.admin-sidebar__foot { margin-top: auto; padding: 0 0.5rem; }
.admin-sidebar__link {
  display: inline-block; color: var(--accent); font-size: 0.85rem; margin-bottom: 0.6rem;
  text-decoration: none;
}
.admin-sidebar__link:hover { text-decoration: underline; }
.admin-sidebar__hint { font-size: 0.7rem; color: var(--text-tertiary); line-height: 1.6; }

.admin-main {
  margin-left: 248px;
  padding: 2rem 2.5rem 4rem;
  max-width: 1400px;
}

/* ---------- 面板切换：默认隐藏，激活才显示（左侧标签栏切换） ---------- */
.admin-panel { display: none; }
.admin-panel.is-active {
  display: block;
  animation: panelFade 0.25s ease both;
}
@keyframes panelFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 顶部栏 ---------- */
.admin-topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
}
.admin-topbar__title { font-size: 1.6rem; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.admin-topbar__sub { color: var(--text-secondary); font-size: 0.85rem; margin: 0.35rem 0 0; }

.btn-up {
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn-up:hover { background: var(--accent-hover); }
.btn-up:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem; cursor: pointer;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-tertiary); }

/* ---------- 批量管理栏 ---------- */
.batch-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.batch-bar[hidden] { display: none; }
.batch-check {
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; gap: 0.35rem;
}
.batch-count { color: var(--text-tertiary); flex: 1; }
.btn-ghost-batch {
  padding: 0.35rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.78rem; cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ghost-batch:hover { color: var(--text-primary); border-color: var(--accent); }
.btn-ghost-batch--danger:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* 批量模式下卡片/子场景的 checkbox 叠加 */
.pano-card__bcheck,
.pano-child__bcheck,
.article-card__bcheck {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  width: 20px; height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}
/* 批量模式：作品卡命中选中态高亮 */
.card--admin.is-batch-selected { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 统计条 ---------- */
.admin-stats {
  font-size: 0.85rem; color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.admin-stats b { color: var(--accent); }

/* ---------- 作品卡片网格 ---------- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.pano-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}
.pano-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.pano-card__cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-tertiary);
}
.pano-card__cover-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
}
.pano-card__cover-link:hover { background: rgba(0, 0, 0, 0.28); }
.pano-card__cover-hint {
  opacity: 0;
  transform: translateY(6px);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pano-card__cover-link:hover .pano-card__cover-hint { opacity: 1; transform: translateY(0); }
.pano-card__body { padding: 0.85rem 0.95rem 0.5rem; }
.pano-card__title { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.5rem; }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.6rem;
}
.pano-card__stats {
  display: flex; gap: 1rem;
  font-size: 0.75rem; color: var(--text-tertiary);
  margin-top: 0.6rem;
}
.pano-card__meta {
  font-size: 0.72rem; color: var(--text-tertiary);
  margin-top: 0.35rem;
}
.pano-card__actions {
  display: flex; gap: 0.5rem;
  padding: 0 0.95rem 0.95rem;
}
.pano-card__actions button {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; cursor: pointer;
  transition: all 0.15s ease;
}
.pano-card__actions button:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.pano-card__actions .act-share:hover { color: #c9a96e; border-color: #c9a96e; }
.pano-card__actions .act-del:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* 分组卡片（多场景折叠） */
.pano-card--group { cursor: default; }
.pano-card--group .pano-card__cover {
  pointer-events: none; /* 组头封面不可点（预览是整个组的，走子场景链接） */
}
.pano-card__group-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.72); color: #c9a96e;
  padding: 3px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.pano-card__toggle {
  width: 100%; padding: 0.45rem;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  font-size: 0.78rem; cursor: pointer;
  margin-top: 0.6rem; transition: all 0.15s ease;
}
.pano-card__toggle:hover { color: var(--accent); border-color: var(--accent); }
.pano-card__scenes {
  margin-top: 0.75rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.pano-child {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}
.pano-child:hover { border-color: var(--accent); }
.pano-child__thumb {
  width: 60px; height: 30px;
  background-size: cover; background-position: center;
  border-radius: 3px; flex-shrink: 0;
}
.pano-child__body {
  flex: 1; min-width: 0;
}
.pano-child__title {
  font-size: 0.82rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.pano-child__actions {
  display: flex; gap: 0.3rem; flex-shrink: 0;
}
.pano-child__actions button {
  padding: 0.2rem 0.45rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.7rem; cursor: pointer;
  transition: all 0.15s ease;
}
.pano-child__actions button:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.pano-child__actions .act-share:hover { color: #c9a96e; border-color: #c9a96e; }
.pano-child__actions .act-del:hover { color: #ff6b6b; border-color: #ff6b6b; }
.pano-child.is-offline { opacity: 0.55; }
.pano-child.is-offline .pano-child__title::after { content: '（已下架）'; color: var(--text-tertiary); font-size: 0.7rem; margin-left: 4px; }
/* 下架按钮跟随子场景状态 */

.card.is-offline { opacity: 0.55; }
.card__offflag {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  padding: 3px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
}
.card__actions {
  display: flex; gap: 0.5rem;
  padding: 0 0.95rem 0.95rem;
}
.card__actions button {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; cursor: pointer;
  transition: all 0.15s ease;
}
.card__actions button:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.card__actions .act-share:hover { color: #c9a96e; border-color: #c9a96e; }
.card__actions .act-del:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* 全案作品卡片缩略图上的「预览」按钮：悬浮显现，点开前台正文 */
.card--admin .card__preview {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  z-index: 3;
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem; line-height: 1;
  color: #fff;
  background: rgba(20, 20, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  backdrop-filter: blur(2px);
}
.card--admin:hover .card__preview { opacity: 1; transform: translateY(0); }
.card--admin .card__preview:hover { background: rgba(196, 154, 84, 0.92); border-color: #c49a54; color: #1a1206; }
.card--admin .card__preview-ic { font-size: 0.85rem; }
@media (hover: none) {
  .card--admin .card__preview { opacity: 1; transform: none; }
}

/* wangEditor 辅助线 */
.editor-guide-bar {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 6px 0; font-size: 12px; color: var(--text-secondary, #b8b2ab);
}
.editor-guide-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.editor-guide-bar input { margin: 0; }
.editorjs-shell .w-e-text-container--guide {
  background-image: linear-gradient(to bottom, transparent 95%, rgba(201,169,110,.25) 95%);
  background-size: 100% 28px;
}
.editorjs-shell .w-e-text-container--guide p {
  line-height: 28px; margin: 0; padding: 0;
}

/* ---------- 占位（图文 UI 待定） ---------- */
.admin-placeholder {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-tertiary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
}
.admin-placeholder__icon { font-size: 2.5rem; margin-bottom: 1rem; }
.admin-placeholder h2 { color: var(--text-secondary); margin: 0 0 0.5rem; }
.admin-placeholder p { font-size: 0.85rem; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative;
  width: min(560px, 92vw);
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border-light);
}
.modal__head h2 { font-size: 1.15rem; margin: 0; }
.modal__close {
  background: none; border: none; color: var(--text-tertiary);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.modal__close:hover { color: var(--text-primary); }
.modal__body { padding: 1.4rem; }

/* ---------- 拖拽区 ---------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  min-height: 180px;
  display: grid; place-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-light); }
.dropzone__inner { padding: 1.5rem; }
.dropzone__icon { font-size: 2rem; color: var(--accent); margin-bottom: 0.5rem; }
.dropzone__title { font-size: 0.95rem; margin: 0 0 0.4rem; }
.dropzone__title .link { color: var(--accent); cursor: pointer; }
.dropzone__hint { font-size: 0.75rem; color: var(--text-tertiary); margin: 0; }

/* 多图缩略图列表（120×60） */
.dropzone__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.dropzone__list:empty { display: none; }
.dz-item {
  position: relative;
  width: 120px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.dz-item__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.dz-item__ring {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
  pointer-events: none;
}
.dz-item__ring svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.dz-item__ring .track { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 3; }
.dz-item__ring .bar   { fill: none; stroke: #c9a96e; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.15s ease; }
.dz-item__pct {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}
.dz-item.is-done .dz-item__ring { display: none; }
.dz-item.is-done .dz-item__pct { display: none; }
.dz-item__done {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(46, 204, 113, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  pointer-events: none;
}
.dz-item.is-done .dz-item__done { display: flex; }
.dz-item.is-error .dz-item__ring { background: rgba(231, 76, 60, 0.6); }
.dz-item.is-error .dz-item__bar { stroke: #ff6b6b !important; }
.dz-item__remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 12px; line-height: 16px;
  cursor: pointer; padding: 0;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.dz-item__remove:hover { background: rgba(231, 76, 60, 0.9); }

.dropzone__clear {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  padding: 0.3rem 0.7rem; border-radius: var(--radius-sm);
  font-size: 0.75rem; cursor: pointer;
}

/* ---------- 表单 ---------- */
.upload-form { display: flex; flex-direction: column; gap: 0.95rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field__label { font-size: 0.8rem; color: var(--text-secondary); }
.field__label i { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.95rem; }
.upload-form__actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0.8rem 1.4rem; border-radius: var(--radius-md);
  font-size: 0.9rem; z-index: 80; box-shadow: var(--shadow-lg);
}
.toast[hidden] { display: none; }
.toast.is-error { border-color: #ff6b6b; color: #ff9b9b; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .admin-sidebar { position: static; width: auto; flex-direction: row; align-items: center; }
  .admin-nav { flex-direction: row; }
  .admin-sidebar__foot { display: none; }
  .admin-main { margin-left: 0; padding: 1.25rem; }
  .field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   文章编辑模态框（图文上传）
   ============================================================ */
.modal__panel--wide {
  max-width: 1080px;
  width: 95%;
  max-height: 92vh;
}
.modal__body--scroll { overflow-y: auto; max-height: calc(92vh - 64px); }

.article-meta { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1rem; }
.article-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1.5rem 0;
}
.field-row--inline { display: flex; gap: 0.5rem; align-items: stretch; }
.field-row--inline input { flex: 1; }
.field__hint { color: var(--text-tertiary, #888); font-weight: 400; margin-left: 0.4rem; font-size: 0.82rem; }

.editorjs-shell {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 6px);
  padding: 1.25rem;
  min-height: 320px;
  color: var(--text-primary);
}
.editorjs-shell .w-e-text-container { min-height: 320px; }
.editorjs-shell .w-e-text-container [data-slate-editor] { padding: 12px 16px; line-height: 1.75; }
.editorjs-shell .w-e-toolbar { border-bottom: 1px solid var(--border); }
.editorjs-shell .w-e-bar-item { color: var(--text-primary); }

/* 夜间模式：wangEditor 富文本输入框覆盖变量（与 article-edit.html 同类） */
[data-theme="dark"] .editorjs-shell {
  --w-e-textarea-bg-color: #1b1b20;
  --w-e-textarea-color: #e8e4df;
  --w-e-textarea-border-color: rgba(255,255,255,.16);
  --w-e-textarea-slight-border-color: rgba(255,255,255,.10);
  --w-e-textarea-slight-color: #8a8a90;
  --w-e-textarea-slight-bg-color: #2a2a30;
  --w-e-textarea-selected-border-color: #4290f7;
  --w-e-textarea-handler-bg-color: #4290f7;
  --w-e-toolbar-color: #c9c9cf;
  --w-e-toolbar-bg-color: #232329;
  --w-e-toolbar-active-color: #fff;
  --w-e-toolbar-active-bg-color: #3a3a42;
  --w-e-toolbar-disabled-color: #6a6a72;
  --w-e-toolbar-border-color: rgba(255,255,255,.16);
  --w-e-modal-button-bg-color: #2a2a30;
  --w-e-modal-button-border-color: rgba(255,255,255,.16);
}
.editor-toolbar { border-bottom: 1px solid var(--border); border-radius: var(--radius-md, 6px) var(--radius-md, 6px) 0 0; overflow: hidden; }

/* 后台文章卡片 */
.card--admin { cursor: default; }
.card--admin .card__image { cursor: default; }
.card--admin .card__meta {
  font-size: 0.78rem;
  color: var(--text-tertiary, #888);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}
.admin-empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-tertiary, #888);
  font-size: 0.95rem;
}

.btn-ghost--sm { padding: 0.45rem 0.8rem; font-size: 0.85rem; }

/* ============================================================
   首页轮播图管理（后台）
   ============================================================ */
.hero-slides-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.hero-slide-slot {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease;
}
.hero-slide-slot:hover { border-color: var(--accent); }
.hero-slot__num {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  width: 28px; height: 28px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700;
  z-index: 2;
}
.hero-slot__preview {
  aspect-ratio: 16 / 10;
  background: var(--bg-tertiary);
  background-size: cover;
  background-position: center;
  display: grid; place-items: center;
  cursor: pointer;
}
.hero-slot__empty {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  pointer-events: none;
}
.hero-slot__actions {
  display: flex; gap: 0.5rem;
  padding: 0.75rem;
}
.hero-slot__actions .btn-ghost {
  flex: 1;
  padding: 0.45rem 0.5rem;
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 1024px) {
  .hero-slides-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero-slides-grid { grid-template-columns: 1fr; }
}

.login-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg-primary);
}
.login-gate[hidden] { display: none; }
.login-card {
  width: min(360px, 90vw);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin-bottom: 1.25rem; font-weight: 600;
}
.login-brand__logo {
  width: 34px; height: 34px; background: var(--accent); color: var(--text-inverse);
  border-radius: var(--radius-sm); display: grid; place-items: center; font-weight: 700;
}
.login-title { font-size: 1.25rem; margin: 0 0 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}
.login-input:focus { outline: none; border-color: var(--accent); }
.login-btn { width: 100%; }
.login-error { color: #ff6b6b; font-size: 0.92rem; margin: 0; font-weight: 600; }
.login-error.is-error {
  display: block;
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 107, 107, 0.55);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.12);
  color: #ff6b6b;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}
.login-error[hidden] { display: none; }

/* 已下架作品：卡片整体降透明度 + 角标 + 下架按钮配色 */
.pano-card.is-offline { opacity: 0.55; }
.pano-card__offflag {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  padding: 3px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
}
.act-unpub { background: #b8893a; color: #fff; border: none; }
.act-unpub:hover { background: #a3762d; }

/* ========== 站长工具 ========== */
.wm-sections { display: flex; flex-direction: column; gap: 26px; padding: 8px 0 40px; }
.wm-section { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 20px; }
.wm-section__title { font-size: 16px; font-weight: 700; color: #e8e4df; margin: 0 0 16px; }
.wm-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.wm-label { font-size: 13px; color: #9a948c; }
.wm-hint { font-size: 12px; color: #6f6a63; }
.stepper { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; overflow: hidden; }
.stepper button { width: 32px; height: 32px; background: transparent; border: none; color: #e8e4df; font-size: 18px; cursor: pointer; }
.stepper button:hover { background: rgba(255,255,255,0.06); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper span { min-width: 38px; text-align: center; font-weight: 700; color: #fff; }
.wm-actions { margin-top: 14px; display: flex; gap: 10px; }

/* ---------- 版本历史（自动留存回滚） ---------- */
.wm-versions { margin-top: 14px; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; background: rgba(255,255,255,0.02); overflow: hidden; }
.wm-versions[hidden] { display: none; }
.wm-versions__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.wm-versions__title { font-size: 13px; font-weight: 700; color: #e8e4df; letter-spacing: 0.08em; }
.wm-versions__hint { font-size: 12px; color: #9a948c; flex: 1; }
.wm-versions__list { max-height: 260px; overflow-y: auto; padding: 6px; }
.wm-version-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.wm-version-item:hover { background: rgba(255,255,255,0.04); }
.wm-version-item__time { font-size: 13px; color: #c9c9cf; font-variant-numeric: tabular-nums; }
.wm-version-item__restore { white-space: nowrap; }
.wm-versions__empty { padding: 18px 14px; font-size: 13px; color: #9a948c; text-align: center; margin: 0; }
.btn-ghost.is-active { color: #c9a96e; border-color: #c9a96e; }

/* ---------- 首页精选项目管理 ---------- */
.featured-manage-list { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.featured-manage-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 10px 12px;
}
.featured-manage-item__thumb {
  width: 96px; height: 54px; flex-shrink: 0; border-radius: 6px;
  background-size: cover; background-position: center; background-color: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.featured-manage-item__noimg { font-size: 11px; color: #6f6a63; }
.featured-manage-item__info { flex: 1; min-width: 0; }
.featured-manage-item__title { font-size: 14px; font-weight: 600; color: #e8e4df; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-manage-item__sub { font-size: 12px; color: #6f6a63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-manage-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.featured-manage-empty { list-style: none; padding: 14px; text-align: center; color: #6f6a63; font-size: 13px; border: 1px dashed rgba(255,255,255,0.1); border-radius: 10px; }
.featured-add-row { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.featured-add-select {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 9px 10px; color: #fff; font-size: 13px; font-family: inherit; box-sizing: border-box;
}
.featured-add-select:focus { outline: none; border-color: #c9a96e; }
.featured-add-select:disabled { opacity: 0.5; cursor: not-allowed; }

.wm-subtabs { display: flex; gap: 8px; margin-bottom: 16px; }
.wm-subtab { padding: 8px 16px; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: #9a948c; border-radius: 8px; cursor: pointer; font-size: 13px; }
.wm-subtab.is-active { background: #c9a96e; color: #1a1a1a; border-color: #c9a96e; font-weight: 700; }

.wm-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wm-form { display: flex; flex-direction: column; gap: 14px; }
.wm-field { display: flex; flex-direction: column; gap: 6px; }
.wm-field__label { font-size: 12px; color: #9a948c; }
.wm-input, .wm-textarea { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 9px 10px; color: #fff; font-size: 13px; font-family: inherit; width: 100%; box-sizing: border-box; }
.wm-textarea { resize: vertical; min-height: 80px; }
.wm-input:focus, .wm-textarea:focus { outline: none; border-color: #c9a96e; }

/* 媒体上传（图片/视频） */
.wm-media { border: 1px dashed rgba(255,255,255,0.18); border-radius: 10px; padding: 12px; background: rgba(255,255,255,0.02); }
.wm-media__preview { min-height: 84px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.wm-media__preview img, .wm-media__preview video { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; background: #000; }
.wm-media__empty { color: #9a948c; font-size: 12px; }
.wm-media__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wm-media__upload { cursor: pointer; }
.wm-media__status { margin-top: 8px; font-size: 12px; color: #c9a96e; min-height: 16px; }

/* 后台二维码编辑（2×2，每张含图片上传 + 名称输入） */
.wm-qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wm-qr-card { border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 12px; background: rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 8px; }
.wm-qr-card .wm-media { border-style: solid; border-color: rgba(255,255,255,0.08); }
@media (max-width: 720px) { .wm-qr-grid { grid-template-columns: 1fr; } }

/* 首页精选卡片编辑（最多 4 张） */
.wm-cards-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wm-card-edit { border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 12px; background: rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 8px; }
.wm-card-edit__head { font-size: 13px; font-weight: 600; color: #cfc9c1; }
.wm-card-edit__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wm-input--sm { width: 100%; }
@media (max-width: 720px) { .wm-cards-edit { grid-template-columns: 1fr; } }
.wm-stats-edit { display: flex; flex-direction: column; gap: 8px; }
.wm-stat-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }

.wm-preview { display: flex; flex-direction: column; gap: 8px; }
.wm-preview__bar { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #9a948c; }
.wm-preview__frame { width: 100%; height: 760px; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; background: #0e0e12; }

.wm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.wm-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 14px; }
.wm-card__title { font-size: 12px; color: #9a948c; }
.wm-card__value { font-size: 20px; font-weight: 800; color: #fff; margin: 6px 0 2px; word-break: break-all; }
.wm-card__sub { font-size: 11px; color: #6f6a63; }
.wm-card__delta-row { margin: 6px 0 2px; }
.wm-card__delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; line-height: 1.4; }
.wm-card__delta.is-up { color: #6bd49a; background: rgba(107,212,154,0.14); }
.wm-card__delta.is-down { color: #ff8a8a; background: rgba(255,138,138,0.14); }
.wm-card__delta.is-flat { color: #9a948c; background: rgba(255,255,255,0.05); }
.wm-chart-card { margin-top: 16px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px; }
.wm-chart-card h3 { font-size: 13px; color: #9a948c; margin: 0 0 10px; font-weight: 600; }
.wm-chart { width: 100%; }
.wm-chart__svg { width: 100%; height: auto; display: block; }
.wm-chart__empty { color: #6f6a63; font-size: 13px; }

.wm-cloud-form, .wm-pwd-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.wm-pwd-form { max-width: 760px; }

@media (max-width: 880px) {
  .wm-edit-grid { grid-template-columns: 1fr; }
  .wm-preview__frame { height: 600px; }
}

/* ---------- 720 全景列表搜索框 ---------- */
.admin-search { position: relative; display: inline-flex; align-items: center; }
.admin-search__ico { position: absolute; left: 11px; font-size: 13px; opacity: 0.55; pointer-events: none; }
.admin-search__input {
  width: 500px; max-width: 70vw;
  min-height: 18px;       /* 模拟 input 高度；contenteditable 需 min-height 防止空内容塌陷 */
  padding: 8px 32px 8px 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary, #fff);
  font-size: 13px; line-height: 1.4; outline: none;
  cursor: text;
  transition: border-color .15s, background .15s;
  /* 让 div 行为像 input：禁止换行溢出 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-search__input:empty::before {
  content: attr(data-placeholder);
  color: #6f6a63;
  pointer-events: none;
}
.admin-search__input:focus { border-color: #c9a96e; background: rgba(255,255,255,0.08); }
.admin-search__clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #cfc9c1; font-size: 15px; padding: 0;
}
.admin-search__clear:hover { background: rgba(255,255,255,0.22); color: #fff; }
