/* group-list.css - 群聊列表页面样式 */

.group-list-page.page-full-width {
    max-width: none;
    margin: 0;
    width: 100% !important;
    background-color: transparent;
}

/* PC shell: always use desktop conversation list styling */
#app.desktop-layout .group-list-page {
    padding-bottom: 0;
    min-height: 100vh;
}

#app.desktop-layout .conversation-list-wrapper {
    padding: 10px 12px 16px;
    overflow-y: auto;
    height: calc(100vh - 64px);
}

#app.desktop-layout .conversation-header {
    position: sticky;
    top: 0;
    padding: 24px 18px 16px;
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.92), rgba(246, 250, 255, 0.78));
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    box-shadow: none;
    border-bottom: 1px solid rgba(171, 195, 225, 0.18);
}

#app.desktop-layout .conversation-header-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

#app.desktop-layout .conversation-header-btn {
    color: #3f7fd8;
    font-size: 15px;
    font-weight: 600;
}

#app.desktop-layout .conversation-header-btn.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: rgba(68, 130, 224, 0.12);
}

#app.desktop-layout .conversation-item {
    margin: 0 6px 8px;
    padding: 14px 14px;
    border-radius: 22px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 22px rgba(66, 98, 140, 0.04);
}

#app.desktop-layout .conversation-item:first-child {
    border-top: none;
}

#app.desktop-layout .conversation-item:hover {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(158, 188, 226, 0.24);
    transform: translateY(-1px);
}

#app.desktop-layout .conversation-item.active {
    background: linear-gradient(180deg, rgba(83, 160, 246, 0.18), rgba(73, 147, 237, 0.14));
    border-color: rgba(113, 173, 241, 0.28);
    transform: none;
    box-shadow: 0 16px 30px rgba(66, 120, 194, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#app.desktop-layout .conversation-item.has-unread {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.9));
    border-color: rgba(129, 177, 237, 0.22);
}

#app.desktop-layout .conversation-avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 20px rgba(72, 106, 151, 0.09);
}

#app.desktop-layout .conversation-content {
    gap: 5px;
    padding-top: 1px;
}

#app.desktop-layout .conversation-name {
    font-size: 15px;
    font-weight: 700;
    color: #142033;
}

#app.desktop-layout .conversation-preview {
    font-size: 13px;
    color: #6c7f98;
}

#app.desktop-layout .conversation-time {
    font-size: 12px;
    color: #8da0b8;
}

#app.desktop-layout .conversation-unread-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #4b9eff, #2375de);
    font-size: 11px;
    line-height: 16px;
    padding: 2px 6px;
    box-shadow: 0 8px 18px rgba(44, 118, 212, 0.24);
}

#app[data-page="group-list"] {
    min-height: 100vh;
}

.group-list-page {
    min-height: 100vh;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.conversation-header {
    position: sticky;
    top: 0;
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: calc(10px + env(safe-area-inset-top)) 18px 12px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.conversation-header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.4px;
}

.conversation-header-btn {
    border: none;
    background: none;
    color: #007aff;
    font-size: 16px;
    font-weight: 500;
    padding: 6px 4px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.conversation-header-btn.icon-button {
    width: 34px;
    height: 34px;
    border-radius: 17px;
    background-color: rgba(0, 122, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.conversation-header-btn:active {
    transform: scale(0.92);
}

.icon-plus {
    position: relative;
    width: 14px;
    height: 14px;
}
.icon-plus::before,
.icon-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background-color: #007aff;
    border-radius: 1px;
    transform: translate(-50%, -50%);
}

.icon-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.conversation-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 14px;
    width: 190px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    padding: 10px 0;
    backdrop-filter: blur(18px);
    z-index: 180;
}

.conversation-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    right: 18px;
    border-width: 0 8px 10px 8px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.98) transparent;
}

.conversation-menu-item {
    width: 100%;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    font-size: 15px;
    color: #1c1c1e;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.conversation-menu-item:active {
    transform: scale(0.97);
}

.conversation-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
}

.menu-icon-chat {
    background-color: rgba(0, 122, 255, 0.12);
    color: #007aff;
}

.menu-icon-chat::before {
    content: "群";
}

.menu-icon-contact {
    background-color: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.menu-icon-contact::before {
    content: "友";
}

.menu-icon-scan {
    background-color: rgba(88, 86, 214, 0.12);
    color: #5856d6;
}

.menu-icon-scan::before {
    content: "加";
}

.conversation-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 140;
}

.conversation-list-wrapper {
    padding: 0 0 24px;
}

.conversation-search-bar {
    padding: 10px 14px 12px;
    background:
        linear-gradient(180deg, rgba(252, 254, 255, 0.92), rgba(246, 250, 255, 0.82));
    border-bottom: 1px solid rgba(171, 195, 225, 0.14);
}

.conversation-search-shell {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(236, 243, 250, 0.82);
    border: 1px solid rgba(176, 194, 216, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.conversation-search-icon {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 2px solid #89a0bb;
    border-radius: 50%;
}

.conversation-search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: #89a0bb;
    transform: rotate(45deg);
    transform-origin: center;
}

.conversation-search-shell input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #26384d;
}

