/* =========================================================
   Photography Showcase Theme
   - 可主题化（CSS variables）
   - 顶部胶囊菜单 + 缩放下拉
   - 横版浮动风格菜单（滚动时固定在顶部）
   - 瀑布流图库 + 灯箱
   - 管理后台：登录 / 上传 / 菜单编辑 / 主题设置
   ========================================================= */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

/* 背景纹理层（data-texture 切换样式；参考站 demo.muyin.site 纸面风格） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--texture-opacity, 0);
  transition: opacity .45s ease;
}
body[data-texture="none"]::before { display: none !important; }
/* 纸面：柔和分形噪点，营造纸墙 / 墙面质感 */
body[data-texture="paper"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: multiply;
}
/* 细噪点：更高频噪点，颗粒更细 */
body[data-texture="grain"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  mix-blend-mode: multiply;
}
/* 点阵：规则圆点矩阵 */
body[data-texture="dots"]::before {
  background-image: radial-gradient(var(--text-soft) 1px, transparent 1.6px);
  background-size: 20px 20px;
  mix-blend-mode: multiply;
}
/* 斜纹：45° 细线 */
body[data-texture="lines"]::before {
  background-image: repeating-linear-gradient(45deg, var(--text-soft) 0 1px, transparent 1px 11px);
  mix-blend-mode: multiply;
}
body[data-mode="dark"][data-texture]:not([data-texture="none"])::before { mix-blend-mode: overlay; }
/* 背景随大图色系染色层（data-hero-bg-follow=on 时由 JS 写 --hero-bg-tint / --hero-tint-op） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--hero-bg-tint, transparent);
  opacity: var(--hero-tint-op, 0);
  mix-blend-mode: soft-light;
  transition: background .6s ease, opacity .6s ease;
}
body[data-mode="dark"]::after { mix-blend-mode: overlay; }
body {
  font-family: 'Inter', 'Noto Serif SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .4s ease;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* admin-only 元素默认隐藏，登录后 body[data-admin="true"] 才显示 */
.admin-only { display: none !important; }
body[data-admin="true"] .admin-only { display: revert !important; }
/* R204：场景图库相册编辑权限 与 主站编辑权限 分离后的显隐规则 ——
   · .gallery-edit-only / [data-need-upload]  上传图片 · 创建相册 · 创建分组 · 删除图片
   · [data-need-edit]                         LOGO · 站点图标 · 关于页配图等站点外观与设置
   开关只放在 body 的两个属性上（applyPermissions() 统一设置，口径同服务端）：
   权限未确认（body 尚无 data-can-gallery）或权限不足 → 一律隐藏；
   授权后本规则不再命中，元素自身的 flex / inline-flex 布局与 [hidden] 属性都原样保留
   （刻意不用 inline display 强制还原，正是为了不把 flex 打成 block、不盖掉 [hidden]）。 */
body:not([data-can-gallery="1"]) .gallery-edit-only,
body:not([data-can-gallery="1"]) [data-need-upload],
body:not([data-can-edit="1"]) [data-need-edit],
.perm-hidden { display: none !important; }
/* theme-panel 必须保持 flex 布局，否则 tab-panels 高度塌陷导致内容不可见 */
body[data-admin="true"] .theme-panel { display: flex !important; }
/* 关闭态（panel.hidden=true）必须真正隐藏：否则 !important flex 会盖掉 [hidden]，导致面板关不掉、页面不随面板收缩 */
body[data-admin="true"] .theme-panel[hidden] { display: none !important; }

/* ========== Tokens / 主题变量 ========== */
:root {
  --bg: #f1ede6;
  --bg-2: #e8e2d6;
  --text: #1a1a1a;
  --text-soft: #6b6358;
  --line: rgba(20,20,20,.08);

  --menu-bg: rgba(255,255,255,.55);
  --menu-border: rgba(255,255,255,.7);
  --menu-shadow: 0 10px 40px rgba(40,30,20,.12);
  --menu-blur: 18px;

  --card-bg: rgba(255,255,255,.7);
  --card-shadow: 0 14px 40px rgba(30,20,10,.08);

  /* 后台管理侧边抽屉宽度（抽屉展开时主内容整体右移这个距离） */
  --admin-panel-w: min(380px, 92vw);

  --accent: #b08968;
  --accent-soft: #ddc7b0;
  --serif: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --sans: 'Inter', system-ui, sans-serif;

  /* 主导航栏选中（u39：移入①板块直接编辑） */
  --menu-active-bg: rgba(0,0,0,.05);
  --nav-active-text: var(--text);
}

/* 暗色主题 */
body[data-mode="dark"] {
  --bg: #181715;
  --bg-2: #100f0d;
  --text: #efeae0;
  --text-soft: #a8a094;
  --line: rgba(255,255,255,.10);
  --menu-bg: rgba(20,18,15,.55);
  --menu-border: rgba(255,255,255,.12);
  --menu-shadow: 0 14px 50px rgba(0,0,0,.45);
  --card-bg: rgba(30,26,22,.7);
  --card-shadow: 0 14px 40px rgba(0,0,0,.4);
  --accent: #d8b48a;
  --menu-active-bg: rgba(255,255,255,.12);
  --nav-active-text: var(--text);
}

/* ========== 滚动后顶部渐变遮盖条（真正的“下滑渐变遮盖”） ========== */
.topbar-spacer {
  position: fixed;
  top: 0;
  /* 默认满窗宽（left/right 仅由 遮盖宽度 控制，0 = 跟随窗口大小缩放，不露出图片） */
  left: var(--top-cover-w, 0px);
  right: var(--top-cover-w, 0px);
  height: calc(var(--menu-top-dist, 36px) + var(--top-cover-h, 84px));
  background: linear-gradient(to bottom, var(--bg) calc(100% - var(--top-cover-grad, 60%)), transparent);
  z-index: 54;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, background .5s ease,
              left .38s cubic-bezier(.22,.61,.36,1), right .38s cubic-bezier(.22,.61,.36,1);
}
body[data-scrolled="true"] .topbar-spacer {
  opacity: 1;
}
/* item：关闭顶部渐变遮盖时，彻底隐藏遮罩条，避免残留在最顶部形成色带 */
body[data-top-cover="off"] .topbar-spacer {
  display: none !important;
}
/* 大图模块锁定浮动(lockHero)开启时，取消顶部遮盖，完整显示整个大图（item4） */
body[data-hero-float="on"] .topbar-spacer {
  display: none !important;
}

/* ========== 顶部浮动胶囊菜单 ========== */
.topbar {
  position: fixed;
  top: var(--menu-top-dist, 36px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: clamp(320px, min(880px, 92vw), 880px);
  max-width: calc(100vw - 2 * var(--page-inset-x) - 24px);
  /* 胶囊高度 / 背景（20260811j）：用户设置可覆盖；默认沿用原外观 */
  height: var(--nav-capsule-h, auto);
  background: var(--nav-capsule-bg, var(--menu-bg, var(--bg)));
  border: 1px solid var(--menu-border, var(--line));
  border-radius: 999px;
  box-shadow: none;
  /* 下滑右缩动画（item6）：胶囊平滑缩小并向右滑动到位；transform 保持 left:50% 以便平滑插值 */
  transition: background .4s ease,
              width .42s cubic-bezier(.22,.61,.36,1),
              height .42s cubic-bezier(.22,.61,.36,1),
              border-radius .42s cubic-bezier(.22,.61,.36,1),
              transform .42s cubic-bezier(.22,.61,.36,1),
              padding .42s cubic-bezier(.22,.61,.36,1),
              left .38s cubic-bezier(.22,.61,.36,1);
  overflow: hidden;
}
.topbar:hover { box-shadow: none; }
/* 主导航栏 胶囊背景宽度（仅当用户设置宽度时生效，避免覆盖默认 clamp 宽度） */
body[data-nav-capsule-set="on"] .topbar {
  width: var(--nav-capsule-w);
  max-width: none;
}
/* 主导航栏 胶囊背景毛玻璃 */
body[data-nav-capsule-glass="on"] .topbar {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.45);
}
body[data-mode="dark"][data-nav-capsule-glass="on"] .topbar { background: rgba(255,255,255,.08); }
body[data-mode="dark"] .topbar,
body[data-mode="dark"] .topbar:hover { box-shadow: none; }
/* 主导航栏下边线已取消 */
.topbar::after { display: none !important; }

.topbar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  /* 高度填满胶囊，使导航文字在胶囊内随胶囊高度自适应垂直居中（req2） */
  height: 100%;
  box-sizing: border-box;
  /* 上下内边距随胶囊高度自适应：胶囊高时留白多、胶囊矮时不溢出（req2） */
  padding: clamp(4px, calc(var(--nav-capsule-h, 56px) * 0.18), 12px) 18px
           clamp(4px, calc(var(--nav-capsule-h, 56px) * 0.18), 12px) 14px;
  gap: 18px;
}
.topbar__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--logo-size, 38px); height: var(--logo-size, 38px);
  border-radius: var(--logo-radius, 999px);
  background: var(--bg);
  border: var(--logo-border-w, 0px) solid var(--logo-border-color, var(--line));
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color .3s ease, transform .25s ease, border-radius .3s ease, width .3s ease, height .3s ease;
}
/* Logo 形状（item3）：圆形 / 圆角矩形 / 方形 */
.topbar__logo[data-logo-shape="circle"] { border-radius: 50%; }
.topbar__logo[data-logo-shape="rounded"] { border-radius: 12px; }
.topbar__logo[data-logo-shape="square"] { border-radius: 4px; }
.topbar__logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.topbar__logo-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.logo-mark {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.topbar__logo:hover { transform: rotate(-6deg) scale(1.04); }

.topbar__nav {
  display: flex; gap: 26px;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  /* 胶囊变窄时允许换行并居中，避免导航文字溢出胶囊（req2） */
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topbar__nav::-webkit-scrollbar { display: none; }
.nav-item {
  font-size: 13.5px;
  color: var(--text-soft);
  padding: 6px 2px;
  position: relative;
  transition: color .25s ease;
  cursor: pointer;
}
.nav-item:hover { color: var(--text); }
.nav-item.is-active { color: var(--nav-active-text, var(--text)); background: transparent; }
/* 激活/悬停下划线：由中心平滑展开，取代原来生硬的短横线 */
.nav-item::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 20px; height: 2px;
  /* 选中菜单背景色：同时驱动主导航栏文字下方横线 与 底部风格菜单选中背景（item1） */
  background: var(--menu-active-bg, var(--text));
  border-radius: 999px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .25s ease;
}
.nav-item:hover::after { transform: translateX(-50%) scaleX(.55); opacity: .4; }
.nav-item.is-active::after { transform: translateX(-50%) scaleX(1); opacity: 1; }

.topbar__actions {
  display: flex; gap: 4px; align-items: center;
}
.iconbtn {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.iconbtn:hover { background: rgba(0,0,0,.06); color: var(--text); }
body[data-mode="dark"] .iconbtn:hover { background: rgba(255,255,255,.08); }

/* 20260811u: 单一用户入口 #userBtn
   - 访客态：内嵌 .topbar__user-icon（小人 svg 默认显示）
   - 已登录态：.topbar__user-icon 显示（小人图标），.topbar__user-badge 隐藏（不再显示文本账号名）；点击打开弹窗内「已登录」卡片
   - 切换由 syncAccountButtons() 控制 hidden 属性；
   - 父级 .topbar__actions 在窄屏会被 [data-collapsed="true"]/Narrow 隐藏，整体隐藏属于正常布局设计 */
.topbar__user {
  position: relative;
  width: auto;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
}
.topbar__user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar__user-icon[hidden] { display: none !important; }
.topbar__user-badge {
  display: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2px;
  color: var(--text);
  line-height: 1;
}
.topbar__user-badge[hidden] { display: none !important; }
/* 已登录：账号名徽章做成「胶囊里的一颗导航药丸」，配色/边框/圆角全部跟随顶部导航栏 */
.topbar__user[data-mode="logged"] {
  width: auto;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  /* 与 .topbar 同源：胶囊背景 / 胶囊描边；透明底，只在 hover 时才浮起 */
  background: transparent;
  border: 1px solid var(--menu-border, var(--line));
  border-radius: 999px;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.topbar__user[data-mode="logged"] .topbar__user-icon { display: none; }
.topbar__user[data-mode="logged"] .topbar__user-badge {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* 跟随导航栏文字色 */
  color: var(--nav-text-color, var(--text));
  font-size: 13px;
  letter-spacing: .3px;
}
/* hover：与 .iconbtn 同一套高亮语汇，不另起一套颜色 */
.topbar__user[data-mode="logged"]:hover {
  background: rgba(0, 0, 0, .06);
  border-color: var(--menu-border, var(--line));
}
body[data-mode="dark"] .topbar__user[data-mode="logged"]:hover { background: rgba(255, 255, 255, .08); }
body[data-mode="dark"] .topbar__user[data-mode="logged"] .topbar__user-badge { color: var(--nav-text-color, var(--text)); }


/* 下拉扩展 */
.topbar__expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s ease;
}
.topbar.is-expanded .topbar__expand { grid-template-rows: 1fr; }
.topbar__expand > .expand-row {
  overflow: hidden;
  padding: 0 18px;
  transition: padding .35s ease;
}
.topbar.is-expanded .topbar__expand > .expand-row { padding: 8px 18px 16px; }

.expand-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  position: relative;
  /* 注意：不要在此处加 border-top —— 折叠态（grid-template-rows:0fr）时边框仍会绘制，
     导致导航栏下方出现一条恒定的虚线。改用仅展开态显示的柔和渐变分隔线。 */
  padding-top: 0;
  margin-top: 0;
}
.expand-row::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--menu-border) 18%,
    var(--menu-border) 82%,
    transparent 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.topbar.is-expanded .expand-row {
  padding-top: 12px;
  margin-top: 6px;
}
.topbar.is-expanded .expand-row::after { opacity: 1; }
.searchwrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-soft);
}
.searchwrap input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font: inherit; color: var(--text);
  font-size: 13px;
}
.quickstyles {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.qstyle {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  transition: all .25s ease;
}
.qstyle:hover { color: var(--text); border-color: var(--text); }
.qstyle.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ========== 滚动后固定在顶部的标题（"探索" + 风格名） ========== */
.sticky-title {
  position: fixed;
  top: var(--menu-top-dist, 36px);
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 56;
  max-width: min(820px, calc(100% - 110px), calc(100vw - 2 * var(--page-inset-x) - 24px));
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--menu-bg);
  color: var(--menu-text);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
  border: 1px solid var(--menu-border);
  box-shadow: var(--menu-shadow);
  font-size: 13px;
  letter-spacing: .5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,.61,.36,1),
              background .5s ease, left .38s cubic-bezier(.22,.61,.36,1);
  /* 收起时立刻消失，不做延迟 */
  transition-delay: 0s;
}
body[data-scrolled="true"] .sticky-title {
  opacity: 1;
  transform: translate(-50%, 0);
  /* 保留毛玻璃浮动效果 + 描边/阴影，形成层次；颜色随明暗自适应（暗色时 --menu-text 为浅色） */
  background: var(--menu-bg);
  border-color: var(--menu-border);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
  /* 等顶部导航栏 .35s 缩放动画完全结束后再淡入，避免两者叠在一起 */
  transition-delay: .42s;
}
.sticky-title__main {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  margin-right: 6px;
  letter-spacing: -.5px;
}
.sticky-title__sep {
  margin: 0 6px;
  color: var(--menu-text-soft);
  opacity: .5;
}
.sticky-title__sub {
  color: var(--menu-text-soft);
}

/* ========== 横版浮动风格菜单 ========== */
/* 首页首屏：内联显示在大图框架下方；滚动后或图库/关于视图：固定在底部 */
.floating {
  position: relative;
  z-index: 58;
  margin: 22px 0 36px;
  padding: 0;
  pointer-events: none;
  opacity: 1;
  transform: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.22,.61,.36,1),
              padding-left .38s cubic-bezier(.22,.61,.36,1);
}
/* 滚动后：浮动菜单固定到底部（仅首页视图；图库/关于视图下 #home 已隐藏，菜单不显示） */
body[data-scrolled="true"] .floating {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--float-bottom-off, 30px);
  margin: 0;
  padding: 0 64px 0;
  opacity: 1;
  transform: translateY(0);
}
/* 图库 / 关于 视图不显示风格选项菜单 */
body[data-view="gallery"]  .floating,
body[data-view="about"]    .floating { display: none !important; }
/* 浮动菜单的整体外观：统一为大圆角胶囊（首屏 / 滚动后 / 各模式一致） */
.floating__inner {
  pointer-events: auto;
  max-width: min(1080px, 94vw, calc(100vw - 2 * var(--page-inset-x) - 24px));
  margin: 0 auto;
  width: var(--mobile-float-w, auto);      /* u34：移动端底部菜单长度（宽），0=自适应 */
  height: var(--mobile-float-h, auto);     /* u34：移动端底部菜单高度（厚），0=自适应 */
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--float-bg, var(--menu-bg));
  border: 1px solid var(--menu-border);
  border-radius: var(--float-radius, 999px);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
  font-size: var(--float-text-size, 14px);
  color: var(--float-text-color, var(--text));
  transition: gap .25s ease, padding .25s ease, width .3s ease, height .3s ease, background .3s ease, border-radius .3s ease, box-shadow .3s ease, color .3s ease, font-size .3s ease;
}
/* 底部菜单水平位置（u35）：auto 居中（默认 margin:0 auto）｜left 偏左｜right 偏右 */
body[data-float-halign="left"]  .floating__inner { margin-left: 0;    margin-right: auto; }
body[data-float-halign="right"] .floating__inner { margin-left: auto; margin-right: 0; }
/* 左右两侧边缘渐变（淡出）开关：作用于可滚动的风格名称列表，
   仅当名称被两侧遮挡（溢出）时由 JS 加 data-float-edge=1 才显示 */
body[data-float-edge="1"] .floating__scroll {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--float-edge-grad, 24px), #000 calc(100% - var(--float-edge-grad, 24px)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--float-edge-grad, 24px), #000 calc(100% - var(--float-edge-grad, 24px)), transparent 100%);
}
/* 下滑后（fixed 底部）：恢复白色弧形胶囊外观 */
body[data-scrolled="true"] .floating__inner {
  padding: 10px 18px;
  background: var(--float-bg, var(--menu-bg));
  border: 1px solid var(--menu-border);
  border-radius: var(--float-radius, 999px);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
}
/* 模式：固定在底部（无论是否滚动都 fixed bottom + 始终白色胶囊） */
.floating[data-mode="fixed-bottom"] {
  position: fixed !important;
  left: 0; right: 0;
  bottom: var(--float-bottom-off, 30px) !important;
  margin: 0 !important;
  padding: 0 64px 0 !important;
  z-index: 58; /* 高于浮动标题带(54)，低于主导航栏 topbar(60)：底部菜单始终在最上层、不被标题文字遮盖 */
}
.floating[data-mode="fixed-bottom"] .floating__inner {
  padding: 10px 18px;
  background: var(--float-bg, var(--menu-bg));
  border: 1px solid var(--menu-border);
  border-radius: var(--float-radius, 999px);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
}
/* 模式：固定在网页中 —— 始终内联显示，取消浮动效果（无阴影/毛玻璃/圆角胶囊） */
.floating[data-mode="inline"] {
  position: relative !important;
  bottom: auto !important;
  left: auto !important; right: auto !important;
  margin: 22px 0 36px !important;
  padding: 0 !important;
  transform: none !important;
  z-index: auto;
}
.floating[data-mode="inline"] .floating__inner {
  padding: 10px 18px;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 999px;
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(var(--menu-blur));
  -webkit-backdrop-filter: blur(var(--menu-blur));
}
.floating[data-mode="inline"] .floating__inner:hover { animation: none; }

