/* ============================================================================
   统一提示条 —— 鸿蒙（HarmonyOS）风格
   ----------------------------------------------------------------------------
   这个文件用户中心与登录 / 注册页共用。单独抽出来是因为登录页只加载 auth.css、
   用户中心只加载 app.css —— 以前提示写在 app.css 里，登录页的错误提示完全没样式。
   这里用 var(--x, fallback) 写，两边都能用。

   视觉规范（对齐鸿蒙设计语言）：
     · 容器：**系统浅灰 #F1F3F5**，圆角 16px，**无边框、无投影、无渐变**
       —— 所有状态共用同一个灰底，不再一种状态换一种底色
     · 颜色全部交给「图标 + 文字」承担：蓝 #0A59F7 / 红 #E84026 /
       橙 #FA9D28 / 绿 #41BA41
     · 图标走内联 SVG（CSS background-image），静态元素不用 JS 也有图标
     · 出现动画：淡入 + 上浮 + 末段轻微过冲回弹，鸿蒙那种弹性手感
     · 深色规则限定 body.jwb-app，登录页是纯浅色稿不跟着变
   ========================================================================== */

/* ---------- 鸿蒙色板（同时作为兜底值，登录页没有 iOS 变量也能正常渲染）---------- */
:root{
  --hmo-gray:      #F1F3F5;   /* 系统浅灰底 */
  --hmo-text:      #182431;   /* 深灰蓝，鸿蒙主文字色 */
  --hmo-text-2:    #666666;
  --hmo-blue:      #0A59F7;   /* 鸿蒙品牌蓝 */
  --hmo-red:       #E84026;   /* 鸿蒙功能红 */
  --hmo-orange:    #FA9D28;
  --hmo-green:     #41BA41;
  --hmo-radius:    16px;
  --hmo-ease:      cubic-bezier(.34, 1.28, .5, 1);
}

/* ============================ 基础容器 ============================ */
.tip,.err,.ok-msg,.hint-ok,.hint-warn,.rf-tip,.qr-hint{
  display:block;
  margin-top:10px;
  padding:12px 14px 12px 40px;
  border:0;
  border-radius:var(--hmo-radius);
  background-color:var(--hmo-gray);
  background-repeat:no-repeat;
  background-position:14px 12px;
  background-size:17px 17px;
  color:var(--hmo-text);
  font-size:13px;
  line-height:1.6;
  font-weight:400;
  letter-spacing:0;
  word-break:break-word;
  animation:tipPop .3s var(--hmo-ease) both;
}
.err,.ok-msg{display:none}                       /* 这两个由 JS 控制显隐 */
.tip.hidden-tip{display:none!important}
.tip.tip-ml{white-space:pre-line}
.tip b,.hint-warn b,.hint-ok b{font-weight:600}
.tip a,.hint-warn a,.hint-ok a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.tip code,.hint-warn code,.hint-ok code{
  background:rgba(10,89,247,.09);border-color:transparent;
  color:inherit;font-weight:500;border-radius:4px;padding:1px 5px;
}

/* ============================ 五种状态 ============================ */
/* 图标彩色、文字彩色，底色永远是那层浅灰 —— 鸿蒙就是这么干的 */
.tip.info,.rf-tip,.qr-hint{
  color:var(--hmo-blue);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A59F7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M12 11.2v5.4'/><circle cx='12' cy='7.7' r='1.15' fill='%230A59F7' stroke='none'/></svg>");
}
.tip.ok,.ok-msg,.hint-ok{
  color:var(--hmo-green);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2341BA41' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M7.8 12.3l2.9 2.9 5.5-6'/></svg>");
}
.tip.err,.err{
  color:var(--hmo-red);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E84026' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M9 9l6 6M15 9l-6 6'/></svg>");
}
.tip.warn,.hint-warn{
  color:#B26A00;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FA9D28' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M12 7.4v5.6'/><circle cx='12' cy='16.6' r='1.15' fill='%23FA9D28' stroke='none'/></svg>");
}
.tip.wait,.qr-hint.wait{
  color:var(--hmo-text-2);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='9.2' stroke-dasharray='5 4'/></svg>");
}

