/* =========================================================
   Mira — new-api 控制台清理层（2026-10-20）
   ---------------------------------------------------------
   目标：把 new-api 自带的品牌痕迹与用不到的入口从 /console 里清掉。
   手段：nginx sub_filter 在 HTML 里注入这两个文件（前端编译进 Go 二进制，改不了源码）。

   为什么用 JS 而不是纯 CSS：需要匹配的是「中文文本」（聊天 / 关于 / 文档），
   CSS 无法按文本选元素，只能靠 JS 遍历。
   为防止误伤，所有匹配都限定在「菜单项/按钮」这种小元素上，并限制文本长度。
   ========================================================= */

/* 立刻隐藏，避免首屏闪一下 */
.semi-navigation-item[data-mira-hidden],
[data-mira-hidden] {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   登录页（/sign-in）：黑金 · 毛玻璃 · 亚克力
   ══════════════════════════════════════════════════════════════ */

body.mira-login-page {
  background: #050505 !important;
}
body.mira-login-page #root {
  position: relative;
  z-index: 1;
}

/* ── 氛围层 ─────────────────────────────────────────────── */
#mira-login-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.mira-deco__glow {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 900px;
  height: 900px;
  margin-left: -450px;
  margin-top: -450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 196, 160, 0.22), rgba(216, 196, 160, 0.05) 45%, transparent 68%);
  filter: blur(26px);
  animation: miraGlowA 11s ease-in-out infinite;
}
.mira-deco__glow--b {
  left: auto;
  right: -10%;
  top: auto;
  bottom: -16%;
  width: 700px;
  height: 700px;
  margin: 0;
  background: radial-gradient(circle, rgba(110, 145, 255, 0.12), transparent 66%);
  animation: miraGlowB 16s ease-in-out infinite;
}
@keyframes miraGlowA {
  0%, 100% { opacity: .5; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.08); }
}
@keyframes miraGlowB {
  0%, 100% { opacity: .32; transform: scale(1.02); }
  50% { opacity: .6; transform: scale(1.1); }
}
.mira-deco__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 92% 62% at 50% 38%, #000 16%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% 38%, #000 16%, transparent 76%);
}
/* 胶片噪点：亚克力质感的关键（纯 CSS 生不出颗粒） */
.mira-deco__noise {
  position: absolute;
  inset: 0;
  opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='150' height='150' filter='url(%23n)'/></svg>");
}
/* 一条缓慢下扫的光带 */
.mira-deco__sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(216,196,160,.06), transparent);
  animation: miraSweepDown 9s linear infinite;
}
@keyframes miraSweepDown {
  0% { transform: translateY(0); opacity: 0; }
  18% { opacity: .8; }
  100% { transform: translateY(430%); opacity: 0; }
}

/* ── 品牌区（真图标）────────────────────────────────────── */
.mira-deco__brand {
  position: absolute;
  left: 50%;
  top: 11%;
  transform: translateX(-50%);
  text-align: center;
  color: #f6f5f1;
  animation: miraBrandIn .9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes miraBrandIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%); }
}
.mira-deco__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(246, 245, 241, .12),
    0 0 40px rgba(216, 196, 160, .22);
}
.mira-deco__name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .01em;
}
.mira-deco__slogan {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: .32em;
  color: rgba(246, 245, 241, .34);
}

/* ── 登录卡片 ───────────────────────────────────────────── */
body.mira-login-page form {
  position: relative;
  border-radius: 24px !important;
  border: 1px solid rgba(246, 245, 241, .13) !important;
  background:
    linear-gradient(168deg, rgba(255,255,255,.085), rgba(255,255,255,.022) 56%, rgba(255,255,255,.008)) !important;
  backdrop-filter: blur(42px) saturate(1.9) !important;
  -webkit-backdrop-filter: blur(42px) saturate(1.9) !important;
  box-shadow:
    0 52px 140px rgba(0, 0, 0, .86),
    0 1px 0 rgba(255, 255, 255, .12) inset,
    0 -1px 0 rgba(0, 0, 0, .45) inset !important;
  padding: 36px 32px 30px !important;
  animation: miraCardIn .8s cubic-bezier(.16,1,.3,1) .1s both;
}
@keyframes miraCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
/* 卡片顶部那道高光 */
body.mira-login-page form::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 196, 160, .55), transparent);
}

/* ── 输入框：走 Semi 的 wrapper，避免「双层框」───────────── */
body.mira-login-page .semi-input-wrapper {
  background: rgba(0, 0, 0, .42) !important;
  border: 1px solid rgba(246, 245, 241, .14) !important;
  border-radius: 12px !important;
  min-height: 46px !important;
  height: auto !important;
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
body.mira-login-page .semi-input-wrapper:hover {
  border-color: rgba(246, 245, 241, .24) !important;
  background: rgba(0, 0, 0, .5) !important;
}
body.mira-login-page .semi-input-wrapper-focus {
  border-color: rgba(216, 196, 160, .62) !important;
  background: rgba(0, 0, 0, .6) !important;
  box-shadow: 0 0 0 3px rgba(216, 196, 160, .13) !important;
}
/* 内层 input 必须完全透明、无边框、无固定高（否则会看到两层边）*/
body.mira-login-page .semi-input-wrapper input,
body.mira-login-page .semi-input-wrapper .semi-input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  height: 44px !important;
  line-height: 44px !important;
  color: #f6f5f1 !important;
  padding: 0 14px !important;
  font-size: 14.5px !important;
}
body.mira-login-page .semi-input-wrapper input::placeholder {
  color: rgba(246, 245, 241, .26) !important;
}
/* 密码可见性小图标 */
body.mira-login-page .semi-input-wrapper .semi-input-suffix,
body.mira-login-page .semi-input-wrapper svg {
  color: rgba(246, 245, 241, .38) !important;
  fill: currentColor;
}