/* 鼠标滑过下方的风格菜单：轻微晃动 */
.floating__inner:hover { animation: floatWobble .7s ease; }
@keyframes floatWobble {
  0%   { transform: translateY(0) rotate(0); }
  25%  { transform: translateY(-3px) rotate(-.5deg); }
  55%  { transform: translateY(2px) rotate(.35deg); }
  80%  { transform: translateY(-1px) rotate(0); }
  100% { transform: translateY(0) rotate(0); }
}

/* 首页瀑布流：当前风格菜单对应图库相册图片 */
.home-masonry { margin-top: var(--gallery-title-gap, 44px); margin-bottom: 50vh; } /* 下方留白约半屏 */

/* 折叠态：变成一个干净的圆形 logo */
.topbar[data-collapsed="true"] {
  width: 56px !important;
  border-radius: 50% !important;
  overflow: hidden;
  transition: all .35s cubic-bezier(.22,.61,.36,1);
}
.topbar[data-collapsed="true"] .topbar__nav,
.topbar[data-collapsed="true"] .topbar__actions,
.topbar[data-collapsed="true"] .topbar__expand { display: none !important; }
.topbar[data-collapsed="true"] .topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 0;
  grid-template-columns: none;
}
.topbar[data-collapsed="true"] .topbar__logo {
  width: 56px; height: 56px;
  background: transparent;
  border-color: var(--line);
}

/* ========== 页面布局 ========== */
/* 网页宽度：内容列居中时的左右留白，由 --page-max-width 推导（默认 100vw = 全屏） */
:root { --page-max-width: 100vw; }
html { --page-inset-x: max(0px, calc((100vw - var(--page-max-width)) / 2)); }
/* 20260814：全屏模式默认两侧留白（自适应），不再贴边 */
:root { --page-full-gutter: clamp(16px, 4vw, 64px); }
/* 20260814：内容列内边距（hero / 标题固定带），有界响应式；
   此前误用外留白 --page-inset-x 作内边距，px 模式会被外留白撑爆导致内容宽度不正确 */
:root { --page-pad-x: clamp(16px, 4vw, 64px); }
.page { padding-top: calc(var(--menu-top-dist, 36px) + 114px); max-width: var(--page-max-width); margin-inline: auto; }

/* ========== 视图切换：首页 / 图库 / 关于（图库为独立页面） ========== */
body[data-view="home"]    #gallery,
body[data-view="home"]    #about   { display: none; }
body[data-view="gallery"] #home,
body[data-view="gallery"] #about   { display: none; }
body[data-view="about"]   #home,
body[data-view="about"]   #gallery { display: none; }
/* 非首页视图不显示「探索 · 风格名」悬浮标题 */
body[data-view="gallery"] .sticky-title,
body[data-view="about"]   .sticky-title { display: none; }

/* ========== Hero / 精选大图 ========== */
.hero {
  /* 内边距用有界的 --page-pad-x（内容列内留白），而非外留白 --page-inset-x，避免 px 模式被撑爆 */
  padding: var(--hero-top-space, 56px) var(--page-pad-x, 64px) 28px;
  /* 导航栏距大图模块距离（req1）：基础回退值（菜单在底部 bottom-center 时使用，导航栏不占顶部） */
  margin-top: var(--nav-hero-gap, 0);
  min-height: calc(100vh - var(--menu-top-dist, 36px) - 114px);
  position: relative;
  transition: opacity .35s ease;
}
/* 导航栏距大图模块距离（req1）：菜单在顶部时，navHeroGap=0 应让大图模块顶部贴导航栏底部
   - 页面顶部留白 .page padding-top = menu-top-dist + 114；导航栏底部 = menu-top-dist + 胶囊高
   - 故本 margin = navHeroGap + 胶囊高 - 114；胶囊高取 --nav-capsule-h（auto 时回退 56px），随胶囊高度自适应
   - 效果：navHeroGap=0 → 大图顶=导航栏底（贴顶）；正值拉远，负值（滑块已支持）上压 */
body:not([data-menu-pos="bottom-center"]) .hero {
  margin-top: calc(var(--nav-hero-gap, 0) + var(--nav-capsule-h, 56px) - 114px);
}
/* 移动端：首页大图与主导航栏距离（移动端专属 mobileNavHeroGap，独立于桌面 navHeroGap） */
@media (max-width: 720px) {
  .hero { margin-top: var(--mobile-nav-hero-gap, var(--nav-hero-gap, 0)) !important; }
}
/* 大图锁定浮动后：给 hero 实心背景，避免上滑时页面元素从大图周围镂空处透出 */
body[data-lock-hero="1"] .hero { background: var(--bg); }
/* 滚动后：大图区域完全隐藏，不再展示滑动/轮播图 */
/* 滚动后 hero 仍保留，但不让轮播图透到导航/标题背后 */
body[data-scrolled="true"] .hero {
  /* 保持大图可见，不做 display:none */
}
.hero__viewport {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: var(--bg-2);
  cursor: grab;
  touch-action: pan-y;
}
.hero__viewport.is-dragging { cursor: grabbing; }
.hero__track {
  position: relative;
  width: 100%;
}
.hero__slide {
  display: none;
  position: relative;
}
.hero__slide.is-active { display: block; }
.hero__slide img {
  width: var(--hero-img-width, 100%);
  height: var(--hero-img-height, auto);
  max-height: 90vh;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  transform: scale(1.01);
  transition: transform .9s ease, opacity .45s ease;
}
/* 显式高度设置时取消 max-height 限制 */
body[data-hero-img-height-set="true"] .hero__slide img { max-height: none; }
.hero__slide.is-active img { transform: scale(1.04); }
.hero__slide.is-leaving { opacity: 0; }

/* 上一张 / 下一张：悬停大图时显示 */
.hero__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px; height: 46px;
  background: transparent;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .3s ease, transform .2s ease, filter .2s ease;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.hero__viewport:hover .hero__nav { opacity: 1; }
.hero__nav:hover { filter: drop-shadow(0 1px 4px rgba(0,0,0,.7)); }
.hero__nav--prev { left: 18px; }
.hero__nav--next { right: 18px; }
.hero__nav--prev:active { transform: translateY(-50%) translateX(-2px); }
.hero__nav--next:active { transform: translateY(-50%) translateX(2px); }
.hero__badge {
  position: absolute;
  left: calc(22px + var(--hero-badge-pos-x, 0px));
  bottom: calc(22px + var(--hero-badge-pos-y, 0px));
  background: var(--hero-badge-bg-color, transparent);  /* 由 JS 合成 rgba（颜色 + 透明度） */
  color: #fff;
  /* 标签大小：随窗口宽度自适应（clamp 的 vw 项）；基准大小由 --hero-badge-scale 微调 */
  font-size: clamp(12px, 1vw + 9px, 17px);
  letter-spacing: 1.5px;
  padding: 7px 12px;
  border-radius: 6px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: none;                       /* 默认隐藏，由 data-hero-badge 控制 */
  transform: scale(var(--hero-badge-scale, 1));
  transform-origin: left bottom;
  /* u35：上下居中（strong + span inline 元素，按 padding 撑开后纵向对齐基线导致偏低；改 inline-flex 让子元素垂直居中） */
  align-items: center;
  line-height: 1.2;
}
/* 移动端：标签基准更小，仍随窗口宽度自适应 */
@media (max-width: 720px) {
  .hero__badge { font-size: clamp(10px, 3.4vw, 14px); padding: 6px 10px; }
}
.hero__badge strong {
  display: inline-block;
  margin-right: 8px;
  font-weight: 600;
}
.hero__badge span { opacity: .75; }

/* 大图文件名标签：正确关联到 .hero__badge（风格名称 + 图片文件名，20260811j）
   显示开关 / 背景开关 / 大小缩放 / 位置偏移，由 CSS 变量驱动 */
body[data-hero-badge="1"] .hero__badge { display: inline-flex; }
/* 背景开关：开启 → 用 --hero-badge-bg-color（颜色 + 透明度合成）；关闭 → 透明（即便毛玻璃开启也只留模糊不留底色） */
body[data-hero-badge-bg="1"] .hero__badge { background: var(--hero-badge-bg-color, rgba(20,20,20,.55)); }
body[data-hero-badge-bg=""] .hero__badge { background: transparent; }
/* 毛玻璃效果：仅当开关开启时叠加，避免关闭背景后残留毛玻璃 */
body[data-hero-badge-glass="1"] .hero__badge {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero__caption {
  margin-top: calc(36px + var(--title-top-gap, 0px));
  display: block;
  position: relative;
  z-index: 54;
}
/* 下滑跳过首屏大图后，标题固定在页面顶部（由 JS 切换 .is-fixed），瀑布流在下方继续滚动
   - 顶部直接对齐页面最高处（top:0，被 .topbar z=60 覆盖）
   - 背景渐变方向：顶部实色 → 底部透明（镂空在下方）
   - 标题左对齐，与 .hero padding-left 对齐（桌面 64 / 移动 24）
   - 宽度始终满屏（与背景融合）
   - --top-blank-height: 顶部额外留白（在 menu-top-dist 之上叠加）
   - --top-blank-width: 左右留白
   - --top-blank-gradient: 底部渐变高度 */
.hero__caption.is-fixed {
  position: fixed;
  top: var(--title-float-top, 0px);
  /* 20260812：标题固定带跟随「网页宽度」设置 —— 宽度=内容列(--page-max-width)，水平居中，
     与 .page 对齐；背景渐变(::before)在带内由 --top-blank-width 收缩，整体随网页宽度变化 */
  left: 50%;
  transform: translateX(-50%);
  width: var(--page-max-width);
  max-width: 100vw;
  margin: 0;
  padding: calc(var(--menu-top-dist, 36px) + 56px + var(--top-blank-height, 0px))
           var(--page-pad-x, 64px)
           var(--top-blank-gradient, 60px);
  background: none;
  z-index: 54;
  pointer-events: none; /* 固定时不拦截下方瀑布流交互 */
  box-shadow: none;
}
/* 标题浮动背景渐变：背景色块宽度由 --top-blank-width 控制（item9：实际宽度，居中）
   - adaptive = 内容列宽(100% - 2*page-inset-x)；full = 100%(覆盖整窗)；custom = 自定义 px 宽度 */
.hero__caption.is-fixed::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--top-blank-width, 100%);
  z-index: -1;
  background: linear-gradient(to bottom,
    var(--bg) 0,
    var(--bg) calc(100% - var(--top-blank-gradient, 60px)),
    transparent 100%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .hero__caption.is-fixed { padding-left: 24px; padding-right: 24px; }
}
.hero__caption.is-fixed .hero__scroll { pointer-events: auto; }
.hero__caption.is-fixed .home-cols-btn { pointer-events: auto; }
.hero__caption.is-fixed .home-cols-group { pointer-events: auto; }

/* 桌面端：顶栏 LOGO 不显示文字（仅移动端显示 QX + studio） */
@media (min-width: 721px) {
  .topbar__logo-text { display: none; }
}
.hero__caption-spacer { height: 0; }
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  /* 标题首帧字号：优先用 head 内联脚本从 localStorage 写入的 --hero-title-init（用户已设定值），
     未设定时回退 40vw（跟随屏幕宽度的默认行为）。避免先超大再缩小的闪烁。 */
  font-size: var(--hero-title-init, 40vw);
  margin: 0;
  letter-spacing: -1px;
  line-height: .95;
  /* 标题文字位置偏移（#240）：默认 0 = 跟随网页宽度自适应 */
  transform: translate(var(--title-text-x, 0px), var(--title-text-y, 0px));
  transition: font-size .35s cubic-bezier(.22,.61,.36,1);
}
/* 标题固定置顶后缩小到合理尺寸，避免撑爆顶栏 */
.hero__caption.is-fixed .hero__title {
  font-size: clamp(22px, 5vw, 34px);
}
.hero__subtitle {
  font-size: 13px;
  color: var(--text-soft);
  /* 标题与副标题距离（#240）：默认 clamp 跟随网页宽度自适应；用户设置后由 --title-sub-gap 覆盖 */
  margin: var(--title-sub-gap, clamp(6px, 1vw, 12px)) 0 0;
  /* 与标题同步偏移，保证标题+副标题整体移动 */
  transform: translate(var(--title-text-x, 0px), var(--title-text-y, 0px));
  letter-spacing: .5px;
}
/* 大标题下方滚动提示（指向图库页） */
.hero__scroll {
  position: static;
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 1px;
  cursor: pointer;
  transition: color .25s ease, transform .25s ease;
  /* 浏览图库按钮位置（u24，reqB）：link=跟随标题文字垂直偏移；custom=距遮盖下边框间距 */
  transform: translateY(var(--scroll-btn-y, 0px));
}
.hero__scroll:hover { color: var(--text); }
.hero__scroll .dot {
  display: inline-block; width: 1px; height: 22px;
  background: var(--text-soft);
  position: relative;
}
.hero__scroll .dot::after {
  content: ""; position: absolute; bottom: 0; left: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-soft);
  animation: float 2.2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-8px); opacity: .4; }
}

/* ========== Gallery / 图库页 ========== */
.gallery {
  padding: 40px 64px 80px;
}

/* 图库顶栏（返回 + 管理员操作） */
.gallery__topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.gallery__topbar .gallery__admin-actions { margin-left: auto; }
.gal-btn--ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.gal-btn--ghost:hover { color: var(--text); border-color: var(--text); transform: translateY(-1px); }

/* 相册总览：封面网格 */
.gallery__index-title { margin-bottom: 6px; }
.gallery__index-title h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -.5px;
}
.gallery__index-title p { margin: 0; color: var(--text-soft); font-size: 14px; }

/* 相册详情：当前所在相册标题 */
.gallery__album-head { margin: 4px 0 22px; padding: 0 56px; }
.gallery__album-name {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -.4px;
}
.gallery__album-desc { margin: 0; color: var(--text-soft); font-size: 14px; }
@media (max-width: 640px) {
  .gallery__album-head { padding: 0 8px; }
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 26px;
}
/* 图库总览容器：块级，分组 <section> 纵向从上到下堆叠；只有内层 .album-grid 才负责横向网格换行 */
.album-grid-list { display: block; margin-top: 26px; }
.gallery__groupbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.album-card { position: relative; }
.album-card.is-batch { cursor: pointer; }
.album-card__check {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.28);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease;
  pointer-events: none;
}
.album-card__check.is-on { background: var(--accent); border-color: var(--accent); }
.album-card__check.is-on::after {
  content: ''; width: 6px; height: 11px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.album-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.album-card.is-dragging { opacity: .45; }
.album-card.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.4); }
.album-group-section.is-drop-target { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px; }
.album-grid.is-drop-target { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px; }
.gallery__batch-count { font-size: 12.5px; color: var(--text-soft); align-self: center; margin-left: 2px; }
/* 图库总览：相册按分类分节展示 */
.album-group-section { margin-bottom: 30px; }
.album-group-section:last-child { margin-bottom: 0; }
.album-group-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* 标题后接一条分隔横线，视觉对齐 album 内「图片分组」的 .masonry-group__head */
.album-group-section__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
  transform: translateY(1px);
}
.album-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: transform .35s ease, box-shadow .35s ease, border-color .25s ease;
}
.album-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 50px rgba(30,20,10,.16);
  border-color: var(--accent);
}
.album-card__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  overflow: hidden;
}
.album-card__cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.album-card:hover .album-card__cover img { transform: scale(1.05); }
.album-card__cover--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 13px;
}
.album-card__empty-text {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-family: var(--serif);
  font-size: 15px; letter-spacing: 3px;
  color: var(--text-soft); text-align: center; padding: 8px 12px;
}
/* 后台「无图相册封面」设置：标签 + 输入框行 */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 0; font-size: 13px;
}
.setting-row > span { color: var(--text); white-space: nowrap; }
.setting-row input[type="text"] {
  flex: 1; min-width: 0;
  padding: 7px 9px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.setting-row input[type="text"]:focus { outline: none; border-color: var(--accent, var(--text)); }
.album-card__name {
  padding: 14px 16px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.album-card__count {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-soft);
  flex-shrink: 0;
}
.album-card__scene {
  padding: 0 16px 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-soft);
  opacity: .7;
}
.gallery__album { margin-top: 8px; }

/* 二级分类：风格 Tab + 管理员操作 */
.gallery__tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.gallery__tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.gallery__tabs::-webkit-scrollbar { display: none; }
.gallery__tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}
.gallery__tab:hover { color: var(--text); border-color: var(--text); }
.gallery__tab.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* 管理员操作按钮组 */
.gallery__admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.gal-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, background .2s ease;
  white-space: nowrap;
}
.gal-btn:hover { transform: translateY(-2px); }
.gal-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.gal-btn.is-active:hover { color: #fff; border-color: var(--accent); }
.gal-btn--outline {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
}
.gal-btn--outline:hover { color: var(--text); border-color: var(--text); }
.gal-btn--solid {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
}
/* 原「显示此相册」勾选框已移除，相册显隐统一在「相册管理」弹窗中设置 */
.gal-btn--danger {
  border: 1px solid rgba(200,60,60,.4);
  background: rgba(200,60,60,.08);
  color: #c44;
}
.gal-btn--danger:hover { background: rgba(200,60,60,.16); color: #b33; border-color: rgba(200,60,60,.6); }

.gallery__head {
  margin-bottom: 32px;
}
.gallery__head h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -.5px;
}
.gallery__head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  max-width: 520px;
}

/* 图库标题行：标题 + 右侧「分组视图」小图标（20260917，形似首页列数切换按钮） */
.gallery__head-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.gallery__head-row h2 { margin: 0; }
.gal-group-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.gal-group-icon:hover { color: var(--text); transform: scale(1.08); }
.gal-group-icon.is-active { color: var(--accent, var(--text)); }
.gal-group-icon:active { transform: scale(.94); }

/* 上传按钮 */
.upload-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  transition: transform .2s ease, opacity .2s ease;
}
.upload-btn:hover { transform: translateY(-2px); }

/* 空状态 */
.gallery__empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-soft);
}
.gallery__empty p { margin: 4px 0; font-size: 15px; }
.gallery__empty .small { font-size: 12px; opacity: .7; }

