/* 全站左侧导航组件（配 /js/site-nav.js + /_partials/site-nav.html）。
   首页有 #navBurger → host 模式不注入 DOM；其它页注入 .sn-* 左栏 + 汉堡 + 全屏弹窗。
   .sn-* 命名空间与既有页面样式隔离；z-index：浮窗20 < 左栏30 < 弹窗40 < 汉堡45 < 分享层50。 */

/* 桌面左栏 */
/* 【新增】全站导航宽度唯一源：导航宽度与内容让位都引用它，杜绝断点错位遮挡 */
:root { --nav-w: 200px; }
/* body.sn-has-nav { padding:0 0 0 200px; } */

.sn-nav-col {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: var(--nav-w, 200px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px; 
  background: var(--card, #fff);
  box-sizing: border-box;
}
/* 左栏 logo / 菜单与首页 .nav-col 视觉对齐（菜单「跟首页一致」） */
.sn-logo { padding: 20px 0 0 14px; margin-bottom: 30px;  }
/* 新增 aspect-ratio 占位：图片加载前就预留 470:164 的高度（120px 宽 → 约 42px 高），
   避免刷新时 logo 从 0 高度撑开、把整条左栏菜单往下顶造成跳闪。 */
.sn-logo img { display: block; width: 120px; height: auto; aspect-ratio: 470 / 164; }
.sn-list {
  border-top: 1px solid rgba(0, 0, 0, .08);
  flex: 1 1 auto;
  display: flex;
  gap:12px;
  flex-direction: column;
  margin: 0;
  padding: 30px 0 0 0;
  list-style: none;
}
.sn-item { display: block; width: 100%; line-height: 46px; }
.sn-item:last-child { margin-bottom: 0; }
.sn-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 18px;
  box-sizing: border-box;
  white-space: nowrap;
  font-size: 18px;
  color: var(--ink, #333);
  text-decoration: none;
  border-radius: 99px;
  padding: 0 14px;             /* 与首页 .nav-col ul li a 一致 */
}
.sn-link:hover { background: rgba(0, 0, 0, .06); }
.sn-link i{ color: var(--accent); font-style: normal;}
.sn-link i.ico-user{ width: 28px; color: var(--card);}
.sn-item.is-active .sn-link { background: rgba(0, 0, 0, .05); }
.sn-item.sn-blue .sn-link {
  margin-top: 60px;
  color: var(--card, #fff);
  background: var(--accent, #1080ff);
}
.sn-item.sn-blue .sn-link:hover { color: var(--card, #fff); }
.sn-ico { width: 28px; flex-shrink: 0; }
.sn-footer {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted, #888);
  margin-bottom: 26px;
}
.sn-footer a { color: var(--accent); }

/* 移动端汉堡 */
.sn-burger {
  display: none;
  position: fixed;
  top: 18px;
  right: 8px;
  z-index: 45;
  width: 50px;
  height: 46px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.sn-burger-bar {
  display: block;
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink, #000);
  transition: transform .2s ease, opacity .2s ease;
}
.sn-burger[aria-expanded="true"] .sn-burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sn-burger[aria-expanded="true"] .sn-burger-bar:nth-child(2) { opacity: 0; }
.sn-burger[aria-expanded="true"] .sn-burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端全屏弹窗 */
.sn-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--card, #fff);
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  animation: snOverlayIn .3s ease both;
}
.sn-modal-card {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px 32px;
  background: transparent;
  box-shadow: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  animation: snCardIn .3s cubic-bezier(.22, .61, .36, 1) both;
}
.sn-modal-logo { margin-bottom: 26px; }
.sn-modal-logo img { width: 132px; max-width: 100%; height: auto; }
.sn-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sn-modal-list .sn-item { margin: 0; opacity: 0; transform: translateY(16px); animation: snItemIn .42s cubic-bezier(.22, .61, .36, 1) forwards; }
.sn-modal-list .sn-item:nth-child(1) { animation-delay: .05s; }
.sn-modal-list .sn-item:nth-child(2) { animation-delay: .11s; }
.sn-modal-list .sn-item:nth-child(3) { animation-delay: .17s; }
.sn-modal-list .sn-item:nth-child(4) { animation-delay: .23s; }
.sn-modal-list .sn-item:nth-child(5) { animation-delay: .29s; }
.sn-modal-list .sn-link {
  height: 60px;
  gap: 14px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 20px;
  background: rgba(0, 0, 0, .04);
}
.sn-modal-list .sn-link:hover { background: rgba(0, 0, 0, .07); color: var(--accent, #1080ff); }
.sn-modal-list .sn-item.sn-blue .sn-link { margin-top: 0; color: var(--card, #fff); background: var(--accent, #1080ff); }
.sn-modal-list .sn-item.sn-blue .sn-link:hover { color: var(--card, #fff); }

@keyframes snOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes snCardIn { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: translateX(0); } }
@keyframes snItemIn { to { opacity: 1; transform: translateY(0); } }

.sn-modal.sn-closing { animation: snOverlayOut .26s ease forwards; }
.sn-modal.sn-closing .sn-modal-card { animation: snCardOut .26s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes snOverlayOut { to { opacity: 0; } }
@keyframes snCardOut { to { opacity: 0; transform: translateX(36px); } }

@media (prefers-reduced-motion: reduce) {
  .sn-modal, .sn-modal .sn-modal-card,
  .sn-modal.sn-closing, .sn-modal.sn-closing .sn-modal-card { animation: none !important; }
  .sn-modal-list .sn-item { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ≤900px：隐藏左栏，启用汉堡 */
@media (max-width: 900px) {
  body.sn-has-nav { padding-left: 0; padding-top: 20px; }
  .sn-nav-col { display: none; }
  .sn-burger { display: flex; }
}

/* 注入页：左栏空间已由 body.sn-has-nav 同步预留（site-nav.js 在拉取片段前添加），
   此处仅让导航淡入，避免「硬弹出」造成的闪烁。首页为 host 模式、body 无 sn-has-nav，
   故首页静态左栏不受此动画影响。 */
.sn-has-nav .sn-nav-col { animation: snNavIn .22s ease both; }
@keyframes snNavIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sn-has-nav .sn-nav-col { animation: none !important; }
}

/* ===== 底部附加项：更多 / 关于我们（占位，贴齐容器底部）=====
   .sn-nav-col / .sn-modal-card / #navModal .nav-modal-card 均为 flex column，
   .sn-list 已 flex:1 会顶开剩余空间；footer 再加 margin-top:auto 双保险贴底。 */
.sn-foot-list {
  list-style: none;
  margin: auto 0 30px 0;
  padding: 18px 0 0 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.sn-foot-list .sn-item { margin-bottom: 8px; line-height: 40px; }
.sn-foot-list .sn-item:last-child { margin-bottom: 0; }
.sn-foot-list .sn-link { height: 40px; font-size: 16px; color: var(--muted, #888); }
.sn-foot-list .sn-foot-link:hover { background: rgba(0, 0, 0, .06); color: var(--accent, #1080ff); }

/* 注入页弹窗底部项 */
.sn-modal-foot-list {
  list-style: none;
  margin: auto 0 0 0;
  padding: 18px 0 0 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sn-modal-foot-list .sn-item { margin: 0; opacity: 1; transform: none; animation: none; }
.sn-modal-foot-list .sn-link {
  height: 56px;
  gap: 14px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 18px;
  color: var(--muted, #888);
  background: rgba(0, 0, 0, .04);
}
.sn-modal-foot-list .sn-link:hover { background: rgba(0, 0, 0, .07); color: var(--accent, #1080ff); }

/* 首页 host 弹窗底部项（index.css 里为主菜单定义的 .nav-modal-list 选择器不会命中这里，用 id 提高优先级） */
#navModal .nav-modal-foot-list {
  list-style: none;
  margin: auto 0 0 0;
  padding: 18px 0 0 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#navModal .nav-modal-foot-list li { margin: 0; opacity: 1; transform: none; animation: none; }
#navModal .nav-modal-foot-list li a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 18px;
  color: var(--muted, #888);
  text-decoration: none;
  background: rgba(255, 255, 255, .8);
}
#navModal .nav-modal-foot-list li a:hover { background: rgba(0, 0, 0, .07); color: var(--accent, #1080ff); }
#navModal .nav-modal-foot-list li svg, #navModal .nav-modal-foot-list li .ico { flex-shrink: 0; }

/* 底部附加项 hover 浅灰背景缓慢淡入：鼠标经过「更多 / 关于我们」时，
   浅灰底色（及高亮字色）柔和浮现而非瞬跳。纯新增过渡，不改上面任何规则。 */
.sn-foot-list .sn-link,
.sn-modal-foot-list .sn-link,
#navModal .nav-modal-foot-list li a {
  transition: background-color .55s ease, color .55s ease;
}

@media (max-width: 900px) {
  .sn-modal-foot-list .sn-link, #navModal .nav-modal-foot-list li a { background: rgba(0, 0, 0, .04); }
}

/* ===== 「我的收藏」入口：仅会员登录后显示 =====
   入口 <li> 统一带 .sn-member-only，登录态由 site-nav.js 同步到 body.is-member。
   未登录隐藏，登录后 display:block（在 flex 列容器里作为普通 flex item，布局不变）。 */
.sn-member-only { display: none !important; }
body.is-member .sn-member-only { display: block !important; }

/* 人工评画入口：只跟后台总开关走，所有访客可见（site-nav.js 打 body.sn-mr-on），不再判断代理/管理员令牌 */
.sn-manual-review { display: none !important; }
body.sn-mr-on .sn-manual-review { display: block !important; }

/* 评画工作台入口：仅老师（代理令牌）/管理员可见，site-nav.js 校验后置 body.is-teacher。
   普通访客默认隐藏；校验通过才显示（display:block，在 flex 列容器里作普通 item）。 */
.sn-teacher-only { display: none !important; }
body.is-teacher .sn-teacher-only { display: block !important; }

/* 已确认是会员时，登录入口一律不显示（第161轮）。
   不用 !important：退出登录时 login.js / index.member.js 会把 inline display 还原，
   inline 优先级高于本规则，能立即重新露出「登录」。
   目的：刷新页面时若本地有令牌，登录按钮不会先显一下再消失（尤其是动态注入的
   .sn-list 片段晚于 is-member 落地时，插入即隐藏，不会闪）。 */
body.is-member li[data-sn-key="login"],
body.is-member #topbarActions,
body.is-member #navLoginItem { display: none; }

/* ===== 蓝色 ART 悬浮装饰按钮（全站前端页统一显示）=====
   首页由 index.html + index.css 提供；非首页由 site-nav.js 注入同款 .btn-art。
   样式与首页保持一致（右侧固定、顶部 100px、宽 60px、刷新从右滑入）。 */
.btn-art{
  position: fixed;
  right: 0;
  top: 100px;
  width: 60px;
  z-index: 49;
  transform: translateX(130%);
  animation: btnArtSlideIn .55s cubic-bezier(.22,.61,.36,1) .12s both;
}
.btn-art img{ width: 100%; }
@media (max-width: 600px) {
  .btn-art{
    width: 40px;
  }
}
@keyframes btnArtSlideIn{
  from{ transform: translateX(130%); opacity: 0; }
  to  { transform: translateX(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce){
  .btn-art{ animation: none; transform: none; }
}
.btn-art.is-hidden { display: none !important; }

/* ===== 会员个人资料（修改昵称） =====
   入口 .mp-edit 由 member-profile.js 动态插入 #topbarUser（昵称后），
   弹窗 .mp-mask/.mp-card 同脚本注入；沿用站点 CSS 变量，暗色/浅色都适配。 */
.mp-edit{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: 5px;
  padding: 0;
  border-radius: 50%;
  color: var(--accent, #1080ff);
  border: 1px solid rgba(16,128,255,.35);
  text-decoration: none;
  vertical-align: middle;
  transition: background-color .2s ease;
}
.mp-edit:hover{ background: rgba(16,128,255,.08); }
/* 侧栏会员行不换行：昵称过长省略，头像/编辑/退出始终在一行 */
.sn-list #topbarUser{ white-space: nowrap; }
.sn-list #topbarUser #memberName{
  display: inline-block; max-width: 56px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}

.mp-mask{
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(20,20,20,.45);
}
.mp-card{
  width: 100%; max-width: 380px;
  background: var(--card, #fff);
  color: var(--ink, #222);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.mp-title{ margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.mp-label{ display: block; font-size: 13px; color: var(--muted, #888); margin-bottom: 8px; }
.mp-input{
  width: 100%; box-sizing: border-box;
  height: 42px; padding: 0 12px;
  font-size: 15px; color: var(--ink, #222);
  background: #fff;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 10px;
  outline: none;
}
.mp-input:focus{ border-color: var(--accent, #1080ff); box-shadow: 0 0 0 3px rgba(16,128,255,.15); }
/* index.css 里 input[type=text]{text-transform:uppercase;...} 是给评画码用的，
   昵称会被显示成大写 + 等宽字体；用 .mp-card .mp-input 提高优先级还原。 */
.mp-card .mp-input{ text-transform: none; letter-spacing: normal; font-family: inherit; }
.mp-hint{ min-height: 20px; margin-top: 8px; font-size: 12px; color: var(--muted, #888); }
.mp-hint.mp-err{ color: #d93025; }
.mp-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.mp-btn{
  height: 38px; padding: 0 18px; font-size: 14px;
  border-radius: 9px; cursor: pointer; border: none;
}
.mp-cancel{ background: rgba(0,0,0,.06); color: var(--ink, #222); }
.mp-save{ background: var(--accent, #1080ff); color: #fff; }
.mp-save:disabled{ opacity: .6; cursor: default; }

.mp-toast{
  position: fixed; right: 24px; bottom: 28px; z-index: 2100;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(28,28,28,.92); color: #fff; font-size: 13px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.mp-toast.show{ opacity: 1; transform: none; }

/* 头像行：预览 + 更换/恢复默认 */
.mp-avatar-wrap{
  padding: 2px 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.mp-avatar{
  display: flex; align-items: center; gap: 14px;
}
.mp-avatar-img{
  width: 64px; height: 64px; flex: 0 0 64px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0,0,0,.05);
  display: block;
}
.mp-avatar-ops{ min-width: 0; }
.mp-avatar-name{ font-size: 13px; color: var(--muted, #888); margin-bottom: 6px; }
.mp-avatar-btns{ display: flex; gap: 8px; flex-wrap: wrap; }
.mp-mini{
  height: 30px; padding: 0 12px; font-size: 13px;
  border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(16,128,255,.35);
  background: rgba(16,128,255,.08);
  color: var(--accent, #1080ff);
  white-space: nowrap;
}
.mp-mini:hover{ background: rgba(16,128,255,.14); }
.mp-mini:disabled{ opacity: .55; cursor: default; }
.mp-mini-ghost{
  border-color: rgba(0,0,0,.16);
  background: rgba(0,0,0,.04);
  color: var(--ink, #222);
}
.mp-mini-ghost:hover{ background: rgba(0,0,0,.08); }
.mp-avatar-tip{ margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--muted, #888); }

/* ===== 导航高亮胶囊（第162轮）：跨页面「滑」到当前项 =====
   site-nav.js 在 .sn-list 里插入一个绝对定位的 <li class="sn-pill">，
   从上一页的菜单项平滑过渡到当前项 → 切页时浅灰底是滑过去的，不是瞬移。
   绝对定位的 flex 子项不占位、不参与 gap，所以不影响菜单排布。 */
.sn-list { position: relative; }
.sn-item { position: relative; z-index: 1; }
.sn-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border-radius: 99px;
  background: rgba(0, 0, 0, .05);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition:
    top .32s cubic-bezier(.34, .08, .22, 1),
    left .32s cubic-bezier(.34, .08, .22, 1),
    width .32s cubic-bezier(.34, .08, .22, 1),
    height .32s cubic-bezier(.34, .08, .22, 1),
    opacity .18s ease;
}
/* 首次落位 / 重算位置时关掉过渡，避免从 0,0 滑过来 */
.sn-pill.sn-pill-notrans { transition: none; }
/* 有胶囊时，当前项自己的底色让位给胶囊，不然两层叠加颜色会更深 */
.sn-list.sn-has-pill .sn-item.is-active .sn-link { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .sn-pill { transition: none; }
}

/* ===== 会员入口「我」+「更多」面板（第161轮，对齐小红书） =====
   原来侧栏是一整行「头像 昵称 ✏️ 退出」，现在只留「头像 + 我」，
   退出登录收进「更多」面板；#topbarUser / #logoutBtn 等 id 全部保留，
   login.js / index.member.js 的显隐与退出逻辑不受影响。 */
#topbarUser.sn-me{
  display: none;                 /* 登录后由 JS 置 inline flex；退出时 JS 置 none */
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 99px;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink, #333);
  white-space: nowrap;
  user-select: none;
  transition: background-color .2s ease;
}
#topbarUser.sn-me:hover{ background: rgba(0,0,0,.06); }
#topbarUser.sn-me:focus-visible{ outline: 2px solid var(--accent, #1080ff); outline-offset: 2px; }
#topbarUser.sn-me #memberAvatar{ flex: 0 0 28px; margin-right: 0; }
#topbarUser.sn-me #memberName,
#topbarUser.sn-me #memberBadge,
#topbarUser.sn-me #logoutBtn,
#topbarUser.sn-me #mpEditBtn{ display: none !important; }
#topbarUser.sn-me::after{ content: '我'; }
#topbarUser.sn-me img{ margin-right: 0!important;}
/* 抽屉里的「我」入口（site-nav.js 注入，仅会员可见） */
.sn-me-av{ flex: 0 0 28px; margin-right: 0; background: rgba(0,0,0,.05); }

/* 更多面板 */
.sn-more-panel{
  position: fixed;
  z-index: 130;              /* 必须高于首页 #navModal（index.css .modal z-index:110），否则抽屉里看不见 */
  min-width: 208px;
  max-width: 264px;
  padding: 8px;
  background: var(--card, #fff);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0,0,0,.16);
  display: none;
}
.sn-more-panel.is-open{ display: block; animation: snMoreIn .16s ease both; }
@keyframes snMoreIn{ from{ opacity: 0; transform: translateY(6px); } to{ opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .sn-more-panel.is-open{ animation: none; } }

.sn-more-user{
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
body.is-member .sn-more-user{ display: flex; }
.sn-more-av{
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%; object-fit: cover;
  background: rgba(0,0,0,.05); display: none;
}
.sn-more-meta{ min-width: 0; }
.sn-more-name{
  font-size: 14px; font-weight: 600; color: var(--ink, #222);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sn-more-sub{ font-size: 12px; color: var(--muted, #888); margin-top: 3px; }

.sn-more-item{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  color: var(--ink, #333);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sn-more-item:hover{ background: rgba(0,0,0,.05); }
.sn-more-danger{ color: #e5484d; }
.sn-more-item.sn-need-member{ display: none; }
body.is-member .sn-more-item.sn-need-member{ display: flex; }

/* 打印：隐藏导航，归零留白 */
@media print {
  body.sn-has-nav { padding-left: 0 !important; padding-top: 0 !important; }
  .sn-nav-col, .sn-burger, .sn-modal { display: none !important; }
  .sn-foot-list, .sn-modal-foot-list, #navModal .nav-modal-foot-list { display: none !important; }
  .btn-art { display: none !important; }
}
