/**
 * 朴新教育官网 v5.2 - 交互效果增强
 * 包含hover动画、加载动画、过渡效果
 */

/* ==================== 课程卡片hover效果 ==================== */
.course-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 110, 212, 0.15);
}
.course-card:hover .placeholder-course {
    transform: scale(1.05);
}
.course-card .placeholder-course {
    transition: transform 0.3s ease;
}

/* 课程卡片按钮hover */
.course-card .btn-outline {
    background: transparent;
    border: 1px solid var(--primary, #0A6ED4);
    color: var(--primary, #0A6ED4);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}
.course-card .btn-outline:hover {
    background: var(--primary, #0A6ED4);
    color: #fff;
    transform: translateX(4px);
}

/* ==================== 教师卡片hover效果 ==================== */
.teacher-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.teacher-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}
.teacher-card:hover .placeholder-teacher {
    transform: scale(1.05);
}
.teacher-card .placeholder-teacher {
    transition: transform 0.3s ease;
}
.teacher-card:hover .teacher-overlay {
    opacity: 1;
    transform: translateY(0);
}
.teacher-card .teacher-overlay {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* ==================== 新闻卡片hover效果 ==================== */
.news-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}
.news-card:hover .placeholder-news {
    transform: scale(1.05);
}
.news-card .placeholder-news {
    transition: transform 0.3s ease;
}
.news-card h3 a {
    transition: color 0.2s ease;
}
.news-card:hover h3 a {
    color: var(--primary, #0A6ED4);
}

/* ==================== 按钮hover效果 ==================== */
.btn-primary {
    background: linear-gradient(135deg, #0A6ED4 0%, #1e40af 100%);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 110, 212, 0.4);
    filter: brightness(1.1);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-white {
    background: #fff;
    color: var(--primary, #0A6ED4);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

/* ==================== 导航hover效果 ==================== */
.nav-link {
    position: relative;
    color: var(--text-dark, #1f2937);
    text-decoration: none;
    padding: 8px 16px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary, #0A6ED4);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary, #0A6ED4);
}

/* ==================== 加载动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 页面加载动画 */
.animate-item {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-item:nth-child(1) { animation-delay: 0.1s; }
.animate-item:nth-child(2) { animation-delay: 0.2s; }
.animate-item:nth-child(3) { animation-delay: 0.3s; }
.animate-item:nth-child(4) { animation-delay: 0.4s; }
.animate-item:nth-child(5) { animation-delay: 0.5s; }
.animate-item:nth-child(6) { animation-delay: 0.6s; }

/* 滚动加载动画 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 骨架屏加载效果 ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 数字滚动动画 ==================== */
.strength-number span[data-count] {
    display: inline-block;
    transition: all 0.3s ease;
}

/* ==================== 卡片hover光泽效果 ==================== */
.glow-effect {
    position: relative;
    overflow: hidden;
}
.glow-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
    pointer-events: none;
}
.glow-effect:hover::before {
    animation: shine 1s ease;
}

@keyframes shine {
    from { transform: translateX(-100%) rotate(45deg); }
    to { transform: translateX(100%) rotate(45deg); }
}

/* ==================== Banner轮播动画 ==================== */
.hero-swiper .swiper-slide {
    position: relative;
}

.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.3s ease;
}
.hero-swiper .swiper-button-prev:hover,
.hero-swiper .swiper-button-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}
.hero-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}
.hero-swiper .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.2);
}

/* ==================== 表单交互效果 ==================== */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary, #0A6ED4);
    box-shadow: 0 0 0 3px rgba(10, 110, 212, 0.1);
    outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

/* ==================== CTA区块效果 ==================== */
.cta-section {
    background: linear-gradient(135deg, #0A6ED4 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0A6ED4, #1e40af);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(10, 110, 212, 0.3);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(10, 110, 212, 0.4);
}

/* ==================== AI客服按钮 ==================== */
.ai-chat-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}
.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}
.ai-chat-toggle span {
    font-size: 10px;
    position: absolute;
    bottom: -4px;
}

/* ==================== 移动端优化 ==================== */
@media (max-width: 768px) {
    .btn-primary,
    .btn-white,
    .btn-accent {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .ai-chat-toggle {
        bottom: 75px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .course-card:hover {
        transform: translateY(-4px);
    }
    
    .teacher-card:hover {
        transform: translateY(-3px);
    }
    
    .news-card:hover {
        transform: translateY(-3px);
    }
}

/* ==================== 右侧咨询栏最终覆盖：收编旧悬浮按钮 ==================== */
.service-dock .service-dock-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.service-dock .service-dock-item,
.service-dock .ai-chat-toggle,
.service-dock .back-to-top {
    position: static !important;
    inset: auto !important;
    width: 88px !important;
    height: auto !important;
    min-height: 68px !important;
    margin: 0 !important;
    padding: 10px 8px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
}

.service-dock .ai-chat-toggle {
    background: linear-gradient(180deg, #ecfdf5, #ffffff) !important;
    color: #0f9f7a !important;
}

.service-dock .ai-chat-toggle img {
    width: 44px !important;
    height: 44px !important;
    position: static !important;
}

.service-dock .ai-chat-toggle span {
    position: static !important;
    bottom: auto !important;
    display: inline-flex !important;
    padding: 3px 6px !important;
    border-radius: 5px !important;
    background: #14b8a6 !important;
    color: #fff !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.service-dock .back-to-top {
    background: transparent !important;
    color: #475569 !important;
}

.service-dock .back-to-top:hover,
.service-dock .service-dock-item:hover {
    background: #f0fdfa !important;
    color: #0f9f7a !important;
    transform: none !important;
}

.service-dock .service-back-to-top i {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}

@media (max-width: 768px) {
    .service-dock .service-dock-item,
    .service-dock .ai-chat-toggle,
    .service-dock .back-to-top {
        width: 76px !important;
        min-height: 60px !important;
        font-size: 12px !important;
    }
}

/* ==================== 卡片涟漪效果 ==================== */
.ripple {
    position: relative;
    overflow: hidden;
}
.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--primary, #0A6ED4) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}
.ripple:active::after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

/* ==================== 标签hover效果 ==================== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-light, #f3f4f6);
    color: var(--text-body, #4b5563);
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.2s ease;
}
.tag:hover {
    background: var(--primary, #0A6ED4);
    color: #fff;
}

/* ==================== 链接下划线动画 ==================== */
.animated-link {
    position: relative;
    text-decoration: none;
    color: inherit;
}
.animated-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary, #0A6ED4);
    transition: width 0.3s ease;
}
.animated-link:hover::after {
    width: 100%;
}