/* 瀑布流 */
.masonry {
  column-count: 3;
  column-gap: 18px;
}
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 600px) { .masonry { column-count: 1; } }

.masonry__card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  cursor: zoom-in;
  transition: transform .35s ease, box-shadow .35s ease;
}
.masonry__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(30,20,10,.14);
}
.masonry__card img {
  width: 100%;
  height: auto;
  transition: transform .8s ease;
}
.masonry__card:hover img { transform: scale(1.04); }
.masonry__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  color: #fff;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.masonry__card:hover .masonry__cap {
  opacity: 1; transform: translateY(0);
}
.masonry__cap strong { font-weight: 600; letter-spacing: 1.5px; }
.masonry__cap small {
  display: block; opacity: .8; font-size: 11px;
  margin-top: 2px;
}

/* 删除按钮（管理员可见） */
.masonry__del {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
  z-index: 2;
}
.masonry__card:hover .masonry__del { opacity: 1; }
.masonry__del:hover { background: rgba(220,50,50,.8); }

/* 重命名按钮（管理员可见）：与删除按钮对称，位于卡片左上角 */
.masonry__rename {
  position: absolute;
  top: 8px; left: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
  z-index: 2;
}
.masonry__card:hover .masonry__rename { opacity: 1; }
.masonry__rename:hover { background: rgba(60,120,200,.85); }

/* 新 JS 布局：行优先 + 标签分组（覆盖旧 column-count 瀑布流） */
.masonry.masonry--js { column-count: auto !important; }
.masonry-group { margin-bottom: 32px; }
.masonry-group:last-child { margin-bottom: 0; }
.masonry-group__head {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 600; color: var(--text);
  margin: 2px 2px 14px; opacity: .92;
}
/* 分组标题吸顶：图库开启「批量管理」或「分组视图」时生效，停靠【窗口顶部】贴边（非贴浮动按钮）。
   满宽：负 margin 突破居中容器、左右拉到视口边，底色=网页背景 var(--bg) 完全一致（明/暗主题自动适配），
   文字内边距随页面对齐内容列；不抢层（z-index:50），相册管理浮动条 z-index:70 压在其上。
   首页瀑布流（#homeMasonry）均不吸顶。 */
#masonry.img-batch .masonry-group__head,
#masonry.masonry--grouped .masonry-group__head {
  position: sticky; top: 0; z-index: 50;
  margin: 0 calc(50% - 50vw) 14px; /* 左右满宽到窗口边，无漏缝 */
  background: var(--bg); /* 底色＝网页背景（含暗色模式适配） */
  padding: 8px calc(50vw - 50% + 16px); /* 文字左右留白随页面对齐内容列 */
  opacity: 1;
}
.masonry-group__head::after {
  content: ''; flex: 1; height: 1px;
  background: var(--line); opacity: .55;
}
/* 吸顶分组标题的纹理层：复刻 body::before 的同款纹理，使标题条底色＝网页背景（纯色 --bg + 同款纹理），
   而不是一块与周围质感脱节的实色条。z-index:-1 绘制在自身背景之上、文字之下；
   background-attachment: fixed 让纹理相对视口定位，与 body 的固定纹理层严丝合缝、滚动吸顶时不会错位。
   仅吸顶态（.img-batch / .masonry--grouped）声明 content，故非吸顶时不生成该伪元素。 */
#masonry.img-batch .masonry-group__head::before,
#masonry.masonry--grouped .masonry-group__head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--texture-opacity, 0);
  background-attachment: fixed;
  transition: opacity .45s ease;
}
body[data-texture="none"] #masonry .masonry-group__head::before { display: none !important; }
body[data-texture="paper"] #masonry .masonry-group__head::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: multiply;
}
body[data-texture="grain"] #masonry .masonry-group__head::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  mix-blend-mode: multiply;
}
body[data-texture="dots"] #masonry .masonry-group__head::before {
  background-image: radial-gradient(var(--text-soft) 1px, transparent 1.6px);
  background-size: 20px 20px;
  mix-blend-mode: multiply;
}
body[data-texture="lines"] #masonry .masonry-group__head::before {
  background-image: repeating-linear-gradient(45deg, var(--text-soft) 0 1px, transparent 1px 11px);
  mix-blend-mode: multiply;
}
body[data-mode="dark"][data-texture]:not([data-texture="none"]) #masonry .masonry-group__head::before { mix-blend-mode: overlay; }
/* 批量管理：分组标题上的「全选」按钮 */
.masonry-group__selall {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-soft); font-size: 11.5px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.masonry-group__selall:hover { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.masonry__cols { display: flex; gap: 18px; align-items: flex-start; }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.masonry__col > .masonry__card { margin-bottom: 0; }

/* 分组视图：可拖拽图片归组 */
.masonry__card--draggable { cursor: grab; }
.masonry__card--draggable:active { cursor: grabbing; }
.masonry__card.is-dragging {
  opacity: .55; transform: scale(.97); z-index: 30;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  pointer-events: none; /* 拖动时不挡住下方分组的命中检测 */
}
.masonry-group.droptarget {
  outline: 2px dashed var(--accent); outline-offset: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.masonry-group.droptarget .masonry-group__head { color: var(--accent); }

/* ========== About ========== */
.about { padding: 100px 64px 140px; }
.about__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.about__inner h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 500;
  margin: 0 0 18px;
}
.about__inner p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-soft);
}
.about__info {
  margin: 26px auto 0;
  max-width: 520px;
  text-align: left;
  display: grid;
  gap: 10px;
}
.about__info-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--text-soft);
}
.about__info-label {
  flex-shrink: 0;
  width: 72px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text);
  opacity: .7;
}
.about__info-row a { color: var(--accent); }
.about__qr {
  margin: 22px auto 0;
  max-width: 520px;
  text-align: center;
}
.about__qr .about__info-label { display: block; width: auto; margin-bottom: 8px; }
.about__qr img {
  width: 160px; height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* ========== 关于页富文本编辑器 ========== */
/* 公共展示区正文（富 HTML） */
.about__content {
  text-align: left;
  max-width: 560px;
  margin: 6px auto 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.9;
  word-break: break-word;
}
.about__content.is-empty { min-height: 1em; }
.about__content h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
  text-align: center;
}
.about__content h3 {
  font-size: 19px; font-weight: 600; color: var(--text);
  margin: 20px 0 8px;
}
.about__content p { margin: 0 0 12px; }
.about__content ul, .about__content ol { margin: 0 0 12px; padding-left: 1.4em; }
.about__content li { margin: 4px 0; }
.about__content blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft, rgba(0,0,0,.03));
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-style: italic;
}
.about__content a { color: var(--accent); text-decoration: underline; }
.about__content img {
  max-width: 100%; border-radius: 10px; margin: 10px 0; display: block;
}
.about__content.is-editing {
  outline: 2px dashed var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

/* 后台富文本编辑区 */
.rte-editor {
  min-height: 140px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  text-align: left;
}
.rte-editor:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rte-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-soft);
  opacity: .6;
}
.rte-editor h2 { font-size: 22px; font-weight: 600; margin: 8px 0 6px; }
.rte-editor p { margin: 0 0 10px; }
.rte-editor ul, .rte-editor ol { padding-left: 1.4em; margin: 0 0 10px; }
.rte-editor blockquote {
  margin: 8px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent); background: rgba(0,0,0,.03);
  border-radius: 0 8px 8px 0; font-style: italic;
}
.rte-editor img { max-width: 100%; border-radius: 8px; margin: 8px 0; display: block; }

