/* 图个乐 · 第三批界面改版（2026-11-30）
   只改外观与交互层：模板数据、编辑器核心逻辑一律不动。
   每一项都加了 zg- 前缀或限定作用域，避免影响原站其它页面。 */

/* ========== 0. 顶部预留，防止跑马灯出现时整页往下跳 ========== */
html.zg-reserve #app { padding-top: 36px; }
/* 编辑器页不显示横幅：撤掉这条预留，页面内容（含画布）直接上移填满 */
html.zg-reserve.zg-ed-route #app,
html.zg-reserve body.zg-editor #app { padding-top: 0 !important; }
html.zg-reserve .zg-marquee {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 70;
}

/* ========== 1. 头部：最近使用 / 收藏 / 头像 贴右 ========== */
body.zg-home .zg-header .zg-search { margin-right: auto !important; }
body.zg-home .zg-header .zg-tools { margin-left: 8px !important; }
body.zg-home .zg-header .zg-usermenu { margin-left: 10px !important; margin-right: 2px !important; }
/* 头部钉死，滚动时不位移 */
body.zg-home .zg-header {
  position: sticky !important;
  top: 0;
  z-index: 40;
}

/* ========== 2. 「我的模板」前台入口全部撤掉（后台照旧） ========== */
.zg-my-tpls,
.zg-my-tpls.float,
.zg-my-panel { display: none !important; }

/* ========== 3. 底部「授权剩余 N 天」整条删掉 ========== */
#zkh-badge, .zkh-badge { display: none !important; }

/* ========== 4. 左栏分组标题 ========== */
.zg-grp-head {
  display: flex !important;
  align-items: center !important;
  gap: 4px;
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 8px !important;
  margin: 6px 0 2px !important;
  font-size: 13px !important;
  border-radius: 9px !important;
  cursor: pointer;
  user-select: none;
}
.zg-grp-head .zg-grp-t { font-size: 13px !important; font-weight: 600; }
.zg-grp-head .zg-grp-n { margin-left: auto; font-size: 11.5px !important; opacity: .62; }
.zg-grp-head:hover { background: #f2f5fa; }
.zg-grp-head.on { background: #e8f0fe !important; color: #1259d6 !important; }
.zg-grp-head.on .zg-grp-n { opacity: .9; }

/* ========== 5. 左栏分类胶囊：字号加大、文字严格居中 ========== */
.zg-rail .scroll-container .ant-btn,
.zg-rail .scroll-container .ant-btn.ant-btn-lg,
.zg-rail .scroll-container .ant-btn.ant-btn-text {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 1 !important;
  font-size: 14.5px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  margin: 2px 0 !important;
}
.zg-rail .scroll-container .ant-btn > span { line-height: 1.25 !important; }

/* 分组视图顶部的小标签条 */
.zg-grp-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 2px 4px 10px;
  align-items: center;
}
.zg-grp-tabs button {
  height: 30px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #e3e8f0; background: #fff; color: #475467;
  font-size: 13px; cursor: pointer;
}
.zg-grp-tabs button.on { background: #12203a; border-color: #12203a; color: #fff; }
.zg-grp-tabs .zg-gt-ttl {
  font-size: 13px; color: #98a2b3; margin-right: 4px;
}

/* ========== 6. 右侧网格铺满，不再右边空一大块 ========== */
.main.zg-grid {
  display: grid !important;
  /* auto-fit：分类少的时候（比如某组只有 5 个）自动把空列收掉、卡片撑满整行，
     不再右边空一大块 */
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important;
  gap: 14px !important;
  align-content: start !important;
  padding: 16px 18px 24px !important;
}
.main.zg-grid > .itme {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}
.main.zg-grid > div[style*="height: 4px"],
.main.zg-grid > div[style*="height:4px"] { display: none !important; }
@media (max-width: 820px) {
  .main.zg-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; gap: 10px !important; }
}

/* ========== 7. 编辑器 ========== */
/* 7.1 右侧编辑菜单永远在最上层：任何浮层（图查询/主题色/打开页面那一排）都盖不住它 */
.menuMian { position: relative !important; z-index: 100000 !important; background: #fff !important; border-radius: 10px; }
.menu-container { position: relative !important; z-index: 100001 !important; }
.editField { position: fixed !important; z-index: 100002 !important; }

/* 7.2 右上角「复制图一 / 保存图片 / 收藏图片」那一列，收窄不挡画布 */
body.zg-editor .resizable-div { will-change: transform; }

/* ========== 8. 登录页：先盖住原站那套，再出我们自己的卡 ========== */
#zgLoginCover {
  position: fixed; inset: 0; z-index: 2147483600;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef3fa 100%);
  pointer-events: none;
  transition: opacity .18s ease;
}
#zgLoginCover.off { opacity: 0; visibility: hidden; }
body.zg-login #app > div > img,
body.zg-login .login-left { display: none !important; }
