/* =======================================================
   自定义UI组件样式
   包含：按钮式单选按钮组、滑动开关
   ======================================================= */

/* =====================================================
   按钮式单选按钮组
   ===================================================== */

/* 按钮式单选按钮组容器 */
.btn-radio-group {
    display: flex;
    align-items: center;
    gap: 0;
}

/* 隐藏原生单选按钮 */
.btn-radio-group input[type="radio"] {
    display: none;
}

/* 单选按钮标签样式 */
.btn-radio-group label {
    border: 1px solid #ddd;
    padding: 10px 16px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-right: 0;
    margin-left: 10px;
    user-select: none;
    height: 40px;
    width: 120px; /* 与输入框宽度一致 */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center; /* 文字居中 */
}

/* 第一个按钮不需要左边距 */
.btn-radio-group label:first-of-type {
    margin-left: 0;
}

/* 悬停效果 */
.btn-radio-group label:hover {
    border-color: #999;
    background: #f9f9f9;
}

/* 选中状态 */
.btn-radio-group input[type="radio"]:checked + label {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* =====================================================
   滑动开关
   ===================================================== */

/* 隐藏原生复选框 */
.toggle-switch input[type="checkbox"] {
    display: none;
}

/* 开关容器 */
.toggle-switch .switch-container {
    position: relative;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 开关轨道 */
.toggle-switch .switch-track {
    width: 50px;
    height: 26px;
    background: #ddd;
    border: 1px solid #ccc;
    position: relative;
    transition: all 0.3s ease;
}

/* 开关滑块 */
.toggle-switch .switch-thumb {
    width: 22px;
    height: 22px;
    background: #fff;
    border: 1px solid #ccc;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 选中状态的轨道 */
.toggle-switch input[type="checkbox"]:checked + .switch-container .switch-track {
    background: #000;
    border-color: #000;
}

/* 选中状态的滑块 */
.toggle-switch input[type="checkbox"]:checked + .switch-container .switch-thumb {
    left: 25px;
    border-color: #000;
}

/* =====================================================
   组件通用样式
   ===================================================== */

/* 组件容器基础样式 */
.component-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 组件标签样式 */
.component-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .btn-radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-radio-group label {
        margin-left: 0;
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .toggle-switch .switch-container {
        gap: 8px;
    }
}