/* 工具栏（后台 / 内联共用） */
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft, rgba(0,0,0,.02));
  margin-bottom: 8px;
}
.rte-btn {
  min-width: 34px; height: 30px; padding: 0 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.rte-btn:hover { border-color: var(--accent); color: var(--accent); }
.rte-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.rte-b { font-weight: 700; }
.rte-i { font-style: italic; }
.rte-u { text-decoration: underline; }
.rte-btn--img { font-weight: 600; }

/* 公共区内联编辑入口 */
.about-edit-btn {
  margin: 16px auto 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  font-size: 13px; cursor: pointer;
}
.about-edit-btn:hover { background: var(--accent); color: #fff; }
.about__editbar {
  position: sticky; top: 8px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 14px 0 0; padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.about__editbar .rte-toolbar { flex: 1; border: none; background: transparent; padding: 0; margin: 0; }
.about__edit-hint { font-size: 12px; color: var(--text-soft); opacity: .8; }
.about-edit-done {
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font-size: 13px; cursor: pointer; flex-shrink: 0;
}

/* ========== 风格项 ========== */
.floating__scroll {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  /* 风格菜单栏两侧渐变（item6）：仅在 JS 判定名称溢出 + 开关开启时
     由 body[data-float-edge="1"] .floating__scroll 加 mask，基础态不加，避免菜单文字被错误截断 */
}
.floating__scroll::-webkit-scrollbar { display: none; }
.floating__list {
  list-style: none; margin: 0;
  /* 小 padding 让首尾不被裁切，但不推开首个菜单（左对齐） */
  padding: 0 12px;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.style-item {
  flex-shrink: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: 5px 14px;
  border-radius: 999px;
  /* 关联后台「菜单文字大小」设置：未自定义时回退 13px */
  font-size: var(--float-text-size, 13px);
  cursor: pointer;
  /* 关联后台「菜单文字颜色」设置：未自定义时回退主题色 */
  color: var(--float-text-color, var(--text-soft));
  border: 1px solid transparent;
  background: transparent;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  line-height: 1.3;
}
.style-item__main {
  display: inline-flex; align-items: center; gap: 6px;
}
.style-item__label { font-size: inherit; }
.style-item__sub {
  font-size: 10px;
  letter-spacing: .5px;
  opacity: .6;
  margin-top: 1px;
}
.style-item:hover { background: rgba(0,0,0,.05); color: var(--text); }
body[data-mode="dark"] .style-item:hover { background: rgba(255,255,255,.06); }
/* 底部菜单选中态：由独立的「菜单选中样式」设置驱动（文字色 / 背景色 / 圆角形状 / 边框） */
.style-item.is-active {
  background: var(--float-active-bg, var(--ct-float-active-bg, var(--menu-text)));
  color: var(--float-active-text, var(--ct-float-active-text, var(--menu-bg)));
  border-radius: var(--float-active-radius, 999px);
  border: var(--float-active-border-width, 1px) solid var(--float-active-border-color, var(--ct-float-active-border, var(--menu-text)));
}
.style-item__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
  flex-shrink: 0;
}

/* 浮动菜单：右侧"更多"按钮（溢出时显示）—— 仅箭头符号，无圆形背景 */
.floating__next {
  flex-shrink: 0;
  width: 22px; height: 30px;
  background: transparent;
  border: 0;
  color: var(--menu-text-soft);
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .2s ease, transform .2s ease;
}
.floating__next.is-visible { display: inline-flex; }
.floating__next:hover { color: var(--menu-text); transform: translateX(2px); }

/* 浮动菜单：左侧"向左"按钮 —— 仅箭头符号，无圆形背景 */
.floating__prev {
  flex-shrink: 0;
  width: 22px; height: 30px;
  background: transparent;
  border: 0;
  color: var(--menu-text-soft);
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .2s ease, transform .2s ease;
}
.floating__prev.is-visible { display: inline-flex; }
.floating__prev:hover { color: var(--menu-text); transform: translateX(-2px); }

/* 浮动菜单：悬停时显示的横向滚动条 —— 已取消显示 */
.floating__scrollbar { display: none !important; }
.floating__thumb {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  min-width: 24px;
  border-radius: 999px;
  background: var(--menu-text-soft);
  opacity: .7;
  cursor: grab;
}
.floating__thumb:active { cursor: grabbing; background: var(--menu-text); }

/* =========================================================
   滚动时：顶部导航栏缩小为右侧 logo，hover 展开
   ========================================================= */

/* 滚动时顶部导航缩小为右侧 logo */
/* 导航栏下滑右缩（#242）：仅当开启导航栏下滑右缩 且 已下滑时，收缩为右侧圆形胶囊 */
/* 滚动后顶部导航缩小为右侧胶囊：保持 left:50%，用 transform 把胶囊平滑滑到右侧
   （item6 动画；item3 logo 随胶囊 flex 居中）；transform 内 100% = 胶囊当前宽度，宽度自适应(图标显隐)也不影响定位 */
body[data-nav-shrink="on"][data-scrolled="true"] .topbar {
  left: 50% !important;
  right: auto !important;
  top: var(--nav-shrink-top, var(--menu-top-dist, 36px)) !important;
  bottom: auto !important;
  /* 位置由 --nav-shrink-right / --nav-shrink-top 驱动（自适应用默认，自定义用用户设定） */
  transform: translateX(calc(50vw - var(--page-inset-x) - var(--nav-shrink-right, 24px) - 100%)) !important;
  /* 自适应 / 自定义 共用：按内容自动对齐缩放，开启图标时自动变宽（item2/3） */
  width: auto !important;
  min-width: var(--nav-shrink-w, 56px);
  height: auto !important;
  min-height: var(--nav-shrink-h, 56px);
  border-radius: 999px !important;
  padding: 0 6px;
  overflow: visible; /* 允许下拉菜单溢出 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* 需求1：右缩 LOGO 胶囊开关 —— 关闭时不显示 LOGO 背后的胶囊背景框（LOGO 直接悬浮，无玻璃底） */
body[data-nav-shrink="on"][data-scrolled="true"]:not([data-nav-shrink-logo-capsule="on"]) .topbar {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* 右缩后开启搜索 / 菜单图标时，胶囊宽度自适应内容（自动变宽） */
body[data-nav-shrink="on"][data-scrolled="true"][data-nav-shrink-show-search="on"] .topbar,
body[data-nav-shrink="on"][data-scrolled="true"][data-nav-shrink-show-menu="on"] .topbar {
  padding: 0 12px;
}
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__nav,
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__expand {
  display: none !important;
}
/* 收缩后胶囊内：默认仅 logo 可见；操作区按开关显隐搜索 / 菜单图标 */
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* 收缩后默认隐藏操作图标，仅按开关显示搜索 / 菜单（主题 / 账号 / 设置仍走 hover 下拉） */
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn:not(#searchBtn):not(#mobileMenuBtn) { display: none !important; }
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions #searchBtn { display: none !important; }
body[data-nav-shrink="on"][data-scrolled="true"][data-nav-shrink-show-search="on"] .topbar__actions #searchBtn { display: inline-flex !important; align-items: center; justify-content: center; }
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle { display: none !important; }
body[data-nav-shrink="on"][data-scrolled="true"][data-nav-shrink-show-menu="on"] .topbar__mobile-toggle { display: inline-flex !important; }
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn,
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle {
  width: 28px; height: 28px;
  background: transparent !important;
  border: 0 !important; box-shadow: none !important;
  border-radius: 50% !important; flex-shrink: 0;
}
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn svg,
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle svg { width: 16px; height: 16px; }
@media (max-width: 720px) {
  /* 移动端滚动后始终显示搜索/菜单图标（覆盖上述开关，沿用原交互） */
  body[data-nav-shrink="on"][data-scrolled="true"] .topbar__actions { display: flex !important; }
}
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-template-columns: none;
  padding: 0;
  gap: 6px;
}
body[data-nav-shrink="on"][data-scrolled="true"] .topbar__logo {
  /* 取胶囊短边做同心圆，确保 logo 与胶囊背景始终同心居中（item1） */
  --_shrink-side: min(var(--nav-shrink-w, 56px), var(--nav-shrink-h, 56px));
  /* LOGO 大小独立可控（--logo-size），仅当超过胶囊可用空间时才受胶囊约束（解耦胶囊） */
  width: min(var(--logo-size, 38px), calc(var(--_shrink-side) - 14px)) !important;
  height: min(var(--logo-size, 38px), calc(var(--_shrink-side) - 14px)) !important;
  background: transparent;
  border-color: var(--line);
  flex-shrink: 0;
  margin: 0 auto;
}
/* hover 时保持右侧定位与圆形，仅去背景（不横向展开） */
body[data-nav-shrink="on"][data-scrolled="true"] .topbar:hover {
  transform: translateX(calc(50vw - var(--page-inset-x) - var(--nav-shrink-right, 24px) - 100%)) !important;
  border-radius: 999px !important;
  background: transparent !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 右缩后仅显示 logo（搜索 / 菜单均关闭）时：胶囊强制圆形、logo 同心居中以适配 logo 图标 */
body[data-nav-shrink="on"][data-scrolled="true"]:not([data-nav-shrink-show-search="on"]):not([data-nav-shrink-show-menu="on"]) .topbar {
  width: var(--nav-shrink-w, 56px) !important;
  min-width: 0 !important;
  height: var(--nav-shrink-w, 56px) !important;
  min-height: 0 !important;
  padding: 0 !important;
  gap: 0;
  border-radius: 50% !important;
}
body[data-nav-shrink="on"][data-scrolled="true"]:not([data-nav-shrink-show-search="on"]):not([data-nav-shrink-show-menu="on"]) .topbar__inner {
  width: 100%;
  height: 100%;
}
body[data-nav-shrink="on"][data-scrolled="true"]:not([data-nav-shrink-show-search="on"]):not([data-nav-shrink-show-menu="on"]) .topbar__logo {
  width: min(var(--logo-size, 38px), calc(var(--nav-shrink-w, 56px) - 16px)) !important;
  height: min(var(--logo-size, 38px), calc(var(--nav-shrink-w, 56px) - 16px)) !important;
  border-radius: 50% !important;
  margin: 0 auto;
}
body[data-nav-shrink="on"][data-scrolled="true"]:not([data-nav-shrink-show-search="on"]):not([data-nav-shrink-show-menu="on"]) .topbar__actions { display: none !important; }
/* 下拉紧凑菜单（滚动后 hover 触发） */
.topbar__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.15);
  padding: 6px;
  z-index: 61;
  flex-direction: column;
  gap: 2px;
  animation: dropdownIn .2s ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 桥接 12px 间隙，避免鼠标移动到下拉菜单时 hover 丢失而缩回 */
.topbar__dropdown::before {
  content: "";
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 12px;
}
body[data-scrolled="true"] .topbar:hover .topbar__dropdown {
  display: flex;
}
.topbar__dropdown.is-open { display: flex; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
.dropdown-item:hover {
  background: rgba(0,0,0,.05);
  color: var(--text);
}
body[data-mode="dark"] .dropdown-item:hover { background: rgba(255,255,255,.06); }
.dropdown-item.is-active {
  color: var(--text);
  font-weight: 500;
  background: var(--menu-active-bg, rgba(0,0,0,.04));
}
body[data-mode="dark"] .dropdown-item.is-active { background: rgba(255,255,255,.05); }
.dropdown-item--btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
}
.dropdown-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}/* 风格管理面板 */
.style-list-mgr {
  display: grid;
  gap: 8px;
}
.style-mgr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.style-mgr-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.style-mgr-item__name { font-weight: 600; }
.style-mgr-item__name small { font-weight: 400; opacity: .5; margin-left: 4px; }
.style-mgr-item__desc { font-size: 11px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-mgr-item__del {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(220,50,50,.1);
  color: #c44;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.style-mgr-item__del:hover { background: rgba(220,50,50,.25); }
.style-mgr-item__del:disabled { opacity: .25; cursor: not-allowed; }

/* 回到顶部 */
.back-to-top {
  position: fixed;
  right: 16px; bottom: 152px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 70;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); }

/* ========== 管理员登录弹窗 ========== */
.login-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  animation: fadeIn .2s ease;
}
.login-modal__card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: min(360px, calc(100% - 48px));
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.login-modal__card h3 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}
.login-modal__card input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease;
}
.login-modal__card input:focus { border-color: var(--accent); }
/* 分组管理弹窗（加宽 + 内部布局） */
.login-modal__card--wide { width: min(560px, calc(100% - 48px)); max-height: 86vh; overflow: auto; }
.gm-new { display: flex; gap: 10px; margin-bottom: 18px; }
.gm-new input { flex: 1; }
.gm-group-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.gm-group-row { display: flex; gap: 8px; align-items: center; }
.gm-group-row input { flex: 1; }
.gm-group-row .gal-btn { flex: 0 0 auto; }
.gm-group-row__handle {
  flex: 0 0 auto;
  width: 28px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; color: var(--text-soft);
  border-radius: 6px; user-select: none; -webkit-user-select: none;
  touch-action: none; /* 触屏拖拽时不触发页面滚动 */
}
.gm-group-row__handle:hover { color: var(--text); background: var(--menu-bg); }
.gm-group-row__handle:active { cursor: grabbing; }
.gm-group-row.dragging {
  opacity: .6;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  background: var(--card-bg);
  border-radius: 10px;
}
.gm-group-empty { color: var(--text-soft); font-size: 13px; padding: 4px 0; }
.gm-img-row select { flex: 0 0 auto; max-width: 150px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; color: var(--text); font: inherit; }
.login-modal__row {
  display: flex; gap: 10px;
  margin-top: 16px;
}
.login-modal__cancel,
.login-modal__confirm {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  transition: background .2s ease;
}
.login-modal__cancel {
  background: var(--bg-2);
  color: var(--text-soft);
}
.login-modal__cancel:hover { background: var(--line); }
.login-modal__confirm {
  background: var(--text);
  color: var(--bg);
}
.login-modal__confirm:hover { opacity: .85; }
.login-modal__hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #c44;
  min-height: 16px;
}
.login-modal__remember {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 2px -2px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.login-modal__remember input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.login-modal__remember:hover { color: var(--text); }
.upload-target-select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
}
.upload-target-select:focus { border-color: var(--accent); }

/* ========== 相册管理弹窗 ========== */
.login-modal__card--wide { width: min(460px, calc(100% - 48px)); }

/* 相册管理弹窗：默认更宽并跟随页面宽度缩放；右下角可拖拽改变大小 */
#albumMgrModal .login-modal__card {
  width: min(960px, 94vw);
  max-width: 96vw;
  resize: both;
  overflow: auto;
  min-width: 320px;
  min-height: 240px;
}
#albumMgrModal .album-mgr__list { max-height: min(58vh, 560px); }
/* 名称 / 场景编号改为点击弹出输入框（行内过窄时体验更好） */
.album-mgr__name { flex: 1 1 auto; cursor: pointer; }
.album-mgr__name:hover { text-decoration: underline; color: var(--accent); }
.album-mgr__scene {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.album-mgr__scene:hover { border-color: var(--accent); color: var(--accent); }
/* 相册字段编辑弹窗（点击名称 / 场景编号弹出） */
#albumFieldModal .login-modal__card { width: min(420px, calc(100vw - 48px)); }

/* ===== 单图册设置面板 ===== */
.album-set-card { width: min(440px, calc(100vw - 48px)); }
.album-set-row { margin-bottom: 14px; }
.album-set-label { display: block; font-size: 12px; color: var(--muted, #8a8a8a); margin-bottom: 6px; }
.album-set-row input,
.album-set-row textarea {
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.album-set-row textarea { resize: vertical; }
.album-set-row input:focus,
.album-set-row textarea:focus { border-color: var(--accent); outline: none; }
.album-set-idwrap { display: flex; align-items: center; gap: 10px; }
.album-set-idwrap code {
  background: var(--line); padding: 5px 9px; border-radius: 7px;
  font-size: 13px; color: var(--text); word-break: break-all;
}
.album-set-copy {
  flex: 0 0 auto; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--text); cursor: pointer; font-size: 12px;
}
.album-set-copy:hover { border-color: var(--accent); color: var(--accent); }
.album-set-hint { font-size: 11px; color: var(--muted, #999); margin: 7px 0 0; line-height: 1.5; }
.album-set-row--switch { display: flex; align-items: center; justify-content: space-between; }
.album-set-row--switch .album-set-label { margin-bottom: 0; }
/* 开关（独立实现，避免与既有 .switch 冲突） */
.qx-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.qx-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.qx-switch__slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background .25s ease;
}
.qx-switch__slider::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s ease;
}
.qx-switch input:checked + .qx-switch__slider { background: var(--accent); }
.qx-switch input:checked + .qx-switch__slider::after { transform: translateX(16px); }

/* ===== 上传任务面板（右下角，多任务并发） ===== */
.upload-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 320;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--card, #fff); color: var(--text);
  border: 1px solid var(--line, #e3ddd0); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  overflow: hidden; font-size: 12px;
}
.upload-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line, #e3ddd0);
  background: var(--card-2, #faf7f0);
}
.upload-panel__title { font-weight: 600; font-size: 12px; }
.upload-panel__clear {
  border: 0; background: transparent; color: var(--accent, #8a6d3b);
  font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.upload-panel__clear:hover { background: var(--line, #eee); }
.upload-panel__list { max-height: 42vh; overflow-y: auto; padding: 6px 12px 12px; }
.up-row { padding: 8px 0; border-bottom: 1px dashed var(--line, #ece5d6); }
.up-row:last-child { border-bottom: 0; }
.up-row__top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.up-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row__pct { color: var(--muted, #8a8475); flex: 0 0 auto; }
.up-row__bar { height: 6px; border-radius: 999px; background: var(--line, #ece5d6); overflow: hidden; }
.up-row__fill {
  height: 100%; width: 0;
  border-radius: 999px; background: var(--accent, #8a6d3b);
  transition: width .12s ease;
}
.up-row__status { margin-top: 5px; font-size: 11px; color: var(--muted, #8a8475); }
.up-row--done .up-row__fill { background: #2e9e6b; }
.up-row--done .up-row__status { color: #2e9e6b; }
.up-row--error .up-row__fill { background: #c0392b; }
.up-row--error .up-row__status { color: #c0392b; }
@media (max-width: 600px) {
  .upload-panel { right: 8px; left: 8px; bottom: 8px; width: auto; }
}

/* ===== 上传图片：多级相册选择窗口 ===== */
.upload-modal__card {
  width: min(540px, calc(100vw - 40px));
  max-height: min(82vh, 660px);
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.upload-modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: var(--bg-2, #faf7f0); flex: 0 0 auto;
}
.upload-modal__head h3 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; flex: 1; }
.upload-modal__back {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer;
}
.upload-modal__back:hover { border-color: var(--accent); }
.upload-modal__close {
  border: 0; background: transparent; color: var(--muted, #8a8475);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.upload-modal__close:hover { background: var(--line); color: var(--text); }
.upload-modal__body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }

/* 第 1 级：相册列表（一相册一行，与相册管理同款行样式） */
.upload-album-list { display: flex; flex-direction: column; gap: 8px; max-height: min(54vh, 460px); overflow-y: auto; padding-right: 2px; }
.upload-album-empty { color: var(--muted, #8a8475); padding: 24px 0; text-align: center; }
.upload-album-row { cursor: pointer; }
.upload-album-row__arrow { margin-left: 8px; color: var(--text-soft); font-size: 18px; flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.upload-album-row:hover .upload-album-row__arrow { color: var(--accent); transform: translateX(3px); }
.upload-album-row--new { border-style: dashed; }
.upload-album-row--new .album-mgr__name { color: var(--accent); font-weight: 600; }
.upload-album-row--new:hover { border-color: var(--accent); background: var(--bg-3, var(--bg-2)); }

/* 第 2 级：待传图片列表 */
.upload-img-wrap { display: flex; flex-direction: column; gap: 12px; }
.upload-img-empty { color: var(--muted, #8a8475); font-size: 13px; text-align: center; padding: 18px 0; }
.upload-img-list { display: flex; flex-direction: column; gap: 10px; }
.upload-img-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card, #fff);
}
.upload-img-row__top { display: none; }
.upload-img-row__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--bg-2); }
.upload-img-row__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-img-row__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-img-row__q {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12px;
  background: var(--bg); color: var(--text); max-width: 180px;
}
.upload-img-row__del {
  border: 0; background: transparent; color: var(--muted, #8a8475);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; flex: 0 0 auto;
}
.upload-img-row__del:hover { background: #fdecea; color: #c0392b; }
/* 上传中：内联进度条（替代右下角面板，直到返回相册列表才转交面板） */
.upload-img-row.is-uploading .upload-img-row__del { display: none; }
.upload-img-row__progress {
  width: 100%; height: 7px; border-radius: 999px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); flex: 1 1 auto;
}
.upload-img-row__bar { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
.upload-img-row__pct { font-size: 11.5px; color: var(--text-soft); min-width: 38px; text-align: right; flex-shrink: 0; }
.upload-img-row.is-done { border-color: var(--accent); }
.upload-img-row.is-done .upload-img-row__pct { color: var(--accent); font-weight: 600; }
.upload-img-row.is-error { border-color: #c0392b; }
.upload-img-row.is-error .upload-img-row__pct { color: #c0392b; }

.upload-modal__foot {
  display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line);
  background: var(--bg-2, #faf7f0); flex: 0 0 auto;
}
.upload-modal__foot .gal-btn { flex: 1; justify-content: center; }
.upload-modal__foot .gal-btn:disabled,
.upload-modal__foot .gal-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== 全局提示 toast（替代浏览器原生 alert） ===== */
.ui-toast-wrap {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 10px;
  align-items: center; pointer-events: none;
}
.ui-toast {
  max-width: min(90vw, 440px);
  padding: 12px 18px; border-radius: 12px;
  background: rgba(24,24,24,.94); color: #fff; font-size: 13px; line-height: 1.5;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto; word-break: break-word;
}
.ui-toast.is-show { opacity: 1; transform: translateY(0); }
.ui-toast--success { background: rgba(34,139,84,.96); }
.ui-toast--error { background: rgba(176,42,42,.96); }

/* 搜索弹窗（点击 topbar 搜索图标弹出） */
.search-popup {
  position: fixed; inset: 0;
  z-index: 80;
  display: none;
  pointer-events: none;
}
.search-popup.is-open { display: block; pointer-events: auto; }
.search-popup__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .25s ease;
}
.search-popup.is-open .search-popup__backdrop { opacity: 1; }
.search-popup__panel {
  position: absolute;
  top: 84px; left: 50%;
  transform: translate(-50%, -10px);
  width: min(560px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity .25s ease, transform .25s cubic-bezier(.22,.61,.36,1);
  overflow: hidden;
}
.search-popup.is-open .search-popup__panel { opacity: 1; transform: translate(-50%, 0); }
.search-popup__inputwrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  flex-shrink: 0;
}
.search-popup__inputwrap input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font: inherit; color: var(--text);
  font-size: 14px;
}
.search-popup__inputwrap input::placeholder { color: var(--text-soft); }
.search-popup__close {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: transparent; border: 0;
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, color .2s ease;
}
.search-popup__close:hover { background: var(--bg-2); color: var(--text); }
.search-popup__results {
  padding: 12px 6px 6px;
  overflow-y: auto;
}
.search-popup__hint {
  padding: 16px 14px;
  color: var(--text-soft);
  font-size: 12.5px; letter-spacing: .5px;
}
.search-popup__item {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease;
}
.search-popup__item:hover { background: var(--bg-2); }
.search-popup__item-name { font-size: 14px; font-weight: 500; }
.search-popup__item-meta { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; letter-spacing: .5px; }
.search-popup__group-title {
  padding: 12px 14px 6px;
  font-size: 11px; letter-spacing: 1.5px;
  color: var(--text-soft);
}
.album-mgr__tip {
  margin: -8px 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-soft);
}
.album-mgr__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}
/* 相册行布局：勾选 | 名称框 | 场景框 | 张数标签 | × 删除 */
.album-mgr__row {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, opacity .2s ease;
}
.album-mgr__row:hover { border-color: var(--accent); }
/* 相册拖拽排序手柄：放在勾选框前面 */
.album-mgr__handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--text-soft);
  cursor: grab;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.album-mgr__handle:hover { background: var(--bg-3, var(--bg-2)); color: var(--text); }
.album-mgr__handle:active { cursor: grabbing; }
.album-mgr__row.is-dragging { opacity: .5; border-style: dashed; }
.album-mgr__row.is-over { border-color: var(--accent); background: var(--bg-3, var(--bg-2)); }
/* 用 margin-left:auto 把"张数+删除"推到行尾，与左侧元素拉开距离 */
.album-mgr__row .album-mgr__count { margin-left: auto; }
.album-mgr__row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
/* 名称框：明确上限，腾出空间给场景框与右侧 */
.album-mgr__name {
  font-size: 13.5px;
  color: var(--text);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.album-mgr__name-input {
  flex: 1 1 0;                 /* 与场景框统一宽度，并自适应行内剩余空间 */
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
}
.album-mgr__name-input:focus { outline: none; border-color: var(--accent); }
/* 相册管理内联创建空白行 */
.album-mgr__newrow {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--bg);
  cursor: text;
  gap: 8px;
}
.album-mgr__newrow:hover { border-color: var(--accent); }
.album-mgr__newname {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}
.album-mgr__newname:focus { outline: none; border-color: var(--accent); }
.album-mgr__newrow::before {
  content: "＋"; color: var(--accent); font-size: 16px; flex-shrink: 0;
}
/* 内联创建行的「创建 / 取消」按钮：紧凑、不撑开行高 */
.album-mgr__newok { flex: 0 0 auto; padding: 5px 14px; font-size: 13px; }
.album-mgr__newcancel {
  flex: 0 0 auto; width: 28px; height: 28px;
  background: transparent; color: var(--text-soft);
  border: 0; border-radius: 6px;
  font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.album-mgr__newcancel:hover { color: var(--accent); background: var(--bg-3, var(--bg-2)); }
/* 场景编号框：与名称框统一宽度（自适应） */
.album-mgr__scene-input {
  flex: 1 1 0;                 /* 与名称框等宽 */
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  text-align: center;
}
.album-mgr__scene-input:focus { outline: none; border-color: var(--accent); }
.album-mgr__scene-input::placeholder { color: var(--text-soft); opacity: .75; }  /* placeholder 不再隐藏 */
/* "N 张"独立小 box，避免和 × 视觉堆叠 */
.album-mgr__count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  text-align: center;
  white-space: nowrap;
}
/* 相册管理行：所属分组标签 */
.album-mgr__group {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}
.album-mgr__row.is-off { opacity: .5; }
.album-mgr__row.is-off .album-mgr__name { text-decoration: line-through; }
/* × 删除按钮：去掉圆形红底，纯文字+悬停变色 */
.album-mgr__del {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  background: transparent;        /* 透明背景 */
  color: var(--text-soft);       /* 默认浅色 */
  border: 0;
  border-radius: 0;              /* 不再 50% 圆形 */
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.album-mgr__del:hover {
  background: transparent;
  color: #c44;                   /* 悬停才显示红色文字 */
}
.album-mgr__del:disabled { opacity: .25; cursor: not-allowed; }

/* ===== 相册/图片批量管理 UI ===== */
.album-mgr__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.album-mgr__batch-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.album-mgr__sel-count {
  font-size: 12px; color: var(--text-soft);
  padding: 0 4px; white-space: nowrap;
}
/* 圆形选择框（相册批量模式） */
.album-mgr__check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.album-mgr__check.is-on {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg);
}
.album-mgr__row.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-2));
}
/* 图片批量工具栏 */
.gallery__album-batch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.gallery__album-batch-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
/* 滚动时浮动显示的顶部按钮条（相册管理 / 上传图片 / 分组视图 / 管理分组 / 批量管理） */
.gallery__floatbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: 92px; /* 主导航胶囊下方 */
  z-index: 70; /* 高于吸附分组标题(50)，相册管理浮动条始终在最上层，不被分组标题遮盖 */
  display: none;
  flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  max-width: calc(100vw - 24px);
}
body[data-gallery-float="on"] .gallery__floatbar { display: flex; }
.gallery__floatbar .gal-btn { font-size: 12.5px; padding: 7px 13px; }
@media (max-width: 720px) {
  .gallery__floatbar { top: 70px; padding: 7px 10px; gap: 6px; }
  .gallery__floatbar .gal-btn { font-size: 12px; padding: 6px 11px; }
  #masonry.img-batch .masonry-group__head,
  #masonry.masonry--grouped .masonry-group__head { top: 0; } /* 移动端同样贴窗口顶部（满宽、底色=网页背景） */
}
/* 批量管理开启：工具条吸顶跟随（避开固定顶栏，top 同浮动条；同步隐藏冗余浮动条） */
body[data-batch-sticky="on"] .gallery__album-batch {
  position: sticky; top: 92px; z-index: 54;
  background: var(--bg);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  margin-bottom: 14px;
}
body[data-batch-sticky="on"] .gallery__floatbar { display: none; }
@media (max-width: 720px) {
  body[data-batch-sticky="on"] .gallery__album-batch { top: 70px; }
}
/* 相册详情页左右两侧的「上一个 / 下一个相册」切换按钮（仅相册详情可见时显示） */
.gallery__album-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 56;
  width: 48px; height: 48px;
  display: none; /* 默认隐藏，仅 #galleryAlbum 可见时显示 */
  align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  user-select: none;
  transition: border-color .15s, color .15s, transform .08s;
}
.gallery__album-arrow:hover { border-color: var(--accent); color: var(--accent); }
.gallery__album-arrow:active { transform: translateY(-50%) scale(.92); }
.gallery__album-arrow--prev { left: 18px; }
.gallery__album-arrow--next { right: 18px; }
.gallery__album:not([hidden]) .gallery__album-arrow { display: flex; }
.gallery__album-arrow.is-disabled { opacity: .3; pointer-events: none; }
@media (max-width: 720px) {
  .gallery__album-arrow { width: 40px; height: 40px; font-size: 24px; }
  .gallery__album-arrow--prev { left: 8px; }
  .gallery__album-arrow--next { right: 8px; }
}
/* 拖拽排序落点指示 */
.masonry__card.dropbefore { box-shadow: 0 -3px 0 0 var(--accent); }
.masonry__card.dropafter { box-shadow: 0 3px 0 0 var(--accent); }
/* 瀑布流卡片选择框 */
.masonry__select {
  position: absolute;
  top: 8px; left: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  background: rgba(0,0,0,.35);
  z-index: 2;
  transition: background .2s ease, border-color .2s ease;
}
.masonry__select.is-on {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.35);
}
.masonry__card.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.masonry__card.is-selected img { transform: none; }
/* 危险操作按钮 */
.gal-btn--danger {
  background: #c0392b;
  color: #fff;
  border-color: transparent;
}
.gal-btn--danger:hover { filter: brightness(.92); }

/* 重命名按钮 + inline 输入 */
.album-mgr__rename {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.04);
  color: var(--text-soft);
  border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.album-mgr__rename:hover { background: var(--bg-2); color: var(--text); }
.album-mgr__rename-input {
  flex: 1;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
}
.album-mgr__empty {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
}

/* ========== 管理后台面板 ========== */

/* 抽屉展开时：主内容整体向右推移，避免被后台面板遮挡（push 式抽屉）
   注意：.topbar-spacer / .floating / .sticky-title / .topbar 的推移过渡已并入各自
   原有的 transition 声明中，此处不要再整体覆写它们的 transition，否则会顶掉原动画。 */
.page { transition: margin-left .38s cubic-bezier(.22,.61,.36,1); }
body[data-panel="open"] { --avail: calc(100vw - var(--admin-panel-w)); --side: 12px; }
body[data-panel="open"] .page {
  margin-left: calc(var(--admin-panel-w) + var(--side));
  margin-right: var(--side);
  max-width: min(var(--page-max-width), calc(var(--avail) - var(--side) * 2));
}
body[data-panel="open"] .topbar-spacer { left: var(--admin-panel-w); }
/* 后台打开：浮动标题固定带约束到「设置的网页宽度」可用区（与 .page 盒一致），
   避免拉伸填满整个窗口导致右上角「瀑布流切换按钮」贴到网页窗口最右侧（reqA，u24） */
body[data-panel="open"] .hero__caption.is-fixed {
  left: calc(var(--admin-panel-w) + var(--side));
  right: auto;
  transform: none;
  width: min(var(--page-max-width), calc(100vw - var(--admin-panel-w) - 2 * var(--side)));
  max-width: calc(100vw - var(--admin-panel-w) - 2 * var(--side));
}
/* 后台打开：底部风格菜单（滚动后 fixed 与首屏内联）统一约束到可用宽度，避免超出网页之外（req5） */
body[data-panel="open"] .floating {
  left: calc(var(--admin-panel-w) + var(--side)) !important;
  right: var(--side) !important;
  width: auto !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  transform: none !important;
}
/* 顶部胶囊 / 滚动标题：用可用宽度做流体定位（不再 50% 居中，避免窄屏溢出） */
body[data-panel="open"] .topbar {
  left: calc(var(--admin-panel-w) + var(--side));
  right: var(--side);
  transform: none;
  /* 后台打开时展示胶囊尺寸（导航栏距/胶囊设置可见），不被 auto 填充或右缩覆盖（req5） */
  width: var(--nav-capsule-w);
  max-width: calc(var(--avail) - var(--side) * 2);
  min-width: 0;
  min-height: 0;
  height: var(--nav-capsule-h, auto);
}
body[data-panel="open"] .sticky-title { left: calc(var(--admin-panel-w) + var(--side)); right: var(--side); }
/* 后台打开时底部风格菜单按剩余可视宽度缩放，避免被抽屉遮挡 */
body[data-panel="open"] .floating__inner { max-width: min(1080px, calc(var(--avail) - var(--side) * 2)); }
/* 滚动后导航栏贴右侧、抽屉在左侧，不会重叠，保持原位即可 */

.theme-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--admin-panel-w);
  height: 100vh;
  height: 100dvh;
  max-height: none;
  background: var(--bg);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 0 60px rgba(0,0,0,.25);
  z-index: 75;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: drawerIn .3s ease;
}
@keyframes drawerIn { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }
/* 浮动面板模式：右侧浮动卡片，不 push 网页；位置/尺寸由 JS 拖动手柄写入内联 left/top/width/height 覆盖 */
body[data-panel="float"] .theme-panel {
  left: auto !important;
  right: 20px !important;
  top: 20px !important;
  bottom: auto !important;
  width: min(420px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 40px));
  min-width: 300px;
  min-height: 280px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  border: 1px solid var(--line) !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.32) !important;
  animation: none !important;
  overflow: auto;
}
body[data-panel="float"] .theme-panel header { cursor: move; }
/* 浮动面板：右下角缩放把手 */
.panel-resize-handle { display: none; }
body[data-panel="float"] .panel-resize-handle {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 5;
  background: linear-gradient(135deg, transparent 50%, var(--text-soft) 50%, var(--text-soft) 60%, transparent 60%);
  opacity: .55;
  border-bottom-right-radius: 16px;
}
body[data-panel="float"] .panel-resize-handle:hover { opacity: .9; }
/* 移动端：顶部高度拖动手柄 */
.panel-grabber { display: none; }
@media (max-width: 720px) {
  /* 去除移动端点按出现的蓝色方块高亮（WebKit 默认 tap-highlight）与按下蓝色轮廓 */
  button, a, .switch, [role="button"],
  .mobile-sheet__menu-btn, .mobile-sheet__nav-item,
  .topbar__mobile-toggle, .iconbtn,
  .floating, .floating__inner, .floating__label, .floating__thumb {
    -webkit-tap-highlight-color: transparent;
  }
  button:active, button:focus, a:active, a:focus, .switch:active, .switch:focus, [role="button"]:active, [role="button"]:focus,
  .mobile-sheet__menu-btn:active, .mobile-sheet__menu-btn:focus, .mobile-sheet__nav-item:active, .mobile-sheet__nav-item:focus,
  .topbar__mobile-toggle:active, .topbar__mobile-toggle:focus, .iconbtn:active, .iconbtn:focus, .floating__inner:active, .floating__inner:focus {
    outline: none;
  }
  .panel-grabber {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    flex-shrink: 0;
    cursor: ns-resize;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }
  .panel-grabber span {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    opacity: .9;
  }
}
.theme-panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head__actions {
  display: flex; align-items: center; gap: 8px;
}
.logout-btn {
  font-size: 12px;
  color: var(--text-soft);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background .2s ease, color .2s ease;
}
.logout-btn:hover { background: rgba(220,50,50,.1); color: #c44; }
/* 面板右上角的 × 关闭按钮已移除：与「退出」功能重复，面板开合统一由右下角管理按钮控制 */

.tabs {
  display: flex;
  flex-wrap: wrap;
  padding: 8px 10px 0;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 90px;
  scrollbar-width: thin;
  scrollbar-color: var(--text-soft) transparent;
}
.tabs::-webkit-scrollbar { width: 6px; height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.tab {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  font-size: 12px;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  transition: color .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.tab-panels {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.tab-panel {
  display: none;
  padding: 16px;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: auto;
  scrollbar-color: var(--text-soft) transparent;
}
.tab-panel::-webkit-scrollbar { width: 10px; height: 10px; }
.tab-panel::-webkit-scrollbar-track { background: rgba(0,0,0,.03); border-radius: 5px; }
.tab-panel::-webkit-scrollbar-thumb { background: rgba(107, 99, 88, 0.4); border-radius: 5px; }
.tab-panel::-webkit-scrollbar-thumb:hover { background: var(--text); }
body[data-mode="dark"] .tab-panel::-webkit-scrollbar-track { background: rgba(255,255,255,.03); }
.tab-panel.is-active { display: block; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.preset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
  position: relative;
}
.preset:hover { transform: translateY(-2px); border-color: var(--text); }
.preset.is-active {
  border-color: var(--text);
  background: rgba(0,0,0,.03);
}
body[data-mode="dark"] .preset.is-active { background: rgba(255,255,255,.04); }
.preset__name {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.preset__swatch {
  display: flex; gap: 4px;
}
.preset__swatch span {
  flex: 1; height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* 自定义配色编辑器 */
.preset--custom { display: flex; align-items: center; justify-content: space-between; }
.preset--custom .preset__swatch { width: 40px; flex: none; }
.preset--custom.is-active { border-color: var(--text); }
.custom-theme-editor {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 18px 0 6px;
  background: rgba(0,0,0,.02);
}
body[data-mode="dark"] .custom-theme-editor { background: rgba(255,255,255,.03); }
.custom-theme-editor .tip-bar { margin: 0 0 10px; }
.color-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 8px 0;
}
.color-row label { margin: 0; flex: 1; }
.color-row input[type="color"] {
  width: 42px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.custom-theme-editor .btn {
  flex: 1;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s ease;
}
.custom-theme-editor .btn:hover { opacity: .85; }
.custom-theme-editor .btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

/* 验证码行：输入框 + 获取按钮 并排 */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn {
  flex: none;
  white-space: nowrap;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  border-radius: 9px;
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s ease;
}
.code-row .btn:hover { opacity: .85; }
.code-row .btn:disabled { opacity: .5; cursor: not-allowed; }
.tip-bar code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: rgba(0,0,0,.06);
  padding: 1px 5px;
  border-radius: 4px;
}
body[data-mode="dark"] .tip-bar code { background: rgba(255,255,255,.1); }

label {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
label input {
  display: block;
  margin-top: 4px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
}
.apply {
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.check {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.check input { accent-color: var(--text); }
.check.is-on { border-color: var(--text); }

hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ========== 灯箱 ========== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 80;
  padding: 60px 40px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  cursor: zoom-in;
  touch-action: none; /* 移动端手势（双击/捏合/拖动）交由 JS 处理，禁用浏览器默认缩放滚动 */
  transition: transform .22s ease;
  transform-origin: center center;
}
.lightbox img.is-zoomed {
  cursor: zoom-out;
  transform: scale(2);
  max-width: none;
  max-height: none;
}
.lightbox__close {
  position: absolute; top: 24px; right: 28px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  z-index: 2;
}
/* 灯箱内「重命名文件名」入口（管理员可见，位于左上角，避免与右上关闭按钮冲突） */
.lightbox__actions { position: absolute; top: 24px; left: 28px; z-index: 3; }
.lightbox__action-btn {
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s ease;
}
.lightbox__action-btn:hover { background: rgba(0,0,0,.65); }

/* 重命名弹窗输入框 */
.text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.text-input:focus { border-color: #b9a18c; box-shadow: 0 0 0 3px rgba(185,161,140,.18); }
/* 灯箱底部导航栏：箭头 + 圆点指示器 */
.lightbox__bar {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 16px;
  z-index: 3;
}
.lightbox__bar-btn {
  width: var(--lb-nav-size, 44px); height: var(--lb-nav-size, 44px);
  border: 0; cursor: pointer;
  background: transparent;
  color: rgba(255,255,255,.7);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  /* item26：切换按钮透明度 / 大小，由后台设置驱动 */
  opacity: var(--lb-nav-opacity, .7);
  transition: color .2s ease, background .2s ease, opacity .2s ease;
}
.lightbox__bar-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.lightbox__dots {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 60vw; overflow-x: auto; scrollbar-width: none;
}
.lightbox__dots::-webkit-scrollbar { display: none; }
.lightbox__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease, transform .2s ease;
}
.lightbox__dot.is-active {
  background: #fff;
  transform: scale(1.4);
}
@media (max-width: 720px) {
  .lightbox__bar { gap: 10px; bottom: 16px; }
  .lightbox__bar-btn { width: var(--lb-nav-size, 44px); height: var(--lb-nav-size, 44px); }
  .lightbox__dot { width: 6px; height: 6px; }
}
.lightbox__cap {
  position: absolute;
  bottom: 72px; left: 50%; transform: translateX(-50%);
  color: #fff;
  font-size: clamp(11px, 2.6vw, 14px);  /* 字号随视口宽度自适应，长标题不溢出 */
  letter-spacing: 1px;
  background: rgba(0,0,0,.4);
  padding: 8px 14px;
  border-radius: 6px;
  max-width: 92vw;                        /* 不超过视口宽度，长字符串省略号 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 查看大图切换按钮位置（item26）：默认 bottom 在底部（上方样式），
   切到 side 时左右箭头移到图片两侧、垂直居中，圆点隐藏 */
body[data-lightbox-nav="side"] .lightbox__bar {
  top: 0; bottom: 0; left: 0; right: 0;
  transform: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
}
body[data-lightbox-nav="side"] .lightbox__bar-btn { pointer-events: auto; }
body[data-lightbox-nav="side"] .lightbox__dots { display: none; }
/* 灯箱内图片再次点击放大（is-zoomed 由 JS 切换） */

/* ========== 主题预设效果 ========== */
:root {
  --menu-text: var(--text);
  --menu-text-soft: var(--text-soft);
}

/* 风格切换图标（替代原来的"装修风格"文字） */
.floating__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 24px;
  color: var(--menu-text-soft);
  opacity: .85;
  transition: opacity .25s ease;
}
.floating__label:hover { opacity: 1; }
.floating__label svg { display: block; }

/* 浮动菜单/导航栏字体颜色随 preset 自适应，避免被全局明暗干扰 */
.floating__inner,
.topbar {
  color: var(--nav-text-color, var(--menu-text));
}
.floating__label,
.iconbtn,
.style-item {
  color: var(--float-text-color, var(--menu-text-soft));
}
/* 导航栏文字颜色（20260812）：关联主题配色 或 自定义，覆盖默认 menu-text-soft */
.nav-item { color: var(--nav-text-color, var(--menu-text-soft)); }
.nav-item:hover,
.iconbtn:hover {
  color: var(--menu-text);
}
.style-item:hover { color: var(--menu-text); }
/* 菜单预设作用域内：选中态同样优先用独立的「菜单选中样式」设置，未自定义则回退预设配色 */
.style-item.is-active {
  /* 选中态三层回退：① 自定义「菜单选中样式」(--float-active-*) 最高优先；
     ② 其次主题配色「底部菜单选中」底座变量(--ct-float-active-*)；
     ③ 兜底高对比 --menu-text(深)/--menu-bg(浅)，保证文字与背景始终区分 */
  background: var(--float-active-bg, var(--ct-float-active-bg, var(--menu-text)));
  color: var(--float-active-text, var(--ct-float-active-text, var(--menu-bg)));
  border-radius: var(--float-active-radius, 999px);
  border: var(--float-active-border-width, 1px) solid var(--float-active-border-color, var(--ct-float-active-border, var(--menu-text)));
}
.style-item:hover { background: rgba(0,0,0,.05); }
body[data-mode="dark"] .style-item:hover { background: rgba(255,255,255,.06); }
.iconbtn:hover { background: rgba(0,0,0,.06); }
body[data-mode="dark"] .iconbtn:hover { background: rgba(255,255,255,.08); }
.nav-item.is-active { color: var(--nav-active-text, var(--nav-text-color, var(--menu-text))); background: transparent; }
.nav-item.is-active::after { background: var(--menu-active-bg, var(--text)); }
/* 导航栏文字字号（20260812）：自适应 inherit / 自定义 px */
.topbar__logo-text,
.topbar__nav .nav-item { font-size: var(--nav-text-size, inherit); }

body[data-menu-preset="cream"] {
  --menu-bg: rgba(255,253,247,.55);
  --menu-border: rgba(255,255,255,.7);
  --menu-blur: 18px;
  --menu-shadow: 0 10px 40px rgba(40,30,20,.12);
  --menu-text: #1a1a1a;
  --menu-text-soft: #6b6358;
}
body[data-menu-preset="ink"] {
  --menu-bg: rgba(20,18,15,.65);
  --menu-border: rgba(255,255,255,.10);
  --menu-blur: 22px;
  --menu-shadow: 0 14px 50px rgba(0,0,0,.45);
  --menu-text: #f3ece0;
  --menu-text-soft: #a8a094;
  --text: #f3ece0;
  --bg: #161310;
  --text-soft: #a8a094;
  --line: rgba(255,255,255,.10);
  --accent: #d8b48a;
}
body[data-menu-preset="frost"] {
  --menu-bg: rgba(255,255,255,.18);
  --menu-border: rgba(255,255,255,.35);
  --menu-blur: 26px;
  --menu-shadow: 0 14px 50px rgba(0,0,0,.18);
  --menu-text: #1a1a1a;
  --menu-text-soft: rgba(40,40,40,.7);
}
body[data-menu-preset="sand"] {
  --menu-bg: rgba(214,196,168,.7);
  --menu-border: rgba(120,80,40,.18);
  --menu-blur: 18px;
  --menu-shadow: 0 14px 40px rgba(120,80,40,.18);
  --menu-text: #3a2a18;
  --menu-text-soft: rgba(80,55,30,.7);
  --accent: #8b5a2b;
}

  /* 暗色主题：强制菜单（浮动栏 / 顶部胶囊 / 滚动标题）使用浅色文字 + 深色毛玻璃背景，
     与浅色 preset 解耦，保证暗色模式下对比清晰。该块位于所有 preset 规则之后，暗色时优先生效。 */
  body[data-mode="dark"] {
    --menu-bg: rgba(28,26,22,.72);
    --menu-border: rgba(255,255,255,.14);
    --menu-text: #f4ede0;
    --menu-text-soft: #b6ab9e;
  }

/* 图库页风格 */
body[data-gallery-preset="gallery-classic"] {
  --card-bg: rgba(255,255,255,.7);
  --card-shadow: 0 14px 40px rgba(30,20,10,.08);
}
body[data-gallery-preset="gallery-edge"] {
  background: var(--bg-2);
  --card-bg: transparent;
  --card-shadow: none;
}
body[data-gallery-preset="gallery-edge"] .masonry__card {
  border: 1px solid var(--line);
  box-shadow: none;
}
body[data-gallery-preset="gallery-polaroid"] {
  background: #efe8da;
}
body[data-gallery-preset="gallery-polaroid"] .masonry__card {
  background: #fff;
  padding: 10px 10px 26px;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 18px 40px rgba(80,60,40,.12);
  font-family: var(--serif);
}
body[data-gallery-preset="gallery-polaroid"] .masonry__card img {
  border-radius: 4px;
}
body[data-gallery-preset="gallery-darkroom"] {
  background: #0d0c0a;
  --card-bg: #181614;
  --card-shadow: 0 14px 40px rgba(0,0,0,.6);
  --text: #f3ece0;
  --text-soft: #a8a094;
}

/* 首页瀑布流「图库卡片预设风格」自定义（u33）：仅在 .home-masonry--styled 时覆盖卡片外观，
   不影响图库页与其它沿用全局 body[data-gallery-preset] 的区域（此规则带 #id，优先级高于 body 规则）。 */
#homeMasonry.home-masonry--styled .masonry__card {
  border-radius: var(--hm-radius, 14px);
  border: var(--hm-border-w, 0) solid var(--hm-border-color, rgba(0,0,0,0));
  background: var(--hm-card-bg, transparent);
  box-shadow: var(--hm-shadow, none);
  padding: var(--hm-pad, 0) var(--hm-pad, 0) var(--hm-pad-b, 0);
  overflow: hidden;
}
#homeMasonry.home-masonry--styled .masonry__card img {
  border-radius: inherit;
  display: block;
  width: 100%;
}
#homeMasonry.home-masonry--styled .masonry__card .masonry__cap {
  opacity: 1;
  transform: none;
  background: var(--hm-cap-bg, transparent);
  color: var(--hm-cap-text, #fff);
}
/* 批量「加入分组」弹窗内：分组选项按钮占满整行 */
.gm-group-row--pick .gal-btn { width: 100%; justify-content: center; }

/* 响应式 */
/* 响应式：主导航栏随页面尺寸缩短长度（导航横向滚动保留） */
@media (max-width: 1180px) {
  .topbar { width: min(820px, calc(100vw - 36px)); }
}
@media (max-width: 1024px) {
  .topbar { width: min(720px, calc(100vw - 32px)); }
}
@media (max-width: 900px) {
  .topbar { width: min(620px, calc(100vw - 28px)); }
  .topbar__inner { gap: 12px; padding: 8px 12px 8px 10px; }
  .topbar__nav { gap: 14px; }
  .nav-item { font-size: 13px; }
}
@media (max-width: 760px) {
  .topbar { width: min(540px, calc(100vw - 24px)); }
  .topbar__inner { gap: 9px; padding: 7px 11px 7px 9px; }
  .topbar__nav { gap: 11px; }
  .nav-item { font-size: 12.5px; }
  .iconbtn { width: 34px; height: 34px; }
}
@media (max-width: 600px) {
  .topbar { top: 12px; width: calc(100vw - 16px); }
  .topbar__inner { gap: 7px; padding: 7px 10px; }
  .topbar__nav { gap: 9px; }
  .nav-item { font-size: 12px; }
  .iconbtn { width: 32px; height: 32px; }
  .topbar__logo { width: 34px; height: 34px; }
}
@media (max-width: 720px) {
  .hero, .gallery, .about { padding-left: 24px; padding-right: 24px; }
  /* 20260917：移动端图库列数改由后台「手机端图库列数」驱动（--mobile-album-cols，JS 写入）。
     原先是 auto-fill minmax(150px,1fr) 纯响应式，后台设置对相册卡片网格完全无效，
     导致设置了 3 列却仍塌成 1~2 列。 */
  .album-grid { grid-template-columns: repeat(var(--mobile-album-cols, 2), minmax(0, 1fr)); gap: 14px; }
  .gallery__admin-actions { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .topbar__inner { gap: 5px; padding: 6px 9px; }
  .topbar__nav { gap: 7px; }
  .nav-item { font-size: 11.5px; }
  .iconbtn { width: 30px; height: 30px; }
}
@media (max-width: 420px) {
  .topbar__nav { gap: 5px; }
  .nav-item { font-size: 11px; padding: 6px 0; }
  .iconbtn { width: 28px; height: 28px; }
  .topbar__logo { width: 30px; height: 30px; }
}

/* =========================================================
   移动端：底部抽屉菜单（按用户截图设计）
   ========================================================= */
/* 移动端按钮默认隐藏，仅在 ≤720px 时显示 */
.topbar__mobile-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,.04);
  color: var(--text-soft);
  border: 1px solid transparent;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.topbar__mobile-toggle:hover { background: rgba(0,0,0,.08); color: var(--text); }
.topbar__mobile-toggle.is-on { background: rgba(220,80,80,.12); color: #c84a4a; border-color: rgba(220,80,80,.35); }

.mobile-sheet {
  display: none; /* 桌面隐藏 */
  position: fixed; inset: 0;
  z-index: 70;
  pointer-events: none;
}
.mobile-sheet.is-open { pointer-events: auto; }
.mobile-sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .3s ease;
}
.mobile-sheet.is-open .mobile-sheet__backdrop { opacity: 1; }
.mobile-sheet__panel {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  max-height: 78vh;
  background: var(--bg);
  border-radius: 22px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  transform: translateY(110%);
  transition: transform .38s cubic-bezier(.22,.61,.36,1);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.mobile-sheet.is-open .mobile-sheet__panel { transform: translateY(0); }
.mobile-sheet__handle {
  width: 44px; height: 4px;
  margin: 10px auto 4px;
  border-radius: 2px;
  background: var(--line);
  flex-shrink: 0;
}
.mobile-sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px;
  flex-shrink: 0;
}
.mobile-sheet__brand {
  display: flex; align-items: center; gap: 10px;
}
.mobile-sheet__avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  border: 1px solid var(--line);
}
.mobile-sheet__name {
  font-size: 14px; font-weight: 500; letter-spacing: 1px;
}
.mobile-sheet__menu-btn {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 11px; letter-spacing: 1.5px;
  cursor: pointer;
  transition: background .2s ease;
}
.mobile-sheet__menu-btn:hover { background: var(--bg-2); }

.mobile-sheet__nav {
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 18px 12px;
  flex-shrink: 0;
}
.mobile-sheet__nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  font-size: 16px; font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.mobile-sheet__nav-item:hover { background: var(--bg); border-color: var(--text-soft); }
.mobile-sheet__nav-item.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.mobile-sheet__nav-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px;
  border-radius: 6px;
  background: rgba(0,0,0,.05);
  color: var(--text-soft);
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  flex-shrink: 0;
}
body[data-mode="dark"] .mobile-sheet__nav-num { background: rgba(255,255,255,.08); }
.mobile-sheet__nav-item.is-active .mobile-sheet__nav-num { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); }

.mobile-sheet__section-title {
  padding: 4px 22px 8px;
  font-size: 11px; letter-spacing: 2px; color: var(--text-soft);
  flex-shrink: 0;
}
.mobile-sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 18px 18px;
  overflow-y: auto;
}
.mobile-sheet__action {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
  text-align: left;
}
.mobile-sheet__action:hover { background: var(--bg); border-color: var(--text-soft); }
.mobile-sheet__action--danger { color: #c84a4a; border-color: rgba(220,80,80,.35); }
.mobile-sheet__action--danger:hover { background: rgba(220,80,80,.08); }
.mobile-sheet__action svg { flex-shrink: 0; }

/* ===== 移动端抽屉：深色模式适配（原仅有 nav-num 一条覆盖，导致文字/图标在深色下对比度不足） ===== */
body[data-mode="dark"] .mobile-sheet__panel {
  background: var(--bg);
  box-shadow: 0 -10px 40px rgba(0,0,0,.55);
}
/* 深色下 --bg-2 比面板更暗，导航项改用卡片底色拉开层次，避免糊成一片 */
body[data-mode="dark"] .mobile-sheet__nav-item {
  background: var(--card-bg);
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
body[data-mode="dark"] .mobile-sheet__nav-item:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.28);
}
body[data-mode="dark"] .mobile-sheet__nav-item.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
body[data-mode="dark"] .mobile-sheet__nav-item.is-active .mobile-sheet__nav-num {
  background: rgba(0,0,0,.18);
  color: rgba(0,0,0,.7);
}
body[data-mode="dark"] .mobile-sheet__section-title { color: #8f867a; }
body[data-mode="dark"] .mobile-sheet__action {
  background: var(--card-bg);
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
body[data-mode="dark"] .mobile-sheet__action:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.28);
}
/* 危险操作（退出）：原 #c84a4a 在深色底上过暗，提亮到可读的珊瑚红 */
body[data-mode="dark"] .mobile-sheet__action--danger {
  color: #ff9b9b;
  border-color: rgba(255,120,120,.42);
}
body[data-mode="dark"] .mobile-sheet__action--danger:hover { background: rgba(255,120,120,.14); }
body[data-mode="dark"] .mobile-sheet__avatar {
  background: var(--card-bg);
  border-color: rgba(255,255,255,.16);
  color: var(--text);
}
body[data-mode="dark"] .mobile-sheet__menu-btn { border-color: rgba(255,255,255,.22); color: var(--text); }
body[data-mode="dark"] .mobile-sheet__menu-btn:hover { background: rgba(255,255,255,.10); }
/* 深色模式切换项：开启后高亮提示当前状态 */
.mobile-sheet__action[data-theme-on="true"] { border-color: var(--accent); color: var(--accent); }

/* 仅在移动端启用抽屉 + 简化顶栏（按截图：左 LOGO 独立 + 右 搜索/菜单 图标） */
@media (max-width: 720px) {
  .topbar__nav,
  .topbar__expand,
  .topbar__dropdown { display: none !important; }
  .mobile-sheet { display: block; }

  /* 移动端独立设置（20260812）：大图尺寸 / 标题字号 / 瀑布流列数，独立于桌面端，!important 覆盖桌面端对应规则 */
  body[data-mobile-hero-size="short"] .hero__slide img { max-height: 40vh !important; }
  body[data-mobile-hero-size="normal"] .hero__slide img { max-height: 56vh !important; }
  body[data-mobile-hero-size="tall"] .hero__slide img { max-height: 78vh !important; }
  body[data-mobile-hero-size="full"] .hero__slide img { max-height: 94vh !important; }
  body[data-mobile-hero-size="fit"] .hero__slide img { max-height: none !important; }
  body[data-mobile-title-mode="custom"] .hero__title { font-size: var(--mobile-title-size, 48px) !important; }

  /* 移动端瀑布流列数由 JS（layoutMasonry 生成的 flex 列）完全控制；
     data-mobile-cols 仅作兼容标记，原 column-count 规则会与 flex 列打架，已移除。 */

  /* 移动端独立搜索+菜单（在 topbar 外部，fixed 不受 topbar 干扰） */
  .mobile-topbar-actions {
    position: fixed;
    top: var(--menu-top-dist, 36px);
    right: 16px;
    z-index: 61;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }
  .mobile-topbar-actions .iconbtn {
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.04);
    border: 1px solid var(--line, rgba(0,0,0,.08));
    border-radius: 50%;
    box-shadow: none;
    color: var(--text-soft);
    cursor: pointer;
  }
  body[data-mode="dark"] .mobile-topbar-actions .iconbtn { background: rgba(255,255,255,.06); }
  /* 滚动后隐藏独立 actions（按钮已收入 topbar 胶囊） */
  body[data-scrolled="true"] .mobile-topbar-actions { display: none; }

  /* ===== 第一屏：LOGO 在左侧长条胶囊（左右大留空呈明显长条形），浅底+细边 ===== */
  .topbar {
    width: max-content !important;
    left: 16px !important;
    transform: none !important;
    padding: 6px var(--mobile-logo-capsule-pad-x, 24px) !important;
    background: rgba(0,0,0,.04) !important;
    border: 1px solid var(--line, rgba(0,0,0,.08)) !important;
    box-shadow: none !important;
    border-radius: 999px !important;
    overflow: visible !important; /* 不裁剪 fixed 的菜单 */
    transition: left .55s cubic-bezier(.22,.61,.36,1),
                right .55s cubic-bezier(.22,.61,.36,1),
                padding .35s ease, width .35s ease,
                border-radius .35s ease, transform .35s ease;
  }
  body[data-mode="dark"] .topbar { background: rgba(255,255,255,.06) !important; }
  /* u27：首屏 LOGO 胶囊 自定义边框+背景（关联主题=上方硬编码主题值；自定义=下列变量，:not([data-scrolled]) 限定首屏，不串到滚动后胶囊） */
  body[data-mobile-logo-capsule-mode="custom"]:not([data-scrolled="true"]) .topbar {
    background: var(--mobile-logo-capsule-bg, rgba(0,0,0,.04)) !important;
    border: var(--mobile-logo-capsule-border-w, 1px) solid var(--mobile-logo-capsule-border-color, var(--line)) !important;
  }
  .topbar__inner {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0 !important;
  }
  .topbar__logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: auto !important; height: var(--mobile-logo-capsule-h, 36px) !important;
    padding: 0;
  }
  /* 第一屏显示 QX studio 文字 */
  .topbar__logo-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    gap: 2px;
    padding-right: 6px;
  }
  .topbar__logo-qx { font-family: var(--serif, Georgia, serif); font-size: 16px; font-weight: 600; color: var(--text); }
  .topbar__logo-studio { font-size: 9px; letter-spacing: 1.5px; color: var(--text-soft); text-transform: uppercase; }
  .topbar__logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: min(var(--logo-size, 38px), calc(var(--mobile-logo-capsule-h, 36px) - 8px)); height: min(var(--logo-size, 38px), calc(var(--mobile-logo-capsule-h, 36px) - 8px));
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
  }
  .topbar__logo-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
  /* u27：首屏 LOGO 胶囊 边框+背景 改由外层 .topbar（胶囊本体）承载，见下方自定义覆盖；内层 .topbar__logo 保持无边框 */

  /* u25(a)：首屏 LOGO 无文字时呈干净圆形；有文字时给 mark 左侧留白，避免被胶囊左圆角边缘遮挡 */
  body[data-mobile-logo-text=""] .topbar {
    padding: 0 !important;
  }
  body[data-mobile-logo-text=""] .topbar__logo {
    width: min(var(--logo-size, 38px), var(--mobile-logo-capsule-h, 36px)) !important;
    height: min(var(--logo-size, 38px), var(--mobile-logo-capsule-h, 36px)) !important;
    border-radius: 50% !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body[data-mobile-logo-text=""] .topbar__logo-mark {
    width: 100% !important;
    height: 100% !important;
  }
  body[data-mobile-logo-text="1"] .topbar__logo {
    padding-left: 4px !important;
  }

  /* 第一屏：隐藏 topbar 内的 actions（用独立的 mobile-topbar-actions 代替） */
  .topbar__actions { display: none !important; }

  /* item35：移动端下滑右缩时，顶栏/LOGO/胶囊平滑过渡动画（左右位/尺寸/圆角/背景过渡） */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__inner,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo-mark,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo-text {
    transition:
      left .35s cubic-bezier(.22,.61,.36,1),
      right .35s cubic-bezier(.22,.61,.36,1),
      top .35s cubic-bezier(.22,.61,.36,1),
      width .35s cubic-bezier(.22,.61,.36,1),
      height .35s cubic-bezier(.22,.61,.36,1),
      max-width .35s cubic-bezier(.22,.61,.36,1),
      transform .35s cubic-bezier(.22,.61,.36,1),
      border-radius .35s cubic-bezier(.22,.61,.36,1),
      padding .35s cubic-bezier(.22,.61,.36,1),
      gap .35s cubic-bezier(.22,.61,.36,1),
      background .3s ease,
      border-color .3s ease;
  }

  /* ===== 滚动后：LOGO 变圆形，三图标并排收入新胶囊（仅底色） ===== */
  /* 导航栏下滑右缩（item20）：移动端独立开关，改用 data-mobile-nav-shrink 控制，与桌面端 data-nav-shrink 解耦 */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar {
    left: auto !important;
    right: 16px !important;
    transform: none !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 0 !important;
    border-radius: 999px !important;
    padding: 5px var(--mobile-menu-capsule-pad-x, 14px) !important; /* 新胶囊左右 padding */
    overflow: visible !important;
    background: rgba(0,0,0,.04) !important;
    border: 1px solid var(--line, rgba(0,0,0,.08)) !important;
    box-shadow: none !important;
  }
  body[data-mode="dark"][data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar { background: rgba(255,255,255,.06) !important; }
  /* u28：首屏右侧菜单胶囊（.mobile-topbar-actions 内搜索/菜单按钮）自定义边框+背景 */
  body[data-mobile-menu-capsule-mode="custom"] .mobile-topbar-actions .iconbtn {
    background: var(--mobile-menu-capsule-bg, rgba(0,0,0,.04)) !important;
    border: var(--mobile-menu-capsule-border-w, 1px) solid var(--mobile-menu-capsule-border-color, var(--line)) !important;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__inner {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center;
    width: max-content !important;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    z-index: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    top: auto !important;
    right: auto !important;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn:not(#searchBtn):not(#mobileMenuBtn):not(#settingsBtn) { display: none; }
  /* 滚动后显示 #mobileMenuBtn（.topbar__mobile-toggle 默认 display:none，需强制开启） */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle { display: inline-flex !important; }
  /* 滚动后 #searchBtn 圆形背景（与其他图标一致） */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] #searchBtn {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    background: transparent !important;
    border-radius: 50% !important;
  }
  /* 滚动后 #settingsBtn 圆形背景（与其他图标一致，仅登录后显示） */
  body[data-admin="true"][data-mobile-nav-shrink="on"][data-scrolled="true"] #settingsBtn {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    background: transparent !important;
    border-radius: 50% !important;
  }
  /* LOGO 变圆形 */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo {
    width: min(var(--logo-size, 38px), var(--mobile-menu-capsule-h, 28px)) !important;
    height: min(var(--logo-size, 38px), var(--mobile-menu-capsule-h, 28px)) !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    padding: 0 !important;
  }
  /* u28：下滑右缩胶囊（滚动后右侧胶囊本体）自定义边框+背景 */
  body[data-mobile-scroll-logo-mode="custom"][data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar {
    background: var(--mobile-scroll-logo-bg, rgba(0,0,0,.04)) !important;
    border: var(--mobile-scroll-logo-border-w, 1px) solid var(--mobile-scroll-logo-border-color, var(--line)) !important;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo-mark {
    width: var(--mobile-menu-capsule-h, 28px) !important; height: var(--mobile-menu-capsule-h, 28px) !important;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__logo-text { display: none !important; }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle {
    width: var(--mobile-menu-capsule-h, 28px) !important; height: var(--mobile-menu-capsule-h, 28px) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    flex-shrink: 0;
  }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__actions .iconbtn svg,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar__mobile-toggle svg { width: 14px; height: 14px; }
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar:hover {
    width: max-content !important;
    border-radius: 999px !important;
  }
}

/* 桌面端隐藏移动端独立 actions */
@media (min-width: 721px) {
  .mobile-topbar-actions { display: none !important; }
}

/* =========================================================
   面板扩展控件
   ========================================================= */

.section-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent, var(--text-soft));
  margin: 18px 0 8px;
  padding-left: 9px;
  border-left: 3px solid var(--accent, var(--line));
  text-transform: uppercase;
  font-weight: 700;
}
.section-label:first-child { margin-top: 0; }
/* 设置模块大标题（每个设置页顶部） */
.module-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent, var(--line));
}
/* 首页设置内：五大板块子标题（① 顶部导航栏板块 …） */
.block-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent, var(--text));
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent, #999) 12%, transparent);
  border-radius: 8px;
  border-left: 4px solid var(--accent, var(--line));
}
/* 首页设置内：板块下的子板块标题（导航栏设置 / 背景框体设置 / 移动端设置 …） */
.sub-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 6px;
}

.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-group button {
  flex: 1;
  min-width: 56px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  color: var(--text-soft);
  transition: all .2s ease;
  text-align: center;
}
.btn-group button:hover { color: var(--text); border-color: var(--text); }
.btn-group button.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  background: var(--bg-2);
  transition: border-color .2s ease, transform .2s ease;
}
.thumb:hover { transform: translateY(-2px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-selected { border-color: var(--accent); }
.thumb.is-selected::after {
  content: "✓";
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}
.switch {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background .25s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.is-on { background: var(--text); }
.switch.is-on::after { transform: translateX(16px); }

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--text);
}
.range-row .val {
  font-size: 12px;
  color: var(--text-soft);
  min-width: 48px;
  text-align: right;
}

.tip-bar {
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(0,0,0,.03);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 10px;
  line-height: 1.5;
}
body[data-mode="dark"] .tip-bar { background: rgba(255,255,255,.04); }

/* =========================================================
   菜单尺寸 / 位置 / 大图高度 / 图库密度
   ========================================================= */
body[data-menu-size="compact"] .topbar__inner { padding: 6px 12px 6px 10px; gap: 14px; }
body[data-menu-size="compact"] .topbar__nav { gap: 16px; }
body[data-menu-size="compact"] .nav-item { font-size: 12px; }
body[data-menu-size="compact"] .topbar__logo { width: 32px; height: 32px; }
body[data-menu-size="compact"] .iconbtn { width: 30px; height: 30px; }
body[data-menu-size="compact"] .iconbtn svg { width: 15px; height: 15px; }

body[data-menu-size="wide"] .topbar__inner { padding: 14px 26px 14px 20px; gap: 24px; }
body[data-menu-size="wide"] .topbar__nav { gap: 36px; }
body[data-menu-size="wide"] .nav-item { font-size: 15px; }
body[data-menu-size="wide"] .topbar__logo { width: 44px; height: 44px; }
body[data-menu-size="wide"] .iconbtn { width: 40px; height: 40px; }
body[data-menu-size="wide"] .iconbtn svg { width: 20px; height: 20px; }

body[data-menu-pos="top-center"] .topbar {
  left: 50%; right: auto; top: var(--menu-top-dist, 36px); bottom: auto;
  transform: translateX(-50%);
}
body[data-menu-pos="top-left"] .topbar {
  left: 24px; right: auto; top: var(--menu-top-dist, 36px); bottom: auto;
  transform: none;
  width: auto; max-width: calc(100% - 48px);
}
body[data-menu-pos="top-right"] .topbar {
  left: auto; right: 24px; top: var(--menu-top-dist, 36px); bottom: auto;
  transform: none;
  width: auto; max-width: calc(100% - 48px);
}
body[data-menu-pos="bottom-center"] .topbar {
  left: 50%; right: auto; top: auto; bottom: 22px;
  transform: translateX(-50%);
}
body[data-menu-pos="bottom-center"] .page { padding-top: 24px; }

body[data-hero-size="short"] .hero__slide img { max-height: 46vh; }
body[data-hero-size="tall"]   .hero__slide img { max-height: 84vh; }
body[data-hero-size="full"]   .hero__slide img { max-height: 98vh; }

body[data-gallery-density="cozy"]  .masonry { column-count: 2; column-gap: 12px; }
body[data-gallery-density="loose"] .masonry { column-count: 4; column-gap: 22px; }
@media (max-width: 900px) {
  body[data-gallery-density="loose"] .masonry { column-count: 2; }
}

/* =========================================================
   首页大图鼠标视差效果
   ========================================================= */
.hero__slide img {
  transition: transform .4s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.hero__viewport {
  cursor: grab;
}

/* =========================================================
   textarea 样式（后台面板）
   ========================================================= */
label textarea {
  display: block;
  margin-top: 4px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  resize: vertical;
  outline: none;
}
label textarea:focus { border-color: var(--accent); }

/* =========================================================
   响应式补充
   ========================================================= */
@media (max-width: 720px) {
  body[data-scrolled="true"] .floating { padding: 0 16px 0; }
  .floating__label { display: none; }
  /* 关键：滚动后 topbar 宽度由内容决定（max-content），不强制 48px，
     避免 LOGO+菜单溢出右侧画面。padding 增大让胶囊能容纳 3 个图标（仅下滑右缩开启时） */
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar,
  body[data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar:hover {
    width: max-content !important;
    max-width: calc(100vw - 32px) !important;
    padding: 5px 14px !important;
  }
  /* 移动端底部菜单：背景色 + 文字大小（20260811j：以文字大小取代旧 文字宽/高） */
  .floating__inner {
    background: var(--mobile-float-bg, var(--menu-bg, rgba(255,255,255,.92))) !important;
    border-radius: var(--mobile-float-radius, 16px) !important;
  }
  /* u34：移动端圆角设置对下滑/固定底部模式同样生效 */
  body[data-scrolled="true"] .floating__inner,
  .floating[data-mode="fixed-bottom"] .floating__inner {
    border-radius: var(--mobile-float-radius, 16px) !important;
  }
  /* u35：移动端底部菜单水平位置（auto 居中 / left 偏左 / right 偏右） */
  body[data-mobile-float-halign="left"]  .floating__inner { margin-left: 0;    margin-right: auto; }
  body[data-mobile-float-halign="right"] .floating__inner { margin-left: auto; margin-right: 0; }
  /* u35：移动端底部菜单距底部位置（独立变量，0/未设 = 回退桌面 --float-bottom-off 默认 30px） */
  body[data-scrolled="true"] .floating { bottom: var(--mobile-float-bottom-off, var(--float-bottom-off, 30px)); }
  .floating[data-mode="fixed-bottom"] { bottom: var(--mobile-float-bottom-off, var(--float-bottom-off, 30px)) !important; }
  .floating__inner .style-item__label {
    font-size: var(--mobile-float-text-size, 13px);
    display: inline-flex;
    align-items: center;
  }
  /* 移动端底部菜单「仅当前相册名」模式（body[data-mobile-float-single=on]）：左右箭头常显用于切换相册 */
  body[data-mobile-float-single="on"] .floating__prev,
  body[data-mobile-float-single="on"] .floating__next { display: inline-flex !important; }
  /* 仅当前相册名模式：取消选中背景（显示即选中）、名称在胶囊内居中、隐藏选中指示点 */
  body[data-mobile-float-single="on"] .style-item.is-active {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--float-text-color, var(--text-soft)) !important;
  }
  body[data-mobile-float-single="on"] .style-item__dot { display: none; }
  body[data-mobile-float-single="on"] .floating__list { justify-content: center; padding: 0; }
  body[data-mobile-float-single="on"] .style-item__main { justify-content: center; }
  body[data-mobile-float-single="on"] .style-item__label { text-align: center; }
  /* u25(c)：移动端底部菜单毛玻璃（独立开关；桌面 floatTransparent 的 inline bg 被上方 !important 覆盖，故移动端单独处理） */
  body[data-mobile-float-glass="on"] .floating__inner {
    background: var(--bg-glass, rgba(255,255,255,.5)) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-color: var(--bg-glass-border, rgba(255,255,255,.35)) !important;
  }
}

/* =========================================================
   移动端：后台面板改为底部弹出 sheet，打开时不 push 网页（u29）
   ========================================================= */
@media (max-width: 720px) {
  .theme-panel {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 88vh;
    max-height: calc(100vh - 8px);
    min-height: 180px;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: 0 -14px 60px rgba(0,0,0,.3) !important;
    animation: panelSheetUp .32s cubic-bezier(.22,.61,.36,1) !important;
  }
  @keyframes panelSheetUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }

  /* 移动端浮动模式：仍是可拖动 / 可缩放的浮动卡片（不是全宽底部 sheet） */
  body[data-panel="float"] .theme-panel {
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    width: min(420px, calc(100vw - 40px)) !important;
    height: min(620px, calc(100vh - 40px)) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 16px !important;
    border: 1px solid var(--line) !important;
  }

  /* 打开面板：网页不 push，各元素保持原位 */
  body[data-panel="open"] .page {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: var(--page-max-width) !important;
  }
  body[data-panel="open"] .topbar {
    left: 16px !important;
    right: auto !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
  }
  body[data-panel="open"][data-mobile-nav-shrink="on"][data-scrolled="true"] .topbar {
    left: auto !important;
    right: 16px !important;
  }
  body[data-panel="open"] .topbar-spacer { left: 0 !important; }
  body[data-panel="open"] .sticky-title { left: 16px !important; right: 16px !important; }
  body[data-panel="open"] .floating {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
  }
  body[data-panel="open"] .floating__inner { max-width: none !important; }
  body[data-panel="open"] .hero__caption.is-fixed {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }
  body[data-panel="open"] .server-status--floating { right: 16px !important; }
  /* 移动端无需 collapsed 缩回态：撤销其 push */
  body[data-panel="collapsed"] .page { margin-left: auto !important; margin-right: auto !important; max-width: var(--page-max-width) !important; }
  body[data-panel="collapsed"] .topbar-spacer { left: 0 !important; }
  body[data-panel="collapsed"] .sticky-title { left: 16px !important; right: 16px !important; }
}

/* =========================================================
   浮动菜单尺寸（管理后台控制）
   ========================================================= */
body[data-float-size="compact"] .floating__inner { padding: 6px 14px; gap: 10px; }
body[data-float-size="compact"] .style-item { padding: 5px 10px; font-size: 12px; }
body[data-float-size="wide"] .floating__inner { padding: 14px 24px; gap: 18px; }
body[data-float-size="wide"] .style-item { padding: 9px 18px; font-size: 14px; }

/* =========================================================
   页面底部留白给固定的浮动栏
   ========================================================= */
.page { padding-bottom: 92px; }

/* =========================================================
   v16 新增：后台缩回 / 关于图片墙 / 导航添加拖动 / 标题样式 /
   下滑固定大图 / 列数切换 / 取消回到顶部
   ========================================================= */

/* 大图高度：按图片调整（自适应，不限制高度） */
body[data-hero-size="fit"] .hero__slide img { max-height: none; }

/* ---- 后台面板缩回（collapsed 贴边） ---- */
body[data-panel="collapsed"] .theme-panel {
  width: 46px;
  border-right: 1px solid var(--line);
}
body[data-panel="collapsed"] .theme-panel header,
body[data-panel="collapsed"] .theme-panel .tabs,
body[data-panel="collapsed"] .theme-panel .tab-panel { display: none; }
body[data-panel="collapsed"] .page { margin-left: 58px; margin-right: 12px; max-width: min(var(--page-max-width), calc(100vw - 70px)); }
body[data-panel="collapsed"] .topbar-spacer { left: 46px; }
body[data-panel="collapsed"] .topbar {
  left: 58px; right: 12px; transform: none; width: auto;
}
body[data-panel="collapsed"] .sticky-title { left: 58px; right: 12px; }
body[data-panel="collapsed"] .floating__inner { max-width: min(var(--page-max-width), calc(100vw - 70px)); }

/* 五大板块锁定浮动（20260811i）：锁定后下拉时固定在顶部，各模块可独立开启 */
body[data-lock-hero="1"] #heroViewport { position: sticky; top: var(--lock-top-hero, 0); z-index: 40; }
/* 标题锁定浮动(lockTitle)已移除：浮动由 .hero__caption.is-fixed 统一驱动（桌面/移动端一致） */

/* 大图文件名标签（20260811i）：关联到 .hero__badge，见上方 .hero__badge 规则 */
.hero__slide { position: relative; }

/* 模块背景框下边框渐变（20260811i）：由 JS 在模块内追加 .mod-box-grad 子元素渲染，
   颜色关联背景框颜色（--mod-box-bg），强度由 --mod-box-grad 控制，grad=0 时不显示 */
.mod-box-grad {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--mod-box-bg, rgba(0,0,0,.25)));
  opacity: calc(var(--mod-box-grad, 0) / 100);
  pointer-events: none;
  z-index: 3;
}

/* 模块底部框体（20260811j）已并入单一模块背景框，此处仅保留后台开关控制规则 */

/* 桌面端搜索图标开关（后台「① 顶部导航栏 → 桌面端显示搜索图标」控制） */
body[data-desktop-search="off"] #searchBtn { display: none; }
/* 首页瀑布流列数锁定：后台锁定后隐藏前台列数切换按钮 */
body[data-home-cols-lock="1"] #homeColsBtn { display: none; }

/* ---- 导航项：添加模式 + 拖动排序 ---- */
.nav-items-box {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.nav-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 12.5px;
  color: var(--text);
  cursor: grab;
  user-select: none;
  transition: border-color .2s ease, background .2s ease, opacity .2s ease, transform .15s ease;
}
.nav-chip:hover { border-color: var(--accent); }
.nav-chip.is-dragging { opacity: .4; cursor: grabbing; }
.nav-chip.is-over { border-color: var(--text); transform: scale(1.04); }
.nav-chip__text { line-height: 1; }
.nav-chip__del {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  color: var(--text-soft);
  font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, color .2s ease;
}
.nav-chip__del:hover { background: rgba(220,50,50,.15); color: #c44; }
.nav-add-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.nav-add-row input {
  flex: 1; min-width: 0;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; color: var(--text);
}
.ghost-btn {
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-soft); font-size: 12px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text); }

/* ---- 首页标题文字样式 ---- */
.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.color-row input[type="color"] {
  width: 42px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer;
}

/* ---- 关于页图片墙 ---- */
.about__gallery {
  margin: 34px auto 0; max-width: 720px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.about__gallery.is-on { display: grid; }
.about-gallery-img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 14px; box-shadow: var(--card-shadow);
  transition: transform .4s ease;
}
.about-gallery-img:hover { transform: translateY(-4px); }

/* 路书图片指引（关于页地图定位下方） */
.about__route-guide {
  margin: 24px auto 0; max-width: 720px;
}
.about__route-guide .about__info-label { display: block; margin-bottom: 10px; }
.about__route-guide__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.about__route-guide__grid .about-gallery-img {
  aspect-ratio: 4 / 3;
}
@media (max-width: 600px) {
  .about__route-guide__grid { grid-template-columns: 1fr; }
}
.about-images-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px;
}
.about-img-cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.about-img-cell img { width: 100%; height: 100%; object-fit: cover; }
.about-img-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.about-img-del:hover { background: rgba(220,50,50,.85); }

/* ========== 主题配色弹窗（req4） ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(420px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  max-height: 86vh; overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 15px; font-weight: 600; }
.modal__close {
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-soft); padding: 0 4px;
}
.modal__close:hover { color: #c44; }
.modal__body { padding: 12px 16px; overflow-y: auto; }
.modal__foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
/* 弹窗内单条颜色行 */
.popup-color-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.popup-color-row label { flex: 1; font-size: 13px; }
.popup-color-row input[type="color"] {
  width: 44px; height: 30px; border: 1px solid var(--line);
  border-radius: 8px; background: none; cursor: pointer; padding: 2px;
}
/* 自定义配色列表：可点击弹窗微调（req4） */
.color-row[data-ct] { cursor: pointer; }
.color-row[data-ct]:hover { background: rgba(0,0,0,.03); }
.color-chip {
  margin-left: auto; width: 26px; height: 18px; border-radius: 5px;
  border: 1px solid var(--line); display: inline-block; flex-shrink: 0;
}

/* 关于页美化：标题下方分隔线 */
.about__inner h2 { position: relative; padding-bottom: 18px; }
.about__inner h2::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 56px; height: 2px; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ---- 首页固定大图带（v16）已移除：改为 .hero__caption 下滑后 sticky 固定标题 ---- */

/* ---- 风格菜单左侧三点 → 下滑后变为向上小三角 ---- */
.floating__label .fl-up { display: none; }
body[data-scrolled="true"] .floating__label { cursor: pointer; }
body[data-scrolled="true"] .floating__label .fl-dots { display: none; }
body[data-scrolled="true"] .floating__label .fl-up { display: block; }

/* ---- 首页标题行：滚动提示文字 + 列数切换按钮（右侧无圆圈） ---- */
.hero__caption-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}
.home-cols-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft); background: transparent;
  border: none; cursor: pointer; padding: 0;
  transition: color .2s ease, transform .2s ease;
}
.home-cols-btn:hover { color: var(--text); transform: scale(1.12); }

