/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    /* 防止页面闪烁 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 优化渲染 */
    text-rendering: optimizeLegibility;
    /* 防止滚动闪烁 */
    -webkit-overflow-scrolling: touch;
    /* 确保页面内容立即可见 */
    visibility: visible;
    opacity: 1;
    /* 平滑过渡 */
    transition: opacity 0.3s ease;
    /* 防止水平滚动条 */
    overflow-x: hidden;
}

/* 防止图片闪烁 */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
}

/* 优化所有过渡效果 */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.2s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    /* 防止内容溢出到页面边界外 */
    overflow-x: hidden;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* 添加硬件加速，减少闪烁 */
    transform: translateZ(0);
    will-change: transform;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    /* 防止图片闪烁 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    /* 添加硬件加速 */
    transform: translateZ(0);
    will-change: transform;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    /* 优化过渡效果，减少闪烁 */
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    /* 防止文字闪烁 */
    backface-visibility: hidden;
    transform: translateZ(0);
}

.nav-link:hover,
.nav-link.active {
    color: #d8b43d;
    /* 添加微妙的缩放效果 */
    transform: translateZ(0) scale(1.05);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #d8b43d, #e7d05e);
    /* 优化过渡效果 */
    transition: width 0.2s ease;
    /* 防止闪烁 */
    backface-visibility: hidden;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 登录课程平台按钮特殊样式 */
.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.login-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b5b95 100%);
    color: #fff !important;
    transform: translateZ(0) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.login-btn::after {
    display: none; /* 移除下划线效果 */
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    /* 防止点击闪烁 */
    -webkit-tap-highlight-color: transparent;
    /* 添加硬件加速 */
    transform: translateZ(0);
    will-change: transform;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    /* 优化过渡效果 */
    transition: 0.2s ease;
    /* 防止闪烁 */
    backface-visibility: hidden;
    transform: translateZ(0);
    /* 设置变换原点 */
    transform-origin: center;
}

/* 汉堡菜单激活状态动画 */
.hamburger.active .bar:nth-child(1) {
    transform: translateZ(0) rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateZ(0) rotate(-45deg) translate(7px, -6px);
}

/* 主页横幅 */
.hero {
    position: relative;
    color: white;
    text-align: center;
    padding: 200px 20px 100px;
    /* 增加高度，确保图片完整显示 */
    height: 80vh;
    min-height: 600px;
    max-height: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 添加文字阴影，确保在无遮罩情况下文字清晰可见 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    /* 增加与导航菜单的距离 */
    margin-top: 50px;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    overflow: hidden;
}

.slide img {
    /* 确保图片完整显示，优先保持宽度 */
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    /* 确保图片完整显示，不被压缩 */
    object-fit: contain;
    /* 添加图片质量优化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.slide.active {
    opacity: 1;
}

/* 取消banner遮罩效果 */
/* .slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(216, 180, 61, 0.8) 0%, rgba(231, 208, 94, 0.8) 100%);
} */

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.4s both;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.btn-primary {
    background: #fff;
    color: #d8b43d;
}

.btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: #fff;
    color: #d8b43d;
    transform: translateY(-2px);
}

/* 快速导航 */
.quick-nav {
    padding: 80px 0;
    background: #f8f9fa;
}

.quick-nav h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2c3e50;
}

.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.nav-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d8b43d, #e7d05e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.card-icon i {
    font-size: 2rem;
    color: white;
}

.nav-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.nav-card p {
    color: #666;
    margin-bottom: 20px;
}

.card-link {
    color: #d8b43d;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.card-link:hover {
    gap: 10px;
}

/* 产品精选 */
.product-section {
    padding: 10px 0;
    background: #fff;
    position: relative;
    /* 默认隐藏溢出，防止布局问题 */
    overflow: hidden;
}

/* 当有放大图片时，只允许垂直溢出 */
.product-section.has-zoom {
    overflow-x: hidden; /* 水平方向始终隐藏 */
    overflow-y: visible; /* 垂直方向允许溢出 */
}

.product-section h2 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.product-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-viewport {
    overflow: hidden;
    width: 100%;
}

/* 当有中心放大图片时，精确控制溢出 */
.product-viewport.has-center-zoom {
    overflow-x: hidden; /* 水平方向隐藏，防止左右溢出 */
    overflow-y: visible; /* 垂直方向允许溢出 */
    /* 为放大图片预留垂直空间 */
    padding: 50px 0;
}

/* 防止放大图片导致页面出现横向滚动条的额外保护 */

.product-track {
    display: flex;
    gap: 12px;
    will-change: transform;
    transform: translateX(0);
    transition: transform 0.4s ease;
}

