.custom-control-input:focus~.custom-control-label::before {
    box-shadow: none !important;
    border-color: #adb5bd !important;
}

.custom-control-input:checked~.custom-control-label::before {
    border-color: #adb5bd !important;
    background-color: #adb5bd !important;
}

.custom-control-input:focus:not(:checked)~.custom-control-label::before {
    border-color: #adb5bd !important;
}

.beforeafterText {
    font-size: 15px;
    color: gray;
    padding-top: 7px;
    margin: 0;
}

.container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 20px;
    }

    .upload-container, .controls-section {
        width: 100%;
        max-width: 300px;
    }
}

/* 左侧上传区域 */
.upload-section {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    height: 280px;
    background: white;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

/* 右侧控制区域 */
.controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    height: 340px;
    padding: 10px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.6);
    width: 220px;
}

.controls-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.controls-row-before_after {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    width: 100%;
    justify-content: space-between;
}

.controls-row button {
    width: 100%;
    max-width: none;
}

.joystick {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    gap: 10px;
    justify-items: center;
    align-items: center;
    margin-top: 20px;
}

.joystick button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    font-size: 16px;
    border: 2px solid #6c757d;
    color: #6c757d;
    background: #ffffff;
    transition: all 0.3s;
}

.joystick button:active {
    background: #6c757d;
    color: white;
}

.joystick .center-button {
    background-color: #00d2ff;
    color: white;
    border: none;
}

/* 自定义按钮样式 */
.btn-outline-custom {
    color: #acb0b4;
    border: 1.5px solid #adb5bd;
    background-color: white;
    border-radius: 12px;
    padding: 2px 2px;
    transition: all 0.3s;
}

.btn-outline-custom:not(:disabled):hover {
    background-color: #adb5bd;
    color: white;
}

.btn-outline-custom.active {
    background-color: #6c757d;
    color: white;
}

.btn-outline-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #acb0b4;
    border-color: #dee2e6;
}

.upload-section a {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
}

.joystick button,
.btn-outline-custom {
    outline: none;
}

.joystick button:focus,
.btn-outline-custom:focus {
    outline: none;
    box-shadow: none;
}

.grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.loading-container {
    position: relative;
    display: inline-block;
}

.loading-text {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 1000;
    animation: loadingColorChange 1s infinite;
}

@keyframes loadingColorChange {
    0% {
        color: white;
    }
    50% {
        color: #72d6fe;
    }
    100% {
        color: white;
    }
}

.loading .loading-text {
    display: block;
}

.custom-control-input:disabled~.custom-control-label {
    cursor: not-allowed;
}

.custom-control-input:disabled~.custom-control-label::before {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Upload button styles */
.upload-container {
    text-align: center;
    border: 2px dashed #d3d3d3;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.3s ease;
}

.upload-container:hover {
    border-color: #72d6fe;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.8);
}

.upload-button {
    background: linear-gradient(to right, #72d6fe, #a4e8d1);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background 0.3s ease;
}

.upload-button:hover {
    background: linear-gradient(to right, #a4e8d1, #72d6fe);
}

.upload-container p {
    margin: 0;
    color: #a3a3a3;
}

/* Control button styles */
.button-13 {
    background-color: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    box-shadow: rgba(213, 217, 217, .5) 0 2px 5px 0;
    box-sizing: border-box;
    color: #0f1111;
    cursor: pointer;
    display: inline-block;
    font-family: "Amazon Ember", sans-serif;
    font-size: 13px;
    line-height: 29px;
    padding: 0 10px 0 11px;
    position: relative;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    vertical-align: middle;
    width: 100px;
}

.button-13:hover {
    background-color: #f7fafa;
}

.button-13:focus {
    border-color: #008296;
    box-shadow: rgba(213, 217, 217, .5) 0 2px 5px 0;
    outline: 0;
}

/* Example image styles */
.no-image-container {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.no-image-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle2 {
    font-size: 15px;
    color: #666;
    margin-bottom: 0px;
    text-align: center;
}

.example-images {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.image-card {
    width: 80px;
    height: auto;
    overflow: hidden;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-8px);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.terms {
    color: #666;
    font-size: 14px;
    text-align: center;
}

.example-image-input {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.demo-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Modal styles */
.demo-image-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 455px;
    display: none;
}

@media (max-width: 768px) {
    .demo-image-modal {
        width: 85%;
        max-width: 350px;
        padding: 15px;
    }

    .demo-image-modal .close-button {
        font-size: 18px !important;
        padding: 12px 8px;
        margin-top: 20px;
    }

    .demo-image-modal label[for="dontShowAgain"] {
        font-size: 16px !important;
    }

    .demo-image-modal hr {
        margin: 15px 0;
    }

    .close-modal {
        top: 2px;
        right: 2px;
        font-size: 32px;
        padding: 5px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.close-modal {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    font-weight: bold;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-modal:hover {
    color: #333;
}

.close-button {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 8px;
    border-radius: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.close-button:hover {
    background-color: #218838;
}

.progress-container {
    width: 300px;
    height: 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    display: none;
    margin: 10px auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-text {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

/* 红色主题按钮样式 */
.btn-red-theme {
    color: white;
    border: 1.5px solid #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-radius: 12px;
    padding: 2px 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-red-theme:not(:disabled):hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    color: white;
    border-color: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-red-theme.active {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border-color: #c53030;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.btn-red-theme:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #d32f2f;
    border-color: #ffab91;
    text-shadow: none;
    font-weight: 500;
}

/* 动画效果 */
@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.8), 0 2px 8px rgba(255, 107, 107, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0.2), 0 4px 16px rgba(255, 107, 107, 0.4);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0), 0 2px 8px rgba(255, 107, 107, 0.2);
        transform: scale(1);
    }
}

@keyframes shimmerRed {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.btn-red-theme.animate-ready {
    animation: pulseRed 1.8s infinite;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
}

.btn-red-theme.animate-ready::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    background-size: 200px 100%;
    animation: shimmerRed 2.5s infinite;
    border-radius: 11px;
}

/* 点击提示文字 */
.click-hint {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    animation: bounceHint 2.5s infinite;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
    white-space: nowrap;
}

.click-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #e53e3e;
}

@keyframes bounceHint {
    0%, 20%, 40%, 60%, 80%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    10%, 30%, 50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-3px);
    }
}