/* 首页瀑布流列数由 JS（layoutMasonry 生成的 flex 列）完全控制；
   data-home-cols / data-mobile-cols 仅作兼容标记，不参与布局（原 column-count 规则已移除，避免与 flex 列冲突）。 */

/* 首页尾部模块 */
.home-footer {
  margin-top: 96px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--line);
  background: transparent;
}
.home-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}
.home-footer__brand {
  display: flex; align-items: center; gap: 12px;
}
.home-footer__logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.home-footer__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.home-footer__brand-text { display: flex; flex-direction: column; }
.home-footer__title {
  font-size: 15px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--text);
}
.home-footer__subtitle {
  font-size: 11px; letter-spacing: 1.5px; color: var(--text-soft);
  margin-top: 2px;
}
.home-footer__nav {
  display: flex; gap: 24px;
  justify-content: center;
}
.home-footer__link {
  font-size: 13px; color: var(--text-soft);
  text-decoration: none;
  letter-spacing: 1.5px;
  transition: color .2s ease;
}
.home-footer__link:hover { color: var(--text); }
.home-footer__meta {
  text-align: right;
  display: flex; flex-direction: column; gap: 4px;
}
.home-footer__row {
  font-size: 12px; color: var(--text);
  letter-spacing: 1px;
}
.home-footer__row--soft {
  font-size: 11px; color: var(--text-soft);
  letter-spacing: 1.5px;
}
.home-footer__icp {
  margin-top: 4px;
  font-size: 11px; color: var(--text-soft);
  letter-spacing: .5px;
}
.home-footer__icp:empty { display: none; }
.home-footer__icp a { color: var(--text-soft); text-decoration: none; }
.home-footer__icp a:hover { color: var(--text); }
@media (max-width: 720px) {
  .home-footer { margin-top: 64px; padding: 32px 0 24px; }
  .home-footer__inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 24px;
    text-align: center;
  }
  .home-footer__brand { justify-content: center; }
  .home-footer__nav { justify-content: center; gap: 18px; }
  .home-footer__meta { text-align: center; }
}
/* 不再用 media query 覆盖列数，让用户在所有屏幕尺寸下都能自由切换 1/2/3 列 */

