/* ═══════════════════════════════════════════════════════════
   全站公共壳样式 — 侧边栏 / 顶部导航 / 固定页脚 / 回到顶部
   来源:Newhtmlindex/css/styles.css 拆分重建,适配 Laravel 布局
   设计规格(1440 桌面):侧栏 240px / 顶栏 56px / 底栏 32px
   加载顺序:common.css → shell.css → 页面样式(@stack styles)
   注:全局字号不在 body 上设置(旧页面按 16px 基准设计),
       壳组件字号均在组件内部自带。
   ═══════════════════════════════════════════════════════════ */

/* ---------- Design Tokens ---------- */
:root {
  /* 品牌色 */
  --color-accent: #FF0000;          /* 主强调色(按钮/高亮) */
  --color-fire: #FF0000;            /* 推荐火焰色 */
  --color-vip: #FFBE7C;             /* 会员描边金 */
  --color-dark-btn: #0F0F0F;        /* 深色按钮(分页选中/次级Tab选中) */

  /* 中性色 */
  --text-1: rgba(0, 0, 0, 0.9);     /* 主文字 */
  --text-2: rgba(0, 0, 0, 0.7);     /* 次文字 */
  --text-3: rgba(0, 0, 0, 0.5);     /* 弱文字 */
  --text-footer: #555555;
  --bg-surface: rgba(0, 0, 0, 0.03);/* 卡片/封面底 */
  --bg-hover: rgba(0, 0, 0, 0.05);  /* 悬停底 */
  --bg-badge: rgba(255, 255, 255, 0.7); /* 封面角标底 */

  /* 布局 */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 56px;
  --topnav-h: 56px;
  --footer-h: 32px;
  --content-pad: 30px;
  --grid-gap: 20px;

  /* 圆角 */
  --radius-card: 10px;
  --radius-promo: 16px;
  --radius-pill: 8px;
  --radius-btn: 10px;

  /* 字体 */
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ---------- 全站链接色:去掉浏览器默认蓝,未显式设色的链接继承文字色 ---------- */
a { color: inherit; }

/* ---------- 壳内浏览器默认样式 reset(零特异性 :where,不覆盖组件与旧页面样式) ---------- */
:where(.sidebar, .topnav, .footer) :where(a) { text-decoration: none; }
:where(.sidebar, .topnav, .footer) :where(button) {
  font-family: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

/* ---------- 壳内 hidden 兜底(收窄作用域,不影响旧页面) ---------- */
#backTop[hidden], #menuBackdrop[hidden] { display: none !important; }

/* ---------- body:字体族对齐新设计(背景/文字色仍由 common.css 的 light-mode 体系负责) ---------- */
body {
  font-family: var(--font-sans);
  background: #fff;
}

/* ═══════════ 侧边栏 ═══════════ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}
.sidebar__header {
  height: var(--topnav-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}
.sidebar__logo { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--text-1); }
.sidebar__logo-img { width: 32px; height: 32px; object-fit: contain; display: block; border-radius: 8px; }
.sidebar__logo-lockup { flex: none; display: block; }
.sidebar__logo-lockup text { font-family: var(--font-sans); }
.sidebar__collapse {
  flex: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.sidebar__collapse:hover { background: var(--bg-hover); color: var(--text-1); }

.sidebar__menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px 16px;
  /* 隐藏滚动条(原站为无感滚动) */
  scrollbar-width: none;
}
.sidebar__menu::-webkit-scrollbar { display: none; }
.sidebar__group { margin-top: 14px; }
.sidebar__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  width: 100%;
  font-size: 14px;
}
.sidebar__item:hover { background: var(--bg-hover); }
.sidebar__item.is-active { color: var(--color-accent); font-weight: 500; }
.sidebar__item .icon { flex: none; width: 18px; height: 18px; color: inherit; }
.sidebar__item .arrow { margin-left: auto; color: var(--text-3); transition: transform .2s; }
.sidebar__group.is-open .arrow { transform: rotate(180deg); }
.sidebar__badge {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}
.sidebar__badge--count { background: var(--color-dark-btn); }
.sidebar__flyout { display: none; position: relative; padding: 2px 0 4px 30px; }
.sidebar__group.is-open .sidebar__flyout { display: block; }
/* 子菜单左侧灰色细引导线 */
.sidebar__flyout::before {
  content: "";
  position: absolute;
  left: 14px; top: 6px; bottom: 8px;
  width: 1px;
  background: rgba(0, 0, 0, 0.09);
}
.sidebar__flyout-item {
  position: relative;
  display: flex; align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  white-space: nowrap;
  font-size: 14px;
}
.sidebar__flyout-item:hover { background: var(--bg-hover); color: var(--text-1); }
.sidebar__flyout-item.is-active { color: var(--color-accent); font-weight: 500; }
/* 激活项:引导线上叠加红色粗竖条 */
.sidebar__flyout-item.is-active::before {
  content: "";
  position: absolute;
  left: -18px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  border-radius: 2px;
  background: var(--color-accent);
}

