/* ==========================================
   乐学百年官网 - 自定义样式
   主色调: #f3680d
   ========================================== */

:root {
    --primary-color: #f3680d;
    --primary-hover: #d45a0b;
    --text-dark: #333333;
    --text-muted: #666666;
    --bg-light: #f8f9fa;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 
                 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

html {
    scroll-behavior: smooth;
}

/* 导航栏样式 */
.navbar {
    transition: all 0.3s ease;
    padding: 0.75rem 0;
    background-color: #f3680d !important;
}

.navbar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px; /* 与内容区域保持一致 */
    margin: 0 auto; /* 水平居中 */
}

/* 大屏幕时导航栏也增加留白 */
@media (min-width: 1400px) {
    .navbar > .container {
        max-width: 1300px;
    }
}

/* 超大屏幕时进一步增加留白 */
@media (min-width: 1600px) {
    .navbar > .container {
        max-width: 1400px;
    }
}

/* 移动端时导航栏恢复全屏 */
@media (max-width: 767px) {
    .navbar > .container {
        max-width: 100%;
        margin: 0;
    }
}

.navbar-brand {
    font-size: 1.5rem;
    color: #ffffff !important;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    padding: 0;
    margin: 0;
    height: 48px;
}

.navbar-logo {
    height: 48px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    display: block;
    vertical-align: middle;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

.brand-text {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff !important;
    padding: 0.5rem 2.5rem;
    margin: 0 30px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #ffffff !important;
    font-weight: 700;
    transform: scale(1.1);
}

/* 汉堡菜单图标样式（移动端） */
.navbar-toggler {
    border: none;
    padding: 0;
    width: 48px;
    height: 48px;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    width: 27px;
    height: 24px;
    position: relative;
    background-image: none;
    display: block;
    transform: translateY(-2px);
}

/* 自定义汉堡菜单图标 - 始终显示三条线 */
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.9);
    left: 0;
}

.navbar-toggler-icon::before {
    top: 0;
}

.navbar-toggler-icon::after {
    bottom: 0;
}

/* 中间的线 - 始终显示 */
.navbar-toggler-icon {
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 44%, 
        rgba(255, 255, 255, 0.9) 44%, 
        rgba(255, 255, 255, 0.9) 56%, 
        transparent 56%, 
        transparent 100%);
}

