/* =============================================
   优学网首页美化样式 - 专业教育风格
   ============================================= */

/* --- CSS 变量（配色方案） --- */
:root {
    --theme-color: #0366c2;           /* 专业蓝 - 主色 */
    --theme-color-dark: #0353a0;      /* 深蓝 - 悬停/强调 */
    --theme-color-light: #e8f0fe;     /* 浅蓝 - 背景 */
    --accent-color: #f5c520;         /* 金色 - CTA按钮 */
    --accent-hover: #e0b010;         /* 深金 - 悬停 */
    --success-color: #10B981;         /* 绿色 - 成功/数据 */
    --text-primary: #1E293B;          /* 主文字 */
    --text-secondary: #64748B;        /* 次要文字 */
    --bg-light: #F8FAFC;             /* 浅灰背景 */
    --bg-white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* --- 快捷入口条优化 --- */
.quick-cta-bar {
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    padding: 20px 0;
    color: #fff;
}
.cta-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.cta-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.cta-text p {
    font-size: 14px;
    opacity: 0.9;
}
.cta-btns {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245,158,11,0.35);
}
.btn-cta-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245,158,11,0.45);
    color: #fff;
}
.btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
}
.btn-cta-secondary:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* --- 通用区块标题 --- */
.section-title {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}
.section-title h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.section-title p {
    font-size: 16px;
    color: var(--text-secondary);
}
.section-title .more-link {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}
.section-title .more-link:hover {
    color: var(--theme-color-dark);
}

/* --- 课程项目区域 --- */
.courses-section {
    padding: 40px 0 45px;
    background: var(--bg-white);
}
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.course-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 24px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #E2E8F0;
    position: relative;
    overflow: hidden;
}
.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--theme-color);
}
.course-card .icon {
    font-size: 48px;
    margin-bottom: 16px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-color-light);
    border-radius: 50%;
    transition: all 0.35s;
}
.course-card:hover .icon {
    background: var(--theme-color);
    transform: scale(1.1);
}
.course-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.course-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}
.btn-trial {
    display: inline-block;
    padding: 8px 24px;
    background: var(--theme-color) !important;
    color: #ffffff !important;
    border-radius: 50px;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s;
    text-decoration: none !important;
    line-height: 1.5;
    white-space: nowrap;
    text-align: center;
}
.course-card:hover .btn-trial {
    background: var(--theme-color-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* --- 为什么选择我们 --- */
.features-section {
    padding: 40px 0 45px;
    background: var(--bg-light);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-item {
    background: var(--bg-white);
    padding: 36px 28px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.35s;
    border: 1px solid transparent;
}
.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--theme-color-light);
}
.feature-item .feature-icon {
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--theme-color-light), #EFF6FF);
    border-radius: 50%;
    font-size: 32px;
}
.feature-item h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.consult-btn-wrap {
    text-align: center;
    margin-top: 40px;
}
.btn-consult-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 42px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.btn-consult-lg:hover {
    background: var(--theme-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
    color: #fff;
}

/* --- 数据展示区域优化 --- */
/* 数据区域已在index中inline style，这里补充动画 */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.col-md-3.col-6 div[style*="font-size:40px"] {
    animation: countUp 0.8s ease-out forwards;
}

/* --- 数据统计 --- */
.stats-section {
    padding: 40px 0 45px;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
}
.stats-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}
.stat-item {
    text-align: center;
    color: #fff;
}
.stat-number {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 6px;
}
.stat-number span {
    font-size: 48px;
}
.stat-label {
    font-size: 14px;
    opacity: 0.85;
}

/* --- 师资团队区域 --- */
.teacher-section {
    padding: 40px 0 45px;
    background: var(--bg-white);
}
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.teacher-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.35s;
    cursor: pointer;
}
.teacher-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.teacher-card .avatar {
    width: 100%;
    height: 220px;
    overflow: hidden;
}
.teacher-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.teacher-card:hover .avatar img {
    transform: scale(1.05);
}
.teacher-card h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 16px 4px;
}
.teacher-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 16px 16px;
    line-height: 1.6;
}

