/* =============================================================================
 * layout.css —— 顶栏 / 左侧悬浮隐藏侧边栏 / 画布 / 悬浮关于按钮 / 登录页
 * ========================================================================== */

/* ---------- 1. 顶栏 ---------- */
.topbar {
  /* 【2026-10-05 整改 #9】原 position:fixed 的顶栏会被祖先的 transform/滤镜等
     新层叠上下文破坏（破坏后 fixed 退化为相对该祖先定位，随页面一起滚走）。
     改为 sticky 吸顶：回到正常文档流 + 始终吸附视口顶部，不受祖先生效层叠影响；
     相应地画布不再需要为 fixed 顶栏预留顶部内边距（见下方 .canvas-wrap）。 */
  position: sticky; top: 0; z-index: var(--z-topbar);
  /* 20260913 三栏网格：左 brand / 中搜索 / 右操作，搜索框对顶栏真居中（原 flex 下因右侧操作簇比 brand 宽而左偏） */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  height: var(--topbar-h);
  padding: 0 16px 0 20px;
  background: var(--surface); /* 不支持 color-mix 的浏览器回退 */
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; flex: none; grid-column: 1; justify-self: start; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff;
}
.brand__mark svg { width: 15px; height: 15px; }
.brand__text { font-size: 14.5px; font-weight: 600; letter-spacing: .2px; }

/* 汉堡按钮：仅移动端出现 */
.hamburger { display: none; }

/* —— 全局搜索：只检索预览字段（提醒标题 / 收藏名称 / 便签标题） —— */
/* 20260913 固定宽度 460px + 网格中栏居中；宽度与原 max-width 一致，逻辑不变 */
.search { position: relative; grid-column: 2; justify-self: center; width: 460px; max-width: 100%; }
.search__box {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search__box:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search__box svg { color: var(--text-3); }
.search__input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 13px;
}
.search__kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px;
}

.search__panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  max-height: 60vh; overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  display: none;
}
.search__panel.is-open { display: block; animation: pop .18s var(--ease); }
.search__group-title {
  padding: 7px 9px 4px; font-size: 11px; color: var(--text-3); letter-spacing: .4px;
}
.search__item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--dur) var(--ease);
}
.search__item:hover, .search__item.is-active { background: var(--surface-3); }
.search__item .s-name { flex: 1; font-size: 13px; }
.search__item mark { background: transparent; color: var(--brand); font-weight: 600; }

.topbar__right { display: flex; align-items: center; gap: 8px; flex: none; grid-column: 3; justify-self: end; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--brand-line);
}

/* ---------- 2. 左侧悬浮隐藏侧边栏 ---------- */
/* 触发条：桌面端最左边缘一条窄条，鼠标悬浮即滑出侧边栏 */
.rail {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: var(--z-rail);
  width: var(--rail-w);
  background: linear-gradient(90deg, var(--line-strong), transparent);
  opacity: .5;
  transition: opacity var(--dur) var(--ease);
}
.rail:hover { opacity: 1; }
.rail::after { /* 视觉提示的小把手 */
  content: "";
  position: absolute; top: 50%; left: 2px;
  width: 3px; height: 46px; margin-top: -23px;
  border-radius: var(--radius-pill);
  background: var(--text-3); opacity: .5;
}

.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: var(--z-sidebar);
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 14px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transform: translateX(calc(-100% - 12px));
  transition: transform .26s var(--ease);
  overflow: hidden;   /* 裁切滑入动画；滚动交给内层 .side__scroll（避开 transform 固定元素在 Chromium/Edge 下的滚动路由异常） */
  /* 【2026-10-15 修复⑤：Edge/Chromium 命中测试失效】部分 GPU 后端（Intel Mac / Windows）
     下，顶层「backdrop-filter 顶栏」与「position:fixed + transform 侧栏」共处时，合成器会把
     侧栏的命中区域算错 —— 表现为「面板照常弹出/隐藏，但内部按钮、开关、滚轮全部点不动/滚不动」
     （Safari/WebKit 与 Apple-Silicon 版 Chromium 不受影响，故只在特定机器暴露）。
     修复：强制侧栏常驻独立合成层 + 独立层叠上下文，使其命中测试不再依赖与顶栏模糊层的合成时序。
     仅加合成/层叠提示，不改任何视觉与滑入动画。 */
  will-change: transform;
  isolation: isolate;
}
.sidebar.is-open { transform: translateX(0); }
/* 内层滚动容器：无 transform，跨浏览器可靠内部滚动（修复 Edge 下「模块列表内部滚动失效、整页滚动」） */
.side__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.side__section { margin-bottom: 16px; }
.side__title {
  padding: 0 8px 7px;
  font-size: 11px; letter-spacing: .5px; color: var(--text-3);
}
.side__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2);
  cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.side__link:hover { background: var(--surface-3); color: var(--text); }
