.wk-contacts {
    width: 100%;
    height: 100%;
    border-right: 1px solid var(--wk-border-subtle);
    overflow: hidden;
    position: relative;
    background: var(--wk-bg-base);
}

.wk-contacts-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--wk-sp-2) 0;
    box-sizing: border-box;
}

/* ============================================================
   BotFather 横幅
   ============================================================ */
.wk-contacts-botfather-banner {
    display: flex;
    align-items: center;
    gap: var(--wk-sp-3);
    margin: var(--wk-sp-2) var(--wk-sp-3);
    padding: var(--wk-sp-2) var(--wk-sp-3);
    background: linear-gradient(135deg, #7C5CFC, #00D4AA);
    border-radius: var(--wk-r-md);
    cursor: pointer;
    transition: opacity var(--wk-dur-fast) var(--wk-ease);
}

.wk-contacts-botfather-banner:hover {
    opacity: 0.92;
}

.wk-contacts-botfather-avatar {
    flex-shrink: 0;
}

.wk-contacts-botfather-avatar .wk-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--wk-r-sm);
}

.wk-contacts-botfather-info {
    flex: 1;
    min-width: 0;
}

.wk-contacts-botfather-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.wk-contacts-botfather-desc {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   搜索框
   ============================================================ */
.wk-contacts-search {
    padding: var(--wk-sp-2) var(--wk-sp-3);
}

.wk-contacts-search-input {
    display: flex;
    align-items: center;
    gap: var(--wk-sp-2);
    padding: var(--wk-sp-2) var(--wk-sp-3);
    background: var(--wk-bg-elevated);
    border: 1.5px solid transparent;
    border-radius: var(--wk-r-md);
    transition: border-color var(--wk-dur-fast);
}

.wk-contacts-search-input:focus-within {
    border-color: var(--wk-brand-primary);
}

.wk-contacts-search-icon {
    flex-shrink: 0;
    color: var(--wk-text-tertiary);
}

.wk-contacts-search-input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    color: var(--wk-text-primary);
    min-width: 0;
}

.wk-contacts-search-input input::placeholder {
    color: var(--wk-text-tertiary);
}

.wk-contacts-search-clear {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--wk-text-tertiary);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.wk-contacts-search-clear:hover {
    color: var(--wk-text-secondary);
}

/* ============================================================
   搜索结果
   ============================================================ */
.wk-contacts-search-results {
    padding: var(--wk-sp-1) 0;
}

.wk-contacts-search-section {
    margin-bottom: var(--wk-sp-2);
}

.wk-contacts-search-section-title {
    padding: var(--wk-sp-1) var(--wk-sp-4);
    font-size: 11px;
    font-weight: 600;
    color: var(--wk-text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================================
   筛选标签
   ============================================================ */
.wk-contacts-filters {
    display: flex;
    gap: 6px;
    padding: var(--wk-sp-1) var(--wk-sp-4) var(--wk-sp-2);
}

.wk-contacts-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--wk-r-full);
    border: 1px solid var(--wk-border-default);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--semi-color-text-2);
    cursor: pointer;
    transition: all var(--wk-dur) var(--wk-ease);
    user-select: none;
    line-height: 1;
}

.wk-contacts-chip:hover {
    background: var(--semi-color-fill-0);
    border-color: var(--semi-color-fill-0);
}

.wk-contacts-chip.active {
    background: color-mix(in srgb, var(--wk-brand-primary) 8%, transparent);
    border-color: color-mix(in srgb, var(--wk-brand-primary) 20%, transparent);
    color: var(--wk-text-accent);
    font-weight: 600;
}

.wk-contacts-chip-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--semi-color-text-3);
}

.wk-contacts-chip.active .wk-contacts-chip-count {
    color: var(--wk-brand-primary);
}

/* ============================================================
   群标签
   ============================================================ */