/* ---- 取消回到顶部按钮（下滑后不再显示） ---- */
.back-to-top { display: none !important; }

/* ---- 后台：服务器同步状态条 ---- */
.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: .2px;
  border: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.server-status__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}
.server-status__txt { flex: 1 1 auto; min-width: 0; word-break: break-word; }

/* 全局浮层版：屏幕右下角，登录后任何界面都能看到 */
.server-status--floating {
  position: fixed;
  right: 16px;
  bottom: 16px;
  margin: 0;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 32px));
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  cursor: default;
  user-select: none;
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .35s ease;
}
.server-status--floating[hidden] { display: none !important; }
body[data-panel="open"] .server-status--floating { right: calc(var(--admin-panel-w, 380px) + 16px); }

/* 服务器同步状态条（已收入后台管理面板）：置于面板顶栏下方，复用 .server-status 配色规则 */
.panel-server-status {
  margin: 0;
  padding: 8px 14px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
}
.panel-server-status[hidden] { display: none !important; }

/* 后台顶部访问量计数（每日 / 每月）：字号从简，与状态条风格一致 */
.visit-counter {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;                 /* 字体不需要太大 */
  line-height: 1.4;
  color: var(--text-soft);
  background: transparent;
}
.visit-counter[hidden] { display: none !important; }
.visit-counter__label {
  font-size: 11px; letter-spacing: .04em; opacity: .8;
  padding-right: 2px;
}
.visit-counter__item { white-space: nowrap; }
.visit-counter__item b {
  color: var(--text); font-weight: 600; font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}
