/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: min(calc(100% - 280px), 1600px);
    margin-left: max(260px, calc((100% - 1860px) / 2 + 260px));
    margin-right: auto;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* Header Styles */
.header {
    text-align: left;
    margin-top: -20px;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1001;
}

.logo {
    font-size: 3rem;
    color: #6c5ce7;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-img {
    max-height: 120px;
    width: auto;
    display: block;
    margin: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.logo i {
    margin-right: 15px;
    color: #a29bfe;
}

.tagline {
    font-size: 1.2rem;
    color: #636e72;
    max-width: 800px;
    margin: 0;
    text-align: left;
}

/* Header Layout Styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
    min-width: 300px;
}

.header-right {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1002;
}

.header-buttons {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
}

.btn-service, .btn-login {
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 400;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.btn-service {
    background-color: #3498db;
    color: white;
    background-image: linear-gradient(to bottom, #3498db, #2980b9);
}

.btn-service:hover {
    background-color: #2980b9;
    background-image: linear-gradient(to bottom, #2980b9, #1c6ea4);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.btn-login {
    background-color: #2ecc71;
    color: white;
    background-image: linear-gradient(to bottom, #2ecc71, #27ae60);
}

.btn-login:hover {
    background-color: #27ae60;
    background-image: linear-gradient(to bottom, #27ae60, #219955);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

/* Responsive adjustments for header buttons */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        justify-content: flex-start;
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    .header-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px;
    }

    .btn-service, .btn-login {
        width: auto;
        justify-content: center;
        padding: 2px 4px;
        font-size: 0.7rem;
    }
}

/* Feature Section Styles */
.feature-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-section:nth-child(odd) {
    border-left: 6px solid #6c5ce7;
}

.feature-section:nth-child(even) {
    border-left: 6px solid #00b894;
}

.feature-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #dfe6e9;
}

.feature-header h2 {
    font-size: 1.8rem;
    color: #2d3436;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.feature-header h2 i {
    margin-right: 15px;
    font-size: 1.6rem;
}

.feature-header p {
    color: #636e72;
    font-size: 1.1rem;
}

/* Demo Area Styles */
.demo-area {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.demo-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
}

/* Two-column layout: controls (30%) | result (70%) */
.demo-container .demo-controls {
    flex: 0 0 30%;
    max-width: 30%;
    min-width: 240px;
}

.demo-container .image-container {
    flex: 0 0 calc(70% - 20px);
    max-width: calc(70% - 20px);
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1000px) {
    .demo-container {
        flex-wrap: wrap;
        flex-direction: row;
        justify-content: center;
    }

    .demo-container .demo-controls,
    .demo-container .image-container {
        flex: 0 0 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .demo-container {
        flex-direction: column;
    }

    .demo-container .demo-controls,
    .demo-container .image-container {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 100%;
    }

    .demo-container .demo-controls {
        order: -1;
        margin-top: 0;
    }
}

.image-container {
    flex: 1;
    min-width: 280px;
}

.original-image, .result-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: clamp(300px, 35vw, 750px);
    background: white;
}

.original-image img, .result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 结果区中的画笔覆盖层 */
.result-image {
    position: relative;
}

.result-image .brush-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.result-image .brush-overlay[style*="pointer-events: auto"] {
    cursor: crosshair;
}

.image-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-weight: 500;
    color: #636e72;
    font-size: clamp(0.85rem, 1vw, 1.2rem);
}

.image-action-btn {
    background: none;
    border: none;
    color: #9b59b6;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 4px 10px;
    font-weight: 500;
    vertical-align: middle;
    line-height: 1.4;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color 0.2s ease;
    margin-left: 6px;
}
.image-action-btn:last-child {
    margin-right: 0;
}

.image-action-btn:hover {
    color: #7d3c98;
}

.image-action-btn i {
    pointer-events: none;
    font-size: 0.75em;
}

/* Header upload buttons container */
.feature-header .upload-buttons-container {
    display: inline;
    margin-left: 6px;
    white-space: nowrap;
}

.feature-header .upload-buttons-container .image-action-btn {
    background: rgba(155, 89, 182, 0.08);
    border: 1px solid #9b59b6;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    margin-left: 4px;
    color: #6c5ce7;
}

.feature-header .upload-buttons-container .image-action-btn:hover {
    background: #9b59b6;
    color: white;
    transform: translateY(-1px);
}

/* Default comparison view (for result area when no image uploaded) */
.result-comparison {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
}

.result-comparison .compare-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

.result-comparison .compare-base {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.result-comparison .compare-result-clip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: contain;
    background: #fff;
}

