html {
    scroll-behavior: smooth;
}
:root {
    --color-primary: #5a4bff;
    --color-primary-dark: #5B5FEE;
    --color-secondary: #fd703c;
    --color-text: #333;
    --color-text-light: #444;
    --color-border: #ccc;
    --color-border-light: #eee;
    --color-bg-gradient-start: #F3F4F6;
    --color-bg-gradient-end: #E0E7FF;
    --color-submenu-hover: #f0f0f0;
    --color-bg-white: #ffffff;
    --color-footer-bg: #E4E7FF;
    --color-footer-text: #888;
    --color-hover-light: rgba(91, 95, 238, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.05);
  }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
a:link {
    text-decoration: none;
}

/* ========== Inter 字体 ========== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    src: url('/fonts/inter/inter-v18-latin-500.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/inter/inter-v18-latin-600.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    src: url('/fonts/inter/inter-v18-latin-800.woff2') format('woff2');
  }
  
  /* ========== Baloo 2 字体 ========== */
  @font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 500;
    src: url('/fonts/baloo-2/baloo-2-v21-latin-500.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/baloo-2/baloo-2-v21-latin-600.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 700;
    src: url('/fonts/baloo-2/baloo-2-v21-latin-700.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 800;
    src: url('/fonts/baloo-2/baloo-2-v21-latin-800.woff2') format('woff2');
  }
  

body {
    /* 字体分级设置 */
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    /* 终极降级 */

    /* 原有样式保留 */
    background: linear-gradient(135deg, #F3F4F6 0%, #E0E7FF 100%);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    /* 字体加载优化 */
    font-display: swap;
    /* 避免布局偏移 */
    text-rendering: optimizeLegibility;
    font-size: 10px;
    /* 提升可读性 */
}

/* 预加载关键字体（可选） */
@font-face {
    font-family: 'Baloo 2 Fallback';
    src: local('Comic Sans MS'), local('Marker Felt');
    size-adjust: 105%;
    /* 视觉尺寸补偿 */
    ascent-override: 95%;
}
header{
    width: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eee;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
   
    flex-wrap: wrap;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;;
    max-width: 120rem;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    font-family: 'Baloo 2', cursive;
    font-size: 2rem;
    font-weight: 600;
    color:var(--color-primary);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.logo:link {
    text-decoration: none;
}

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

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.2em;
    width: 1.3em;
    margin-right: 2px;
    color:var(--color-primary);
    transition: transform 0.3s ease;
}

.logo-icon svg {
    display: block;
    height: 100%;
    width: 100%;
}

.logo:hover .logo-icon {
    transform: rotate(-5deg) scale(1.1);
}

.logo-main {
    color:var(--color-primary);
    font-weight: bold;
}

.logo-sub {
    /**color: #9b8eff;**/
    color: rgb(253, 112, 60);
    margin-left: 2px;
    font-size: 2rem;
    font-weight: bold;

}




.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color:var(--color-primary);
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: #444;
    font-weight: 600;
    position: relative;
    font-size: 1.05rem;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 3px;
    width: 0%;
    background: #5B5FEE;
    border-radius: 2px;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

#main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

#main-nav.show {
    display: flex;
    /* 或根据你的需求使用其他显示方式 */
    /* 其他样式 */
}

/* 子菜单容器 */
.submenu-wrapper {
    position: relative;
}

.has-submenu {
    cursor: pointer;
}

/* 子菜单默认隐藏 */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    z-index: 999;
    min-width: 180px;
}

/* 子菜单样式 */
.submenu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    white-space: nowrap;
}

.submenu a:hover {
    background-color: #f0f0f0;
}

/* 桌面端 hover 显示子菜单 */
@media (min-width: 768px) {
    .submenu-wrapper:hover .submenu {
        display: block;
    }

    .submenu-wrapper {
        position: relative;
    }

    .submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border: 1px solid #ccc;
        z-index: 10;
        min-width: 160px;
    }

    /* 修改：阻止点击时子菜单显示 */
    .submenu-wrapper.open .submenu {
        display: none !important;
    }
}

/* 手机端展开时的样式 */
.submenu-wrapper.open .submenu {
    display: block;
    position: static;
    box-shadow: none;
    padding-left: 1rem;
}



.language-switch select {
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    background: #fff;
}

/* 新增：移动端语言切换样式 */
.language-switch-mobile {
    display: none;
    margin-top: 1rem;
}

.language-switch-mobile a {
    display: inline-block;
    padding: 0.5rem;
    margin: 0 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.language-switch-mobile a:hover {
    background: rgba(91, 95, 238, 0.1);
}

.language-switch-mobile img {
    width: 24px;
    height: 24px;
}

/* === Responsive Navigation === */
@media (max-width: 768px) {

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 2rem;
        display: none;
    }

    #main-nav {
        display: none;
    }

    nav.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .language-switch {
        display: none;
    }

    /* 新增：显示移动端语言切换 */
    .language-switch-mobile {
        display: block;
        text-align: center;
    }

    #main-nav.show {
        display: flex;
    }

    footer {
        display: flex;
        flex-direction: column;
        justify-content: center;
        font-size: 0.85rem;
        color: #888;
        background: #E4E7FF;
        height: 20rem;
        align-items: center;
    }

    footer div {
        text-align: center;
        width: 100%;
        height: 100%;
    }
}