/* css/wb-spacing.css —— fix240f 极简工作台「精准纠偏」版
 *
 * 老板 2026-11-12 第三次纠偏（对照旧版图）：
 *   ① [下发今日目标] 退化成实心蓝块 ⇒ 改回**透明底 + 蓝字方括号**（幽灵按钮）；
 *   ② 四张月卡与红条之间空隙过大 ⇒ 月卡 margin-bottom 16→12，红条上下 margin 统一 12；
 *   ③ 圆盘被撑大、左边 5 个块被压成细长条 ⇒ 圆盘四维全部物理锁死 148，行高也钉死 148。
 *
 * ⚠️ 本文件在 index.html 里**排在 css/styles.css 之后**，
 *    同特异性 + !important ⇒ 本文件的规则覆盖 styles.css 的 fix229 块。这是有意为之：
 *    styles.css 是共用文件（别的对话框也在改），不动它，只在自己的文件里压住。
 *
 * ⚠️ 与老板原令的一处偏差（必须说明）：
 *   原令要求 `html, body { overflow: hidden !important; }` 全局锁死。
 *    但那是**全站生效** —— 客户查询（几百行）、提交与审批、知识库长文都会滚不动，属于功能级破坏。
 *    所以改成：滚动条全局隐藏（视觉干净，仍可滚），`overflow:hidden` 只锁工作台页。
 */

/* ══════════ ① 顶部留白 + 左右内边距 ══════════ */
#content:has(#panel-wb) {
  padding-top: 16px !important;
}
#panel-wb {
  padding: 0 24px 16px !important;
}

/* ══════════ ② 直属子块统一 16px（兜底）══════════ */
#panel-wb > div:not(:last-child) {
  margin-bottom: 16px !important;
}

/* ══════════ ③ 顶部数据区（四张月卡）—— 下班紧到 12px ══════════ */
#wbMonthCards {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

/* ══════════ ④ 红条（今日提醒 / 越期告警）上下统一 12px ══════════ */
/* 红条是 #wbTodayBar 的直属子 div，带 data-wbremind；行内只写了 margin-bottom:10px，
   这里统一改成上下 12px，并压掉多余的下边距。 */
#wbTodayBar > [data-wbremind] {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}
/* 今日进度整块：上下各 12px */
#wbTodayBar {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}
/* 今日进度与下方 5 大块之间那根 10px 占位条：不再额外叠外边距 */
#panel-wb > div[style*="height:10px"] {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  height: 10px !important;
}

/* ══════════ ⑤ 圆盘：四维物理锁死 148×148（不许撑大，也不许被压扁）══════════ */
/* fix240f 关键：**删掉 aspect-ratio**。
   aspect-ratio:1/1 配 height:100% 会跟着父容器高度长大 —— 这就是"圆盘变得极大"的根因。
   现在 width / height / max-width / max-height / flex-basis 五个维度全部写死 148。 */
#wbEntryGrid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-rows: 148px !important;   /* 行高钉死 ⇒ 左边 5 块不会被拉成长条 */
  gap: 13px !important;
  align-items: stretch !important;
  margin: 0 0 12px 0 !important;
  min-height: 0 !important;
}
/* 左边 5 个大块：与圆盘严格同高 148 ⇒ 整排方正 */
#wbEntryGrid > .wb-entry-btn {
  height: 148px !important;
  min-height: 148px !important;
  max-height: 148px !important;
}
/* 第 6 格容器：不限高，交给里面的 .wb-hub-wrap */
#wbEntryGrid > #wbServiceHub {
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#wbServiceHub .wb-hub-wrap {
  width: 148px !important;
  height: 148px !important;
  max-width: 148px !important;
  max-height: 148px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 0 0 148px !important;
  aspect-ratio: auto !important;      /* 🔴 就是这一行：禁止按比例长大 */
  margin: auto !important;
}
#wbServiceHub .wb-hub-svg {
  width: 148px !important;
  height: 148px !important;
  max-width: 148px !important;
  max-height: 148px !important;
}

/* ══════════ ⑥ [下发今日目标] 幽灵按钮的 hover（内联写法写不了 :hover）══════════ */
#wbTodayBar [data-wbtarget]:hover {
  background: #eef3ff !important;
  text-decoration: none !important;
}
#wbTodayBar [data-wbtarget]:active {
  background: #e2ebff !important;
}

/* ══════════ ⑦ 干掉滚动条 ══════════ */
::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* 只锁**工作台页**：其他页面照常滚动（客户列表几百行必须能滚） */
body:has(#panel-wb) {
  overflow: hidden !important;
}
/* 兜底：万一大屏下内容仍超出一屏，让 #content 自己滚，不至于卡死看不着 */
#content:has(#panel-wb) {
  overflow-y: auto !important;
  max-height: 100vh !important;
}

/* ══════════ ⑧ 窄屏（1366×768 笔记本）再收一档 ══════════ */
@media (max-height: 800px) {
  #content:has(#panel-wb) { padding-top: 12px !important; }
  #panel-wb { padding: 0 18px 12px !important; }
  #panel-wb > div:not(:last-child) { margin-bottom: 12px !important; }
  #wbMonthCards { margin-bottom: 12px !important; }
  #wbTodayBar { margin-top: 12px !important; margin-bottom: 12px !important; }
  #wbTodayBar > [data-wbremind] { margin-top: 12px !important; margin-bottom: 12px !important; }
  #wbEntryGrid { gap: 12px !important; margin-top: 0 !important; margin-bottom: 12px !important; }
}

/* 超窄屏（列宽 < 148）时圆盘等比缩小，绝不溢出格子 */
@media (max-width: 1180px) {
  #wbEntryGrid { grid-auto-rows: 118px !important; }
  #wbEntryGrid > .wb-entry-btn { height: 118px !important; min-height: 118px !important; max-height: 118px !important; }
  #wbServiceHub .wb-hub-wrap,
  #wbServiceHub .wb-hub-svg {
    width: 118px !important; height: 118px !important;
    max-width: 118px !important; max-height: 118px !important;
  }
}
