/**
 * @用户选择弹窗样式
 * 用于 SNS 首页快捷发布和评论区
 */

/* ========== 弹窗遮罩 ========== */
.ls-at-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.ls-at-overlay.show {
    opacity: 1;
}

/* ========== 弹窗主体 ========== */
.ls-at-modal {
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.ls-at-overlay.show .ls-at-modal {
    transform: translateY(0) scale(1);
}

/* ========== 头部 ========== */
.ls-at-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
}

.ls-at-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.ls-at-title span {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

.ls-at-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 14px;
}

.ls-at-close:hover {
    background: #e5e5e5;
    color: #333;
    transform: rotate(90deg);
}

/* ========== 搜索框 ========== */
.ls-at-search {
    padding: 0 20px 14px;
}

.ls-at-search-wrap {
    position: relative;
}

.ls-at-search-wrap > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

.ls-at-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: #f8f9fa;
    box-sizing: border-box;
}

.ls-at-search input::placeholder {
    color: #aaa;
}

.ls-at-search input:focus {
    border-color: var(--ls-color-primary, #1890ff);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* ========== 用户列表区域 ========== */
.ls-at-body {
    flex: 1;
    min-height: 200px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 12px;
    background: #fafbfc;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.ls-at-body::-webkit-scrollbar {
    width: 5px;
}

.ls-at-body::-webkit-scrollbar-track {
    background: transparent;
}

.ls-at-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.ls-at-body::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.ls-at-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ========== 用户项 ========== */
.ls-at-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    border: 1px solid transparent;
}

.ls-at-item:hover {
    border-color: #e8e8e8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ls-at-item.selected {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ls-at-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    flex-shrink: 0;
    position: relative;
}

.ls-at-item-avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.ls-at-item-avatar .ls-verify-icon {
    display: block;
}

.ls-at-item-avatar .ls-verify-icon img {
    width: 14px;
    height: 14px;
    position: absolute;
    right: -2px;
    bottom: -1px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: #fff;
}

.ls-at-item-info {
    flex: 1;
    min-width: 0;
}

.ls-at-item-name {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-at-item-name .ls-verify-icon {
    margin-left: 4px;
    vertical-align: middle;
}

.ls-at-item-id {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.ls-at-item-check {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 11px;
}

.ls-at-item.selected .ls-at-item-check {
    background: var(--ls-color-primary, #1890ff);
    border-color: var(--ls-color-primary, #1890ff);
    color: #fff;
}

/* ========== 已选用户区域 ========== */
.ls-at-selected {
    padding: 14px 20px;
    background: #fff;
}

.ls-at-selected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ls-at-selected-title {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.ls-at-selected-count {
    font-size: 11px;
    color: #fff;
    background: var(--ls-color-primary, #1890ff);
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.ls-at-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 80px;
    min-height: 32px;
    overflow-y: auto;
    align-content: flex-start;
}

.ls-at-selected-list::-webkit-scrollbar {
    width: 3px;
}

.ls-at-selected-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.ls-at-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    transition: all 0.15s;
    max-width: 140px;
}

.ls-at-selected-tag:hover {
    background: #fff;
    border-color: #ddd;
}

.ls-at-selected-tag-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.ls-at-selected-tag-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ls-at-selected-tag-name {
    font-size: 12px;
    color: #333;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-at-selected-tag-remove {
    width: 16px;
    height: 16px;
    border: none;
    background: #e8e8e8;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
    border-radius: 50%;
    transition: all 0.15s;
    margin-left: 2px;
    flex-shrink: 0;
}

.ls-at-selected-tag-remove:hover {
    background: #ffebee;
    color: #f44336;
}

.ls-at-selected-empty {
    color: #bbb;
    font-size: 12px;
    padding: 6px 0;
    text-align: center;
    width: 100%;
}

/* ========== 底部按钮 ========== */
.ls-at-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 16px;
}

.ls-at-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ls-at-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.ls-at-btn-cancel:hover {
    background: #e5e5e5;
    color: #333;
}

.ls-at-btn-confirm {
    background: var(--ls-color-primary, #1890ff);
    color: #fff;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.3);
}

.ls-at-btn-confirm:hover {
    filter: brightness(1.1);
    box-shadow: 0 3px 10px rgba(24, 144, 255, 0.4);
    transform: translateY(-1px);
}

.ls-at-btn-confirm:active {
    transform: translateY(0);
}

/* ========== 空状态和加载状态 ========== */
.ls-at-empty,
.ls-at-loading {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    padding: 40px 20px;
}

.ls-at-empty i,
.ls-at-loading i {
    font-size: 40px;
    margin-bottom: 12px;
    color: #ddd;
}

.ls-at-empty span,
.ls-at-loading span {
    font-size: 13px;
}

/* ========== @用户标签（评论区/发布区展示） ========== */
.ls-at-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
}

.ls-at-tags:empty {
    display: none;
}

.ls-at-tags .at {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 3px;
    background: #f0f7ff;
    border: 1px solid #d6e8fa;
    border-radius: 14px;
    font-size: 12px;
    color: var(--ls-color-primary, #1890ff);
    cursor: pointer;
    transition: all 0.15s;
}

.ls-at-tags .at:hover {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #f44336;
}

.ls-at-tags .at img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ls-at-tags .at .at-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 分组标题 ========== */
.ls-at-group-title {
    font-size: 11px;
    color: #999;
    padding: 8px 10px 4px;
    font-weight: 500;
}
