/**
 * 头像框系统 - 前台样式
 * 前缀: .zaf-
 * 使用主题 CSS 变量保持一致，自动适配亮/暗色
 */

/* ============================================================
   头像框叠加层（JS 注入到 .avatar-img 内）
   ============================================================ */
.zaf-frame-overlay {
    pointer-events: none !important;
    user-select: none !important;
    max-width: none !important;
    opacity: 1;
    transition: opacity 0.3s;
}

/* ============================================================
   头像框卡片列表（用户中心 + 模态框）
   ============================================================ */
.zaf-list-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zaf-list-item {
    flex: 0 0 calc(25% - 10px);
    max-width: calc(25% - 10px);
    box-sizing: border-box;
    border: 1px solid var(--main-border-color, #e5e9ef);
    border-radius: var(--main-radius, 8px);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.zaf-list-item:hover {
    border-color: var(--key-color, #1890ff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zaf-list-item a {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

.zaf-card {
    padding: 10px;
    text-align: center;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
}

.zaf-card img {
    max-width: 80px;
    max-height: 80px;
    display: block;
    margin: 0 auto;
}

.zaf-card .muted-color {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 模态框中小尺寸 */
.modal-mini .zaf-list-item {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
}

/* ============================================================
   头像框分类折叠
   ============================================================ */
.zaf-cat-box {
    margin-bottom: 15px;
}

.zaf-cat-header {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--muted-bg-color, #f5f7fa);
    border-radius: var(--main-radius, 8px);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
    user-select: none;
}

.zaf-cat-header:hover {
    background: var(--muted-bg-color, #eaeef5);
    filter: brightness(0.97);
}

.zaf-cat-toggle {
    font-size: 11px;
    color: var(--muted-color, #8590a6);
    transition: transform 0.25s ease;
}

.zaf-cat-toggle.open {
    transform: rotate(180deg);
}

.zaf-cat-box .folded {
    display: none;
}

.zaf-cat-name {
    font-weight: 600;
    color: var(--key-color, #333);
    font-size: 14px;
}

/* ============================================================
   预览弹窗 - 单个头像框
   ============================================================ */
.zaf-single-card {
    display: flex;
    justify-content: center;
    align-items: center;
}

.zaf-single-card .zaf-preview {
    position: relative;
    display: inline-block;
}

.zaf-preview .avatar {
    border-radius: 50% !important;
    width: 120px !important;
    height: 120px !important;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .zaf-list-item {
        flex: 0 0 calc(33.33% - 10px);
        max-width: calc(33.33% - 10px);
    }
}

@media (max-width: 480px) {
    .zaf-list-item {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}
