/* 首页上叠加的两个小控件：身份胶囊、提示条。
   设计稿本身很干净，这里刻意做轻，不去抢主视觉。

   注意：首页是 slim-homepage.mjs 的生成物，**不引 theme.css**
   （theme.css 的 html/body 背景会盖掉首页那张 canvas 粒子画布），
   所以这里拿不到 var() 令牌，只能手写字面量。
   下面这批数值是**照着 theme.css 抄过来的**，改令牌时要顺手同步这里：
     中性色相 264 / 面板色相 261 / 强调色 oklch(52% 0.095 185)
     圆角 控件 4px · 卡片 6px · 浮层 8px · 胶囊 999px
   （此前这里是另一套色相 250/175，跟内页并排看是两种灰、两种青。） */

#homeIdentity {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 50;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
}

.home-identity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid oklch(0.5 0.03 264 / 0.16);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: oklch(0.24 0.032 264);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 120ms cubic-bezier(0.2, 0.7, 0.2, 1),
    background 120ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.home-identity-chip:hover {
  border-color: oklch(0.5 0.03 264 / 0.3);
  background: oklch(1 0 0 / 0.9);
}

.home-identity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(0.63 0.018 264);
}
.home-identity-dot[data-role="admin"] { background: oklch(0.52 0.095 185); }
.home-identity-dot[data-role="staff"] { background: oklch(0.49 0.024 264); }
.home-identity-dot[data-role="supplier"] { background: oklch(0.64 0.12 68); }

.home-identity-role {
  padding-left: 8px;
  border-left: 1px solid oklch(0.5 0.03 264 / 0.16);
  color: oklch(0.49 0.024 264);
  font-size: 11.5px;
}

.home-identity-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  padding: 8px;
  border: 1px solid oklch(0.5 0.03 264 / 0.14);
  border-radius: 8px;
  background: oklch(1 0 0 / 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px oklch(0.3 0.06 264 / 0.08);   /* = --e-pop 的手抄件 */
}
.home-identity-menu[hidden] { display: none; }

.home-identity-hint {
  margin: 2px 4px 8px;
  color: oklch(0.63 0.018 264);
  font-size: 11px;
  line-height: 1.5;
}

.home-identity-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: oklch(0.24 0.032 264);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.home-identity-option:hover:not(:disabled) { background: oklch(0.52 0.095 185 / 0.08); }
.home-identity-option.current { background: oklch(0.52 0.095 185 / 0.12); }
/* 停用的账号照样列出来但点不动——藏起来会让人以为账号被删了 */
.home-identity-option:disabled { opacity: 0.45; cursor: not-allowed; }
.home-identity-option strong { display: block; font-size: 13px; font-weight: 500; }
.home-identity-option small { display: block; color: oklch(0.49 0.024 264); font-size: 11px; }
.home-identity-tick { color: oklch(0.52 0.095 185); font-size: 13px; }

/* ---------- 提示条 ---------- */

#homeNotice {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 55;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid oklch(0.5 0.03 264 / 0.14);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px oklch(0.3 0.06 264 / 0.08);   /* = --e-pop 的手抄件 */
  color: oklch(0.24 0.032 264);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
#homeNotice.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  #homeIdentity { top: 12px; right: 12px; }
  .home-identity-chip { padding: 4px 12px; font-size: 12px; }
  .home-identity-menu { width: min(268px, calc(100vw - 28px)); }
}