/* 轮播图样式 */
.hero-section {
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.carousel {
    overflow: hidden;
}

.carousel-item {
    height: auto;
    min-height: 200px;
    overflow: hidden;
}

.carousel-item img {
    object-fit: contain;
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
}

.carousel-caption h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.carousel-indicators {
    margin-bottom: 1rem;
    z-index: 10; /* 确保指示器在视频元素之上 */
    pointer-events: auto; /* 确保指示器可以点击 */
}

.carousel-indicators button {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background-color: var(--primary-color) !important;
    margin: 0 5px !important;
    border: none !important;
    opacity: 0.7 !important;
}

.carousel-indicators button.active {
    opacity: 1 !important;
    background-color: var(--primary-color) !important;
}

/* 轮播左右箭头样式 */
.carousel-control-prev,
.carousel-control-next {
    width: 80px;
    opacity: 0.9;
    z-index: 10; /* 确保按钮在视频元素之上 */
    pointer-events: auto; /* 确保按钮可以点击 */
}

.carousel-control-prev {
    left: 5px;
}

.carousel-control-next {
    right: 5px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

/* 移动端按钮区域 */
.mobile-button-section {
    display: none;
    background-color: #f3680d; /* 橙色背景 */
    height: 80px; /* 移动端按钮区域高度增加 */
    margin: 0;
    padding: 0;
}

.mobile-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* 移动端按钮间距更小 */
    height: 100%;
    padding: 0 20px;
    position: relative;
    max-width: 100%; /* 移动端全屏显示 */
    margin: 0; /* 移动端无留白 */
}

/* 移动端按钮图片大小 */
.mobile-button-section .action-button img {
    height: 40px; /* 移动端按钮更小 */
    width: auto;
    max-width: none;
    display: block;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 120px;
    height: 100%;
    padding: 0 20px;
    position: relative;
    max-width: 1200px; /* 与内容区域保持一致 */
    margin: 0 auto; /* 水平居中 */
}

/* 按钮外层容器，固定高度避免被挤压 */
.button-wrapper {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 大屏幕时按钮区域也增加留白 */
@media (min-width: 1400px) {
    .button-container {
        max-width: 1300px;
    }
}

/* 超大屏幕时进一步增加留白 */
@media (min-width: 1600px) {
    .button-container {
        max-width: 1400px;
    }
}

/* 移动端时按钮区域恢复全屏 */
@media (max-width: 767px) {
    .button-container {
        max-width: 100%;
        margin: 0;
    }
}

.action-button {
    display: block;
    transition: all 0.3s ease;
}

.action-button img {
    height: 120px;
    width: auto;
    max-width: none;
    display: block;
}

.action-button:hover {
    transform: scale(1.05);
}

/* PC端按钮区域 - 默认显示 */
.button-wrapper {
    display: block;
}

/* 移动端显示按钮区域，隐藏PC端按钮区域 */
@media (max-width: 767px) {
    .mobile-button-section {
        display: block;
    }
    
    .button-wrapper {
        display: none; /* 移动端隐藏PC端按钮区域 */
    }
}

/* 内容区域样式 */
.content-section {
    position: relative;
    margin: 0;
    padding: 0;
}

/* PC端内容包装器样式 - 居中布局，两侧留白 */
.pc-content-wrapper {
    width: 100%;
    max-width: 1200px; /* 设置最大宽度 */
    margin: 0 auto; /* 水平居中 */
    padding: 0;
}

/* 首页第一张图片全屏显示（PC端和移动端都全屏） */
.pc-content-wrapper.first-image {
    max-width: 100%;
    margin: 0;
}

/* 大屏幕时增加更多留白 */
@media (min-width: 1400px) {
    .pc-content-wrapper {
        max-width: 1300px;
    }
}

/* 超大屏幕时进一步增加留白 */
@media (min-width: 1600px) {
    .pc-content-wrapper {
        max-width: 1400px;
    }
}

/* 移动端时移除留白，恢复全屏 */
@media (max-width: 767px) {
    .pc-content-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}

.content-section img {
    transition: transform 0.3s ease;
    display: block;
    vertical-align: top;
}

/* 产品和师资链接卡片 */
.product-link-card,
.teachers-link-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
}

.hover-zoom {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.product-link-card:hover .hover-zoom,
.teachers-link-card:hover .hover-zoom {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* 区块标题 */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), #ff8c42);
    border-radius: 2px;
}

/* 卡片样式 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.text-primary,
.bi.text-primary {
    color: var(--primary-color) !important;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 104, 13, 0.3);
}

/* 返回顶部按钮 */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f3680d !important;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.btn-floating:hover {
    background-color: #d45a0b !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(243, 104, 13, 0.4);
}

.btn-floating.show {
    display: flex;
}

/* 视频底部区域样式 */
.video-bottom-section {
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.video-overlay-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none; /* 视频不阻止点击事件 */
}

.overlay-image {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    z-index: 2;
    /* 可选：添加透明度让视频透出来 */
    opacity: 0.9;
}

/* 移动端样式 - 不使用视频背景 */
@media (max-width: 768px) {
    .video-background {
        display: none; /* 隐藏视频背景 */
    }
    
    .overlay-image {
        position: static; /* 改为静态定位 */
        opacity: 1; /* 完全不透明 */
    }
    
    /* 移动端轮播图全屏显示 */
    .content-section .pc-content-wrapper:has(.carousel) {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* 尾图样式 */
.footer-image-section {
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.footer-image-section img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50 !important;
}

footer p {
    font-size: 0.9rem;
}

footer a {
    transition: all 0.3s ease;
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-color) !important;
    transform: scale(1.2);
    display: inline-block;
}

/* 响应式设计 */

/* 平板设备 */
@media (max-width: 991px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
        align-items: stretch;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        justify-content: center;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
    
    .hero-section {
        overflow: hidden;
        width: 100%;
    }
    
    .carousel {
        overflow: hidden;
    }
    
    .carousel-item {
        height: auto;
        overflow: hidden;
    }
    
    .carousel-item img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* 手机设备 */
@media (max-width: 767px) {
    /* 确保页面始终从顶部开始 */
    html {
        scroll-behavior: auto;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-collapse {
        padding: 0.4rem 0.6rem;
        margin-top: 0.4rem;
    }
    
    .navbar-nav {
        padding: 0.2rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0.8rem;
        margin: 0.05rem 0;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
        height: 36px;
    }
    
    .navbar-logo {
        height: 36px;
    }
    
    .navbar-toggler {
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-toggler-icon {
        width: 21px;
        height: 18px;
        transform: translateY(-2px);
    }
    
    .hero-section {
        overflow: hidden;
        width: 100%;
    }
    
    .carousel {
        width: 100%;
        overflow: hidden;
    }
    
    .carousel-item {
        height: auto;
        width: 100%;
        overflow: hidden;
    }
    
    .carousel-item img {
        object-fit: contain;
        object-position: center;
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    
    /* 移动端隐藏轮播箭头 */
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
    
    .carousel-caption {
        padding: 10px;
    }
    
    .carousel-caption h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-caption p {
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .footer-image-section img {
        width: 100%;
        height: auto;
    }
    
    footer {
        padding: 1rem 0 !important;
    }
    
    .btn-floating {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
        border-radius: 50%;
    }
}

/* 小屏手机 */
@media (max-width: 575px) {
    .navbar-collapse {
        padding: 0.3rem 0.5rem;
        margin-top: 0.3rem;
    }
    
    .navbar-nav {
        padding: 0.15rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.35rem 0.7rem;
        margin: 0.03rem 0;
        font-size: 0.85rem;
    }
    
    .carousel-item {
        height: auto;
    }
    
    .carousel-caption {
        display: none !important;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.content-section img {
    animation: fadeInUp 0.8s ease;
}

/* 加载动画 */
.card,
.section-title {
    animation: fadeInUp 0.6s ease;
}

/* 优化图片显示 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 图片加载优化 */
.responsive-img {
    background-color: #f0f0f0;
    min-height: 200px;
}

.responsive-img[src] {
    background-color: transparent;
}

/* 阴影效果 */
.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.rounded {
    border-radius: 8px !important;
}

/* 背景色 */
.bg-light {
    background-color: var(--bg-light) !important;
}

/* 文字颜色 */
.text-muted {
    color: var(--text-muted) !important;
}

/* 导航栏滚动效果 */
.navbar.scrolled {
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    background-color: #f3680d !important;
}

/* 底部导航栏样式（仅移动端显示） */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 5px 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 2px 0;
}

.bottom-nav-item .nav-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    display: none;
}

.bottom-nav-item.active {
    color: #f3680d;
    font-weight: 600;
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
}

.bottom-nav-item:hover {
    color: #f3680d;
}

/* 移动端显示底部导航栏 */
@media (max-width: 767px) {
    .bottom-nav {
        display: flex;
    }
    
    /* 给body添加底部内边距，避免内容被底部导航遮挡 */
    body {
        padding-bottom: 60px;
    }
    
    /* 隐藏顶部导航栏 */
    .navbar {
        display: none !important;
    }
    
    /* 确保最后一个内容区域不被底部导航遮挡 */
    .footer-image-section,
    section:last-of-type,
    .tab-content {
        margin-bottom: 60px;
    }
    
    /* 调整返回顶部按钮位置 */
    .btn-floating {
        bottom: 70px;
    }
}

/* 移动端导航栏展开菜单背景 */
@media (max-width: 991px) {
    .navbar {
        padding: 0.6rem 0;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background-color: #f3680d;
        padding: 80px 1.5rem 1.5rem;
        margin-top: 0;
        transition: right 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    
    .navbar-collapse.show {
        right: 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .navbar-collapse.collapsing {
        right: -280px;
        transition: right 0.3s ease;
        height: 100vh;
    }
    
    .navbar-nav {
        padding: 0;
        align-items: flex-start;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        font-size: 1rem;
        transition: all 0.2s ease;
        width: 100%;
        text-align: left;
        border-radius: 8px;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background-color: rgba(255, 255, 255, 0.15);
        transform: none;
    }
    
    .navbar-brand {
        height: 40px;
    }
    
    .navbar-logo {
        height: 40px;
    }
    
    .navbar-toggler {
        width: 40px;
        height: 40px;
        z-index: 10000;
    }
    
    .navbar-toggler-icon {
        width: 23px;
        height: 20px;
        transform: translateY(-2px);
    }
}

