.before-after-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.before-after-slider img {
    display: block;
    width: 100%;
    height: auto;
}

.before-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 50% 0 0);
    z-index: 2;
}

.after-image {
    position: relative;
    width: 100%;
    z-index: 1;
}

.slider-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background-color: #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    z-index: 3;
    transform: translateX(-50%);
    transition: none;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-handle:active {
    cursor: grabbing;
}

.slider-handle::before,
.slider-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.slider-handle::before {
    left: 8px;
    border-width: 6px 6px 6px 0;
    border-color: transparent #333 transparent transparent;
}

.slider-handle::after {
    right: 8px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #333;
}

/* ラベル */
.before-label,
.after-label {
    position: absolute;
    top: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    z-index: 5;
    pointer-events: none;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}

/* タイトル */
.before-after-container {
    margin: 2rem 0;
}

.before-after-title {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #444;
    font-weight: 500;
}

.before-after-comment {
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .slider-handle {
        width: 35px;
        height: 35px;
    }
    
    .before-label,
    .after-label {
        font-size: 12px;
        padding: 3px 8px;
        top: 10px;
    }
    
    .before-label {
        left: 10px;
    }
    
    .after-label {
        right: 10px;
    }
    
    .before-after-title {
        font-size: 0.9rem;
    }
    
    .before-after-comment {
        font-size: 0.8rem;
    }
}