/**
 * SitePay Download Plugin - Modal Styles
 *
 * 独立样式文件，可直接移植到其他项目
 * 主色调: #12CDB0
 */

/* 遮罩层 */
.sitepay-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.sitepay-overlay.active {
    display: flex;
}

/* Body scroll lock when modal is open */
body.sitepay-modal-open {
    overflow: hidden;
}

/* 弹窗容器 */
.sitepay-modal {
    background-color: #fff;
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: sitepaySlideIn 0.3s ease;
}

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

/* 弹窗头部 */
.sitepay-modal-header {
    background: #12CDB0;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sitepay-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.sitepay-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sitepay-modal-close:hover {
    opacity: 1;
}

/* 弹窗内容 */
.sitepay-modal-body {
    padding: 24px 20px;
}

/* 选项卡 */
.sitepay-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.sitepay-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sitepay-tab:hover {
    color: #12CDB0;
}

.sitepay-tab.active {
    color: #12CDB0;
    border-bottom-color: #12CDB0;
}

/* 表单 */
.sitepay-form {
    display: none;
}

.sitepay-form.active {
    display: block;
}

.sitepay-form-group {
    margin-bottom: 16px;
}

.sitepay-form-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.sitepay-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.sitepay-form-input:focus {
    outline: none;
    border-color: #12CDB0;
}

.sitepay-form-input.error {
    border-color: #e74c3c;
}

/* 按钮 */
.sitepay-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sitepay-btn-primary {
    background: #12CDB0;
    color: #fff;
}

.sitepay-btn-primary:hover {
    background: #11eecd;
}

.sitepay-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 错误信息 */
.sitepay-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.sitepay-error.show {
    display: block;
}

.sitepay-form-error {
    background: #fdf2f2;
    color: #e74c3c;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.sitepay-form-error.show {
    display: block;
}

/* 加载状态 */
.sitepay-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sitepay-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: sitepaySpinner 0.8s linear infinite;
}

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

/* 价格信息 */
.sitepay-price-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.sitepay-price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.sitepay-price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #12CDB0;
}

.sitepay-price-currency {
    font-size: 16px;
    color: #666;
    margin-left: 4px;
}

/* 用户状态栏 */
.sitepay-user-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #f0fdfb;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.sitepay-user-bar.show {
    display: flex;
}

.sitepay-user-email {
    font-size: 14px;
    color: #333;
}

.sitepay-logout-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}

.sitepay-logout-btn:hover {
    text-decoration: underline;
}

/* 下载按钮增强样式 */
.sitepay-download-btn {
    position: relative;
}

.sitepay-download-btn.loading {
    pointer-events: none;
}

.sitepay-download-btn .sitepay-btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 付费标识 */
.sitepay-paid-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ff9800;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.sitepay-free-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #4caf50;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* 提示信息 */
.sitepay-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10001;
    display: none;
    animation: sitepayToastIn 0.3s ease;
}

.sitepay-toast.show {
    display: block;
}

.sitepay-toast.success {
    background: #4caf50;
}

.sitepay-toast.error {
    background: #e74c3c;
}

@keyframes sitepayToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* VIP 标识 */
.sitepay-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #333;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

/* ==================== 付费确认弹窗样式 ==================== */

/* 确认弹窗容器 */
.sitepay-confirm-modal {
    width: 380px;
    max-width: 90vw;
}

/* 产品信息展示 */
.sitepay-confirm-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.sitepay-confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sitepay-confirm-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

/* 价格区域 */
.sitepay-confirm-price-box {
    background: linear-gradient(135deg, #f0fdfb 0%, #e8f9f5 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sitepay-confirm-price {
    font-size: 32px;
    font-weight: 700;
    color: #12CDB0;
    text-align: center;
    margin-bottom: 12px;
}

.sitepay-confirm-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(18, 205, 176, 0.3), transparent);
    margin: 12px 0;
}

/* 购买优势列表 */
.sitepay-confirm-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sitepay-confirm-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.sitepay-confirm-benefits li:last-child {
    margin-bottom: 0;
}

.sitepay-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #12CDB0;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* 操作按钮区域 */
.sitepay-confirm-actions {
    display: flex;
    gap: 12px;
}

.sitepay-confirm-actions .sitepay-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
}

.sitepay-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.sitepay-btn-secondary:hover {
    background: #eee;
}