/* ============================ 出现动画 ============================ */
/* 淡入 + 上浮，末段轻微过冲回弹 —— 鸿蒙的弹性手感 */
@keyframes tipPop{
  0%   {opacity:0; transform:translateY(-9px) scale(.965)}
  62%  {opacity:1; transform:translateY(1.5px) scale(1.006)}
  100% {opacity:1; transform:translateY(0) scale(1)}
}
@keyframes tipPopUp{          /* 底部浮层用：从下往上冒 */
  0%   {opacity:0; transform:translateY(14px) scale(.96)}
  62%  {opacity:1; transform:translateY(-2px) scale(1.006)}
  100% {opacity:1; transform:translateY(0) scale(1)}
}
@keyframes tipSpin{to{transform:rotate(360deg)}}
.tip.wait .hmo-spin{display:inline-block;animation:tipSpin 1s linear infinite}

/* ============================ 悬浮模式 ============================
   后台「站点设置 → 提示条」里把位置选成「顶部浮层 / 底部浮层」时，
   tipSet() 会把内容渲染到下面的宿主里，原来的内联位置留空。          */
#jwbTipHost{
  position:fixed;left:0;right:0;z-index:9000;
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:0 14px;pointer-events:none;
}
#jwbTipHost.at-top{top:14px}
#jwbTipHost.at-bottom{bottom:14px;flex-direction:column-reverse}
#jwbTipHost .tip{
  pointer-events:auto;
  width:100%;max-width:440px;margin:0;
  box-shadow:0 8px 28px -10px rgba(24,36,49,.22);
  animation-duration:.32s;
}
#jwbTipHost.at-top .tip{animation-name:tipPop}
#jwbTipHost.at-bottom .tip{animation-name:tipPopUp}
#jwbTipHost .tip.tip-out{animation:tipFadeOut .2s ease forwards}
@keyframes tipFadeOut{to{opacity:0; transform:translateY(-6px) scale(.97)}}
#jwbTipHost.at-bottom .tip.tip-out{animation-name:tipFadeOutUp}
@keyframes tipFadeOutUp{to{opacity:0; transform:translateY(6px) scale(.97)}}

/* ============================ 深色模式 ============================ */
/* 只在用户中心生效：登录 / 注册页是纯浅色稿，跟着变反而更花 */
@media (prefers-color-scheme:dark){
  body.jwb-app{
    --hmo-gray:#2E3033;
    --hmo-text:#F1F3F5;
    --hmo-text-2:#A3A9B0;
    --hmo-blue:#4D8DFF;
    --hmo-red:#FF6B57;
    --hmo-orange:#FFB44D;
    --hmo-green:#5FD15F;
  }
  body.jwb-app .tip,body.jwb-app .err,body.jwb-app .ok-msg,body.jwb-app .hint-ok,
  body.jwb-app .hint-warn,body.jwb-app .rf-tip,body.jwb-app .qr-hint{
    background-color:var(--hmo-gray);
  }
  body.jwb-app .tip.info,body.jwb-app .rf-tip,body.jwb-app .qr-hint{
    color:var(--hmo-blue);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234D8DFF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M12 11.2v5.4'/><circle cx='12' cy='7.7' r='1.15' fill='%234D8DFF' stroke='none'/></svg>");
  }
  body.jwb-app .tip.ok,body.jwb-app .ok-msg,body.jwb-app .hint-ok{
    color:var(--hmo-green);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235FD15F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M7.8 12.3l2.9 2.9 5.5-6'/></svg>");
  }
  body.jwb-app .tip.err,body.jwb-app .err{
    color:var(--hmo-red);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF6B57' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M9 9l6 6M15 9l-6 6'/></svg>");
  }
  body.jwb-app .tip.warn,body.jwb-app .hint-warn{
    color:var(--hmo-orange);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFB44D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M12 7.4v5.6'/><circle cx='12' cy='16.6' r='1.15' fill='%23FFB44D' stroke='none'/></svg>");
  }
  body.jwb-app .tip.wait,body.jwb-app .qr-hint.wait{
    color:var(--hmo-text-2);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A9B0' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='9.2' stroke-dasharray='5 4'/></svg>");
  }
  body.jwb-app .tip code,body.jwb-app .hint-warn code,body.jwb-app .hint-ok code{
    background:rgba(77,141,255,.16);
  }
  #jwbTipHost .tip{box-shadow:0 8px 28px -10px rgba(0,0,0,.6)}
}

/* 用户开了「减少动态效果」就老老实实别动 */
@media (prefers-reduced-motion:reduce){
  .tip,.err,.ok-msg,.hint-ok,.hint-warn,.rf-tip,.qr-hint,
  #jwbTipHost .tip{animation:none!important}
}
