/* ============================================================================
   黑龙江工商学院 · Casdoor 内页皮肤（多因子认证等）
   ----------------------------------------------------------------------------
   目的：/mfa/setup 这类 Casdoor 原生页面和门户（#005397 / 白卡 2px / #eeecef 底 /
        微软雅黑）风格对不上，这里把它们拉齐。

   机制：Casdoor 前端是 shadcn/ui，主题全部由 CSS 变量驱动
        （--primary / --background / --radius ...，值是裸 HSL 三段）。

   ⛔ 两个必须踩过的坑（不处理会「改了一半」）：
      1) Casdoor 运行时会用 JS 往 <html style="..."> 直接写 --primary / --radius /
         --ring 等变量。**inline style 的优先级高于任何 CSS 选择器**，
         所以这几个变量必须带 !important 才盖得住，否则只有 --background 这类
         inline 里没有的变量生效，看起来像"样式只对了一半"。
      2) 未登录访问 /mfa/* 会被跳去 /login，此时 html 上同时有 hibu-mfa 和
         hibu-login 两个类。所以规则一律限定 :not(.hibu-login)，
         避免 MFA 皮肤污染登录页（登录页有自己的 hibu-login.css）。

   生效条件：web/build/index.html 的首帧脚本会给 /mfa* 路径打上 hibu-mfa 类。
            ⚠️ Casdoor 升级会覆盖 index.html，升级后需重新注入那段判断。

   版本：v2  2026-11-03
   ============================================================================ */

html.hibu-mfa:not(.hibu-login) {
  /* 圆角：对齐门户白卡的 2px（Casdoor 默认 .625rem 偏圆润） */
  --radius: 0.125rem !important;

  /* 底色与文字 */
  --background: 280 9% 93%;            /* #eeecef   门户页面底色 */
  --foreground: 0 0% 20%;              /* #333333   正文 */
  --card: 0 0% 100%;
  --card-foreground: 0 0% 20%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 20%;

  /* 主色 = 学校主色 #005397（这三个是 inline style 里有的，必须 !important） */
  --primary: 207 100% 30% !important;
  --primary-foreground: 0 0% 100% !important;
  --ring: 207 100% 30% !important;

  /* 次级 / 悬停 / 弱化 */
  --secondary: 213 40% 96%;
  --secondary-foreground: 207 100% 30%;
  --accent: 213 40% 96%;
  --accent-foreground: 207 100% 30%;
  --muted: 213 20% 96%;
  --muted-foreground: 0 0% 42%;

  /* 边框 / 输入框 = 门户的 #cfd8e3 */
  --border: 213 26% 85%;
  --input: 213 26% 85%;
}

html.hibu-mfa:not(.hibu-login) body {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC",
               "Hiragino Sans GB", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* 标题用主色，和门户页面 h1 一致 */
html.hibu-mfa:not(.hibu-login) h1,
html.hibu-mfa:not(.hibu-login) h2 {
  color: #005397 !important;
  font-weight: 700 !important;
}

/* 按钮不要全大写、不要额外字距、去掉重阴影 */
html.hibu-mfa:not(.hibu-login) button {
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

/* 二维码 / 画布统一圆角，避免和卡片边缘打架 */
html.hibu-mfa:not(.hibu-login) img,
html.hibu-mfa:not(.hibu-login) canvas,
html.hibu-mfa:not(.hibu-login) svg {
  border-radius: 2px;
}

/* 页脚版权行与门户一致 */
html.hibu-mfa:not(.hibu-login) #footer,
html.hibu-mfa:not(.hibu-login) footer {
  font-size: 12px !important;
  color: #9a9a9a !important;
}

/* 卡片阴影压淡：门户是 0 1px 2px rgba(0,0,0,.045)，Casdoor 默认偏重 */
html.hibu-mfa:not(.hibu-login) [class*="shadow"] {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .045) !important;
}