.wk-contacts-group-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--wk-r-xs);
    font-size: 10px;
    font-weight: 500;
    background: var(--wk-bg-active, #E2E3EA);
    color: var(--wk-text-secondary, #5C6070);
}

/* ============================================================
   手风琴分组
   ============================================================ */
.wk-contacts-accordion {
    margin-bottom: var(--wk-sp-1);
    flex-shrink: 0;
}

.wk-contacts-accordion--expanded {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wk-contacts-accordion-header {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 var(--wk-sp-3);
    cursor: pointer;
    user-select: none;
    border-radius: var(--wk-r-sm);
    margin: 0 var(--wk-sp-2);
    transition: background var(--wk-dur-fast) var(--wk-ease);
}

.wk-contacts-accordion-header:hover {
    background: var(--wk-bg-hover);
}

.wk-contacts-accordion-arrow {
    display: inline-flex;
    align-items: center;
    color: var(--wk-text-tertiary);
    margin-right: var(--wk-sp-2);
    flex-shrink: 0;
}

.wk-contacts-accordion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    margin-right: var(--wk-sp-2);
    color: var(--wk-text-secondary);
    flex-shrink: 0;
}

.wk-contacts-accordion-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--wk-text-secondary);
    letter-spacing: 0.01em;
}

.wk-contacts-accordion-count {
    font-size: 12px;
    color: var(--wk-text-tertiary);
    font-weight: 400;
}

.wk-contacts-accordion-body {
    padding: var(--wk-sp-1) 0;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

/* 全部联系人列表 - 固定高度可滚动（虚拟列表需要） */
.wk-contacts-all-list {
    height: calc(100vh - 320px);
    overflow-y: auto;
}

/* ============================================================
   列表项
   ============================================================ */
.wk-contacts-section-item {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--wk-sp-3);
    margin: 0 var(--wk-sp-2);
    border-radius: var(--wk-r-sm);
    cursor: pointer;
    transition: background var(--wk-dur-fast) var(--wk-ease);
}

.wk-contacts-section-item:hover {
    background: var(--wk-bg-hover);
}

.wk-contacts-section-item-selected {
    background: var(--wk-brand-primary);
    color: var(--wk-text-inverse);
}

.wk-contacts-section-item-selected:hover {
    background: var(--wk-brand-primary-hover);
}

.wk-contacts-section-item-avatar {
    flex-shrink: 0;
    margin-right: var(--wk-sp-3);
}

.wk-contacts-section-item-avatar .wk-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.wk-contacts-section-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: var(--wk-text-primary);
    display: flex;
    align-items: center;
    gap: var(--wk-sp-2);
    min-width: 0;
    overflow: hidden;
}

.wk-contacts-section-item-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wk-contacts-section-item-selected .wk-contacts-section-item-name {
    color: var(--wk-text-inverse);
}

/* 角色 badge */
.wk-contacts-role-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: var(--wk-r-xs);
    line-height: 1.6;
    color: var(--wk-text-inverse);
}

.wk-contacts-role-badge--owner {
    background: var(--wk-brand-primary);
}

.wk-contacts-role-badge--admin {
    background: var(--wk-color-warning);
}

/* Bot 状态标签 */
.wk-contacts-bot-status {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--wk-r-xs);
    line-height: 1.6;
    margin-left: auto;
}

.wk-contacts-bot-status--add {
    color: var(--wk-brand-primary);
    background: var(--wk-brand-primary-light, rgba(22, 119, 255, 0.08));
    cursor: pointer;
}

.wk-contacts-bot-status--pending {
    color: var(--wk-text-tertiary);
    background: var(--wk-bg-tertiary, rgba(0, 0, 0, 0.04));
}

/* ============================================================
   字母分组 header
   ============================================================ */
.wk-contacts-letter-header {
    padding: var(--wk-sp-2) var(--wk-sp-4);
    font-size: 11px;
    font-weight: 600;
    color: var(--wk-text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================================
   空状态
   ============================================================ */
.wk-contacts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--wk-sp-4) var(--wk-sp-4) var(--wk-sp-4);
    text-align: center;
}

.wk-contacts-empty-icon {
    color: var(--wk-text-tertiary);
    margin-bottom: var(--wk-sp-3);
    opacity: 0.6;
}

.wk-contacts-empty-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--wk-text-secondary);
    margin-bottom: var(--wk-sp-1);
}

.wk-contacts-empty-sub {
    font-size: 12px;
    color: var(--wk-text-tertiary);
    line-height: 1.5;
}

/* ============================================================
   Dark mode
   ============================================================ */
body[theme-mode=dark] .wk-contacts-section-item {
    background-color: transparent;
}

body[theme-mode=dark] .wk-contacts-botfather-banner {
    opacity: 0.95;
}
