/* 背景设置公共样式 */

/* 背景预览样式 - 统一版本 */

/* 加载动画样式 */
.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

.spinner.slow {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.loading-progress {
    width: 80%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

/* 背景设置模态框中的进度条样式 - 仅用于背景设置模态框 */
.bg-setting-modal .loading-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

.progress-bar.slow {
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* 预览覆盖层样式 - 确保在所有页面中正确显示 */
.preview-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    color: white !important;
    text-align: center !important;
}

.bg-preview.has-image:hover .preview-overlay {
    opacity: 1 !important;
}

.preview-text {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
}

.preview-hint {
    font-size: 0.75rem !important;
    opacity: 0.8 !important;
}

/* 错误状态样式 - 确保在所有页面中正确显示 */
.error-animation {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
}

.error-icon {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
    animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.error-text {
    font-size: 0.85rem !important;
    color: #e74c3c !important;
    margin-bottom: 4px !important;
    font-weight: 600 !important;
}

.error-hint {
    font-size: 0.75rem !important;
    color: #999 !important;
}

/* 空状态样式 - 确保在所有页面中正确显示 */
.empty-state {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
}

.empty-icon {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
    opacity: 0.6 !important;
}

.empty-text {
    font-size: 0.85rem !important;
    color: #666 !important;
    margin-bottom: 4px !important;
}

.empty-hint {
    font-size: 0.75rem !important;
    color: #999 !important;
}

/* 淡入效果 - 确保在所有页面中正确显示 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 按钮动画样式 - 确保在所有页面中正确显示 */
.btn-spinner {
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    border: 2px solid transparent !important;
    border-top: 2px solid currentColor !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin-right: 6px !important;
}

.pulse {
    animation: pulse-shadow 1.5s ease-in-out infinite !important;
}

/* 加载状态样式 - 确保在所有页面中正确显示 */
.bg-preview.loading {
    border-color: #667eea !important;
    background-color: rgba(102, 126, 234, 0.05) !important;
    animation: pulse-shadow 1.5s ease-in-out infinite !important;
}

@keyframes pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(79, 172, 254, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
    }
}

/* 删除重复的hover和has-image样式，使用下面的统一版本 */

/* 模糊滑块样式 - 删除重复，使用下面的优化版本 */

/* 自定义背景样式 */
body.has-custom-bg {
    color: #333;
    /* 保持黑色文字 */
}

/* 背景过渡效果 - 已移除 */

body.has-custom-bg .header h1,
body.has-custom-bg .header p {
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.8);
}

body.has-custom-bg .header h1 {
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.9);
}

/* 主要内容区域样式 */
body.has-custom-bg .main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* 确保主要内容区域的文字保持黑色 */
body.has-custom-bg .main-content h2,
body.has-custom-bg .main-content h3,
body.has-custom-bg .main-content p,
body.has-custom-bg .main-content label,
body.has-custom-bg .main-content input,
body.has-custom-bg .main-content textarea,
body.has-custom-bg .main-content select {
    color: #333;
}

/* 确保按钮文字保持可见 */
body.has-custom-bg .submit-button {
    color: #fff;
}

/* 订阅页面特定样式 */
body.has-custom-bg .subscription-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

body.has-custom-bg .subscription-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.has-custom-bg .subscription-card h3,
body.has-custom-bg .subscription-card p,
body.has-custom-bg .subscription-card span {
    color: #333;
}

/* 首页服务卡片样式 */
body.has-custom-bg .service-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1)) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.has-custom-bg .service-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2)) !important;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
}

body.has-custom-bg .service-content {
    color: #333;
}

body.has-custom-bg .card-title {
    color: #333;
}

body.has-custom-bg .card-subtitle {
    color: #666;
}

body.has-custom-bg .card-description {
    color: #555;
}

body.has-custom-bg .card-features li {
    color: #333;
}

body.has-custom-bg .card-features li:before {
    color: #4facfe;
}

body.has-custom-bg .status-bar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* VIP卡片样式 */
body.has-custom-bg .vip-card:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

body.has-custom-bg .vip-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* 背景模糊效果 */
body.has-custom-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .bg-preview {
        height: 100px;
    }

    body.has-custom-bg .main-content,
    body.has-custom-bg .subscription-container {
        background: rgba(255, 255, 255, 0.98);
    }
}



/* 背景设置模态框布局优化 - 确保在所有页面中正确显示 */
.bg-setting-modal {
    max-width: 500px !important;
    margin: 0 auto !important;
}

/* 当模态框包含背景设置时，让模态框背景透明以显示毛玻璃效果 */
.modal:has(.bg-setting-modal),
.modal .bg-setting-modal {
    background: transparent !important;
}

/* 确保背景设置模态框内容正确显示 */
.bg-setting-modal .modal-content {
    text-align: left !important;
    padding: 20px !important;
    background: transparent !important;
}

/* 确保加载动画在所有页面中正确显示 */
.loading-animation {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
}

.spinner {
    width: 24px !important;
    height: 24px !important;
    border: 3px solid #f3f3f3 !important;
    border-top: 3px solid #667eea !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin-bottom: 8px !important;
}

.spinner.slow {
    animation: spin 2s linear infinite !important;
}

.loading-text {
    font-size: 0.85rem !important;
    color: #666 !important;
    margin-bottom: 8px !important;
}

/* 背景设置模态框中的进度条样式 - 使用公共进度条样式 */
.bg-setting-modal .loading-progress {
    width: 80%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.bg-setting-modal .progress-bar.slow {
    animation: progress 3s ease-in-out infinite;
}

/* 设置区域样式 - 确保在所有页面模态框中正确显示 */
.setting-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)) !important;
    border-radius: 24px !important;
    padding: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    margin-bottom: 15px !important;
    position: relative;
    overflow: hidden;
}

