/* ============================================================
   RDG 精灵· HUD 头像 UI（重构版）
============================================================ */

/* ---- 用户面板容器（右上角布局） ---- */
#user-panel {
  position: fixed;
  top: 23px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
}

/* ============================================================
   头像外环（新增 ring-layer 独立层）
============================================================ */

.avatar-ring {
  width: 105px;
  height: 105px;
  position: relative;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: avatarGlow 3.8s ease-in-out infinite;
}

/* 色环层：必须放在头像下面，但在背景上面 */
.ring-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 1;

  background: conic-gradient(
    #3174f1 0deg 90deg,
    #249a41 90deg 200deg,
    #f6ad01 200deg 250deg,
    #e92d18 250deg 360deg
  );

  /* ★ 这里加入抗锯齿镜头镂空 ★ */

--hole: 61%;
--smooth: 1.2%;

-webkit-mask: radial-gradient(circle,
    transparent var(--hole),
    rgba(0,0,0,0.15) calc(var(--hole) + var(--smooth)),
    black calc(var(--hole) + var(--smooth) * 2)
);

mask: radial-gradient(circle,
    transparent var(--hole),
    rgba(0,0,0,0.15) calc(var(--hole) + var(--smooth)),
    black calc(var(--hole) + var(--smooth) * 2)
);


  transform: rotate(45deg); /* 保持你的色环角度修正 */
}

/* 头像层：必须最高 */
.avatar-inner {
  position: absolute;
  inset: 10.5%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;

  display: flex;
  justify-content: center;
  align-items: center;
}

#user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}


/* ============================================================
   光效（呼吸光 + hover 扩大 + 点击波纹）
============================================================ */

@keyframes avatarGlow {
  0% {
    box-shadow: 0 0 4px rgba(255,255,255,0.20);
  }
  40% {
    box-shadow: 0 0 20px rgba(255,255,255,0.70),
                0 0 40px rgba(255,255,255,0.35);
  }
  60% {
    box-shadow: 0 0 22px rgba(255,255,255,0.80),
                0 0 48px rgba(255,255,255,0.40);
  }
  100% {
    box-shadow: 0 0 4px rgba(255,255,255,0.20);
  }
}

/* Hover 光效（注意：必须同时保留 rotate(90deg)） */
.avatar-ring:hover {
  transform: scale(1.10);
}

/* 点击波纹 */
.avatar-ring:active::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  animation: ripple .35s ease-out;
}

@keyframes ripple {
  from { opacity: 0.7; transform: scale(0.85); }
  to   { opacity: 0;   transform: scale(1.5);  }
}

/* ============================================================
   下拉菜单（保留你的所有视觉效果）
============================================================ */
/* ============================================================
   RDG 精灵 · HUD 菜单（最终融合版）
   ✔ 保留你原本功能
   ✔ 全面美化
   ✔ 可直接替换旧代码
============================================================ */

/* 菜单外层 */
#user-menu {
  position: absolute;
  top: 102px;
  right: 70px;
  width: 220px;


  /* === HUD 高级玻璃背景（融合版） === */
  background:
    radial-gradient(circle at top right,
      rgba(255,255,255,0.12) 0%,
      rgba(255,255,255,0.05) 35%,
      rgba(0,0,0,0.55) 100%
    );

  border-radius: 16px;
  padding: 12px 0;

  backdrop-filter: blur(18px) saturate(200%);
  -webkit-backdrop-filter: blur(18px) saturate(200%);

box-shadow:
    0 32px 48px rgba(0,0,0,0.85),
    0 12px 28px rgba(0,0,0,0.65),
    0 4px 18px rgba(0,0,0,0.55),
    0 0 18px rgba(255,255,255,0.06),
    inset 0 0 6px rgba(255,255,255,0.05);

display: none;
opacity: 0;


  /* 展开前的初始位置（更柔和） */
  transform: translateY(-14px) scale(0.96);
  transition:
    opacity .32s ease,
    transform .32s cubic-bezier(.16,.84,.44,1);
}






/* ======== HUD 菜单背光（White Ambient Glow for Tesla） ======== */
#user-menu::before {
  content: "";
  position: absolute;
  inset: -22px;                  /* 光晕范围（比阴影更大，更柔和） */
  border-radius: 24px;

  /* HUD 式柔光 */
  background: radial-gradient(
      circle,
      rgba(255,255,255,0.30) 0%,   /* 中心亮 */
      rgba(255,255,255,0.12) 35%,  /* 光晕过渡 */
      rgba(255,255,255,0.04) 60%,
      rgba(0,0,0,0) 100%           /* 外圈完全透明 */
  );

  filter: blur(26px);             /* 柔化光晕（关键） */
  z-index: -1;                    /* 保证光在菜单背后 */
  pointer-events: none;           /* 避免遮挡点击 */
}






/* 展开菜单状态 */
#user-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 菜单项 */
.user-menu-item {
  width: 100%;
  padding: 12px 20px;
  color: #fff;
  font-size: 15px;

  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;

  position: relative;
  overflow: hidden;

  transition:
    padding-left .22s ease,
    background .22s ease;
}

/* Hover 效果（HUD 金属感流动 + 光点） */
.user-menu-item:hover {
  padding-left: 32px;
  background: rgba(255,255,255,0.12);
}

/* 左侧光点 */
.user-menu-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform .22s ease;
}

.user-menu-item:hover::before {
  transform: translateY(-50%) scale(1);
}

/* 分隔线 */
.user-menu-divider {
  margin: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
