/* =========================================================
   avatar-library.css —— 角色头像库（塔拉 7-9）
   身份信息角色头像下方图库：缩略图 grid + 上传 + 命名弹窗 + 红叉删。
   用 AZOTH 主题真集变量（--card-bg/--text/--accent），随主题走。
   ========================================================= */
.avatar-lib { margin: 0 0 15px; }
.avatar-lib-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avatar-lib-title { font-size: 0.8rem; opacity: 0.7; }
.avatar-lib-count {
    font-size: 0.7rem; opacity: 0.55;
    background: rgba(128, 128, 128, 0.15); border-radius: 999px; padding: 0 8px; min-width: 18px; text-align: center;
}
.avatar-lib-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 10px; align-items: start;
}
.avatar-lib-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.avatar-lib-thumb {
    width: 64px; height: 64px; border-radius: 12px; object-fit: cover;
    border: 1px solid rgba(128, 128, 128, 0.28); cursor: pointer;
    transition: transform .12s ease, border-color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.avatar-lib-thumb:active { transform: scale(0.94); }
.avatar-lib-cell:hover .avatar-lib-thumb { border-color: var(--accent); }
.avatar-lib-name {
    font-size: 0.68rem; opacity: 0.7; max-width: 68px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}
.avatar-lib-noname { opacity: 0.4; }
.avatar-lib-del {
    position: absolute; top: -6px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
    border: none; background: #e5484d; color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); z-index: 2;
    -webkit-tap-highlight-color: transparent;
}
.avatar-lib-del:active { transform: scale(0.9); }
.avatar-lib-add {
    width: 64px; height: 64px; border-radius: 12px;
    border: 1.5px dashed rgba(128, 128, 128, 0.4); background: transparent; color: var(--text);
    opacity: 0.65; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    transition: opacity .12s ease, border-color .12s ease, color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.avatar-lib-add:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.avatar-lib-add-plus { font-size: 20px; line-height: 1; }
.avatar-lib-add-txt { font-size: 0.66rem; }

/* 命名弹窗（自绘，fixed 挂 body） */
.avatar-lib-name-backdrop {
    position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, 0.4);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.avatar-lib-name-modal {
    width: 100%; max-width: 340px; background: var(--card-bg, #fff); color: var(--text, #111);
    border-radius: 16px; padding: 20px 18px 14px; box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
}
.avatar-lib-name-h { font-size: 1rem; font-weight: 600; text-align: center; margin-bottom: 14px; }
.avatar-lib-name-input {
    width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 10px;
    border: 1.5px solid rgba(128, 128, 128, 0.35); background: transparent; color: inherit;
    font-size: 0.95rem; outline: none;
}
.avatar-lib-name-input:focus { border-color: var(--accent); }
.avatar-lib-name-btns { display: flex; gap: 10px; margin-top: 14px; }
.avatar-lib-name-btns button { flex: 1; padding: 10px; border-radius: 10px; border: none; font-size: 0.9rem; cursor: pointer; }
.avatar-lib-name-cancel { background: rgba(128, 128, 128, 0.15); color: inherit; }
.avatar-lib-name-ok { background: var(--accent, #4a7bec); color: #fff; }
