/* 整体样式优化 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: #ffffff;
    color: #333;
    line-height: 1.5;
}

.homepage {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 标题区域 */
.page-title {
    text-align: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 36px;
    font-weight: bold;
    color: #5d4037;
    position: relative;
    display: inline-block;
}

.page-title h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(to right, #e0c8a0, #d4a45f);
    border-radius: 2px;
}

/* 套餐卡片区域 */
.plans-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.plan-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    padding: 25px 15px;
    text-align: center;
    width: 220px;
    position: relative;
    transition: all 0.3s ease;
    border-top: 3px solid #e0c8a0;
    background: linear-gradient(to bottom, #fffbf5, #fff9f1);
    min-height: 320px;
}

.plan-card.hot {
    box-shadow: 0 10px 25px rgba(224, 200, 160, 0.25);
    z-index: 1;
    background: linear-gradient(to bottom, #fffbf5, #fff1e0);
    border-top: 3px solid #e91e63;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.plan-card.hot .hot-tag {
    position: absolute;
    top: -8px;
    right: 15px;
    background: linear-gradient(to right, #e91e63, #ff4081);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(233, 30, 99, 0.3);
}

.duration {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #5d4037;
    position: relative;
    padding-bottom: 10px;
}

.duration::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: linear-gradient(to right, #e0c8a0, #d4a45f);
}

.price {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
    background: linear-gradient(to right, #e91e63, #ff4081);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.price::before {
    content: '￥';
    font-size: 0.6em;
    position: relative;
    top: -6px;
}

.description {
    font-size: 15px;
    color: #8d6e63;
    margin: 8px 0 15px;
    padding: 0 10px;
    font-weight: 500;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buy-btn {
    background: linear-gradient(to right, #8d6e63, #5d4037);
    color: white;
    border: none;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 3px 12px rgba(141, 110, 99, 0.3);
}

.buy-btn:hover {
    background: linear-gradient(to right, #7c6158, #4d352d);
    transform: translateY(-2px);
}

.login-notice {
    color: #9e9e9e;
    font-size: 13px;
    margin-top: 12px;
}

.login-notice a {
    color: #e91e63;
    text-decoration: none;
    font-weight: 500;
}

/* 会员权益区域 - 内容不拉伸 */
.benefits-container {
    min-width: 300px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #5d4037;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #e0c8a0, transparent);
    margin-left: 15px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
    /* 关键修改：移除flex:1避免内容拉伸，使用auto高度 */
    height: auto;
    max-height: 260px; /* 限制最大高度，超出可滚动 */
    overflow-y: auto;
    padding-right: 5px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    background: #fdf9f3;
}

.benefit-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f5f0e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8d6e63;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.benefit-text {
    font-size: 14px;
    color: #5d4037;
}

/* 支付区域 */
.payment-container {
    width: 320px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

/* 价格详情区域 */
.price-details {
    padding: 15px;
    background: #f9f7f3;
    border-radius: 6px;
    margin: 10px 0;
    border-left: 2px solid #e0c8a0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.price-label {
    color: #8d6e63;
}

.price-value {
    font-weight: 500;
    color: #5d4037;
}

.price-total {
    font-weight: bold;
    font-size: 18px;
    color: #e91e63;
}

.discount-link {
    color: #e91e63;
    text-decoration: none;
    font-size: 13px;
    display: block;
    text-align: right;
    margin-bottom: 10px;
    font-weight: 500;
}

/* 二维码支付区域 */
.qrcode-pay {
    text-align: center;
    padding: 15px 10px 20px;
    border: 1px solid #f0e6d9;
    border-radius: 8px;
    background: #fffbf7;
    margin-bottom: 15px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.qrcode-title {
    font-size: 16px;
    font-weight: bold;
    color: #5d4037;
    margin: 0 0 15px 0;
}

.qrcode-container {
    width: 136px;
    height: 136px;
    margin: 0 auto 10px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.qrcode-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

#qrcode {
    /* 新增：确保二维码充满容器 */
    width: 100% !important;
    height: 100% !important;
    left: 0;
    top: 0;
    padding: 5px; /* 预留边框空间 */
    box-sizing: border-box;
}

/* 移除二维码上的提示文本样式 */
#qrcode .loading,
#qrcode .error {
    display: none !important; /* 彻底隐藏提示文本 */
}

.refresh-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none; /* 初始隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30; /* 确保在二维码之上 */
    border-radius: 8px;
}

.refresh-prompt {
    font-size: 14px;
    margin-bottom: 8px;
    color: #e91e63;
    font-weight: 500;
}

.refresh-btn {
    background: linear-gradient(to right, #e91e63, #ff4081);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(to right, #d81b60, #f50057);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

/* 更新二维码容器定位 */
.qrcode-img {
    position: relative;
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

/* 加载状态样式 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8d6e63;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    z-index: 20;
}

.error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e91e63;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    z-index: 20;
}

/* 确保登录蒙版在刷新蒙版之下 */
.login-overlay {
    z-index: 20;
}
.refresh-overlay {
    z-index: 30;
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    border-radius: 8px;
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.3s ease;
    pointer-events: none; /* 防止蒙版拦截点击事件 */
}

/* 添加蒙版可见时的样式 */
.login-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* 允许点击 */
}
/* 刷新蒙版样式 */
.refresh-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none; /* 初始隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30; /* 确保在二维码之上 */
    border-radius: 8px;
}

.refresh-prompt {
    font-size: 14px;
    margin-bottom: 8px;
    color: #e91e63;
    font-weight: 500;
}

.refresh-btn {
    background: linear-gradient(to right, #e91e63, #ff4081);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(to right, #d81b60, #f50057);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

/* 确保层级关系正确 */
.login-overlay {
    z-index: 20;
}
.refresh-overlay {
    z-index: 30;
}

.login-prompt {
    background: #ff7043;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(255, 112, 67, 0.35);
    transition: all 0.3s;
}

.login-prompt:hover {
    background: #ff5722;
    transform: translateY(-2px);
}

.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #5d4037;
    padding: 5px 10px;
    border-radius: 4px;
    background: #f9f7f3;
    margin: 15px auto 5px;
}

.payment-method img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.payment-hint {
    font-size: 12px;
    color: #8d6e63;
    margin: 0;
    font-weight: 500;
}

/* 底部支持链接 */
.support-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding-top: 12px;
    border-top: 1px solid #f0e6d9;
    margin-top: auto;
}

.support-link {
    color: #e91e63;
    text-decoration: none;
    font-weight: 500;
}

.agreement {
    font-size: 12px;
    color: #9e9e9e;
    margin-top: 12px;
    text-align: center;
    /* 固定在容器底部 */
    margin-top: auto;
    padding-top: 15px;
}

.agreement a {
    color: #e91e63;
    text-decoration: none;
    font-weight: 500;
}

/* 底部区域 - 保持等高 */
.bottom-section {
    display: flex;
    gap: 25px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: stretch; /* 确保左右区域等高 */
}

/* 响应式设计 */
@media (max-width: 992px) {
    .benefits-container,
    .payment-container {
        width: 100%;
        height: auto;
    }

    .bottom-section {
        flex-direction: column;
        gap: 25px;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .plans-container {
        flex-wrap: wrap;
    }

    .plan-card {
        width: calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .plan-card {
        width: 100%;
        max-width: 320px;
    }

    .page-title h1 {
        font-size: 30px;
    }

    .payment-container {
        width: 100%;
        padding: 15px;
    }

    .qrcode-container {
        width: 140px;
        height: 140px;
    }

    .qrcode-img {
        width: 124px;
        height: 124px;
    }
}