/* ============================================================
 * 99-装扮.css —— 头像框 / 徽章 / 称号（真实商品 ID）
 *
 * ⚠️ 这里的类名必须和 server.js 里 GIFT_CATALOG 的 css 字段**完全一致**：
 *   头像框  frame-green  青竹框   30 沙币
 *          frame-blue   海蓝框   60
 *          frame-gold   鎏金框   150
 *          frame-fire   烈焰框   300
 *   徽章    badge-star   常客     40
 *          badge-code   码农     80
 *          badge-night  夜猫     120
 *          badge-king   大侠     500
 *
 * 之前写成 frame-qingzhu/hailan/liujin/lieyan，和商品 ID 对不上，
 * 导致"买了但看不见"—— 以后改商品 ID 记得同步改这里。
 * ============================================================ */

/* ---------------- 称号标签：一律横排，不允许竖排 ----------------
 * 踩过的坑：装扮商店里的「开发者」被排成了一列三个字（竖着）。
 * 原因是那个格子是 44×44 的固定圆形，三个汉字放不下就逐字换行了。
 * 这里统一规定：所有称号标签不换行、按内容撑宽。 */
.title-newbie, .title-night, .title-ace, .title-coder, .title-dev, .title-owner,
.title-veteran, .title-legend, .title-early, .title-quiet, .title-fast,
.title-teacher, .title-gamer, .title-rich,
.title-auto1, .title-auto2, .title-auto3, .title-auto4,
.title-tag, .title-icon {
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

/* 装扮商店里的称号格子：由固定圆形改成按内容撑宽的胶囊 */
.gift-card .gift-icon.title-icon {
  width: auto;
  min-width: 44px;
  max-width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font-size: 12.5px;
  line-height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------------- 头像框 ----------------
 * 原理：给头像外面套一圈带光晕的描边 + 呼吸动画。
 * 用 box-shadow 做光晕（不会改变布局尺寸），outline 做细描边。 */
.avatar.avatar-frame {
  position: relative;
  animation: frame-breathe 2.8s ease-in-out infinite;
}

/* 青竹框：绿色 */
.avatar.frame-green {
  box-shadow: 0 0 0 2px #34a853, 0 0 8px rgba(52, 168, 83, .75);
}
/* 海蓝框：蓝色 */
.avatar.frame-blue {
  box-shadow: 0 0 0 2px #2f6fed, 0 0 10px rgba(47, 111, 237, .8);
}
/* 鎏金框：金色，光晕更亮 */
.avatar.frame-gold {
  box-shadow: 0 0 0 2px #f5b301, 0 0 12px rgba(245, 179, 1, .9), 0 0 20px rgba(245, 179, 1, .35);
}
/* 烈焰框：红橙双色光晕 */
.avatar.frame-fire {
  box-shadow: 0 0 0 2px #ff4d2e, 0 0 12px rgba(255, 77, 46, .9), 0 0 22px rgba(255, 140, 0, .45);
  animation: frame-breathe 1.6s ease-in-out infinite, frame-fire-pulse 1.6s ease-in-out infinite;
}

@keyframes frame-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}
@keyframes frame-fire-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #ff4d2e, 0 0 10px rgba(255, 77, 46, .8), 0 0 18px rgba(255, 140, 0, .35); }
  50%      { box-shadow: 0 0 0 2px #ff7a1a, 0 0 16px rgba(255, 122, 26, 1), 0 0 28px rgba(255, 140, 0, .6); }
}

/* ---------------- 徽章 ----------------
 * 画在头像右下角的一个小圆点/小标签 */
.avatar.avatar-badge {
  position: relative;
  overflow: visible;
}
.avatar.avatar-badge::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--panel, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  background: #999;
  z-index: 2;
}
.avatar.badge-star::after  { background: linear-gradient(135deg, #ffd54a, #ff9800); }
.avatar.badge-code::after  { background: linear-gradient(135deg, #4dd07a, #1f9d55); }
.avatar.badge-night::after { background: linear-gradient(135deg, #7b6cf6, #4a3ab5); }
.avatar.badge-king::after  { background: linear-gradient(135deg, #ff5f6d, #d32f2f); }

/* 小程序里 ::after 有边框会有缝隙，补一个内圈 */
.avatar.avatar-badge::before {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  z-index: 3;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .85), transparent 55%);
  pointer-events: none;
}

/* ---------------- 称号 ----------------
 * 用在消息昵称旁边、成员列表、个人主页 */
.title-tag,
.msg-title,
.name-title {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 5px;
  vertical-align: 1px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.title-newbie, .title-auto3 { background: #eef7ee; color: #2f855a; border-color: #c6e6cc; }
.title-night,  .title-auto2 { background: #f1effe; color: #5b4bc4; border-color: #d8d2fb; }
.title-ace,    .title-auto1 { background: #fff4e5; color: #b45309; border-color: #ffe0b8; }
.title-coder                 { background: #eaf3ff; color: #1d4ed8; border-color: #c7dcff; }
.title-auto4                 { background: #fff8e1; color: #a16207; border-color: #ffeaa0; }
.title-dev, .title-admin     { background: #ffe9ec; color: #c62828; border-color: #ffcdd2; }

/* ---------------- 个人主页里的展示 ---------------- */
.profile-frame-preview .avatar,
.member-list .avatar,
.msg .avatar {
  transition: transform .18s ease, box-shadow .18s ease;
}

/* 悬停时轻微放大，让装扮更明显 */
.msg .avatar:hover {
  transform: scale(1.08);
}

/* ---------------- 其余称号（自动生成，按顺序分配色系）---------------- */
.title-veteran { background: #eef7ee; color: #2f855a; border-color: #c6e6cc; }
.title-legend { background: #f1effe; color: #5b4bc4; border-color: #d8d2fb; }
.title-owner { background: #fff4e5; color: #b45309; border-color: #ffe0b8; }
.title-early { background: #eaf3ff; color: #1d4ed8; border-color: #c7dcff; }
.title-quiet { background: #ffe9ec; color: #c62828; border-color: #ffcdd2; }
.title-fast { background: #eefafb; color: #0e7490; border-color: #bae6fd; }
.title-teacher { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.title-gamer { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.title-rich { background: #fefce8; color: #a16207; border-color: #fde68a; }