.setting-section:last-child {
    margin-bottom: 0;
}

/* 区域标题样式 - 确保在所有页面中正确显示 */
.section-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    padding-bottom: 6px !important;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* 表单组样式优化 - 确保在所有页面模态框中正确显示 */
.form-group {
    margin-bottom: 15px !important;
}

.form-group:last-child {
    margin-bottom: 0 !important;
}

.form-group label {
    display: block !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
    font-size: 0.9rem !important;
}

.form-group input[type="text"] {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
}

.form-group input[type="text"]:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    background: #fff !important;
}

/* 模糊滑块样式优化 - 确保在所有页面模态框中正确显示 */
.blur-slider {
    width: 100% !important;
    height: 8px !important;
    border-radius: 4px !important;
    background: #e9ecef !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 10px 0 !important;
}

.blur-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    cursor: pointer !important;
    border: 3px solid white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.blur-slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    cursor: pointer !important;
    border: 3px solid white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.blur-value {
    color: #667eea !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

/* 复选框样式优化 - 确保在所有页面中正确显示 */
.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #555 !important;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: rgba(102, 126, 234, 0.8) !important;
    cursor: pointer !important;
}

/* 下拉选择框样式优化 - 确保在所有页面中正确显示 */
#rotateIntervalSelect {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

#rotateIntervalSelect:focus {
    outline: none !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    background: rgba(255, 255, 255, 1) !important;
}

/* 背景源按钮容器 - 确保在所有页面中正确显示 */
.source-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 6px !important;
}

/* 背景源按钮样式优化 - 确保在所有页面模态框中正确显示 */
.bg-source-btn {
    flex: 1 !important;
    min-width: 80px !important;
    padding: 8px 12px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.bg-source-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

.bg-source-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4) !important;
}

.bg-source-btn.active {
    background: linear-gradient(135deg, #5a67d8, #6b46c1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4) !important;
}

/* 预览区域样式优化 - 统一背景预览样式，确保在所有页面中正确显示 */
.bg-preview {
    width: 100% !important;
    height: 120px !important;
    border: 2px dashed #e9ecef !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    cursor: pointer !important;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease !important;
    margin-bottom: 15px !important;
    position: relative !important;
    overflow: hidden !important;
    font-size: 0.9rem !important;
    color: #666 !important;
    background-color: #f8f9fa !important;
}

.bg-preview:hover {
    border-color: #667eea !important;
    background-color: #f1f3f4 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.bg-preview.has-image {
    border-style: solid !important;
    border-color: #667eea !important;
    background-color: transparent !important;
}

/* 帮助内容样式 */
.help-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    border-left: 3px solid rgba(102, 126, 234, 0.5);
}

.help-content ul {
    margin: 0;
    padding-left: 15px;
    color: #555;
    font-size: 0.8rem;
    line-height: 1.4;
}

.help-content li {
    margin-bottom: 4px;
}

.help-content li:last-child {
    margin-bottom: 0;
}

/* 模态框按钮禁用状态 */
.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(102, 126, 234, 0.3);
}

.modal-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .bg-setting-modal {
        max-width: 100%;
        margin: 0 10px;
    }

    .setting-section {
        padding: 15px;
    }

    .bg-source-btn {
        min-width: auto;
        width: 100%;
    }

    .section-title {
        font-size: 0.95rem;
    }
}

/* 背景加载优化样式 */
body {
    transition: opacity 0.5s ease-in-out !important;
}

body.has-custom-bg {
    transition: opacity 0.5s ease-in-out !important;
}

#bg-wrapper {
    transition: opacity 0.5s ease-in-out !important;
}

/* 确保页面内容在背景加载完成前可见 */
body::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    z-index: -3 !important;
    pointer-events: none !important;
}

/* 背景加载状态指示器 */
.bg-loading-indicator {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 20px 30px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.bg-loading-spinner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 2px solid white !important;
    border-radius: 50% !important;
    animation: bg-spin 1s linear infinite !important;
}

@keyframes bg-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 背景淡入动画 */
@keyframes bg-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bg-fade-in {
    animation: bg-fade-in 0.5s ease-out !important;
}

/* 优化背景图片加载 */
.bg-optimized-loading {
    position: relative !important;
    overflow: hidden !important;
}

.bg-optimized-loading::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    z-index: -2 !important;
}

.bg-optimized-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: inherit !important;
    z-index: -1 !important;
    opacity: 0 !important;
    transition: opacity 0.5s ease-in-out !important;
}

.bg-optimized-loading.bg-loaded::after {
    opacity: 1 !important;
}

/* 背景过渡动画 - 减少闪烁 */
body {
    transition: background 0.5s ease-in-out, opacity 0.5s ease-in-out !important;
}

body.has-custom-bg {
    transition: opacity 0.5s ease-in-out !important;
}

#bg-wrapper {
    transition: opacity 0.5s ease-in-out !important;
}

/* 背景淡入动画 */
@keyframes backgroundFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bg-fade-in-animation {
    animation: backgroundFadeIn 0.5s ease-out !important;
}

/* 背景切换时的平滑过渡 */
body.bg-transitioning {
    transition: all 0.5s ease-in-out !important;
}

/* 确保页面内容在背景切换时保持可见 */
body {
    opacity: 1 !important;
    transition: opacity 0.5s ease-in-out !important;
}

/* 背景加载时的占位样式 */
.bg-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* 改为渐变背景，与默认背景一致 */
    z-index: -2;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.bg-placeholder.fade-out {
    opacity: 0;
}