.product-card {
    flex: 0 0 calc((100% - 12px * 4) / 5);
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    /* 确保卡片有稳定的定位上下文 */
    position: relative;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 产品图片悬停放大效果（contain下用内边距和阴影营造层次） */
.product-card {
    position: relative;
    background: #fff;
}

.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
    pointer-events: none;
}

.product-card img {
    transition: transform 0.35s ease, filter 0.35s ease;
    transform-origin: center center; /* 固定为居中放大 */
    will-change: transform;
}

/* 中心位置自动放大效果 */
.product-card.center-active {
    z-index: 50; /* 高于普通卡片，但低于箭头按钮 */
    box-shadow: 0 24px 80px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25);
    /* 允许放大的图片超出容器边界 */
    overflow: visible;
    /* 确保不阻挡箭头按钮 */
    pointer-events: none;
    /* 使用transform提升到新的层叠上下文 */
    transform: translateZ(0);
}

.product-card.center-active img {
    transform: scale(1.3) !important; /* 适度放大，减少水平溢出 */
    filter: contrast(1.08) saturate(1.08) brightness(1.08) !important;
    pointer-events: none; /* 放大的图片不拦截点击事件 */
    /* 确保图片在自己的层叠上下文中 */
    position: relative;
    z-index: 1;
    /* 添加边界限制 */
    max-width: none;
}

/* 轻微的悬停效果（不影响中心放大） */
.product-card:hover:not(.center-active) img {
    transform: scale(1.06);
    filter: contrast(1.02) saturate(1.02);
}

/* 已移除 Lightbox 样式 */

.product-prev,
.product-next {
    background: rgba(44, 62, 80, 0.9);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 9999; /* 超高层级确保始终可点击 */
    flex-shrink: 0; /* 防止被压缩 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.product-prev:hover,
.product-next:hover {
    background: rgba(44, 62, 80, 1);
}

@media (max-width: 1024px) {
    .product-card { flex: 0 0 calc((100% - 12px * 3) / 4); }
}

@media (max-width: 768px) {
    .product-card { flex: 0 0 calc((100% - 12px * 2) / 3); }
}

@media (max-width: 560px) {
    .product-card { flex: 0 0 calc((100% - 12px * 1) / 2); }
}

@media (max-width: 380px) {
    .product-card { flex: 0 0 100%; }
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: #d8b43d;
}

.footer-section p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #d8b43d;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: #34495e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: #d8b43d;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 轮播图控制 */
.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.prev-btn,
.next-btn {
    background: rgba(216, 180, 61, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover,
.next-btn:hover {
    background: rgba(216, 180, 61, 1);
    transform: scale(1.1);
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slider-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dots .dot.active {
    background: #d8b43d;
    transform: scale(1.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        /* 优化过渡效果，减少闪烁 */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
        /* 添加硬件加速 */
        transform: translateX(-100%);
        will-change: transform;
        /* 防止闪烁 */
        backface-visibility: hidden;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .hero {
        height: 70vh;
        min-height: 550px;
        padding: 180px 20px 90px;
        margin-top: 30px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .btn {
        display: block;
        margin: 10px auto;
        max-width: 200px;
    }
    
    /* 移动端登录按钮样式 */
    .login-btn {
        margin: 10px auto;
        display: block;
        text-align: center;
        padding: 12px 20px;
        border-radius: 25px;
        font-size: 14px;
        max-width: 180px;
    }
    
    .nav-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 50vh;
        min-height: 400px;
        padding: 140px 20px 80px;
        margin-top: 10px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .quick-nav h2 {
        font-size: 2rem;
    }
    
    .nav-card {
        padding: 30px 20px;
    }
} 

/* 登录弹窗 */
.login-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-dialog {
    width: min(520px, 92vw);
    aspect-ratio: 1 / 1;
    background: url('../login/login.jpg') center/contain no-repeat;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-content {
    width: 82%;
    padding: 10px 0 0 0; /* 去除白色块留白，仅保留输入框白底 */
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center; /* 标题在弹框内居中 */
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    margin: 8px auto 16px auto;
    color: #fff;
    text-align: center;
    display: inline-block;
    padding: 10px 22px;
    border-radius: 26px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    box-shadow: 0 6px 20px rgba(59,130,246,0.35);
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
}

.login-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.captcha-row {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 10px;
    align-items: center;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-img {
    width: 120px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.captcha-tip {
    font-size: 12px;
    color: #fff;
    display: inline-block;
    background: transparent; /* 取消背景 */
    padding: 0;
    border-radius: 0;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.login-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

.login-error {
    color: #ef4444;
    font-size: 13px;
    min-height: 18px;
}

@media (max-width: 780px) {
    .login-dialog {
        width: min(420px, 92vw);
        background-position: center;
    }
}