.wechat-contacts-page {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    color: #2d2527;
    background:
        radial-gradient(circle at 16% 8%, rgba(212, 160, 160, 0.28), transparent 32%),
        radial-gradient(circle at 86% 18%, rgba(123, 184, 212, 0.18), transparent 30%),
        linear-gradient(180deg, #fffaf7 0%, #faf6f0 54%, #f5eceb 100%);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wechat-contacts-page.active {
    display: flex;
}

.wechat-contacts-page::before,
.wechat-contacts-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(1px);
}

.wechat-contacts-page::before {
    width: 170px;
    height: 170px;
    right: -54px;
    top: 92px;
    background: rgba(195, 160, 212, 0.18);
}

.wechat-contacts-page::after {
    width: 210px;
    height: 210px;
    left: -92px;
    bottom: 88px;
    background: rgba(140, 197, 168, 0.16);
}

.wechat-contacts-header {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto);
    align-items: center;
    column-gap: 4px;
    padding: 10px 14px 12px;
    background: rgba(250, 246, 240, 0.72);
    border-bottom: 1px solid rgba(212, 160, 160, 0.28);
    box-shadow: 0 8px 28px rgba(137, 92, 96, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.wechat-contacts-header .wechat-back-btn {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 2;
}

.wechat-contacts-titlebox {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.wechat-contacts-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #5f4448;
    text-align: center;
}

.wechat-contacts-body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px calc(88px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wechat-contacts-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.wechat-contacts-support-card,
.wechat-contacts-list-card {
    border: 2px solid rgba(48, 37, 39, 0.9);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.88), rgba(250,246,240,.74)),
        radial-gradient(circle at 0 0, rgba(212,160,160,.18), transparent 34%);
    box-shadow: 7px 7px 0 rgba(48, 37, 39, 0.92);
}

.wechat-contacts-support-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin: 0 0 18px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wechat-contacts-support-card:active,
.wechat-contacts-friend:active {
    transform: translate(1px, 1px);
}

.wechat-contacts-support-avatar,
.wechat-contacts-avatar {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border: 2px solid rgba(48, 37, 39, 0.9);
    border-radius: 18px;
    overflow: hidden;
    background: #ead8dc;
    box-shadow: 3px 3px 0 rgba(48, 37, 39, 0.85);
}

.wechat-contacts-support-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: grayscale(.25) sepia(.22) saturate(.55) hue-rotate(300deg) brightness(1.08) contrast(.9) opacity(.92);
    mix-blend-mode: multiply;
}

.wechat-contacts-support-main,
.wechat-contacts-main {
    flex: 1 1 auto;
    min-width: 0;
}

