/* S5b 图标侧边栏与项目画廊样式表 */
/* 采用冷米底与玫瑰豆沙色调，提供扁平简约的模块化响应式布局 */

/* ── 1. 侧边导航栏 (Icon Sidebar) ── */
.aat-sb {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 95;
  background: var(--card-solid, #ffffff);
  border-right: 1px solid var(--line, rgba(139, 157, 175, 0.14));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px;
  box-sizing: border-box;
}
.aat-sb-logo {
  width: 30px;
  height: auto;
  margin: 4px 0 18px;
  cursor: pointer;
  opacity: 0.92;
  border-radius: 7px;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.aat-sb-logo:hover { opacity: 1; }
.aat-sb-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
  margin-top: auto;   /* 与 .aat-sb-foot 的 margin-top:auto 一起：两段等分留白 → logo 顶 / 导航中 / 头像底 */
}
.aat-sb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-3, #6b7280);
  border-radius: var(--r-md, 10px);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.aat-sb-item:hover { background: rgba(0, 0, 0, 0.04); color: var(--text, #111827); }
.aat-sb-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.aat-sb-icon svg { width: 22px; height: 22px; display: block; stroke: currentColor; fill: none; stroke-width: 1.5; }
.aat-sb-label { font-size: 11px; letter-spacing: 0.2px; line-height: 1; }
.aat-sb-item.is-active {
  color: var(--brand-red-hover, #a06a63);
  background: var(--brand-red-soft, rgba(184, 125, 117, 0.10));
}
.aat-sb-item.is-active .aat-sb-label { font-weight: 600; }

/* ── 1b. 侧栏底部账户头像（从顶栏迁入） ── */
.aat-sb-foot {
  margin-top: auto;          /* 推到侧栏最底 */
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.aat-sb-foot .canvas-topbar-avatar {   /* 抵消其在顶栏的 absolute 定位，落进侧栏底部流式布局 */
  position: static;
  top: auto;
  right: auto;
  margin: 0;
}
.aat-sb-foot .canvas-avatar-circle { width: 34px; height: 34px; cursor: pointer; }
/* 头像迁到左下后，悬浮的账户/积分面板也跟到侧栏右侧底部（原本固定 top-right） */
body.aat-sb-open #canvas-user-panel-root {
  top: auto;
  bottom: 14px;
  left: 72px;
  right: auto;
}

/* ── 2. 主页面内容偏移 + 顶栏整行下线 + 暖色底 ── */
/* 全站底色：白 + 右上角一点点玫红/柑橘暖光（阳光从右上往左下打），克制不抢眼、突出 UTEN 主题 */
body.aat-sb-open {
  --aat-warm: radial-gradient(125% 95% at 100% 0%, rgba(230,0,18,0.04) 0%, rgba(255,160,110,0.028) 20%, rgba(255,255,255,0) 50%);
  background: var(--aat-warm), #ffffff;
  background-attachment: fixed;
}
body.aat-sb-open .app {
  padding-left: 64px;
  transition: padding-left 0.18s ease;
  /* 旧 topbar/substatus 已删（2026-07-02），.app 单行占满，不再补偿顶行。 */
}
body.aat-sb-open #canvas-mount { padding-left: 64px; }
/* 灵感/主内容区透明，透出 body 的白底+暖红（原 .main 刷 var(--bg) 冷灰会盖住） */
body.aat-sb-open .main { background: transparent; }
/* 旧 topbar 删除后账户头像裸挂在 .app 直属：搬进左侧栏前隐藏，防加载时闪现在右上角（原 absolute top/right）。
   搬进 body>.aat-sb>.aat-sb-foot 后不再是 .app 直属 → 本规则不命中 → 恢复显示。 */
.app > .canvas-topbar-avatar { display: none; }
/* 画布全屏模式：主侧栏隐藏、画布占满（撤掉 64px 左移），只留「回到首页」出口 */
body.aat-canvas-full .aat-sb { display: none; }
body.aat-canvas-full.aat-sb-open .app,
body.aat-canvas-full.aat-sb-open #canvas-mount { padding-left: 0; }

/* ── 3. 项目画廊容器 (Project Gallery Container) ── */
.aat-gallery {
  position: fixed;
  top: 0;            /* 顶栏已下线，画廊顶到最上 */
  left: 64px;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--aat-warm), #ffffff;   /* 同全站暖色底 */
  overflow-y: auto;
  padding: 28px 32px;
  display: none;
  box-sizing: border-box;
}
.aat-gallery.is-open { display: block; }
.aat-gallery-head { display: flex; align-items: center; margin-bottom: 22px; }
.aat-gallery-title { font-size: 19px; font-weight: 600; color: var(--text, #111827); }
.aat-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 18px; align-items: start; }

/* ── 4. 新建项目卡片 (New Project Card) ── */
.aat-gallery-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 11;
  border: 1.5px dashed var(--line-strong, #e5e7eb);
  border-radius: var(--r-lg, 12px);
  background: rgba(255, 255, 255, 0.55);          /* 毛玻璃 */
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  cursor: pointer;
  color: var(--text-2, #4b5563);
  gap: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.aat-gallery-new:hover {
  border-color: var(--brand-red-ring, rgba(184, 125, 117, 0.24));
  background: var(--brand-red-soft, rgba(184, 125, 117, 0.10));
}
.aat-gallery-new-plus { font-size: 30px; font-weight: 300; line-height: 1; color: var(--text-3, #6b7280); }
.aat-gallery-new-text { font-size: 13.5px; font-weight: 600; color: var(--text, #111827); }
.aat-gallery-new-sub { font-size: 11.5px; color: var(--text-mute, #9aa4af); }

/* ── 5. 常规项目卡片 (Standard Project Card) ── */
.aat-gcard {
  background: rgba(255, 255, 255, 0.62);          /* 毛玻璃：半透白 + 背景模糊 */
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), inset 0 0 0 1px var(--line, rgba(139, 157, 175, 0.14));
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.aat-gcard:hover {
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.10);
  border-color: var(--line-strong, #e5e7eb);
  transform: translateY(-1px);
}
.aat-gcard.is-current {
  border-color: var(--brand-red-ring, rgba(184, 125, 117, 0.24));
  box-shadow: 0 0 0 1px var(--brand-red-ring, rgba(184, 125, 117, 0.24));
}
.aat-gcard-cover {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line, rgba(139, 157, 175, 0.14));
  position: relative;
}
.aat-gcard-cover.is-empty { background: linear-gradient(135deg, #eef1f4, #e6eaef); }
.aat-gcard-cover-ph { color: var(--text-mute, #9aa4af); width: 34px; height: 34px; display: flex; }
.aat-gcard-cover-ph svg { width: 100%; height: 100%; display: block; }
.aat-gcard-cover:not(.is-empty) .aat-gcard-cover-ph { display: none; }
.aat-gcard-info { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 11px 11px; }
.aat-gcard-text { min-width: 0; flex: 1; }
.aat-gcard-name { font-size: 13.5px; font-weight: 500; color: var(--text, #111827); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aat-gcard-date { font-size: 11.5px; color: var(--text-mute, #9aa4af); margin-top: 2px; }
.aat-gcard-menu-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-3, #6b7280);
  border-radius: var(--r-sm, 8px);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.aat-gcard-menu-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--text, #111827); }

/* ── 6. 卡片操作下拉菜单 (Card Actions Popover) ── */
.aat-gmenu {
  position: fixed;
  z-index: 99998;
  min-width: 132px;
  background: var(--card-solid, #ffffff);
  border: 1px solid var(--line, rgba(139, 157, 175, 0.14));
  border-radius: var(--r-md, 10px);
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.14);
  padding: 5px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.aat-gmenu-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text, #111827);
  border-radius: var(--r-sm, 8px);
  cursor: pointer;
  transition: background 0.12s ease;
}
.aat-gmenu-item:hover { background: var(--bg, #f5f6f8); }
.aat-gmenu-item.aat-gmenu-danger { color: var(--status-danger, #c4342d); }
.aat-gmenu-item.aat-gmenu-danger:hover { background: rgba(196, 52, 45, 0.08); }

/* ── 7. 重命名弹窗输入框 (Rename Dialog Input) ── */
.aat-proj-input-wrap { display: block; margin: 14px 0 4px; }
.aat-proj-input {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong, #e5e7eb);
  border-radius: var(--r-md, 10px);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text, #111827);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aat-proj-input::placeholder { color: var(--text-mute, #9aa4af); }
.aat-proj-input:focus {
  outline: none;
  border-color: var(--brand-red, #b87d75);
  box-shadow: 0 0 0 3px var(--brand-red-ring, rgba(184, 125, 117, 0.24));
}

/* ── 8. 全局交互焦点环 (Global Interactive Focus Rings) ── */
.aat-sb-logo:focus-visible,
.aat-sb-item:focus-visible,
.aat-gallery-new:focus-visible,
.aat-gcard:focus-visible,
.aat-gcard-menu-btn:focus-visible,
.aat-gmenu-item:focus-visible {
  box-shadow: 0 0 0 2px var(--brand-red-ring, rgba(184, 125, 117, 0.24));
  outline: none;
}

/* ── 8c. 画布全屏「回到首页」出口 ── */
.aat-canvas-exit {
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 96;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #111827);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid var(--line, rgba(139, 157, 175, 0.14));
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
  transition: background 0.15s ease;
}
.aat-canvas-exit:hover { background: #ffffff; }

/* ── 8d. 资产库占位面板（真资产库 = 下一个 slice） ── */
.aat-assets {
  position: fixed;
  top: 0;
  left: 64px;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--aat-warm), #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
}
.aat-assets.is-open { display: flex; }
.aat-assets-empty { text-align: center; }
.aat-assets-empty-title { font-size: 20px; font-weight: 600; color: var(--text, #111827); }
.aat-assets-empty-sub { margin-top: 8px; font-size: 13px; color: var(--text-mute, #9aa4af); }

/* ── 8e. 管理员「全部用户项目」区（仅 admin 渲染，普通用户 display:none） ── */
.aat-admin-section { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line, rgba(139, 157, 175, 0.14)); }
.aat-admin-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.aat-admin-title { font-size: 16px; font-weight: 600; color: var(--text, #111827); }
.aat-admin-hint { font-size: 11.5px; color: var(--text-mute, #9aa4af); }
.aat-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 18px; align-items: start; }
.aat-gcard-owner { font-size: 11.5px; color: var(--text-mute, #9aa4af); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 8f. 只读预览横幅（admin 看别人项目时顶部提示，reload 后仍在） ── */
.aat-ro-banner {
  position: fixed;
  top: 0;
  left: 64px;
  right: 0;
  z-index: 90;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-red, #b87d75);
  background: var(--brand-red-soft, rgba(184, 125, 117, 0.10));
  border-bottom: 1px solid var(--brand-red-ring, rgba(184, 125, 117, 0.24));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-sizing: border-box;
}
.aat-ro-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aat-ro-exit {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #ffffff;
  background: var(--brand-red, #b87d75);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.aat-ro-exit:hover { opacity: 0.88; }
/* 横幅占位：整站内容下移，别被 40px 横幅盖住头部 */
body.aat-ro-on .aat-gallery,
body.aat-ro-on .aat-assets { top: 40px; }

/* ── 9. 响应式布局自适应 (Responsive Design) ── */
@media (max-width: 768px) {
  .aat-gallery-grid,
  .aat-admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .aat-gallery {
    padding: 18px 16px;
  }
  .aat-ro-banner { left: 0; }
}