/* 移动端抽屉底部:会员/登录/联系入口(沿用旧头部元素 id,由 /member/session 驱动) */
.sidebar__foot {
  display: none;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.sidebar__foot-btn {
  display: flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--text-1);
  font-size: 14px;
  white-space: nowrap;
}
.sidebar__foot-btn:hover { background: var(--bg-hover); }
.sidebar__foot-btn svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }

/* 收起态:56px 图标栏,点击顶部按钮恢复展开 */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar__logo-lockup,
body.sidebar-collapsed .sidebar__item span,
body.sidebar-collapsed .sidebar__badge { display: none; }
body.sidebar-collapsed .sidebar__item .arrow { display: none; }
body.sidebar-collapsed .sidebar__flyout,
body.sidebar-collapsed .sidebar__group.is-open .sidebar__flyout { display: none !important; }
body.sidebar-collapsed .sidebar__header {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 12px 0 10px;
  gap: 10px;
}
body.sidebar-collapsed .sidebar__logo { display: flex; justify-content: center; }   /* 窄轨显示 S 图标 */
body.sidebar-collapsed .sidebar__collapse { display: flex; }
body.sidebar-collapsed .sidebar__menu { padding: 4px 8px 16px; }
body.sidebar-collapsed .sidebar__item { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar__item.is-active { background: var(--bg-hover); }

/* ═══════════ 主区域 ═══════════ */
.page {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}
body.sidebar-collapsed .page { margin-left: var(--sidebar-w-collapsed); }

/* ---------- 顶部导航 ---------- */
.topnav {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topnav-h);
  background: #fff;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--content-pad);
  transition: left 0.2s ease;
}
body.sidebar-collapsed .topnav { left: var(--sidebar-w-collapsed); }
.topnav__search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-btn);
  background: var(--bg-surface);
}
.topnav__search:focus-within { background: var(--bg-hover); outline: 1px solid rgba(0,0,0,.08); }
.topnav__search-input {
  flex: 1;
  border: 0; outline: 0; background: none;
  font: inherit; color: var(--text-1);
}
.topnav__search-input::placeholder { color: var(--text-3); }
.topnav__search-submit {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #888;
}
.topnav__search-submit:hover { color: var(--text-1); background: rgba(0,0,0,.06); }
.topnav__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* 游客链接容器:内容提升为顶栏 flex 项,登录后由 JS 整组隐藏 */
.topnav__guest { display: contents; }
.topnav__login {
  display: flex; align-items: center;
  height: 36px; padding: 2px 12px;
  border-radius: var(--radius-btn);
  color: #191919;
}
.topnav__login:hover { background: var(--bg-hover); }
.topnav__register {
  display: flex; align-items: center;
  height: 36px; padding: 2px 12px;
  border-radius: var(--radius-btn);
  background: var(--color-accent);
  color: #fff; font-weight: 500;
}
.topnav__register:hover { filter: brightness(1.05); }
/* 联系入口(沿用留言弹窗,hideContact 页面不渲染):金色高亮款 */
.topnav__contact {
  display: flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 14px;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #FFD34D 0%, #F5A623 100%);
  color: #4a2e00;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.35);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.topnav__contact:hover {
  background: linear-gradient(135deg, #FFDD66 0%, #FFB020 100%);
  color: #3d2400;
  box-shadow: 0 3px 12px rgba(245, 166, 35, 0.5);
  transform: translateY(-1px);
}
.topnav__contact svg { width: 16px; height: 16px; }

/* 会员区(登录后由 /member/session 显示;元素 id 与旧头部一致,复用 common.js) */
.topnav__member { position: relative; }
.topnav__member-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 2px 10px 2px 4px;
  border-radius: var(--radius-btn);
  color: #191919;
}
.topnav__member-btn:hover { background: var(--bg-hover); }
.topnav__member-avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-dark-btn);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.topnav__member-avatar svg { width: 15px; height: 15px; }
.topnav__member-name {
  max-width: 96px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px;
}
.topnav__member-arrow { color: var(--text-3); transition: transform .2s; }
.topnav__member-btn.is-open .topnav__member-arrow { transform: rotate(180deg); }
.topnav__dropdown {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  z-index: 1002;
}
.topnav__dropdown.show { display: block; }
.topnav__dropdown a,
.topnav__dropdown button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
  white-space: nowrap;
}
.topnav__dropdown a:hover,
.topnav__dropdown button:hover { background: var(--bg-hover); color: var(--text-1); }
.topnav__dropdown svg { width: 15px; height: 15px; flex: none; }
.topnav__dropdown-badge {
  margin-left: auto;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 700;
  text-align: center;
}