/* 下载按钮样式增强 */
.sitepay-paid-btn {
    background: linear-gradient(135deg, #12CDB0 0%, #0fb89c 100%) !important;
    color: #fff !important;
    transition: all 0.3s ease;
}

.sitepay-paid-btn:hover {
    background: linear-gradient(135deg, #14e0c1 0%, #12CDB0 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 205, 176, 0.3);
}

.sitepay-btn-price {
    font-weight: 700;
    margin: 0 4px;
}

.sitepay-free-btn {
    background: #4caf50 !important;
    color: #fff !important;
}

.sitepay-free-btn:hover {
    background: #45a049 !important;
}

.sitepay-purchased-btn {
    background: #4caf50 !important;
    color: #fff !important;
}

.sitepay-purchased-btn:hover {
    background: #45a049 !important;
}

/* ==================== Mobile 端下载按钮样式修复 ==================== */

/* 修复 mobile 端下载按钮宽度和样式 */
.reload.downlinks,
.downlinks.reload {
    width: auto !important;
    min-width: 2.4rem;
    padding: 0.1rem 0.3rem;
}

.reload.sitepay-paid-btn,
.reload.sitepay-free-btn,
.reload.sitepay-purchased-btn {
    width: auto !important;
    min-width: 2.4rem;
}

/* 修复按钮内价格文字样式 */
.reload .sitepay-btn-price,
.downlinks .sitepay-btn-price {
    font-weight: 700;
    margin: 0 0.06rem;
    white-space: nowrap;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .sitepay-modal {
        width: 95vw;
        margin: 10px;
    }

    .sitepay-modal-header {
        padding: 0.28rem 0.32rem;
    }

    .sitepay-modal-title {
        font-size: 0.32rem;
    }

    .sitepay-modal-close {
        font-size: 0.48rem;
        width: 0.48rem;
        height: 0.48rem;
    }

    .sitepay-modal-body {
        padding: 0.4rem 0.32rem;
    }

    .sitepay-tabs {
        margin-bottom: 0.32rem;
    }

    .sitepay-tab {
        padding: 0.2rem;
        font-size: 0.28rem;
    }

    .sitepay-form-group {
        margin-bottom: 0.28rem;
    }

    .sitepay-form-label {
        font-size: 0.26rem;
        margin-bottom: 0.12rem;
    }

    .sitepay-form-input {
        padding: 0.2rem 0.24rem;
        font-size: 0.28rem;
        border-radius: 0.08rem;
    }

    .sitepay-btn {
        padding: 0.24rem;
        font-size: 0.3rem;
        border-radius: 0.08rem;
    }

    .sitepay-error {
        font-size: 0.24rem;
        margin-top: 0.08rem;
    }

    .sitepay-form-error {
        padding: 0.2rem 0.24rem;
        font-size: 0.26rem;
        margin-bottom: 0.28rem;
        border-radius: 0.08rem;
    }

    .sitepay-price-amount {
        font-size: 0.48rem;
    }

    /* 确认弹窗移动端适配 */
    .sitepay-confirm-modal {
        width: 95vw;
    }

    .sitepay-confirm-product {
        gap: 0.2rem;
        margin-bottom: 0.32rem;
        padding-bottom: 0.28rem;
    }

    .sitepay-confirm-icon {
        width: 1rem;
        height: 1rem;
        border-radius: 0.2rem;
    }

    .sitepay-confirm-name {
        font-size: 0.3rem;
    }

    .sitepay-confirm-price-box {
        padding: 0.32rem;
        border-radius: 0.2rem;
        margin-bottom: 0.32rem;
    }

    .sitepay-confirm-price {
        font-size: 0.56rem;
        margin-bottom: 0.2rem;
    }

    .sitepay-confirm-divider {
        margin: 0.2rem 0;
    }

    .sitepay-confirm-benefits li {
        gap: 0.16rem;
        font-size: 0.26rem;
        margin-bottom: 0.16rem;
    }

    .sitepay-check-icon {
        width: 0.36rem;
        height: 0.36rem;
        font-size: 0.22rem;
    }

    .sitepay-confirm-actions {
        flex-direction: column;
        gap: 0.2rem;
    }

    .sitepay-confirm-actions .sitepay-btn {
        width: 100%;
        padding: 0.28rem 0.4rem;
        font-size: 0.3rem;
    }

    /* Toast 移动端适配 */
    .sitepay-toast {
        padding: 0.24rem 0.48rem;
        font-size: 0.28rem;
        border-radius: 0.08rem;
    }

    /* Spinner 移动端适配 */
    .sitepay-spinner {
        width: 0.32rem;
        height: 0.32rem;
    }

    .sitepay-loading {
        gap: 0.16rem;
    }

    /* Google 按钮移动端适配 */
    .sitepay-divider {
        margin: 0.32rem 0;
    }

    .sitepay-divider span {
        padding: 0 0.24rem;
        font-size: 0.26rem;
    }

    .sitepay-btn-google {
        padding: 0.24rem;
        font-size: 0.28rem;
    }

    .sitepay-google-icon {
        width: 0.36rem;
        height: 0.36rem;
    }
}

/* ==================== Google 登录按钮样式 ==================== */

/* 分隔线 */
.sitepay-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.sitepay-divider::before,
.sitepay-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.sitepay-divider span {
    padding: 0 12px;
    color: #999;
    font-size: 13px;
}

/* Google 登录按钮 */
.sitepay-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.sitepay-btn-google:hover {
    background: #f8f9fa;
    border-color: #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sitepay-btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sitepay-google-icon {
    flex-shrink: 0;
}
