/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

/* 下载框样式 */
.pay-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.box-body {
    position: relative;
}

/* 标题样式 */
.box-body > div:first-child {
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* 免费资源标签 */
.badg {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.c-red {
    color: #ff4d4f;
}

.hollow {
    background-color: transparent;
    border: 1px solid currentColor;
}

.badg-sm {
    padding: 2px 6px;
}

.mr6 {
    margin-right: 6px;
}

/* 下载按钮区域 */
.hidden-box {
    margin-top: 10px;
}

.hidden-text {
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* 下载按钮 */
.but-download {
    display: flex;
    align-items: center;
}

.but {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.b-theme {
    background-color: #1890ff;
    color: #fff;
    border: 1px solid #1890ff;
}

.b-theme:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.mr10 {
    margin-right: 10px;
}

/* 布局工具类 */
.flex {
    display: flex;
}

.ac {
    align-items: center;
}

.hh {
    height: 40px;
}

/* ================= 弹窗样式 - 已完全修复 ================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    overflow: auto;
    /* 防止滚动穿透 */
    overscroll-behavior: contain;
}

.modal-content {
    position: absolute;
    /* 关键修改：使用视口单位确保始终居中 */
    top: 50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    /* 内容限制 */
    max-height: 80vh;
    overflow-y: auto;
}

/* 移动端小屏幕适配 */
@media (max-height: 600px) {
    .modal-content {
        top: 40vh;
    }
}

/* 弹窗内部元素 */
.modal-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

#qrcode-img {
    display: block;
    margin: 0 auto 15px;
    width: 200px;
    height: 200px;
    background: #f5f5f5; /* 加载时的背景色 */
}

.modal-text {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.modal-close {
    display: block;
    width: 100%;
    background: #f0f0f0;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #e0e0e0;
}