/* 汉堡按钮:仅移动端显示 */
.topnav__hamburger {
  display: none;
  flex: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  align-items: center; justify-content: center;
  color: var(--text-1);
}
.topnav__hamburger:hover { background: var(--bg-hover); }

/* 抽屉遮罩(移动端) */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1003;
}

/* ---------- 内容区 ---------- */
.content {
  padding: calc(var(--topnav-h) + 20px) var(--content-pad) calc(var(--footer-h) + 40px);
}
/* 全屏幻灯片类页面(软件详情 detail-presentation)不受左右留白限制,铺满内容区;
   页内的面包屑/预览条自行补回左右留白 */
.content:has(> .detail-presentation) {
  padding-left: 0;
  padding-right: 0;
}
.content:has(> .detail-presentation) > .breadcrumb,
.content:has(> .detail-presentation) > .software-preview-banner {
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
}

/* ═══════════ 页脚(固定底栏) ═══════════ */
.footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--footer-h);
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-pad);
  font-size: 12px;
  color: var(--text-footer);
}
.footer__left, .footer__right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.footer__right .footer__item + .footer__item::before { content: "|"; margin-right: 16px; color: rgba(0, 0, 0, 0.25); }
.footer__item { display: inline-flex; align-items: center; gap: 2px; color: var(--text-footer); white-space: nowrap; }
.footer__item:hover { color: var(--text-1); }

/* ---------- 面包屑导航(全站内页统一;滚动时吸附在顶栏下方) ---------- */
.breadcrumb {
  position: sticky;
  top: var(--topnav-h);
  z-index: 800;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-3);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 0;
  margin-bottom: 16px;
  min-width: 0;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb__link { color: var(--text-3); transition: color .2s; }
