/* 模式切换按钮样式 - 优化版 */
.mode-switch-container {
    display: flex !important; /* 强制显示 */
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 10px;
    z-index: 1000;
}

.mode-switch-label {
    font-weight: 600;
    margin-right: 1rem;
    color: #495057;
    font-size: 0.95rem;
}

.mode-switch {
    position: relative;
    display: inline-block;
    width: 220px;
    height: 40px;
    z-index: 10;
}

.mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%); /* 渐变绿色（可用词模式） */
    transition: all 0.3s ease;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mode-slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 105px;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    border-radius: 16px;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
}

.mode-text {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.mode-text-allowed {
    padding-left: 8px;
}

.mode-text-forbidden {
    padding-right: 8px;
}

/* 禁用词模式样式 */
input:checked + .mode-slider {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%); /* 渐变红色（禁用词模式） */
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

input:checked + .mode-slider:before {
    transform: translateX(107px) translateY(-50%);
}

/* 当前模式指示器 */
.current-mode-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.mode-allowed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mode-forbidden {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .mode-switch-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .mode-switch-label {
        margin-right: 0;
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }
    
    .mode-switch {
        width: 200px;
        height: 36px;
    }
    
    .mode-slider {
        padding: 0 10px;
        border-radius: 18px;
    }
    
    .mode-slider:before {
        height: 28px;
        width: 95px;
        border-radius: 14px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .mode-slider:before {
        transform: translateX(97px) translateY(-50%);
    }
    
    .mode-text {
        font-size: 0.8rem;
    }
    
    .current-mode-indicator {
        margin-left: 0;
        margin-top: 0.25rem;
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .mode-switch {
        width: 180px;
        height: 34px;
    }
    
    .mode-slider:before {
        width: 85px;
        height: 26px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .mode-slider:before {
        transform: translateX(87px) translateY(-50%);
    }
    
    .mode-text {
        font-size: 0.75rem;
    }
}

/* 悬停效果 */
.mode-slider:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

input:checked + .mode-slider:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.mode-slider:not(input:checked + .mode-slider):hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* 激活状态动画 */
.mode-slider:active {
    transform: scale(0.98);
}

/* 焦点状态 */
.mode-switch input:focus + .mode-slider {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