.visit-counter__sep { opacity: .45; }

.server-status[data-ok="true"] {
  color: #2f9e69;
  background: rgba(47, 158, 105, .10);
  border-color: rgba(47, 158, 105, .28);
}
.server-status[data-ok="false"] {
  color: #c9542f;
  background: rgba(201, 84, 47, .10);
  border-color: rgba(201, 84, 47, .28);
}
body[data-mode="dark"] .server-status[data-ok="true"] {
  color: #6cd49a;
  background: rgba(108, 212, 154, .12);
  border-color: rgba(108, 212, 154, .32);
}
body[data-mode="dark"] .server-status[data-ok="false"] {
  color: #ff8a66;
  background: rgba(255, 138, 102, .12);
  border-color: rgba(255, 138, 102, .32);
}
.server-status[data-ok="false"] .server-status__dot {
  animation: serverStatusPulse 1.8s cubic-bezier(.16, 1, .3, 1) infinite;
}
@keyframes serverStatusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(201, 84, 47, .55); }
  70%  { box-shadow: 0 0 0 6px rgba(201, 84, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 84, 47, 0); }
}
@keyframes serverStatusPulseDark {
  0%   { box-shadow: 0 0 0 0 rgba(255, 138, 102, .55); }
  70%  { box-shadow: 0 0 0 6px rgba(255, 138, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 138, 102, 0); }
}
body[data-mode="dark"] .server-status[data-ok="false"] .server-status__dot {
  animation: serverStatusPulseDark 1.8s cubic-bezier(.16, 1, .3, 1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .server-status[data-ok="false"] .server-status__dot,
  body[data-mode="dark"] .server-status[data-ok="false"] .server-status__dot { animation: none; }
}

/* ---- 顶栏：登录后的账号容器（账号名 + 齿轮） ---- */
.topbar__account {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar__account[hidden] { display: none !important; }
.topbar__account-name {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.topbar__account-name:hover {
  background: rgba(0,0,0,.05);
  border-color: var(--accent-soft, var(--line));
}
body[data-mode="dark"] .topbar__account-name:hover { background: rgba(255,255,255,.08); }

/* 20260811u：登录弹窗的「已登录视图」（用户头像 + 用户名 + 后台管理 + 退出） */
.login-modal__view { animation: fadeIn .25s ease; }
.login-modal__view--logged { display: flex; flex-direction: column; gap: 18px; }
.login-modal__logged-head { display: flex; align-items: center; gap: 12px; }
.login-modal__avatar {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent, #b08968);
  color: #fff;
  font-size: 22px; font-weight: 600;
}
.login-modal__name { font-size: 16px; font-weight: 600; color: var(--text); }
.login-modal__role { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.login-modal__logged-actions { display: flex; flex-direction: column; gap: 8px; }
.login-modal__action {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
.login-modal__action--primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.login-modal__action--primary:hover { opacity: .85; }
.login-modal__action--ghost:hover { background: var(--bg-2); border-color: var(--accent-soft, var(--line)); }
.login-modal__close-x {
  align-self: center;
  margin-top: 4px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
}
.login-modal__close-x:hover { color: var(--text); background: var(--bg-2); }

/* ===== 进站遮蔽动画（覆盖默认标题/文案闪烁，加载完成后由 app.js 收起） ===== */
.splash {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f6f1e7 0%, #ece3d4 100%);
  transition: opacity .5s ease, visibility .5s ease;
}
.splash--hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.splash__logo {
  width: 96px; height: 96px; border-radius: 22px; object-fit: cover;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
  animation: splashPop .6s ease both;
}
.splash__name {
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, "Songti SC", serif;
  font-size: 26px; letter-spacing: .14em; color: #3a352c; text-align: center;
}
.splash__spinner {
  width: 34px; height: 34px; border: 3px solid rgba(0,0,0,.12);
  border-top-color: #b08d57; border-radius: 50%;
  animation: splashSpin .9s linear infinite;
}
.splash__tip { font-size: 13px; letter-spacing: .25em; color: #8a8475; }
@keyframes splashSpin { to { transform: rotate(360deg); } }
@keyframes splashPop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-color-scheme: dark) {
  .splash { background: linear-gradient(135deg, #1b1a17 0%, #26241f 100%); }
  .splash__name { color: #e9e3d6; }
  .splash__tip { color: #a8a193; }
  .splash__spinner { border-color: rgba(255,255,255,.14); border-top-color: #c9a36a; }
}

/* 通用隐藏（图片加载策略总开关关闭时隐藏三选项组） */
.hidden { display: none !important; }

/* ===== 图片加载 LOGO 占位（item37，压暗黑屏 + 居中图标 + 转圈，跟进站遮蔽动画同构图） =====
   图片未缓存、正在加载时，在图片位置压暗黑屏、居中显示 LOGO 小图标 + 旋转环；load/error 后占位淡出、图片淡入。
   已缓存的图片由 JS 直接跳过占位（不会闪一下 LOGO）。 */
.is-img-loading { position: relative; }
/* 默认（首页大图 / 相册封面 / 瀑布流）：压暗黑屏铺满图片区，中间只留居中 LOGO 小图标 + 转圈环 */
.img-loader {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(125% 125% at 50% 50%, rgba(30,28,24,.86) 0%, rgba(12,11,9,.95) 100%);
  transition: opacity .35s ease, visibility .35s ease;
  pointer-events: none;
  overflow: hidden;
}
.img-loader--hide { opacity: 0; visibility: hidden; }
/* 用 .img-loader > 子代选择器提高特异性，并加 !important，
   防止被 .hero__slide img / .album-card__cover img / .masonry__card img 的 width:100% 把占位小图标撑满整个图片框 */
.img-loader > .img-loader__logo {
  width: clamp(26px, 12%, 56px) !important;
  height: auto !important;
  max-width: 56px !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 18% !important;
  object-fit: cover !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  animation: splashPop .5s ease both, imgLoaderBreath 1.9s ease-in-out .5s infinite;
}
.img-loader__ring {
  flex: 0 0 auto;
  width: clamp(18px, 9%, 34px);
  height: clamp(18px, 9%, 34px);
  border: 2.5px solid rgba(255,255,255,.18);
  border-top-color: #c9a36a;
  border-radius: 50%;
  animation: splashSpin .9s linear infinite;
}
@keyframes imgLoaderBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(.94); } }

/* 灯箱变体：居中（不铺满），避免遮住关闭按钮与底部工具条；用深色圆角卡片表示加载态 */
.img-loader--center {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: auto; height: auto;
  background: rgba(16,15,12,.66);
  border-radius: 18px;
  padding: 22px 28px;
  gap: 12px;
}
.img-loader--center .img-loader__logo { width: 50px !important; max-width: 50px !important; max-height: none !important; box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.img-loader--center .img-loader__ring {
  width: 30px; height: 30px;
  border-color: rgba(255,255,255,.22); border-top-color: #c9a36a;
}

/* 图片淡入（保留各自原有的 transform 过渡时长，避免影响 hover 缩放 / 灯箱手势手感） */
img.img-fadein { transition: opacity .5s ease, transform .8s ease; }
#lightbox > img.img-fadein { transition: opacity .4s ease, transform .22s ease; }
.img-fadein--pending { opacity: 0; }
/* 高清就位 crossfade 覆盖层：缩略图保持，高清透明淡入覆盖（20260831i） */
.img-xfade {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s ease;
  pointer-events: none;
  z-index: 2;
}
/* 占位期撑高：瀑布流图片是 height:auto，未加载时高度会塌陷成 0，导致看不到占位且布局跳动 */
.masonry__card > img.img-fadein--pending { aspect-ratio: var(--img-pending-ratio, 3 / 4); }
/* 大图用 min-height 而非 aspect-ratio，避免覆盖后台自定义的大图高度设置 */
.hero__slide > img.img-fadein--pending { min-height: min(56vw, 78vh); }

/* ===== 首页分享：浮动按钮 + 全屏分享视图（20260913） ===== */
.share-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: #fff;
  background: rgba(26, 26, 26, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  transition: transform .15s ease, background .15s ease;
}
.share-fab:hover { background: rgba(26, 26, 26, .95); transform: translateY(-2px); }
.share-fab[hidden] { display: none; }

.share-view { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.share-view[hidden] { display: none; }
.share-view__mask { position: absolute; inset: 0; background: rgba(20, 18, 15, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.share-view__card {
  position: relative; width: min(440px, 94vw); max-height: 92vh;
  background: #FBF8F2; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.share-view__head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid rgba(26, 26, 26, .07); flex: 0 0 auto;
}
.share-view__head-title { font-size: 15px; font-weight: 600; color: #1a1a1a; letter-spacing: .02em; }
.share-view__close {
  margin-left: auto; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, .05); color: #333; font-size: 20px; line-height: 1; cursor: pointer;
}
.share-view__close:hover { background: rgba(0, 0, 0, .1); }
.share-view__preview {
  position: relative; flex: 1 1 auto; min-height: 0; background: #EFE9DD;
  display: block; padding: 14px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.share-view__img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); background: #fff;
}
/* 生成分享图时的加载动画（替代碎裂图标） */
.share-view__loading {
  display: none;            /* 由 openShareView 切换为 block */
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; z-index: 6; pointer-events: none;
}
.share-view__loading::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(26, 22, 18, .12);
  border-top-color: #1a1a1a;
  animation: share-spin .8s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .share-view__loading::before { animation-duration: 1.6s; }
}
.share-view__status {
  order: -1; flex: 0 0 100%; width: 100%;
  padding: 0 4px 10px; font-size: 12px; line-height: 1.5; color: rgba(26, 22, 18, .55);
  text-align: center;
}
.share-view__foot {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 18px;
  border-top: 1px solid rgba(26, 26, 26, .07);
}
.share-view__action {
  flex: 1 1 auto; border: none; cursor: pointer; padding: 12px 0; border-radius: 999px;
  font-size: 15px; font-weight: 600; background: #1a1a1a; color: #fff;
  transition: background .15s ease, opacity .15s ease;
}
.share-view__action:hover { background: #000; }
.share-view__action:disabled { opacity: .5; cursor: default; }
.share-view__action--ghost { background: transparent; color: #1a1a1a; box-shadow: inset 0 0 0 1.5px rgba(26, 26, 26, .25); }
.share-view__action--ghost:hover { background: rgba(0, 0, 0, .04); }

@media (max-width: 720px) {
  .share-fab { bottom: 84px; right: 16px; }   /* 避开底部居中的风格菜单 */
  .share-view { padding: 0; }
  .share-view__card { width: 100vw; height: calc(100vh - var(--share-vv-bottom, 0px)); max-height: none; border-radius: 0; }
  .share-view__preview { padding: 12px; }
}

/* ============================================================
   图库页面显示方式（20260917）
   standalone：独立图库页（默认）
   home：整个 #gallery 段落搬进首页，位于「首页瀑布流」与「底部模块」之间，
        排版对齐分享卡片（标题 + 分组发丝线 + 相册封面网格）
   ============================================================ */
/* 首页底部相册 dock（复用 .gallery--home 的紧凑排版） */
.home-album-dock[hidden] { display: none !important; }
.gallery--home {
  padding: 0;
  margin-top: 72px;
  scroll-margin-top: 72px;
}
.gallery--home .gallery__topbar { margin-bottom: 16px; }
.gallery--home .gallery__head { margin-bottom: 24px; }
.gallery--home .gallery__head-row h2 {
  font-size: clamp(24px, 3.2vw, 38px);
  letter-spacing: -.3px;
}
.gallery--home .gallery__groupbar { margin-top: 14px; }
.gallery--home .album-grid-list { margin-top: 20px; }
.gallery--home .album-grid { margin-top: 20px; }
.gallery--home .gallery__album { margin-top: 0; }
@media (max-width: 720px) {
  .gallery--home { margin-top: 48px; padding-left: 0; padding-right: 0; }
  .gallery--home .gallery__head-row h2 { font-size: clamp(20px, 6vw, 28px); }
}

/* 相册标题文字：移动端随列数自适应缩放（20260917）
   原先固定 18px，设成 3/4 列时卡片变窄，标题挤成一坨甚至撑破卡片。
   20260917 修复：列数规则必须绑定「各自所在网格的列数」——
   图库页看 body[data-mobile-gallery-cols]，首页相册看 body[data-mobile-home-album-cols]；
   此前首页相册沿用了图库页的列数属性，两者独立后规则完全没命中，字号恒为 13.26px 导致遮挡。 */
.album-card__name > span:first-child { min-width: 0; }
@media (max-width: 720px) {
  .album-card__name {
    padding: 10px 12px;
    gap: 6px;
    font-size: clamp(13px, 3.4vw, 18px);
    line-height: 1.25;
  }
  .album-card__name > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .album-card__count { font-size: 10.5px; }
  .album-card__scene { padding: 0 12px 10px; font-size: 10px; }
  /* 图库页：按图库列数缩放（限定 #albumGrid，避免误伤首页相册） */
  body[data-mobile-gallery-cols="3"] #albumGrid .album-card__name { font-size: clamp(11px, 2.6vw, 13px); }
  body[data-mobile-gallery-cols="4"] #albumGrid .album-card__name { font-size: clamp(10px, 2.1vw, 11.5px); }
  /* 首页底部相册：按首页列数缩放 */
  body[data-mobile-home-album-cols="3"] .home-album-dock .album-card__name { font-size: clamp(11px, 2.6vw, 13px); }
  body[data-mobile-home-album-cols="4"] .home-album-dock .album-card__name { font-size: clamp(10px, 2.1vw, 11.5px); }

  /* 3 / 4 列时卡片很窄：名称与「N 张」改为上下两行，名称独占整行并允许两行截断，
     彻底解决横排时被张数挤压、文字被裁/遮挡的问题 */
  body[data-mobile-gallery-cols="3"] #albumGrid .album-card__name,
  body[data-mobile-gallery-cols="4"] #albumGrid .album-card__name,
  body[data-mobile-home-album-cols="3"] .home-album-dock .album-card__name,
  body[data-mobile-home-album-cols="4"] .home-album-dock .album-card__name {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    padding: 8px 8px 9px;
  }
  body[data-mobile-gallery-cols="3"] #albumGrid .album-card__name > span:first-child,
  body[data-mobile-gallery-cols="4"] #albumGrid .album-card__name > span:first-child,
  body[data-mobile-home-album-cols="3"] .home-album-dock .album-card__name > span:first-child,
  body[data-mobile-home-album-cols="4"] .home-album-dock .album-card__name > span:first-child {
    width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body[data-mobile-gallery-cols="3"] #albumGrid .album-card__scene,
  body[data-mobile-gallery-cols="4"] #albumGrid .album-card__scene,
  body[data-mobile-home-album-cols="3"] .home-album-dock .album-card__scene,
  body[data-mobile-home-album-cols="4"] .home-album-dock .album-card__scene {
    padding: 0 8px 8px;
    font-size: 9.5px;
  }
  .album-group-section__title { font-size: 13.5px; margin-bottom: 10px; gap: 8px; }
}

/* 首页底部相册列数（20260917）
   网页端 --home-album-cols（默认 3） / 移动端 --mobile-home-album-cols（默认 2），
   由后台「图库页面 → 首页相册列数（网页端/移动端）」分别控制，
   只作用于 #homeAlbumDock 内的 .album-grid，不影响图库页。 */
.home-album-dock .album-grid {
  grid-template-columns: repeat(var(--home-album-cols, 3), minmax(0, 1fr));
}
@media (max-width: 720px) {
  .home-album-dock .album-grid {
    grid-template-columns: repeat(var(--mobile-home-album-cols, 2), minmax(0, 1fr));
    gap: 14px;
  }
}

/* ============================================================
   顶栏账号菜单（20260928）：鼠标悬停展开（移动端点击展开）
   已登录：个人中心 / 工作台 / 控制台 / 退出登录
   未登录：登录
   ============================================================ */
.user-menu { position: relative; display: inline-flex; }
/* ⚠️ 20260928e：面板已移到 body 顶层（见 index.html 注释）。
   .topbar 同时有 overflow:hidden 与 transform，两者都会把它裁在胶囊里，
   所以这里必须用 position:fixed（相对视口），left/top 由 JS 按 #userBtn 实时计算。 */
.user-menu__panel {
  position: fixed;
  top: 0; left: 0;
  min-width: 156px;
  padding: 6px;
  /* 与 .topbar 完全同源的背景 / 描边，圆角收一点（列表用 18px，不做成 999 药丸） */
  border-radius: 18px;
  background: var(--nav-capsule-bg, var(--menu-bg, var(--bg)));
  border: 1px solid var(--menu-border, var(--menu-line, var(--line)));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
  z-index: 200;                 /* 必须高于 .topbar 的 60 */
  display: none;
}
/* 顶部胶囊开了毛玻璃 → 菜单同步毛玻璃，视觉上像是从胶囊里延出来的一块 */
body[data-nav-capsule-glass="on"] .user-menu__panel {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .45);
}
body[data-mode="dark"][data-nav-capsule-glass="on"] .user-menu__panel { background: rgba(255, 255, 255, .08); }
.user-menu__panel.is-visible { display: block; }
/* hover 桥接：面板顶部向上延伸一段透明区，鼠标从按钮移到面板时不会「断连」而闪没 */
.user-menu__panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -14px;
  height: 14px;
}
/* 菜单项：沿用 .nav-item 的字号 13.5px 与文字色，hover 用胶囊里的高亮语汇 */
.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border: none;
  background: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--nav-text-color, var(--menu-text-soft, var(--text-soft)));
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.user-menu__item:hover {
  background: rgba(0, 0, 0, .06);
  color: var(--nav-active-text, var(--text));
}
body[data-mode="dark"] .user-menu__item:hover { background: rgba(255, 255, 255, .08); }
.user-menu__item--danger { color: #c84a4a; }
[data-mode="dark"] .user-menu__item--danger,
body[data-mode="dark"] .user-menu__item--danger { color: #ff9b9b; }
.user-menu__item--danger:hover { background: rgba(200, 74, 74, .12); }
.user-menu__sep { height: 1px; margin: 5px 10px; background: var(--menu-border, var(--line)); }
.user-menu__item[hidden] { display: none !important; }
.user-menu__sep[hidden] { display: none !important; }
/* 展开/收起由 JS 控制（面板在 body 顶层，纯 CSS 的 .user-menu:hover 已不再适用）：
   桌面 = 鼠标移入即展开；触屏 = 点击 #userBtn 切换。 */
