/* ===========================
   头像框尺寸定义
   根据显示位置（上下文）分配不同尺寸
   ===========================

   注意：data-frame-sub 用「包含匹配」(*) 而不是「精确匹配」(=)。
   后台填写的 sub_category 可能是 "steam,无限暖暖" 这类带后缀的文本，
   精确匹配永远命中不了，只能靠 JS 归一化——JS 加载慢或后台 AJAX
   注入的 DOM 未归一化时就会落到下面的兜底大尺寸，表现为头像框变大。
   包含匹配让原始值直接命中；服务端（{{ x|frame_sub_key }}）也会输出
   归一化后的 key，两条路径结果一致。
   =========================== */

/* 兜底尺寸：子类别未识别（default）或尚未归一化时使用。
   取各子类别中最常见的 steam/米游社 尺寸，保证兜底与目标尺寸一致，
   避免任何时序问题下出现可见的跳变。 */
.avatar-frame-image[data-frame-ctx="navbar"] {
    width: calc(17px + 30px);
    height: calc(17px + 30px);
}
.avatar-frame-image[data-frame-ctx="post"] {
    width: calc(15px + 72px);
    height: calc(15px + 72px);
}
.avatar-frame-image[data-frame-ctx="chat"] {
    width: calc(12px + 47px);
    height: calc(12px + 47px);
}
.avatar-frame-image[data-frame-ctx="profile"] {
    width: calc(40px + 120px);
    height: calc(40px + 120px);
}
.avatar-frame-image[data-frame-ctx="equip"] {
    width: calc(32px + 100px);
    height: calc(32px + 100px);
}
.frame-preview-image[data-frame-ctx="shop"] {
    width: calc(14px + 66px);
    height: calc(14px + 66px);
}

/* ---------- 导航栏（头像约 30px） ---------- */
.avatar-frame-image[data-frame-ctx="navbar"][data-frame-sub*="米游社"],
.avatar-frame-image[data-frame-ctx="navbar"][data-frame-sub*="steam"] {
    width: calc(17px + 30px);
    height: calc(17px + 30px);
}
.avatar-frame-image[data-frame-ctx="navbar"][data-frame-sub*="和平精英"] {
    width: calc(25px + 30px);
    height: calc(25px + 30px);
}

/* ---------- 帖子作者（头像约 72px） ---------- */
.avatar-frame-image[data-frame-ctx="post"][data-frame-sub*="米游社"],
.avatar-frame-image[data-frame-ctx="post"][data-frame-sub*="steam"] {
    width: calc(15px + 72px);
    height: calc(15px + 72px);
}
.avatar-frame-image[data-frame-ctx="post"][data-frame-sub*="和平精英"] {
    width: calc(25px + 72px);
    height: calc(25px + 72px);
}

/* ---------- 聊天列表（头像约 45px） ---------- */
.avatar-frame-image[data-frame-ctx="chat"][data-frame-sub*="米游社"],
.avatar-frame-image[data-frame-ctx="chat"][data-frame-sub*="steam"] {
    width: calc(12px + 47px);
    height: calc(12px + 47px);
}
.avatar-frame-image[data-frame-ctx="chat"][data-frame-sub*="和平精英"] {
    width: calc(22px + 47px);
    height: calc(22px + 47px);
}

/* ---------- 个人主页（头像约 120px） ---------- */
.avatar-frame-image[data-frame-ctx="profile"][data-frame-sub*="米游社"],
.avatar-frame-image[data-frame-ctx="profile"][data-frame-sub*="steam"] {
    width: calc(40px + 120px);
    height: calc(40px + 120px);
}
.avatar-frame-image[data-frame-ctx="profile"][data-frame-sub*="和平精英"] {
    width: calc(60px + 120px);
    height: calc(60px + 120px);
}

/* ---------- 设置预览（头像约 100px） ---------- */
.avatar-frame-image[data-frame-ctx="equip"][data-frame-sub*="米游社"],
.avatar-frame-image[data-frame-ctx="equip"][data-frame-sub*="steam"] {
    width: calc(32px + 100px);
    height: calc(32px + 100px);
}
.avatar-frame-image[data-frame-ctx="equip"][data-frame-sub*="和平精英"] {
    width: calc(52px + 100px);
    height: calc(52px + 100px);
}

/* ---------- 商店预览 ---------- */
.frame-preview-image[data-frame-ctx="shop"][data-frame-sub*="米游社"],
.frame-preview-image[data-frame-ctx="shop"][data-frame-sub*="steam"] {
    width: calc(14px + 66px);
    height: calc(14px + 66px);
}
.frame-preview-image[data-frame-ctx="shop"][data-frame-sub*="和平精英"] {
    width: calc(24px + 66px);
    height: calc(24px + 66px);
}