.wechat-contacts-support-name,
.wechat-contacts-name {
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
    color: #3f2d30;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wechat-contacts-support-desc,
.wechat-contacts-desc {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
    color: rgba(63, 45, 48, .62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wechat-contacts-support-badge,
.wechat-contacts-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 9px;
    border: 1.5px solid rgba(63, 45, 48, .72);
    border-radius: 999px;
    background: rgba(212, 160, 160, 0.22);
    color: #6a464b;
    font-size: 11px;
    font-weight: 700;
}

.wechat-contacts-list-card {
    padding: 12px 0 8px;
    overflow: hidden;
}

.wechat-contacts-section-title {
    padding: 0 16px 10px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(63, 45, 48, .72);
    letter-spacing: .08em;
}

.wechat-contacts-friend {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-top: 1px dashed rgba(95, 68, 72, .2);
    background: transparent;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.wechat-contacts-friend:first-child {
    border-top: 0;
}

.wechat-contacts-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, #d4a0a0, #c3a0d4);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

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

.wechat-contacts-empty {
    padding: 38px 18px 42px;
    text-align: center;
    color: rgba(63, 45, 48, .6);
}

.wechat-contacts-empty-title {
    font-size: 15px;
    font-weight: 800;
    color: #5f4448;
}

.wechat-contacts-empty-desc {
    margin-top: 7px;
    font-size: 12px;
}

.wechat-nav-svg {
    width: 28px;
    height: 28px;
    color: #333;
}

.wechat-nav-item.active .wechat-nav-svg {
    color: #d4a0a0;
}

@media (max-width: 390px) {
    .wechat-contacts-body {
        padding-left: 10px;
        padding-right: 10px;
    }

    .wechat-contacts-support-card,
    .wechat-contacts-friend {
        gap: 10px;
    }

    .wechat-contacts-title {
        font-size: 22px;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .wechat-contacts-header {
        background: rgba(250, 246, 240, .96);
    }
}

/* 与微信消息 / 发现页统一：柔和玻璃、浅底、圆角列表，不再使用重描边水彩卡片。 */
.wechat-contacts-page {
    color: #1f2326;
    background:
        linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(250,250,250,.72) 52%, rgba(246,251,249,.82) 100%),
        radial-gradient(circle at 50% 44%, rgba(190, 225, 215, .18), transparent 32%);
}

.wechat-contacts-page::before,
.wechat-contacts-page::after {
    display: none;
}

.wechat-contacts-header {
    min-height: 52px;
    padding: 8px 18px 10px;
    background: rgba(255, 255, 255, .76);
    border-bottom: 1px solid rgba(255, 255, 255, .74);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 10px 30px rgba(88, 120, 112, .08);
}

.wechat-contacts-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #1f2326;
    text-align: center;
}

.wechat-contacts-body {
    padding: 14px 16px calc(92px + env(safe-area-inset-bottom, 0px));
}

.wechat-contacts-support-card,
.wechat-contacts-list-card {
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 22px;
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 10px 30px rgba(70, 92, 86, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.wechat-contacts-support-card {
    padding: 12px 14px;
    margin-bottom: 12px;
}

.wechat-contacts-support-card:active,
.wechat-contacts-friend:active {
    transform: scale(.992);
}

.wechat-contacts-support-avatar,
.wechat-contacts-avatar {
    border: none;
    border-radius: 14px;
    box-shadow: none;
    background: rgba(225, 241, 236, .92);
}

.wechat-contacts-support-avatar {
    width: 56px;
    height: 56px;
}

.wechat-contacts-support-name,
.wechat-contacts-name {
    color: #1f2326;
    font-size: 16px;
    font-weight: 700;
}

.wechat-contacts-support-desc,
.wechat-contacts-desc {
    color: rgba(31, 35, 38, .52);
}

.wechat-contacts-support-badge,
.wechat-contacts-tag {
    border: none;
    height: 22px;
    min-width: 36px;
    background: rgba(226, 244, 238, .92);
    color: #31826f;
    font-size: 11px;
}

.wechat-contacts-list-card {
    padding: 10px 0;
}

.wechat-contacts-section-title {
    padding: 0 16px 8px;
    color: rgba(31, 35, 38, .45);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.wechat-contacts-friend {
    min-height: 72px;
    padding: 10px 16px;
    border-top: 1px solid rgba(236, 240, 238, .88);
}

.wechat-contacts-friend:hover {
    background: rgba(245, 250, 248, .72);
}

.wechat-contacts-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #e1f1ec, #f3e5ea);
    color: #477d6f;
}

.wechat-contacts-empty {
    color: rgba(31, 35, 38, .48);
}

.wechat-contacts-empty-title {
    color: #1f2326;
}

.wechat-contacts-page .wechat-bottom-nav {
    margin: 0 10px 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .82);
    box-shadow: 0 -4px 26px rgba(68, 89, 83, .1);
}

.wechat-contacts-page .wechat-nav-item.active {
    margin: 4px 6px;
    border-radius: 18px;
    background: rgba(226, 244, 238, .96);
}

.wechat-contacts-page .wechat-nav-item.active .wechat-nav-svg,
.wechat-contacts-page .wechat-nav-item.active .wechat-nav-text {
    color: #2f8b76;
}

html[data-appearance="dark"] .wechat-contacts-page {
    background: linear-gradient(180deg, #111214 0%, #17191c 100%);
    color: #f5f5f7;
}

html[data-appearance="dark"] .wechat-contacts-header,
html[data-appearance="dark"] .wechat-contacts-support-card,
html[data-appearance="dark"] .wechat-contacts-list-card,
html[data-appearance="dark"] .wechat-contacts-page .wechat-bottom-nav {
    background: rgba(24, 24, 28, .92);
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 .5px rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.24);
}

/* 夜间：通讯录页状态栏（顶部时间/信号栏）与 消息/发现/我 页保持一致的深色，避免顶部仍是浅色亮条 */
html[data-appearance="dark"] .wechat-contacts-page > .status-bar {
    background: #121214 !important;
    color: #f5f5f7 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html[data-appearance="dark"] .wechat-contacts-page > .status-bar .status-left,
html[data-appearance="dark"] .wechat-contacts-page > .status-bar .status-icon-svg {
    color: rgba(245, 245, 250, .92) !important;
}

/* 夜间：底栏未选中项的文字/图标可读性（基础 .wechat-nav-svg 为 #333，在深色底上几乎不可见） */
html[data-appearance="dark"] .wechat-contacts-page .wechat-nav-text,
html[data-appearance="dark"] .wechat-contacts-page .wechat-nav-svg {
    color: rgba(245, 245, 250, .78) !important;
}

/* 夜间：底部「通讯录」高亮态不再用浅薄荷绿亮块，改为深色友好的半透明绿 + 浅绿文字/图标 */
html[data-appearance="dark"] .wechat-contacts-page .wechat-nav-item.active {
    background: rgba(95, 159, 145, .18) !important;
}

html[data-appearance="dark"] .wechat-contacts-page .wechat-nav-item.active .wechat-nav-svg,
html[data-appearance="dark"] .wechat-contacts-page .wechat-nav-item.active .wechat-nav-text {
    color: #7fd8c2 !important;
}

html[data-appearance="dark"] .wechat-contacts-title,
html[data-appearance="dark"] .wechat-contacts-support-name,
html[data-appearance="dark"] .wechat-contacts-name,
html[data-appearance="dark"] .wechat-contacts-empty-title {
    color: #f5f5f7;
}

html[data-appearance="dark"] .wechat-contacts-support-desc,
html[data-appearance="dark"] .wechat-contacts-desc,
html[data-appearance="dark"] .wechat-contacts-section-title,
html[data-appearance="dark"] .wechat-contacts-empty {
    color: rgba(245,245,247,.58);
}

/* 「我的好友 / 我的群组」页签行（位于列表卡片标题处） */
.wechat-contacts-section-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 10px;
}

.wechat-contacts-section-tab {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 14px;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: rgba(31, 35, 38, .45);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.wechat-contacts-section-tab.is-active {
    background: rgba(226, 244, 238, .96);
    border-color: rgba(47, 139, 118, .16);
    color: #2f8b76;
}

.wechat-contacts-section-tab:active {
    transform: scale(.97);
}

html[data-appearance="dark"] .wechat-contacts-section-tab {
    color: rgba(245, 245, 247, .55);
}

html[data-appearance="dark"] .wechat-contacts-section-tab.is-active {
    background: rgba(47, 139, 118, .22);
    border-color: rgba(47, 139, 118, .35);
    color: #7fd8c2;
}