.result-comparison .compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c5ce7;
    font-size: 0.9rem;
}

.result-comparison .compare-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #fff;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    z-index: 2;
}

.result-comparison .compare-label-left,
.result-comparison .compare-label-right {
    position: absolute;
    top: 12px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 2;
}

.result-comparison .compare-label-left {
    left: 12px;
}

.result-comparison .compare-label-right {
    right: 12px;
}

.result-comparison .upload-hint,
.result-image .upload-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.04);
    color: #888;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 400;
    pointer-events: none;
    z-index: 4;
    white-space: nowrap;
}

/* 其余位置的 .upload-hint：普通文本，无按钮外观 */
.upload-hint {
    color: #999;
    font-size: 0.85rem;
    font-weight: 400;
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
    text-align: center;
}

/* 需要叠加在图片底部的 hint（如去水印对比图） */
.wr-hint-overlay {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    white-space: nowrap;
}

/* 图片对比模态框 */
.compare-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

.compare-wrapper .compare-base {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.compare-result-clip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: contain;
    background: #fff;
    clip-path: inset(0 50% 0 0);
}

/* Demo Controls */
.demo-controls {
    flex: 1;
    min-width: 280px;
    max-width: min(380px, 22vw);
    min-height: clamp(220px, 24vw, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 1.5vw, 30px);
}

.control-group {
    width: 100%;
    background: white;
    padding: clamp(16px, 1.8vw, 32px);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: clamp(16px, 1.8vw, 32px);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: clamp(12px, 1.2vw, 22px) clamp(20px, 2vw, 36px);
    font-size: clamp(0.95rem, 1.2vw, 1.5rem);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
    width: 100%;
    margin-bottom: clamp(12px, 1.5vw, 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 0.6vw, 14px);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    background: linear-gradient(135deg, #5a4fcf, #8a7ef0);
}

.btn:active {
    transform: translateY(1px);
}

.slider-container {
    margin: clamp(12px, 1.5vw, 28px) 0;
}

.slider-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3436;
    font-size: clamp(0.85rem, 1vw, 1.15rem);
}

input[type="range"] {
    width: 100%;
    height: clamp(12px, 1vw, 22px);
    border-radius: 8px;
    background: #e0e0e0;
    border: 1px solid #bdbdbd;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: clamp(6px, 0.6vw, 14px) 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: clamp(22px, 2vw, 36px);
    height: clamp(22px, 2vw, 36px);
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: clamp(22px, 2vw, 36px);
    height: clamp(22px, 2vw, 36px);
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 16px;
    border-radius: 8px;
    background: #e0e0e0;
    border: 1px solid #bdbdbd;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-ms-thumb {
    width: clamp(22px, 2vw, 36px);
    height: clamp(22px, 2vw, 36px);
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

input[type="range"]::-ms-track {
    width: 100%;
    height: clamp(12px, 1vw, 22px);
    border-radius: 8px;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

input[type="range"]::-ms-fill-lower {
    background: #6c5ce7;
    border-radius: 8px;
}

input[type="range"]::-ms-fill-upper {
    background: #e0e0e0;
    border-radius: 8px;
}

.hint {
    background: #e3f2fd;
    padding: 12px 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 0.95rem;
    color: #1976d2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hint i {
    font-size: 1.1rem;
}

/* Animation Area */
.animation-area {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #b2bec3;
}

/* Animation Elements */
.pulse-circle {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.7);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00b894, transparent);
    top: 50%;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particles::before, .particles::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e17055;
    border-radius: 50%;
    animation: float 4s infinite linear;
}

.particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.particles::after {
    top: 60%;
    left: 70%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(0) translateX(20px); }
    75% { transform: translateY(20px) translateX(10px); }
}

.blending-effect {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    background: linear-gradient(45deg, rgba(108, 92, 231, 0.3), rgba(0, 184, 148, 0.3));
    border-radius: 10px;
    animation: blend 5s infinite alternate;
}

@keyframes blend {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(1.1); }
}

.focus-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #6c5ce7;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: focus 3s infinite;
}

@keyframes focus {
    0% { width: 60px; height: 60px; opacity: 1; }
    50% { width: 100px; height: 100px; opacity: 0.5; }
    100% { width: 60px; height: 60px; opacity: 1; }
}

.detail-dots {
    position: absolute;
    width: 100%;
    height: 100%;
}

.detail-dots::before, .detail-dots::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #00b894;
    border-radius: 50%;
}

.detail-dots::before {
    top: 30%;
    left: 40%;
    animation: dotPulse 1.5s infinite;
}

