/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}
html { scroll-behavior: smooth; }
body { color: #333; background-color: #fff; overflow-x: hidden; }
.section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-title h2 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}
.section-title p {
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.6;
}
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 导航栏样式 ==================== */
.header-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: rgba(44, 62, 80, 0.95);
    padding: 15px 0;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo img { height: 50px; }
.nav-menu {
    display: flex;
    list-style: none;
}
.nav-menu li { margin-left: 30px; }
.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}
.nav-menu li a:hover,
.nav-menu li a.active {
    color: #3498db;
}
.mobile-nav-btn {
    display: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* ==================== 英雄区样式 ==================== */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    overflow: hidden;
}
#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}
.hero-title {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
}
.hero-subtitle {
    font-size: 18px;
    margin-bottom: 40px;
    line-height: 1.6;
    opacity: 0.9;
}
.hero-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.hero-btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ==================== 课程体系/关于我们/师资团队/赛事成果 通用样式 ==================== */
.courses-section, .advantages-section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.courses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}
.course-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}
.course-card:hover { transform: translateY(-5px); }
.course-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
#teachers .course-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: top center;
}
.course-content { padding: 30px; }
.course-tag {
    display: inline-block;
    padding: 5px 15px;
    background-color: #3498db;
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    margin-bottom: 15px;
}
.course-content h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}
.course-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #7f8c8d;
    margin-bottom: 15px;
}
.course-features { list-style: none; }
.course-features li {
    font-size: 15px;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}
.course-features li i {
    color: #3498db;
    margin-right: 10px;
    margin-top: 5px;
}

/* ==================== 教学特色样式 ==================== */
.advantages-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.advantage-item {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}
.advantage-item:hover { transform: translateY(-5px); }
.advantage-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 20px;
}
.advantage-item h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}
.advantage-item p {
    font-size: 15px;
    line-height: 1.6;
    color: #7f8c8d;
}

/* ==================== 右下角悬浮联系按钮样式（电脑端完全不变）==================== */
.floating-contact {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.floating-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 50px;
    padding: 10px 18px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.floating-item:hover {
    transform: translateX(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.floating-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.floating-icon i {
    font-size: 20px;
    color: #fff;
}

.floating-content {
    display: flex;
    flex-direction: column;
}

.floating-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.floating-detail {
    position: absolute;
    right: 100%;
    bottom: 0;
    transform: translateY(0);
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 360px;
    margin-right: 15px;
    z-index: 9999;
}

.floating-item:hover .floating-detail,
.floating-detail:hover {
    opacity: 1;
    visibility: visible;
}

.form-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}
.form-close:hover {
    color: #e74c3c;
}

.phone-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}
.phone-number {
    font-size: 24px;
    font-weight: 700;
    color: #3498db;
    text-decoration: none;
}
.phone-number:hover {
    color: #2980b9;
}
.work-hours {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.work-hours i {
    color: #3498db;
}

.qrcode-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 280px;
}
.qrcode-detail img {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    margin-bottom: 5px;
}
.qrcode-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}
.qrcode-desc {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
    text-align: center;
}

.form-detail {
    min-width: 360px;
    padding: 25px;
    max-height: 80vh;
    overflow-y: auto;
}
.required {
    color: #e74c3c;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}
.form-btn {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}
.form-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}
.form-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== 页脚样式（更新版权信息）==================== */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 80px 20px 20px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-logo img {
    height: 60px;
    margin-bottom: 15px;
}
.footer-logo p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}
.footer-links h4 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.footer-links a:hover { opacity: 1; }
.footer-contact p {
    font-size: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    opacity: 0.8;
}
.footer-contact i {
    margin-right: 10px;
    font-size: 16px;
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.6;
}

/* ==================== 👇 只改这里：手机端专属优化 👇 ==================== */
@media (max-width: 992px) {
    /* 手机导航：变窄 + 点击空白关闭 */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -240px;
        width: 240px;
        height: 100vh;
        background-color: #2c3e50;
        flex-direction: column;
        padding: 80px 20px;
        transition: right 0.3s ease;
    }
    .nav-menu.active { right: 0; }
    .nav-menu li { margin: 15px 0; }
    .mobile-nav-btn { display: block; }

    /* 悬浮按钮：手机端缩小 */
    .floating-contact {
        bottom: 12px;
        right: 10px;
    }
    .floating-item {
        padding: 6px 12px;
        gap: 8px;
    }
    .floating-icon {
        width: 32px;
        height: 32px;
    }
    .floating-icon i {
        font-size: 15px;
    }
    .floating-title {
        font-size: 12px;
    }

    /* 🔴 关键修复：手机悬浮窗口右对齐 + 下边缘对齐按钮上边缘 */
    .floating-detail {
        right: 0;
        left: auto;
        bottom: 100%;
        transform: none;
        margin-right: 0;
        margin-bottom: 8px;
        min-width: auto;
        width: calc(100vw - 20px);
        max-width: 320px;
    }

    /* 手机表单：可滚动 + 不超出屏幕 */
    .form-detail {
        width: calc(100vw - 20px);
        max-width: 320px;
        max-height: 70vh;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .section-title h2 { font-size: 28px; }
    .hero-title { font-size: 30px; }
    .courses-container { grid-template-columns: 1fr; }
    .advantages-container { grid-template-columns: 1fr; }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    #teachers .course-img img { aspect-ratio: 3/4; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 16px; }
    .hero-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    .course-content { padding: 20px; }
}

/* ==================== 脉冲动画 ==================== */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}