﻿/* FriendPanel 样式（配合 loop.js） */
#friend-panel.fp-panel {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 600px;
    background: var(--btn_bg_s);
    color: var(--btn_color_q);
    border-radius: 8px;
    overflow: hidden;
    z-index: 100;
    display: none;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
}

/* Top 6% */
#friend-panel .fp-top {
    height: 6%;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    text-align: center;
    background: lch(0 0 0 / 0.2);
}

#friend-panel .fp-title {
    font-size: 18px;
    font-weight: 600;
}

/* Mid 86% */
#friend-panel .fp-mid {
    height: 86%;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

/* Loop items container fallback */
#friend-panel .fp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item base (loop.js 会创建 .loop-item .loop-item-inner) */
#friend-panel .loop-item {
    width: 100%;
    box-sizing: border-box;
}

#friend-panel .loop-item-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    box-sizing: border-box;
    min-height: 64px; /* 近似 5:1 视觉 */
}

.fp-item {
    display: flex;
    width: 100%;
    height: 100%;
    border-bottom: 1px solid var(--btn_color_q);
    align-items: center;
    justify-content: space-between; /* 确保右侧区域始终靠右 */
}

/* Left area */
.fp-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto; /* 左侧占满剩余空间，右侧保持紧凑，从而右对齐 */
}

.fp-avatar-wrap {
    position: relative;
    max-height: 50px;
    flex: 0 0 56px;
}

.fp-avatar {
    max-height: 50px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
}

.fp-avatar-frame {
    position: absolute;
    left: 0;
    top: 0;
    max-height: 50px;
    pointer-events: none;
}

.fp-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fp-name {
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-meta {
    font-size: 12px;
    color: #ccc;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right area (icon/buttons) */
.fp-item-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 12px;
}

.fp-action {
    background: var(--btn_bg_q);
    border: 1px solid var(--btn_bg_s);
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .fp-action img {
        width: 24px;
        height: 24px;
        display: block;
    }

    .fp-action.disabled img {
        opacity: 0.4;
    }

    .fp-action.disabled {
        opacity: 0.6;
        pointer-events: none;
    }

/* Bottom 8%：新布局，左侧关闭图标，右侧三文本按钮（右对齐） */
#friend-panel .fp-bottom {
    height: 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 8px;
    box-sizing: border-box;
}

.fp-footer-left {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex: 0 0 auto;
}

.fp-footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 1 1 auto;
}

/* 文字按钮样式（参考 bag.js 布局） */
.fp-tab {
    background: var(--btn_bg_s);
    border: none;
    padding: 6px 0px;
    cursor: pointer;
    border-radius: 3px;
    color: var(--btn_color_q);
    font-weight: 600;
    min-width: 70px;
    text-align: center;
    font-size: 13px;
}

.fp-tab-active {
    background: var(--btn_bg_q);
    color: var(--btn_color_s);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* 关闭按钮保持图标样式 */
.fp-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .fp-btn img {
        max-height: 35px;
    }

/* Search box styles inside loop container
   调整：使搜索区域在容器中水平居中（左右居中对齐），并在窄屏时自动换行 */
.fp-search-box {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center; /* ← 新增：水平方向居中对齐 */
    padding-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap; /* 窄屏时换行以避免溢出 */
}

/* 限制输入宽度以避免在大屏时过宽，同时允许在小屏缩放 */
.fp-search-input {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--btn_bg_s);
    background: var(--btn_bg_q);
    color: var(--btn_color_s);
    width: min(60%, 420px); /* 更灵活的宽度，居中时效果更好 */
    font-size: 14px;
}

/* 搜索/返回 使用图标按钮的内联样式微调 */
.fp-search-icon img,
.fp-back-icon img {
    max-height: 30px;
    display: block;
}