.detail-dots::after {
    top: 70%;
    left: 60%;
    animation: dotPulse 1.5s infinite 0.5s;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.5); opacity: 1; }
}

.dissolve-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 30%, white 70%);
    animation: dissolve 4s infinite;
}

@keyframes dissolve {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Special Elements for Demos */
.brush-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.object-to-remove {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.7);
    border: 3px solid #e74c3c;
    cursor: pointer;
    animation: objectPulse 2s infinite;
    display: none; /* 默认隐藏圆圈 */
}

@keyframes objectPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.object-to-remove:hover {
    background: rgba(231, 76, 60, 0.9);
}

.background-options {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 10px;
}

.bg-option {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
}

.bg-option.active {
    border-color: #6c5ce7;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.bg-option:hover {
    transform: translateY(-5px);
}

.bg-option img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.bg-option span {
    display: block;
    text-align: center;
    padding: 8px;
    background: white;
    font-weight: 500;
}

.progress-container {
    margin-top: 20px;
    background: #dfe6e9;
    border-radius: 10px;
    height: auto;
    min-height: 20px;
    padding-bottom: 2px;
}

.progress-bar {
    height: 20px;
    background: linear-gradient(90deg, #00b894, #55efc4);
    width: 0%;
    transition: width 1s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin-top: 2px;
    font-size: 0.9rem;
    color: #2d3436;
}

.progress-status {
    text-align: center;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #e17055;
    font-weight: 500;
    min-height: 1.2em;
}

/* Result Placeholders */
.result-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
}

.transparent-bg {
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.foreground-subject {
    position: absolute;
    top: 20%;
    left: 25%;
    width: 50%;
    height: 60%;
    background: rgba(108, 92, 231, 0.7);
    border-radius: 10px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.layered-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.background-layer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    filter: brightness(1.02) contrast(1.05);
    transition: all 0.5s ease;
}

.beach-bg {
    background-image: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80');
}

.custom-bg {
    /* Custom background will be set via inline styles */
}

.foreground-layer {
    position: absolute;
    top: 20%;
    left: 25%;
    width: 50%;
    height: 60%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(0, 0, 0, 0.1);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.blurry-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.1);
}

.transparent-result {
    width: 100%;
    height: 100%;
    position: relative;
}

.checkered-bg {
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.product-isolated {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 60%;
    height: 70%;
    background: rgba(253, 203, 110, 0.9);
    border-radius: 10px;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

/* Footer Styles */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    color: #636e72;
    font-size: 0.95rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #b2bec3;
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .logo {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .feature-header h2 {
        font-size: 1.5rem;
    }

    .demo-container {
        gap: 20px;
    }

    .image-container {
        min-width: 100%;
    }

    .demo-controls {
        min-width: 100%;
    }

    .background-options {
        flex-wrap: wrap;
    }

    .bg-option {
        min-width: calc(50% - 10px);
    }
}

/* AI消除结果优化样式 */
.ai-eraser-result {
    position: relative;
    transition: all 0.5s ease;
}

.ai-eraser-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0.05) 80%,
        rgba(255, 255, 255, 0.1) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.ai-eraser-result::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.3)
    );
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.ai-eraser-blur-edge {
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

/* 平滑过渡动画 */
.smooth-transition {
    animation: smoothAppear 0.8s ease-out;
}

@keyframes smoothAppear {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.01);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 优化AI消除结果图像显示 */
.ai-eraser-result img {
    position: relative;
    z-index: 2;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ai-eraser-result:hover img {
    transform: scale(1.02);
}

/* 边缘渐变遮罩，使过渡更自然 */
.ai-eraser-edge-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 10%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0) 70%,
        rgba(255, 255, 255, 0.1) 90%,
        rgba(255, 255, 255, 0.2) 100%
    );
    pointer-events: none;
    z-index: 3;
    border-radius: 12px;
}

/* 处理区域高亮效果 */
.processed-area-hint {
    position: absolute;
    border: 2px dashed rgba(225, 112, 85, 0.5);
    border-radius: 8px;
    background: rgba(225, 112, 85, 0.1);
    pointer-events: none;
    z-index: 4;
    animation: areaHintPulse 2s infinite;
}

@keyframes areaHintPulse {
    0%, 100% {
        opacity: 0.3;
        border-width: 2px;
    }
    50% {
        opacity: 0.7;
        border-width: 3px;
    }
}

/* Feedback Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* 左侧固定导航栏样式 */
.sidebar-nav {
    position: fixed;
    left: max(20px, calc((100% - 1860px) / 2));
    top: 20px;
    width: 220px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-nav:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.nav-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}


