/* =========================================================
   头像框：可缩放的 SVG 金属 / 宝石框，全站头像通用
   ========================================================= */
.avatar-frame {
  position: relative !important;
  border-radius: 50% !important;
  overflow: visible !important;
  isolation: isolate;
}
.avatar-frame::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: -16%;
  border-radius: 50%;
  background: var(--frame-image) center / 100% 100% no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 0 5px var(--frame-glow, rgba(255, 255, 255, 0.15)));
  animation: avatarFrameBreathe 4.5s ease-in-out infinite;
}
.avatar-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 55%, var(--frame-glow, rgba(255, 255, 255, 0.1)) 78%, transparent 90%);
  opacity: 0.45;
  pointer-events: none;
}
.avatar-frame-gold {
  --frame-image: url("/assets/img/avatar-frames/gold.svg");
  --frame-glow: rgba(255, 205, 92, 0.45);
}
.avatar-frame-frost {
  --frame-image: url("/assets/img/avatar-frames/frost.svg");
  --frame-glow: rgba(130, 220, 255, 0.4);
}
.avatar-frame-amethyst {
  --frame-image: url("/assets/img/avatar-frames/amethyst.svg");
  --frame-glow: rgba(185, 120, 255, 0.4);
}
.avatar-frame-emerald {
  --frame-image: url("/assets/img/avatar-frames/emerald.svg");
  --frame-glow: rgba(110, 240, 170, 0.38);
}
.avatar-frame-crimson {
  --frame-image: url("/assets/img/avatar-frames/crimson.svg");
  --frame-glow: rgba(255, 105, 65, 0.42);
}
@keyframes avatarFrameBreathe {
  0%, 100% { opacity: 0.86; }
  50% { opacity: 1; }
}

/* 已有头像框时，隐藏个人主页原来的默认圆环 */
.pf-avatar.avatar-frame + .pf-ring {
  display: none !important;
}

/* 小头像上略收亮，避免在表格里抢视线 */
.mini-avatar.avatar-frame::before,
.wall-avatar-sm.avatar-frame::before,
.live-chat-avatar.avatar-frame::before {
  opacity: 0.82;
  filter: drop-shadow(0 0 2px var(--frame-glow, rgba(255, 255, 255, 0.1)));
}
.mini-avatar.avatar-frame::after,
.wall-avatar-sm.avatar-frame::after,
.live-chat-avatar.avatar-frame::after {
  display: none;
}

/* 设置页：头像框选择器 */
.avatar-fx-picker {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.avatar-fx-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar-fx-head span {
  color: #eeeae0;
  font-size: 12px;
  font-weight: 600;
}
.avatar-fx-head i {
  color: rgba(238, 234, 224, 0.32);
  font-size: 8px;
  letter-spacing: 0.14em;
}
.avatar-fx-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.avatar-fx-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: #eeeae0;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.avatar-fx-option:hover {
  border-color: rgba(255, 255, 255, 0.3);
}
.avatar-fx-option.is-active {
  border-color: var(--accent);
  background: rgba(255, 47, 174, 0.07);
}
.avatar-fx-option b {
  font-size: 10px;
  font-weight: 500;
}
.avatar-fx-option i {
  color: rgba(238, 234, 224, 0.32);
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.08em;
}
.avatar-fx-sample {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #171a22;
  color: #eeeae0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}
.avatar-fx-option.is-active .avatar-fx-sample {
  background: #1d202a;
}
@media (max-width: 640px) {
  .avatar-fx-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-frame::before {
    animation: none !important;
  }
}