.conversation-search-shell input::placeholder {
    color: #8da1b8;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.conversation-item {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 18px;
    background-color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background-color 0.2s, padding-left 0.3s ease, transform 0.1s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.conversation-list.editing .conversation-item {
    padding-left: 60px;
    cursor: pointer;
}

.conversation-selection {
    position: absolute;
    left: -30px; /* Start hidden off-screen */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, left 0.3s ease; /* Animate left property */
}

.conversation-list.editing .conversation-selection {
    left: 18px; /* Slide into view */
}

.selection-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #007aff;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.conversation-item.selected .conversation-selection {
    border-color: #007aff;
}

.conversation-item.selected .selection-indicator {
    transform: scale(1);
}

.edit-mode-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    z-index: 100;
    box-sizing: border-box;
}

.delete-btn {
    border: none;
    background: none;
    color: #ff3b30;
    font-size: 16px;
    font-weight: 500;
    padding: 8px;
    cursor: pointer;
    margin-left: auto;
}

.delete-btn:disabled {
    color: #d1d1d6;
    cursor: not-allowed;
}

.conversation-item:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.conversation-item:hover {
    background-color: rgba(244, 244, 246, 0.8);
}

.conversation-item.active {
    background:
        linear-gradient(180deg, rgba(92, 170, 255, 0.16), rgba(73, 147, 237, 0.12));
    border-color: rgba(103, 169, 243, 0.26);
    box-shadow:
        0 14px 26px rgba(70, 126, 210, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.conversation-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background-color: #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 10px 22px rgba(61, 93, 131, 0.08);
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    letter-spacing: 0.4px;
}

.conversation-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 2px;
    border-radius: 11px;
    background-color: #007aff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
}

.conversation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-top: 2px;
}

.conversation-name {
    font-size: 17px;
    font-weight: 500;
    color: #1c1c1e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: 15px;
    color: #8e8e93;
    white-space: nowrap;
}

.conversation-preview {
    flex: 1;
    font-size: 15px;
    color: #8e8e93;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-list {
    margin: 96px auto;
    max-width: 220px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
    line-height: 1.6;
}

.empty-list::before {
    content: '📪';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}

@media (min-width: 900px) {
    /* On desktop, remove large mobile bottom padding and let page flow next to side-nav */
    .group-list-page {
        padding-bottom: 0;
        min-height: 100vh;
    }

    .conversation-list-wrapper {
        padding: 10px 12px 16px;
    }

    .conversation-header {
        position: sticky;
        top: 0;
        padding: 24px 18px 16px;
        background:
            linear-gradient(180deg, rgba(252, 254, 255, 0.92), rgba(246, 250, 255, 0.78));
        backdrop-filter: blur(10px) saturate(140%);
        -webkit-backdrop-filter: blur(10px) saturate(140%);
        box-shadow: none;
        border-bottom: 1px solid rgba(171, 195, 225, 0.18);
    }

    .conversation-header-title {
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.2px;
    }

    .conversation-header-btn {
        color: #3f7fd8;
        font-size: 15px;
        font-weight: 600;
    }

    .conversation-header-btn.icon-button {
        width: 36px;
        height: 36px;
        border-radius: 18px;
        background: rgba(68, 130, 224, 0.12);
    }

    .conversation-item {
        margin: 0 6px 8px;
        padding: 14px 14px;
        border-radius: 22px;
        border: 1px solid transparent;
        background: rgba(255, 255, 255, 0.68);
        box-shadow: 0 10px 22px rgba(66, 98, 140, 0.04);
    }

    .conversation-item:first-child {
        border-top: none;
    }

    .conversation-item:hover {
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(158, 188, 226, 0.24);
        transform: translateY(-1px);
    }

    .conversation-item.active {
        background:
            linear-gradient(180deg, rgba(83, 160, 246, 0.18), rgba(73, 147, 237, 0.14));
        border-color: rgba(113, 173, 241, 0.28);
        transform: none;
        box-shadow:
            0 16px 30px rgba(66, 120, 194, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    .conversation-item.has-unread {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.9));
        border-color: rgba(129, 177, 237, 0.22);
    }

    .conversation-avatar {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        font-size: 18px;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.28),
            0 10px 20px rgba(72, 106, 151, 0.09);
    }

    .conversation-content {
        gap: 5px;
        padding-top: 1px;
    }

    .conversation-name {
        font-size: 15px;
        font-weight: 700;
        color: #142033;
    }

    .conversation-preview {
        font-size: 13px;
        color: #6c7f98;
    }

    .conversation-time {
        font-size: 12px;
        color: #8da0b8;
    }

    .conversation-unread-badge {
        min-width: 20px;
        height: 20px;
        border-radius: 999px;
        background: linear-gradient(180deg, #4b9eff, #2375de);
        font-size: 11px;
        line-height: 16px;
        padding: 2px 6px;
        box-shadow: 0 8px 18px rgba(44, 118, 212, 0.24);
    }
}
