/* ===== 好友面板 - 从右侧滑入 ===== */

/* 遮罩层 */
.friends-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.friends-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 面板主体 - 从右侧滑入 */
.friends-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 88vw;
    z-index: 9001;
    background: rgba(22, 24, 32, 0.72);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.friends-panel.active {
    transform: translateX(0);
}

/* 拖拽指示条 */
.friends-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* 标题栏 */
.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    padding-top: 28px;
}

.friends-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.friends-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.friends-close:active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(0.9);
}

/* 分类标签栏 */
.friends-tabs {
    display: flex;
    padding: 8px 16px 0;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-tab {
    flex: 1;
    padding: 10px 6px 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.friends-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, #34d399, #10b981);
    transition: width 0.3s ease;
}

.friends-tab.active {
    color: #fff;
}

.friends-tab.active::after {
    width: 60%;
}

.friends-tab:active {
    color: rgba(255, 255, 255, 0.7);
}

/* 内容区域 */
.friends-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 20px;
    -webkit-overflow-scrolling: touch;
}

.friends-content::-webkit-scrollbar {
    width: 3px;
}

.friends-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* 加载状态 */
.friends-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.friends-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #34d399;
    border-radius: 50%;
    animation: friendsSpin 0.8s linear infinite;
}

@keyframes friendsSpin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.friends-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    gap: 12px;
}

.friends-empty-icon {
    font-size: 48px;
    opacity: 0.6;
}

.friends-empty-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* ===== 好友列表项 ===== */
.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.friend-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2px;
}

.friend-action-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.friend-action-btn:active {
    transform: scale(0.92);
}

/* 访问按钮 */
.friend-visit-btn {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* 已添加状态 */
.friend-added-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 添加好友按钮 */
.friend-add-btn {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* 待处理状态 */
.friend-pending-btn {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* 拒绝/删除按钮 */
.friend-reject-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== 访客列表项 ===== */
.visitor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.visitor-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.visitor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
}

.visitor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.visitor-info {
    flex: 1;
    min-width: 0;
}

.visitor-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.visitor-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== 邀请好友按钮 ===== */
.invite-section {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.invite-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    letter-spacing: 0.3px;
}

.invite-btn {
    width: 100%;
    max-width: 240px;
    padding: 14px 0;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
    letter-spacing: 0.5px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.invite-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.2);
}

.invite-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* ===== 搜索栏 ===== */
.friends-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 12px;
}

.friends-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.friends-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.friends-search-input:focus {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.friends-search-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.friends-search-btn:active {
    transform: scale(0.94);
}

/* ===== 安全区域 ===== */
.friends-safe-area {
    height: env(safe-area-inset-bottom, 0px);
    flex-shrink: 0;
}