.breadcrumb__link:hover { color: var(--color-accent); }
.breadcrumb__current {
  color: var(--text-1);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.breadcrumb__sep { color: rgba(0, 0, 0, 0.22); user-select: none; }
/* 工具栏行内使用时去掉组件自带下边距,保持与右侧控件垂直居中 */
.toolbar-breadcrumb .breadcrumb { margin-bottom: 0; }

/* ═══════════ 全站通用:信息流卡片网格与分页(首页/软件列表共用) ═══════════ */
/* 卡片区链接去浏览器默认下划线(零特异性,不覆盖其他样式) */
:where(.feed) :where(a) { text-decoration: none; }
/* ═══════════ 信息流 ═══════════ */
.feed { margin-top: 4px; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 桌面固定 4 列,大屏卡片更大 */
  gap: var(--grid-gap);
}

/* ---------- 作品卡片:图片顶格 16:9,上圆角下直角 ---------- */
.work-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  overflow: hidden;
  cursor: pointer;
}
.work-card__cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-surface);
  aspect-ratio: 16 / 9;
}
.work-card__cover img { width: 100%; height: 100%; object-fit: cover; }
/* 无图封面:渐变底 + 首字 */
.work-card__cover-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}
/* 封面右上角日历日期角标:上大字日,下小字月 */
.work-card__date {
  position: absolute;
  right: 10px; top: 10px;
  width: 36px;
  padding: 5px 0 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
}
.work-card__date b { font-size: 16px; font-weight: 700; color: var(--text-1); }
.work-card__date i {
  font-style: normal;
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);   /* 日/月之间的浅色分隔线 */
  width: calc(100% - 12px);
  text-align: center;
}
/* 封面左上角类型标记(视频/文章/作品) */
.work-card__media-tag {
  position: absolute;
  left: 8px; top: 8px;
  display: flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-badge);
  backdrop-filter: blur(2px);
  font-size: 12px;
  color: var(--text-1);
}
.work-card__title {
  padding: 10px 12px 0;
  font-size: 14px; font-weight: 500;
  line-height: 18px;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-card__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px 12px;
}
.work-card__author { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); }
.work-card__author:hover { color: var(--text-1); }
.work-card__avatar { flex: none; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
/* 无头像:首字圆形兜底 */
.work-card__avatar--ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: var(--color-dark-btn);
}
.work-card__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.like-btn {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  height: 16px;
  color: var(--text-2);
  font-size: 12px;
}
.like-btn svg { width: 16px; height: 16px; }
.like-btn:hover { color: var(--color-accent); }
.like-btn.is-liked { color: var(--color-accent); }

/* ---------- 广告/专题卡片(与作品卡片同构) ---------- */
.ad-card {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.ad-card__cover { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-surface); }
.ad-card__image { width: 100%; height: 100%; object-fit: cover; }
.ad-card__body { padding: 10px 12px 12px; }
.ad-card__title { font-size: 14px; font-weight: 500; color: var(--text-1); line-height: 18px; }
.ad-card__subtitle { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* ---------- 卡片悬停:微浮起 + 封面缓放 + 标题点亮 ---------- */
/* 仅精确指针设备生效,避免触屏点按后悬停态残留 */
.work-card, .ad-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.work-card__cover img, .ad-card__image { transition: transform 0.45s ease; }
.work-card__title, .ad-card__title { transition: color 0.2s ease; }
@media (hover: hover) and (pointer: fine) {
  .work-card:hover, .ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 15, 15, 0.12);
  }
  .work-card:hover .work-card__cover img,
  .ad-card:hover .ad-card__image { transform: scale(1.06); }
  .work-card:hover .work-card__title,
  .ad-card:hover .ad-card__title { color: var(--color-accent); }
}
@media (prefers-reduced-motion: reduce) {
  .work-card, .ad-card, .work-card__cover img, .ad-card__image { transition: none; }
  .work-card:hover, .ad-card:hover { transform: none; box-shadow: none; }
  .work-card:hover .work-card__cover img,
  .ad-card:hover .ad-card__image { transform: none; }
}