/* --- 新闻资讯 --- */
.news-section {
    padding: 40px 0 45px;
    background: var(--bg-light);
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.news-card {
    display: block;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--theme-color);
}
.news-card .news-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
}
.news-card .news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.news-card:hover .news-thumb img {
    transform: scale(1.08);
}
.news-card .news-info {
    padding: 14px 16px;
}
.news-card .news-info .date {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}
.news-card .news-info h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* --- FAQ 区域 --- */
.faq-section {
    padding: 40px 0 45px;
    background: var(--bg-light);
}
.faq-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.faq-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    height: 100%;
}
.faq-item:hover {
    box-shadow: var(--shadow-md);
}
.faq-item .faq-question {
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-color);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.faq-item .faq-answer {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* --- 在线报名 --- */
.register-section {
    padding: 40px 0 45px;
    background: var(--bg-white);
}
.reg-form .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.reg-form .form-row input,
.reg-form .form-row select {
    padding: 12px 18px;
    border: 1px solid #E2E8F0;
    border-radius: 50px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    min-width: 180px;
}
.reg-form .form-row input:focus,
.reg-form .form-row select:focus {
    border-color: var(--theme-color);
}
.reg-form .form-row button {
    padding: 12px 32px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.reg-form .form-row button:hover {
    background: var(--accent-hover);
}

/* --- 荣誉资质 --- */
.honor-section {
    padding: 40px 0 45px;
    background: var(--bg-light);
}
.honor-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.honor-card {
    width: 110px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.35s;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    padding: 20px 12px;
    text-align: center;
}
.honor-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--theme-color);
}
.honor-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}
.honor-card h6 {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* --- 学校简介 --- */
.school-intro-section {
    padding: 45px 0 50px;
    background: var(--bg-white);
}
.school-intro-section .intro-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}
.school-intro-section .intro-img {
    flex: 1;
    min-width: 280px;
}
.school-intro-section .intro-img img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.school-intro-section .intro-text {
    flex: 1;
    min-width: 280px;
    font-size: 15px;
    line-height: 2;
    color: var(--text-secondary);
}
.school-intro-section .intro-text .btn-more {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}
.school-intro-section .intro-text .btn-more:hover {
    background: var(--theme-color-dark);
    color: #fff;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .teacher-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .cta-content {
        flex-direction: column;
        text-align: center;
    }
    .course-grid {
        grid-template-columns: 1fr;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .teacher-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .section-title h2 {
        font-size: 24px;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .teacher-grid {
        grid-template-columns: 1fr;
    }
    .cta-btns {
        flex-direction: column;
        width: 100%;
    }
    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* --- 通用动画 --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animated.fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* --- 返回顶部按钮 --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--theme-color-dark);
    transform: translateY(-3px);
}

/* --- 在线客服面板优化 --- */
.qx-chat-float .qx-chat-toggle {
    background: var(--theme-color) !important;
    box-shadow: 0 4px 14px rgba(37,99,235,0.4) !important;
}
.qx-chat-float .qx-chat-toggle:hover {
    background: var(--theme-color-dark) !important;
    transform: scale(1.1) !important;
}
.qx-chat-panel {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-lg) !important;
}
.qx-chat-header {
    background: linear-gradient(135deg, var(--theme-color), var(--theme-color-dark)) !important;
}

/* --- Banner/轮播图 --- */
/* 2026-09-28：移除原先写死的 height:500px !important 覆盖。
   那段覆盖把轮播高度钉死在 500px，导致模板里的比例类（ratio-2-1 等）完全失效，
   同时 ::after 被 display:none 禁用，比例机制失灵。
   现在轮播高度由 BannerView 模板的 ratio 类控制（PC 当前 5-2，移动端 5-2），
   需要调整高度时改首页模板里 BannerView::basic 的比例参数即可。 */

/* 首页首屏总高锁定 950px（2026-09-28 按需求设定）
   预算：顶部导航 68px + 轮播 H + 蓝色报名条 134px = 950px  →  H = 748px
   Banner 的高度不是写死的，而是靠 .cover:after 的 margin-top 百分比撑起来的（百分比相对宽度）。
   1920 宽时 748 / 1920 = 38.958%，所以这里把首页轮播的比例精确压到 38.958%，
   高度仍然随窗口宽度等比缩放，不是钉死的固定值。
   只作用于首页 .home-banner 内的轮播（会覆盖 Banner 自带的 ratio-5-2 = 40%），其余比例类不受影响。
   想改回原样：把下面这条删掉即可，轮播会回到 5-2 的 40%（1920 宽下 768px，总高 970px）。 */
@media (min-width: 768px) {
    .home-banner .ub-banner.ratio-5-2 .swiper-slide .cover:after {
        margin-top: 38.958%;
    }
}
