/* 存信云组件样式 */

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: modalFadeIn 0.3s ease forwards;
}

.modal-closing {
    animation: modalFadeOut 0.3s ease forwards;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    animation: modalSlideIn 0.3s ease forwards;
}

.modal-closing .modal-container {
    animation: modalSlideOut 0.3s ease forwards;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* 提示框样式 */
.toast {
    position: fixed;
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
}

.toast-show {
    animation: toastSlideIn 0.3s ease forwards;
}

.toast-top-right {
    top: 20px;
    right: 20px;
}

.toast-top-left {
    top: 20px;
    left: 20px;
    transform: translateX(-100%);
}

.toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateX(-100%);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.25rem;
}

/*.toast-success {*/
/*    background: var(--success);*/
/*    color: white;*/
/*}*/

/*.toast-error {*/
/*    background: var(--error);*/
/*    color: white;*/
/*}*/

/*.toast-warning {*/
/*    background: var(--warning);*/
/*    color: white;*/
/*}*/

/*.toast-info {*/
/*    background: var(--info);*/
/*    color: white;*/
/*}*/

/* 加载指示器样式 */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loader-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-small .loader-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loader-large .loader-spinner {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

.loader-text {
    color: var(--gray);
    font-size: 0.9rem;
}

/* 波纹效果 */
.ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
    z-index: 0; /* 确保波纹在内容下方 */
    will-change: transform, opacity; /* 优化性能 */
    margin: 0; /* 确保没有外边距 */
    padding: 0; /* 确保没有内边距 */
    max-width: none; /* 确保不受最大宽度限制 */
    max-height: none; /* 确保不受最大高度限制 */
    box-sizing: content-box; /* 确保尺寸计算不包括内边距和边框 */
}

/* 特殊按钮的波纹效果 */
.billing-option .ripple {
    background: rgba(24, 144, 255, 0.2); /* 使用主色调的透明版本 */
    animation: rippleSmall 0.5s ease-out;
}

@keyframes rippleSmall {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 动画关键帧 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 删除重复的 ripple 动画定义 */

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 10px;
    }

    .toast {
        min-width: auto;
        width: calc(100% - 40px);
    }
}