/* ---------- 空状态 / 查看更多 ---------- */
.feed-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--text-3);
}
.feed-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-2);
}
.feed-more:hover { color: var(--color-accent); }
.feed-more svg { width: 16px; height: 16px; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex; align-items: center; gap: 8px;
  margin-top: 32px;
  font-size: 14px;
  justify-content: center;
}
.pagination__item {
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.pagination__item:hover:not(:disabled):not(.is-current) { background: var(--bg-hover); color: var(--text-1); }
.pagination__item.is-current { background: var(--color-dark-btn); color: #fff; font-weight: 500; }
.pagination__item:disabled { color: rgba(0,0,0,.25); cursor: default; }
.pagination__ellipsis { color: var(--text-3); padding: 0 2px; }


/* ---------- 卡片网格响应式(与 .work-grid 配套) ---------- */
@media (max-width: 1200px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 24px; bottom: 48px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  z-index: 1002;
}
.back-top:hover { color: var(--text-1); }

/* ═══════════ 响应式(壳部分) ═══════════ */
@media (max-width: 768px) {
  :root { --content-pad: 16px; }

  /* —— 侧栏改为汉堡抽屉(默认藏于屏外) —— */
  .sidebar,
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-w);
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform .28s ease;
  }
  body.menu-open .sidebar,
  body.menu-open.sidebar-collapsed .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
    z-index: 1004;              /* 抽屉盖过顶栏与遮罩 */
  }
  body.menu-open { overflow: hidden; }
  .sidebar__header, body.sidebar-collapsed .sidebar__header { justify-content: space-between; padding: 12px 16px; }
  .sidebar__logo, body.sidebar-collapsed .sidebar__logo { display: flex; }
  .sidebar__collapse { display: none !important; }
  .sidebar__menu, body.sidebar-collapsed .sidebar__menu { padding: 4px 16px 8px; }
  .sidebar__item, body.sidebar-collapsed .sidebar__item { justify-content: flex-start; padding: 0 12px; }
  .sidebar__logo-lockup, body.sidebar-collapsed .sidebar__logo-lockup { display: block; }
  .sidebar__item span, body.sidebar-collapsed .sidebar__item span { display: inline; }
  /* 抽屉内恢复二级菜单与手风琴(覆盖桌面收起态的 display:none !important):
     会员中心/登录等自动收起页在手机上打开抽屉时,二级菜单同样可用 */
  body.sidebar-collapsed .sidebar__group:not(.is-open) .sidebar__flyout { display: none !important; }
  body.sidebar-collapsed .sidebar__group.is-open .sidebar__flyout { display: block !important; }
  body.sidebar-collapsed .sidebar__item .arrow { display: inline-flex; }
  body.sidebar-collapsed .sidebar__badge { display: inline-flex; }
  .sidebar__foot { display: flex; flex-direction: column; gap: 4px; }
  .topnav__hamburger { display: flex; }
  .page, body.sidebar-collapsed .page { margin-left: 0; }
  .topnav, body.sidebar-collapsed .topnav { left: 0; }

  /* —— 搜索收成图标,点击展开为顶栏下方搜索条 —— */
  .topnav { gap: 8px; }
  .topnav__search { flex: none; height: 40px; max-width: none; padding: 0; background: none; }
  .topnav__search-input { display: none; }
  .topnav__search-submit { width: 38px; height: 38px; border-radius: 50%; }
  .topnav__search-submit:hover { background: var(--bg-hover); }
  .topnav.search-open .topnav__search {
    position: absolute;
    left: 12px; right: 12px;
    top: calc(100% + 8px);
    height: 42px;
    padding: 0 12px;
    background: var(--bg-surface);
    z-index: 20;
  }
  .topnav.search-open .topnav__search-input { display: block; flex: 1; }

  /* 顶栏动作区精简 */
  .topnav__contact { height: 36px; padding: 0 10px; font-size: 13px; }
  .topnav__member-name { display: none; }

  /* —— 页脚:改为常规流式布局,链接换行居中 —— */
  .footer {
    position: static;
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 20px;
  }
  .footer__left, .footer__right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
  }
  .content { padding-bottom: 40px; }
}
@media (max-width: 480px) {
  .topnav__contact { display: none; }   /* 窄屏联系入口收进抽屉 */
  .topnav__login { display: none; }     /* 窄屏仅留注册主按钮 + 抽屉内登录 */
}
