/* 自定义按钮样式 */
.custom-button-trigger {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px 5px 5px 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.custom-button-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

.custom-button-trigger:active {
    transform: translateY(0);
}

/* 弹窗样式 */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    max-width: 90%;
    max-height: 80%;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.custom-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    transition: color 0.2s ease;
}

.custom-modal-close:hover {
    color: #333;
}

.custom-modal-body {
    padding: 50px 30px 30px;
    max-height: 70vh;
    overflow-y: auto;
    line-height: 1.6;
}

.custom-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.custom-modal-body p {
    margin-bottom: 15px;
}

.custom-modal-body h1,
.custom-modal-body h2,
.custom-modal-body h3,
.custom-modal-body h4,
.custom-modal-body h5,
.custom-modal-body h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
        max-height: calc(100% - 40px);
    }
    
    .custom-modal-body {
        padding: 40px 20px 20px;
    }
    
    .custom-button-trigger {
        margin: 3px 3px 3px 0;
        padding: 10px 15px;
        font-size: 13px;
        min-width: 100px;
    }
}

/* 确保按钮在下载框中与其他按钮保持一致的布局 */
.erphpdown-fee .custom-button-trigger {
    flex: 1;
    margin-left: 0;
}

.erphpdown-child .custom-button-trigger {
    flex: 1;
    margin-left: 0;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .custom-modal-content {
        background: #2a2a2a;
        color: #fff;
    }
    
    .custom-modal-body h1,
    .custom-modal-body h2,
    .custom-modal-body h3,
    .custom-modal-body h4,
    .custom-modal-body h5,
    .custom-modal-body h6 {
        color: #fff;
    }
    
    .custom-modal-close {
        color: #ccc;
    }
    
    .custom-modal-close:hover {
        color: #fff;
    }
}