/* ==================== 固定悬浮客服入口组件 ==================== */
.cs-float-widget {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    align-items: center;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 触发按钮 - 默认窄条状态 */
.cs-float-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    padding: 14px 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.cs-float-trigger:hover {
    width: 48px;
    background: linear-gradient(180deg, #2d2d44 0%, #3d3d5c 100%);
}

.cs-trigger-icon {
    width: 22px;
    height: 22px;
    color: #ff9f40;
    transition: transform 0.3s ease;
}

.cs-trigger-icon svg {
    width: 100%;
    height: 100%;
}

.cs-float-trigger:hover .cs-trigger-icon {
    transform: scale(1.1);
}

.cs-trigger-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
}

/* 展开面板 */
.cs-float-panel {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    width: 260px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: -8px 8px 40px rgba(0, 0, 0, 0.12),
                0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover 展开效果 */
.cs-float-widget:hover .cs-float-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.cs-float-widget:hover .cs-float-trigger {
    border-radius: 0;
}

/* 面板头部 */
.cs-panel-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.cs-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.cs-panel-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* 二维码区域 */
.cs-panel-qrcode {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    padding: 8px;
    background: #ffffff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
}

.cs-float-widget:hover .cs-panel-qrcode {
    border-color: #ff9f40;
    box-shadow: 0 4px 16px rgba(255, 159, 64, 0.15);
}

.cs-panel-qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* 联系信息 */
.cs-panel-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cs-info-item:hover {
    background: #f1f5f9;
}

.cs-info-icon {
    width: 18px;
    height: 18px;
    color: #ff9f40;
    flex-shrink: 0;
}

.cs-info-icon svg {
    width: 100%;
    height: 100%;
}

.cs-info-text {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

/* 面板装饰线条 */
.cs-float-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9f40 0%, #ffb347 50%, #ffc857 100%);
    border-radius: 16px 16px 0 0;
}

/* 面板连接三角形 */
.cs-float-panel::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #ffffff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .cs-float-widget {
        right: 0;
        top: auto;
        bottom: 100px;
        transform: none;
    }

    .cs-float-trigger {
        width: 40px;
        padding: 12px 0;
    }

    .cs-float-panel {
        right: 40px;
        width: 240px;
        padding: 20px;
    }

    .cs-panel-qrcode {
        width: 160px;
        height: 160px;
    }

    .cs-trigger-text {
        font-size: 11px;
        letter-spacing: 3px;
    }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
    .cs-float-widget {
        bottom: 80px;
    }

    .cs-float-panel {
        width: 220px;
        padding: 16px;
        right: 40px;
    }

    .cs-panel-qrcode {
        width: 140px;
        height: 140px;
        margin-bottom: 16px;
    }

    .cs-panel-title {
        font-size: 16px;
    }

    .cs-info-text {
        font-size: 12px;
    }
}

/* 深色模式 - 客服浮窗 */
[data-theme="dark"] .cs-float-panel {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .cs-panel-title {
    color: var(--color-text-primary);
}

[data-theme="dark"] .cs-panel-subtitle {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .cs-info-item {
    background: var(--color-bg);
}

[data-theme="dark"] .cs-info-item:hover {
    background: var(--color-surface-hover);
}

[data-theme="dark"] .cs-info-text {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .cs-float-panel::after {
    border-left-color: var(--color-surface);
}