.nav-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-header i {
    font-size: 1.2rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    border-bottom: 1px solid rgba(108, 92, 231, 0.1);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #2d3436;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
}

.nav-link:hover {
    background: rgba(108, 92, 231, 0.08);
    padding-left: 24px;
    color: #6c5ce7;
}

.nav-link.active {
    background: rgba(108, 92, 231, 0.12);
    color: #6c5ce7;
    border-left: 4px solid #6c5ce7;
    padding-left: 16px;
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-link span {
    font-weight: 500;
    font-size: 1rem;
}

.nav-footer {
    padding: 15px 20px;
    background: rgba(245, 247, 250, 0.8);
    border-top: 1px solid rgba(108, 92, 231, 0.1);
}

.nav-hint {
    font-size: 1rem;
    color: #2d3436;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.nav-hint i {
    color: #6c5ce7;
}

/* 响应式调整 */
@media (max-width: 1100px) {
    .sidebar-nav {
        width: 180px;
        left: 15px;
    }

    .nav-link {
        padding: 14px 16px;
    }

    .nav-link:hover {
        padding-left: 20px;
    }

    .container {
        margin-left: 210px; /* 适配缩小后的导航栏 */
        max-width: calc(100% - 230px); /* 左边距210px + 右边距20px */
    }
}

@media (max-width: 768px) {
    .sidebar-nav {
        display: none; /* 在小屏幕上隐藏导航栏 */
    }

    .container {
        margin-left: 0;
        max-width: calc(100% - 40px); /* 左右各20px边距 */
    }
}

/* 背景替换边缘优化 */
.background-replacement-result {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.background-replacement-result::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.3)
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.background-replacement-result::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 10%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0) 70%,
        rgba(255, 255, 255, 0.1) 90%,
        rgba(255, 255, 255, 0.2) 100%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: 12px;
    mix-blend-mode: overlay;
}

.background-replacement-edge-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    pointer-events: none;
    z-index: 3;
    mask-image: radial-gradient(circle at center, white 90%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, white 90%, transparent 100%);
    /* Fallback for browsers that don't support mask-image */
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.3);
}

.background-replacement-result img {
    position: relative;
    z-index: 0;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.background-replacement-result:hover img {
    transform: scale(1.02);
}

/* 边缘羽化效果 */
.edge-feathering {
    position: relative;
    overflow: hidden;
}

.edge-feathering::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle at center, transparent 60%, rgba(255, 255, 255, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: 16px;
}

/* 自然边缘混合 */
.natural-edge-blend {
    position: relative;
}

.natural-edge-blend::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: soft-light;
}

/* 平滑过渡动画 */
.smooth-edge-transition {
    animation: smoothEdgeAppear 0.8s ease-out;
}

@keyframes smoothEdgeAppear {
    0% {
        opacity: 0;
        transform: scale(0.98);
        filter: blur(5px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.01);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* 边缘抗锯齿 */
.edge-antialiasing {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
}

/* 模态框样式修复，确保Bootstrap模态框按钮不受全局按钮样式影响 */
.modal .btn {
    width: auto;
    min-width: auto;
    background: var(--bs-btn-bg, initial);
    background-image: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 0.375rem;
    box-shadow: none;
    margin-bottom: 0;
    display: inline-block;
}

.modal .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.modal .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.modal .btn:hover {
    transform: none;
    box-shadow: none;
}

/* Navigation Logo Styles */
.nav-logo {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 5px;
}

.nav-logo-img {
    max-height: 80px;
    width: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* 响应式调整：导航栏隐藏时恢复header的上边距 */
@media (max-width: 768px) {
    .header {
        margin-top: 0;
    }
}

/* 返回顶部按钮样式 */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #6c5ce7;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    background-color: #5a4fcf;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}

.back-to-top-btn:active {
    transform: translateY(0);
}

/* 返回顶部提示文字 */
.back-to-top-tooltip {
    position: absolute;
    right: 62px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.back-to-top-btn:hover .back-to-top-tooltip {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    .back-to-top-tooltip {
        display: none;
    }
}
/* 用户下拉菜单样式 */

.user-dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 2147483647;
}

.btn-login.logged-in {
    background-color: #9b59b6;
    background-image: linear-gradient(to bottom, #9b59b6, #8e44ad);
}

.btn-login.logged-in:hover {
    background-color: #8e44ad;
    background-image: linear-gradient(to bottom, #8e44ad, #7d3c98);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 2147483647;
    min-width: 180px;
    padding: 10px 0;
    display: none;
}

.dropdown-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}