.side__link .badge { margin-left: auto; }
.side__link .switch { margin-left: auto; }
.side__link.is-off { color: var(--text-3); }
/* 【2026-10-02】模块入口列表拖拽排序（仅「解锁模块锁定」后可用） */
.side__link.is-sortable { cursor: grab; }
.side__link .side__drag { flex: none; margin: -4px -6px -4px -2px; padding: 2px 1px; font-size: 10px; line-height: 1;
  letter-spacing: -1px; color: var(--text-3); cursor: grab; user-select: none; }
.side__link.is-dragging { opacity: .45; }
.side__link.is-drag-over { background: var(--surface-3); }
.side__link.is-drag-over.is-drop-after { box-shadow: inset 0 -2px 0 0 var(--brand, #2f6feb); }
.side__link.is-drag-over:not(.is-drop-after) { box-shadow: inset 0 2px 0 0 var(--brand, #2f6feb); }
.side__sorthint { margin: 8px 2px 2px; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 11px; line-height: 1.5; color: var(--text-3); background: var(--surface-3); }

/* 模块显示/隐藏开关 */
.switch {
  position: relative; width: 30px; height: 17px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--switch-off);
  transition: background var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform var(--dur) var(--ease);
}
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(13px); }

.side__user {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
}
.side__user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: var(--radius-sm); background: var(--surface-2);
  margin-bottom: 8px;
}
.side__user-name { font-size: 13px; font-weight: 600; }
.side__user-id { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

/* ---------- 3. 画布 ----------
 * 【2026-09-24 需求4】全局卡片栅格自适应（仅容器层，不动任何模块内部）：
 *   · 左右内边距随视口宽度弹性收缩（clamp）：14 寸占屏更满，窄屏不挤压卡片
 *   · 画布容器随视口断点调整最大宽度：≤1680px 占满可用宽（消除 14 寸左侧
 *     大片空白），超宽屏按 4 列实际展开宽（≈1880px）封顶并水平居中
 *   · 高度 100dvh + dvh 兜底：浏览器缩放/地址栏收起时不跳动
 *   · 仅动 .canvas-wrap / .canvas 两个容器规则与断点，卡片圆角/配色/内排版不变 */
/* 【2026-10-02 修复·P2-4】顶栏是 position:fixed，锚点跳转 / scrollIntoView
   会把目标元素顶到顶栏底下被压住。给滚动容器统一预留偏移，一劳永逸。 */
html {
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

.canvas-wrap {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  /* 顶部收紧（已移除画布上方 i 图标行）；底部 20260830 由 90px 收到 24px
     —— 20260924 左右内边距改 clamp(14px,2.2vw,32px)：13/14 寸笔记本自适应收缩 */
  /* 【整改 #9】顶栏已改为 sticky 回到文档流，这里去掉原先为 fixed 顶栏预留的
     calc(var(--topbar-h) + 14px) 顶部补偿，只保留 14px 呼吸位，避免双倍间距。 */
  padding: 14px clamp(14px, 2.2vw, 32px) 24px;
  background-image:
    radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 0);
  background-size: 20px 20px;
}
.canvas {
  position: relative;
  width: 100%;
  max-width: 2400px;        /* 【2026-10-08】超宽屏上限 1880→2400：让 2560 等超宽屏卡片继续加宽
                               （1880 封顶时卡宽被锁在 600px，屏幕两侧各空约 360px）。
                               仅放宽上限值，居中逻辑与断点不变；配套 canvas.js 的 JS 栅格
                               会在容器可用宽内自动重算列宽，左右仍各留 1 个 gap(=20px)。 */
  margin: 0 auto;           /* 水平居中 */
  min-height: 60vh;
  isolation: isolate;   /* 独立层叠上下文：卡片 z-index 只在本层生效，
                           不会盖住顶栏(z:90)/侧边栏(z:95)/遮罩(z:500) */
}

/* 断点：14 寸及以下让容器占满可视宽（不再 1400px 封顶造成左侧大片空白），
   逐档收紧内边距；13 寸(1366/1280)与 11 寸(1024)各一档，100%/110%/125% 缩放
   同样按 CSS 像素命中对应断点，文字与按钮不会被挤压或错位。 */
@media (max-width: 1680px) {
  .canvas { max-width: 100%; }
  .canvas-wrap { padding-left: clamp(12px, 1.8vw, 24px); padding-right: clamp(12px, 1.8vw, 24px); }
}
@media (max-width: 1366px) {
  .canvas-wrap { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1100px) {
  .canvas-wrap { padding-left: 12px; padding-right: 12px; }
}

/* 画布顶部小字提示（硬性要求 11） */
.canvas-note {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 14px;
  font-size: 12px; color: var(--text-3);
}
.canvas-note svg { width: 13px; height: 13px; }

/* 拖拽时的吸附参考线 */
.snapline {
  position: absolute; z-index: var(--z-snapline); background: var(--brand); opacity: .55; pointer-events: none;
}
.snapline--v { width: 1px; top: 0; bottom: 0; }
.snapline--h { height: 1px; left: 0; right: 0; }

/* ---------- 4. 右下角悬浮「关于」按钮 ---------- */
.fab-about {
  position: fixed; right: 22px; bottom: 22px; z-index: var(--z-fab);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.fab-about:hover { transform: translateY(-2px); color: var(--brand); }

.about-list { font-size: 13px; }
.about-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.about-list li:last-child { border-bottom: 0; }
.about-list span:first-child { color: var(--text-3); }
.about-list code { font-family: var(--mono); font-size: 12px; }

/* ---------- 5. 未登录遮罩（不做 JS 自动跳转，必须用户手动点击） ---------- */
/* [备案合规 20260830] 登录提示改为「非阻断式底部卡片」：
   背景透明 + 容器 pointer-events:none，背后的导购内容（广告精选等）可正常浏览/滚动/点击；
   仅卡片本身可交互（pointer-events:auto）。避免「全站强制登录」被人工审核驳回。 */
.gate {
  /* [2026-10-06] z-index 写死：原为 var(--z-gate)（定义在 base.css），
     一旦 base.css 缓存未同步、变量取不到，z-index 会静默退化成 auto 而被模块卡片盖住。
     8000 远高于画布卡片（实测最高 ~33），又低于风格面板 9000 / 设置遮罩 9500 / bind-mask 9999，
     互不打架。 */
  position: fixed; inset: 0; z-index: 8000;
  display: none; align-items: flex-end; justify-content: flex-end; padding: 20px;
  background: transparent;
  pointer-events: none;
  /* 【2026-10-15 防御性加固】全屏 pointer-events:none 遮罩在部分 Chromium GPU 后端会被
     合成器误判为可命中（与侧栏同一类命中测试失效）。强制独立合成层 + 独立层叠上下文，
     保证「背景透传、仅卡片可点」在 Edge/Chromium 上可靠生效。登录态下 .gate 为 display:none，
     此规则完全惰性、零副作用。 */
  will-change: transform;
  isolation: isolate;
}
.gate.is-open { display: flex; }
.gate__panel {
  pointer-events: auto;
  width: 100%; max-width: 340px; text-align: center;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1);
}

/* ---------- 6. 登录 / 注册页 ---------- */
.auth-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, var(--brand-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 392px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .brand { justify-content: center; margin-bottom: 12px; }
.auth-head h1 { font-size: 18px; font-weight: 600; }
.auth-head p { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }

.tabs {
  display: flex; gap: 4px; padding: 3px; margin-bottom: 20px;
  background: var(--surface-3); border-radius: var(--radius-sm);
}
.tabs button {
  flex: 1; height: 30px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.auth-msg {
  display: none; margin-bottom: 14px; padding: 9px 11px;
  border-radius: var(--radius-sm); font-size: 12.5px;
}
.auth-msg.is-err { display: block; background: var(--danger-soft); color: var(--danger); }
.auth-msg.is-ok { display: block; background: var(--ok-soft); color: var(--ok); }

.auth-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3); line-height: 1.75;
}

/* ---------- 7. 响应式：移动端顶部汉堡折叠菜单 ---------- */
@media (max-width: 900px) {
  .rail { display: none; }              /* 移动端不用边缘触发条 */
  .hamburger { display: inline-flex; }  /* 改用汉堡按钮 */

  .sidebar {
    top: var(--topbar-h);
    width: 100%;
    max-width: 100%;
    padding: 14px 16px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    bottom: auto;
    max-height: calc(100vh - var(--topbar-h));
    transform: translateY(-110%);
  }
  .sidebar.is-open { transform: translateY(0); }

  /* 20260913 移动端回退 flex：汉堡按钮入流，搜索框填满剩余空间，与改前行为一致 */
  .topbar { display: flex; }
  .search { max-width: none; flex: 1 1 0%; width: auto; margin: 0; }
  .search__kbd { display: none; }
  .brand__text { display: none; }

  /* 【2026-10-02 窄屏修复·P2】375~414px 视口下，右侧操作簇（模块入口 + 刷新/皮肤/铃铛/设置
     四个图标钮 + 头像，实测约 317px）整体溢出视口右侧 —— 顶栏是 position:fixed，
     不产生横向滚动条，溢出的按钮直接不可达。此处压缩右簇：
     收紧间距与内边距、模块入口按钮文案截断、头像缩到 24px、搜索框允许收缩到 0。 */
  .topbar { padding: 0 10px 0 12px; gap: 8px; }
  .topbar__right { gap: 4px; }
  .topbar__right .btn.btn--ghost { padding-left: 7px; padding-right: 7px; }
  .topbar__right .wd-topbtn {
    max-width: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    padding-left: 8px; padding-right: 8px; flex: none;
  }
  .topbar__right .avatar { width: 24px; height: 24px; }
  .search { min-width: 0; }
  .search .search__input { min-width: 0; }

  /* 底部 20260830 由 84px 收到 28px（页脚紧凑化）；悬浮 FAB 为 fixed 定位，不受此内边距影响 */
  /* 【整改 #9】同桌面端：顶栏 sticky 后不再需要顶部补偿 */
  .canvas-wrap { padding: 14px 14px 28px; }
  .fab-about { right: 14px; bottom: 14px; }
}

@media (max-width: 420px) {
  .search__box { height: 32px; }
}

/* [备案合规 20260830 · 页脚紧凑化 20260830] 匿名访客下底部有 fixed 登录卡片 .gate__panel
   （实测高约 336px + 20px 外边距，定位在「视口右下角」，宽度 max-width:340px）。
   原实现无条件给页脚追加 380px 底部留白，导致页脚下方出现大片空白，页面观感差。
   实测：宽屏时该卡片只占右侧 340px，而页脚文字 text-align:center 居中，两者不发生横向重叠
   → 备案号本就不会被遮挡，无需留白；只有窄屏（卡片 width:100% 压到页面中部）才需要避让。
   故改为按屏宽分档：宽屏紧凑、窄屏保留避让空间 —— ICP 备案号在两种情形下均保持可见，合规不降级。 */
body.is-guest .site-foot { padding-bottom: 16px; }
@media (max-width: 900px) {
  /* 窄屏：登录卡片横向覆盖页面中部，仍需把备案号顶到卡片上方 */
  body.is-guest .site-foot { padding-bottom: 372px; }
}

/* =============================================================================
 * 【2026-08-30 新增】广告精选：列表 / 轮播 双模式
 * 仅追加，不改动任何既有样式；卡片本身仍复用 .feed-item，视觉与工作台一致。
 * ========================================================================== */

/* 模式切换条（列表 / 轮播） */
.ad-modebar {
  display: flex; gap: 4px; align-items: center;
  margin: 0 0 8px; padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  width: fit-content;
}
.ad-modebar__btn {
  appearance: none; cursor: pointer;
  border: 0; background: transparent;
  padding: 4px 14px;
  font-size: 12px; line-height: 1.4;
  color: var(--text-2);
  border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
}
.ad-modebar__btn:hover { color: var(--text); }
.ad-modebar__btn.is-active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

/* 轮播容器 */
.ad-carousel { display: flex; flex-direction: column; }
.ad-carousel__stage {
  min-height: 92px;
  display: flex; align-items: stretch;
}
.ad-carousel__stage .feed-item {
  flex: 1;
  border-top: 0;                 /* 单卡展示时不需要分隔线 */
  background: var(--surface-2);
}

/* 轮播控制条 */
.ad-carousel__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.ad-carousel__btn {
  appearance: none; cursor: pointer;
  width: 24px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  transition: background .15s, color .15s, border-color .15s;
}
.ad-carousel__btn:hover {
  color: var(--brand);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.ad-carousel__dots {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  flex-wrap: nowrap; overflow: hidden;
}
.ad-dot {
  width: 6px; height: 6px; padding: 0;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.ad-dot:hover { background: var(--text-3); }
.ad-dot.is-active { background: var(--brand); transform: scale(1.35); }
.ad-dot__count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 轮播：当前序号计数（与指示点并存，条目多时滑动窗口指示）+ 计数样式 */
.ad-carousel__count {
  font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  margin-left: 2px; white-space: nowrap;
}

/* =============================================================================
 * 【2026-08-30 新增】页脚广告位（承载百度联盟等第三方联盟 JS 代码）
 * -----------------------------------------------------------------------------
 * · 位置：页脚内部、版权/ICP 备案文字「上方」（业务内容与版权文字之间）
 * · 排版：宽度自适应、水平居中、常规文档流静态展示
 *         —— 绝不弹窗（no modal）、不悬浮（no position:fixed/sticky）
 * · 未配置广告代码时容器带 hidden 属性 → 彻底不占位，页面看不到任何空白框
 * · 纯展示容器，不参与任何业务逻辑，不影响导购精选 / 服务条款 / 隐私政策链接
 * ========================================================================== */
.foot-ad {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 10px;
  text-align: center;
  overflow: hidden;            /* 兜底：防止第三方素材超宽撑出横向滚动条 */
  line-height: 0;              /* 消除 inline 素材底部的基线间隙，避免多余留白 */
}
/* 未配置 / 内容为空 → 完全不占位（双保险：属性 + :empty） */
.foot-ad[hidden] { display: none !important; }
.foot-ad:empty   { display: none !important; }
/* 第三方素材自适应，禁止溢出容器 */
.foot-ad img,
.foot-ad iframe { max-width: 100%; border: 0; }

/* =============================================================================
 *  铃铛通知系统样式
 * ========================================================================== */
/* 铃铛按钮定位：固定在 header__right */
#btnNotifyBell { position: relative; }

/* 未读红点 */
.notify-dot {
  display: none;
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--card,#fff);
  z-index: var(--z-dot);
}
.notify-dot[style*="display: block"],
.notify-dot[style*="display:block"] {
  display: block !important;
}

/* 下拉通知面板 */
.notify-dropdown {
  position: absolute; top: 100%; right: 0; z-index: var(--z-in-topbar);
  width: 380px; max-width: 94vw; max-height: 440px;
  background: var(--card,#fff); border: 1px solid var(--line,#eef1f6);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(16,24,40,.18);
  display: none; flex-direction: column; overflow: hidden;
}
.notify-dropdown.is-open { display: flex; }

.notify-dropdown__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line,#eef1f6);
  font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.notify-mark-all {
  border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--brand,#2f6feb); padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
.notify-mark-all:hover { background: var(--brand-soft,#eef2ff); }
.notify-close {
  border: none; background: none; cursor: pointer;
  font-size: 16px; color: var(--text-3,#999); padding: 2px 6px; border-radius: 6px;
  transition: background .15s;
}
.notify-close:hover { background: var(--bg-2,#f1f4f9); }

/* 通知列表 */
.notify-dropdown__list {
  flex: 1; overflow-y: auto; min-height: 80px; padding: 4px 0;
}
.notify-dropdown__list .notif-empty {
  padding: 28px 16px; text-align: center; color: var(--text-3,#999); font-size: 13px;
}
.notify-dropdown__list .notif-item {
  display: flex; gap: 10px; padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--line,#f4f6fa); transition: background .12s;
}
.notify-dropdown__list .notif-item:hover { background: var(--bg-2,#f6f8fc); }
.notify-dropdown__list .notif-item.is-unread { background: var(--surface-2); }
.notify-dropdown__list .notif-item.is-unread .notif-dot { display: block; }

.notif-dot {
  display: none;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  flex-shrink: 0; margin-top: 6px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px; font-weight: 600; color: var(--text,#1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
}
.notif-content {
  font-size: 12px; color: var(--text-2,#555); line-height: 1.5; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-meta {
  font-size: 11px; color: var(--text-3,#999); margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
}
.notif-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; line-height: 1.4;
}
.notif-badge--notice { background: var(--brand-soft); color: var(--brand); }
.notif-badge--message { background: var(--ok-soft); color: var(--ok); }
.notif-read-btn {
  border: none; background: none; cursor: pointer; font-size: 11px;
  color: var(--brand,#2f6feb); padding: 2px 6px; border-radius: 4px;
  transition: background .15s; flex-shrink: 0; align-self: center;
}
.notif-read-btn:hover { background: var(--brand-soft,#eef2ff); }

/* 页脚"联系我们"链接 hover */
.foot-contact { transition: color .15s; }
.foot-contact:hover { color: var(--brand,#2f6feb) !important; }

/* 联系我们弹窗内邮箱区块 */
.contact-email { display: flex; align-items: center; flex-wrap: wrap; }
@media (max-width: 480px) {
  .contact-email { flex-direction: column; align-items: flex-start; gap: 8px; }
  .contact-email .btn { width: 100%; }
}

/* ============================================================================
 * [2026-09-20] 登录页升级：滑块验证码 + 绑定引导弹窗 + 设备管理
 * ========================================================================== */
.cap-box{margin:12px 0;padding:10px;border:1px solid var(--line,#e3e6ea);border-radius:10px;background:var(--bg-soft,#f8fafc)}
.cap-box.is-disabled{opacity:.5;pointer-events:none}
.cap-head{font-size:12px;color:var(--muted,#6b7280);margin-bottom:8px}
.cap-stage{position:relative;height:90px;background:linear-gradient(135deg,#eef2f7,#dfe7f0);border-radius:8px;overflow:hidden;margin-bottom:8px}
.cap-slot{position:absolute;width:42px;height:42px;background:rgba(0,0,0,.18);border-radius:6px}
.cap-piece{position:absolute;width:42px;height:42px;background:#3b82f6;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.cap-track{position:relative;height:38px;background:#e8edf3;border-radius:19px;overflow:hidden}
.cap-fill{position:absolute;left:0;top:0;height:100%;width:0;background:rgba(59,130,246,.25)}
.cap-handle{position:absolute;left:0;top:0;width:38px;height:38px;line-height:38px;text-align:center;background:#3b82f6;color:#fff;border-radius:19px;cursor:grab;user-select:none;font-weight:700}
.cap-box.is-ok .cap-handle{background:#16a34a}
.cap-box.is-ok .cap-head{color:#16a34a;font-weight:600}

/* 绑定引导弹窗 */
.bind-mask{position:fixed;inset:0;z-index:var(--z-max);background:rgba(15,23,42,.5);display:flex;align-items:center;justify-content:center;padding:20px}
.bind-card{background:#fff;border-radius:14px;padding:22px;max-width:460px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.bind-card h3{margin:0 0 8px;font-size:18px}
.bind-row{display:flex;gap:8px;align-items:center;margin:8px 0}
.bind-row .input{flex:1;min-width:0}
.bind-lb{flex:none;width:42px;font-size:13px;color:var(--muted,#6b7280)}
.bind-msg{min-height:18px;font-size:13px;margin:6px 0}
.bind-msg.is-ok{color:#16a34a}
.bind-msg.is-err{color:#dc2626}
.bind-foot{display:flex;justify-content:flex-end;margin-top:10px}

/* 登录页字段内小工具条 */
#chanTabs{margin:10px 0}
#codeArea > div.field{display:flex;gap:8px;align-items:flex-end}   /* 【2026-09-21 修复】限定只作用于验证码输入行，避免把嵌套的邮箱 label.field 压成竖排 */
EOF
echo "✓ CSS appended" && tail -5 assets/css/layout.css | head -2
