/* 全局样式重置 - 强制盒模型+禁止横向溢出 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

html, body {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="%233563E9"/></svg>'), auto;
    background-color: #f8f9fa;
    color: #333;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
}

a, button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="%23FF7D00"/></svg>'), pointer;
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes hoverUp {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: white;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100% !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100% !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.8s ease;
}

.logo-icon {
    font-size: 2.5rem;
    color: #FF7D00;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo-text p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 登录按钮改为a标签样式 */
.login-btn {
    display: inline-block;
    background-color: #FF7D00;
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.login-btn:hover {
    background-color: #FF6A00;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255,125,0,0.3);
}

/* 主容器样式 - 完全适配屏幕 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
    width: 100% !important;
}

/* 通栏广告条样式 */
.ad-banners {
    width: 100% !important;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-banner {
    width: 100% !important;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    padding: 8px;
    background-color: #fff;
}

.ad-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.ad-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 12/1;
    object-fit: cover;
    border-radius: 6px;
}

/* 文字广告列表样式 */
.text-ad-list {
    width: 100% !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.text-ad-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: white;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-color-1 {
    background: linear-gradient(135deg, #FF7D00, #FF9E40);
}
.ad-color-2 {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
}
.ad-color-3 {
    background: linear-gradient(135deg, #10B981, #34D399);
}
.ad-color-4 {
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
}
.ad-color-5 {
    background: linear-gradient(135deg, #EF4444, #F87171);
}

.text-ad-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    filter: brightness(1.1);
}

/* 基础会员区样式 */
.basic-member {
    margin: 4rem 0;
    animation: fadeIn 1s ease 0.2s both;
    width: 100% !important;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #1E3A8A;
    width: 100% !important;
}

.section-title h2 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #FF7D00;
    border-radius: 2px;
}

.member-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    width: 100% !important;
}

.icon-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100% !important;
}

.icon-card {
    background-color: white;
    border-radius: 15px;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    width: 100% !important;
}

.icon-card-link:hover .icon-card {
    animation: hoverUp 0.3s ease forwards;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.icon-card .icon-img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    object-fit: contain;
    border-radius: 50%;
    background-color: #EFF6FF;
    padding: 12px;
}

.icon-card h3 {
    color: #1E3A8A;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.icon-card p {
    color: #666;
    font-size: 0.9rem;
}

/* 高级学员区样式 - 核心修复宽度溢出 */
.advanced-student {
    margin: 4rem 0;
    animation: fadeIn 1s ease 0.4s both;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* 课程列表容器 - 强制单列+100%宽度 */
.course-list {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    margin-bottom: 2.5rem;
    overflow: hidden !important;
}

/* 课程卡片链接样式 */
.course-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    width: 100% !important;
}

/* 课程卡片 - 完全贴合屏幕宽度 */
.course-card {
    background-color: white;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    padding: 0.8rem !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.course-card:hover {
    animation: hoverUp 0.3s ease forwards;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 课程图片容器 - 电脑端固定高度，核心优化 */
.course-img-wrapper {
    width: 100% !important;
    height: 170px !important; /* 电脑端固定高度，统一所有卡片图片区域 */
    overflow: hidden !important; /* 隐藏溢出的图片部分 */
    border-radius: 12px !important;
    background-color: #f5f5f5;
    margin-bottom: 0.5rem !important;
}

/* 课程图片 - 自适应+不变形+居中裁剪 */
.course-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* 关键属性：覆盖容器，保持比例，裁剪多余部分 */
    object-position: center !important; /* 图片居中显示 */
    transition: transform 0.5s ease;
    display: block !important;
}

.course-card:hover .course-img {
    transform: scale(1.05); /* hover时轻微放大，增强交互 */
}

/* 课程信息区 - 防止文字溢出 */
.course-info {
    padding: 1rem 0 0 !important;
    display: flex;
    flex-direction: column;
    width: 100% !important;
}

.course-info h3 {
    color: #1E3A8A;
    font-size: 1.1rem;
    padding: 0 !important; /* 移除多余padding，优化布局 */
    margin-bottom: 0.8rem;
    width: 100% !important;
}

.course-info .tag {
    display: inline-block;
    background-color: #EFF6FF;
    color: #3B82F6;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.course-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 2);
    flex: none;
    width: 100% !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

/* 学员评分区域 */
.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-bottom: 0;
    flex: none;
    width: 100% !important;
}

/* 分页样式 - 新增核心样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    width: 100%;
}

.pagination-btn {
    background-color: #1E3A8A;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #3B82F6;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.pagination-info {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.pagination-link {
    text-decoration: none;
}

/* 查看所有课程链接样式 */
.view-all-courses {
    text-align: center;
    margin-top: 1rem;
    width: 100% !important;
}

.view-all-link {
    display: inline-block;
    background-color: #1E3A8A;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.view-all-link:hover {
    background-color: #3B82F6;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(30, 58, 138, 0.25);
}

.view-all-link i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.view-all-link:hover i {
    transform: translateX(5px);
}

/* 底部样式 */
footer {
    background-color: #1E3A8A;
    color: white;
    padding: 3rem 5% 1rem;
    margin-top: 4rem;
    width: 100% !important;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100% !important;
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #FF7D00;
}

.footer-col p {
    line-height: 1.8;
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* 二维码容器样式 */
.qrcode-group {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0;
    width: 100% !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.qrcode-group::-webkit-scrollbar {
    height: 4px;
}
.qrcode-group::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.qrcode-item {
    flex: 0 0 auto; /* 关键修复：禁止二维码项收缩/拉伸 */
    width: 100px; /* 固定宽度 */
    text-align: center;
}

.qrcode {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    background-color: white;
    padding: 8px;
    border-radius: 12px;
}

.qrcode img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.qrcode-desc {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 微信号联系方式样式 */
.wechat-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100% !important;
}

.wechat-info:hover {
    background-color: rgba(255,255,255,0.1);
}

.wechat-info i {
    color: #FF7D00;
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.wechat-info .wechat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.wechat-info .wechat-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    opacity: 0.7;
    width: 100% !important;
}

/* 响应式适配 - 平板/手机通用 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .section-title h2 {
        font-size: 1.6rem;
    }

    .ad-img {
        aspect-ratio: 8/1;
    }
    
    .text-ad-item {
        font-size: 0.9rem;
        padding: 0.8rem 0.4rem;
        border-radius: 10px;
    }

    .member-icons {
        grid-template-columns: repeat(2, 1fr);
    }

    .icon-card .icon-img {
        width: 70px;
        height: 70px;
        padding: 10px;
    }

    .qrcode-group {
        gap: 0.8rem;
    }
    
    .qrcode-item {
        width: 80px; /* 平板端缩小二维码 */
    }
    
    .qrcode-desc {
        font-size: 0.75rem;
    }

    .wechat-info .wechat-number {
        font-size: 1rem;
    }

    /* 平板端课程容器兜底 */
    .course-list {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* 平板端图片容器高度适配 */
    .course-img-wrapper {
        height: 220px !important;
    }
}

/* 手机端（480px以下）终极适配 */
@media (max-width: 480px) {
    /* 头部适配 */
    .logo-text h1 {
        font-size: 1.5rem;
    }

    .login-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* 广告区适配 */
    .ad-img {
        aspect-ratio: 6/1;
    }
    
    .ad-banners {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .text-ad-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .text-ad-item {
        font-size: 0.85rem;
        padding: 0.7rem 0.3rem;
        border-radius: 8px;
    }

    /* 基础会员区适配 */
    .icon-card .icon-img {
        width: 60px;
        height: 60px;
        padding: 8px;
    }

    /* 主容器彻底适配手机屏幕 */
    main {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 1rem 3% !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    /* 手机端图片容器高度适配 */
    .course-img-wrapper {
        height: 220px !important;
    }

    /* 课程信息区手机端优化 */
    .course-info {
        padding: 0.5rem 0 !important;
    }

    /* 二维码适配 */
    .qrcode-item {
        width: 70px; /* 手机端进一步缩小 */
    }

    /* 联系方式适配 */
    .wechat-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .wechat-info .wechat-number {
        font-size: 0.95rem;
    }
}
