.kf-widget {
    position: fixed;
    bottom: var(--kf-bottom, 100px);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.kf-widget.kf-left { left: 20px; }
.kf-widget.kf-right { right: 20px; }
.kf-toggle {
    width: 54px;
    height: 54px;
    background: var(--kf-theme-color, #2196F3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}
.kf-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.kf-toggle i {
    font-size: 26px;
    color: #fff;
    transition: transform 0.3s;
}
.kf-widget.active .kf-toggle i { transform: rotate(90deg); }
.kf-status {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
}
.kf-status.online { background: #4CAF50; }
.kf-status.offline { background: #9e9e9e; }

.kf-panel {
    position: absolute;
    bottom: 70px;
    width: 280px;
    background: var(--kf-panel-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}
.kf-left .kf-panel { left: 0; }
.kf-right .kf-panel { right: 0; }
.kf-widget.active .kf-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.kf-header {
    background: var(--kf-theme-color, #2196F3);
    padding: 18px 20px;
    color: #fff;
}
.kf-header-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kf-header-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kf-header-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.kf-header-status i.online { background: #a5d6a7; }
.kf-header-status i.offline { background: rgba(255,255,255,0.5); }

.kf-list {
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}
.kf-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: var(--kf-item-bg, #f8f9fa);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}
.kf-item:last-child { margin-bottom: 0; }
.kf-item:hover {
    background: var(--kf-item-hover-bg, #e3f2fd);
    transform: translateX(4px);
}
.kf-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}
.kf-item-icon i { font-size: 20px; color: #fff; }
.kf-item-icon.qq { background: linear-gradient(135deg, #12B7F5, #0d8ecf); }
.kf-item-icon.wx { background: linear-gradient(135deg, #07C160, #06ae56); }
.kf-item-icon.tg { background: linear-gradient(135deg, #0088cc, #006699); }
.kf-item-icon.pt { background: linear-gradient(135deg, #ff6b35, #e55a2b); }
.kf-item-icon.wa { background: linear-gradient(135deg, #25D366, #128C7E); }
.kf-item-icon.email { background: linear-gradient(135deg, #EA4335, #c5221f); }
.kf-item-icon.phone { background: linear-gradient(135deg, #4CAF50, #388E3C); }
.kf-item-icon.link { background: linear-gradient(135deg, #9C27B0, #7B1FA2); }

.kf-item-info { flex: 1; min-width: 0; }
.kf-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--kf-text-color, #333333);
    margin-bottom: 2px;
}
.kf-item-account {
    font-size: 12px;
    color: var(--kf-sub-text-color, #999999);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kf-item-arrow {
    color: #ccc;
    font-size: 16px;
    margin-left: 8px;
}

.kf-footer {
    padding: 12px 16px;
    background: var(--kf-item-bg, #f8f9fa);
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 12px;
    color: var(--kf-sub-text-color, #999999);
    text-align: center;
}

html[data-theme="dark"] .kf-panel { background: #1e1e1e; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
html[data-theme="dark"] .kf-item { background: #2a2a2a; }
html[data-theme="dark"] .kf-item:hover { background: #333; }
html[data-theme="dark"] .kf-item-name { color: #e0e0e0; }
html[data-theme="dark"] .kf-item-account { color: #888; }
html[data-theme="dark"] .kf-footer { background: #252525; border-color: #333; color: #777; }
html[data-theme="dark"] .kf-list::-webkit-scrollbar-track { background: #2a2a2a; }
html[data-theme="dark"] .kf-list::-webkit-scrollbar-thumb { background: #444; }

.kf-list::-webkit-scrollbar { width: 4px; }
.kf-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 2px; }
.kf-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

@media (max-width: 480px) {
    .kf-widget { bottom: var(--kf-mobile-bottom, 80px); }
    .kf-widget.kf-left { left: 15px; }
    .kf-widget.kf-right { right: 15px; }
    .kf-toggle { width: 48px; height: 48px; }
    .kf-toggle i { font-size: 22px; }
    .kf-panel { width: 260px; }
}