/* 兜底：new-api 的密码框不一定走 Semi wrapper —— 所有 input 一律去掉自带背景/边框，
   只让最外层容器画框，从根上消除「大框套小框」。 */
body.mira-login-page input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  color: #f6f5f1 !important;
}
body.mira-login-page input::placeholder {
  color: rgba(246, 245, 241, .26) !important;
}
body.mira-login-page input[type="password"] {
  letter-spacing: .12em;
}
/* 邀请码框是自绘的，不受上面重置影响 */
body.mira-login-page .mira-invite-input {
  background: rgba(216, 196, 160, .05) !important;
  border: 1px solid rgba(216, 196, 160, .34) !important;
}
body.mira-login-page .mira-invite-input:focus {
  background: rgba(216, 196, 160, .09) !important;
  border-color: rgba(216, 196, 160, .78) !important;
  box-shadow: 0 0 0 3px rgba(216, 196, 160, .14) !important;
}

/* ── 主按钮 ─────────────────────────────────────────────── */
body.mira-login-page button[type="submit"],
body.mira-login-page .semi-button-primary {
  background: linear-gradient(180deg, #fbfaf6, #e2ded4) !important;
  border: 0 !important;
  color: #08080a !important;
  font-weight: 650 !important;
  border-radius: 12px !important;
  min-height: 46px !important;
  height: auto !important;
  box-shadow: 0 16px 40px rgba(246, 245, 241, .16) !important;
  transition: transform .2s cubic-bezier(.16,1,.3,1), box-shadow .2s ease !important;
}
body.mira-login-page button[type="submit"]:hover,
body.mira-login-page .semi-button-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 22px 54px rgba(246, 245, 241, .26) !important;
  filter: none !important;
}

/* ── 文字 / 链接 ────────────────────────────────────────── */
body.mira-login-page .semi-typography,
body.mira-login-page label,
body.mira-login-page h1,
body.mira-login-page h2,
body.mira-login-page h3,
body.mira-login-page h4,
body.mira-login-page span {
  color: inherit;
}
body.mira-login-page h1,
body.mira-login-page h2,
body.mira-login-page h3 {
  color: #f6f5f1 !important;
  letter-spacing: -.01em;
}
body.mira-login-page a {
  color: #d8c4a0 !important;
}
body.mira-login-page a:hover {
  color: #ecdfc6 !important;
}

/* ── 邀请码字段 ─────────────────────────────────────────── */
.mira-invite-wrap {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
.mira-invite-label {
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(246, 245, 241, .66) !important;
}
.mira-invite-input {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(216, 196, 160, .34);
  background: rgba(216, 196, 160, .05);
  color: #f4e9d3;
  font: inherit;
  font-size: 14.5px;
  letter-spacing: .1em;
  outline: none;
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.mira-invite-input::placeholder {
  color: rgba(246, 245, 241, .24);
  letter-spacing: .02em;
}
.mira-invite-input:focus {
  border-color: rgba(216, 196, 160, .78);
  background: rgba(216, 196, 160, .09);
  box-shadow: 0 0 0 3px rgba(216, 196, 160, .14);
}
.mira-invite-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(246, 245, 241, .34);
}
.mira-invite-error {
  margin: 4px 0 0;
  font-size: 12px;
  color: #ff9d9d;
}

/* ── 待审核弹窗 ─────────────────────────────────────────── */
.mira-pending__mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: miraFadeIn .3s ease both;
}
@keyframes miraFadeIn { from { opacity: 0; } to { opacity: 1; } }
.mira-pending__panel {
  width: min(430px, 100%);
  padding: 42px 34px 32px;
  border-radius: 24px;
  text-align: center;
  border: 1px solid rgba(216, 196, 160, .3);
  background:
    radial-gradient(125% 90% at 50% -12%, rgba(216, 196, 160, .18), transparent 58%),
    linear-gradient(170deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02));
  backdrop-filter: blur(34px) saturate(1.7);
  -webkit-backdrop-filter: blur(34px) saturate(1.7);
  box-shadow: 0 54px 150px rgba(0, 0, 0, .88), 0 1px 0 rgba(255, 255, 255, .1) inset;
  color: #f6f5f1;
  animation: miraPopIn .42s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes miraPopIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.mira-pending__ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #ecdfc6;
  border: 1px solid rgba(216, 196, 160, .45);
  background: rgba(216, 196, 160, .12);
  box-shadow: 0 0 32px rgba(216, 196, 160, .2);
}
.mira-pending__kicker {
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(216, 196, 160, .82);
  margin-bottom: 12px;
}
.mira-pending__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}
.mira-pending__desc {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(236, 235, 229, .56);
}
.mira-pending__btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #fbfaf6, #e2ded4);
  color: #0a0a0a;
  font-size: 14.5px;
  font-weight: 650;
  transition: transform .2s ease;
}
.mira-pending__btn:hover { transform: translateY(-1px); }
