/* ========== 通用头部导航栏样式 ========== */

/* ========== 容器通用样式 ========== */
.container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ========== 头部容器 ========== */
.header {
    position: relative;
    background: #fff;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.header_con {
    width: 100%;
    background: #fff;
    position: relative;
}

/* ========== 头部主内容区 ========== */
.header-container {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* ========== 头部左侧（Logo区域） ========== */
.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ========== 搜索图标按钮 ========== */
.search-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    margin-left: 10px;
    flex-shrink: 0;
}

/* PC端隐藏移动端搜索框 */
.mobile-search-box {
    display: none;
}

.search-icon-btn:hover {
    background: #eee;
}

.search-icon-btn svg {
    width: 20px;
    height: 20px;
    color: #666;
}

.logo {
    margin: 0;
    line-height: 0;
}

.logo a {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.logo a:hover {
    opacity: 0.85;
}

.logo img {
    display: block;
    height: 46px;
    width: auto;
}

.slogan {
    height: 36px;
    border-left: 1px solid #e0e0e0;
    padding-left: 18px;
    margin-left: 2px;
}

/* ========== 导航菜单 ========== */
.header-nav {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: stretch;
    height: 50px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.nav-item > a {
    display: flex;
    align-items: center;
    color: #333;
    padding: 0 14px;
    height: 100%;
    transition: color 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nav-item > a:hover,
.nav-item > a:focus {
    color: #FE720A;
}

/* ========== 下拉箭头 ========== */
.nav-item.has-dropdown > a {
    padding-right: 24px;
}

.nav-item.has-dropdown > a::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    margin-top: -3px;
    border-style: solid;
    border-width: 5px 4.5px 0 4.5px;
    border-color: #999 transparent transparent transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-item.has-dropdown:hover > a,
.nav-item.has-dropdown.cur > a {
    color: #FE720A;
}

.nav-item.has-dropdown:hover > a::after,
.nav-item.has-dropdown.cur > a::after {
    transform: rotate(180deg);
    border-color: #FE720A transparent transparent transparent;
}

/* ========== 当前激活状态 ========== */
.nav-item.active > a {
    color: #FE720A;
    font-weight: 600;
}

/* ========== 全部课程下拉菜单（dropdown-full） ========== */
.dropdown-full {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    z-index: 99;
    background-color: #fff;
    padding: 16px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dropdown-full .container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    box-sizing: border-box;
}

.dropdown-full a {
    position: relative;
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 12px 0 46px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dropdown-full a:hover {
    background-color: #f5f7fb;
}

.dropdown-full a span {
    display: inline-block;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.dropdown-full a:hover span {
    color: #FE720A;
}

.dropdown-full a img {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* ========== 小型下拉菜单（dropdown-sm） ========== */
.dropdown-sm {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    min-width: 160px;
    z-index: 99;
    background-color: #fff;
    padding: 8px 0;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.dropdown-sm a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dropdown-sm a:hover {
    background-color: #f5f7fb;
    color: #FE720A;
}

.dropdown-sm a span {
    display: inline-block;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.dropdown-sm a:hover span {
    color: #FE720A;
}

.dropdown-sm a img {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    object-fit: cover;
}

/* ========== 课程分类下拉菜单（dropdown-course） ========== */
.dropdown-course {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    min-width: 180px;
    z-index: 99;
    background-color: #fff;
    padding: 8px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.dropdown-course a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dropdown-course a:hover {
    background-color: #f5f7fb;
    color: #FE720A;
}

/* ========== 移动端头部导航 ========== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #333;
    margin: 3px 0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========== 移动端导航菜单 ========== */
.header-nav.active {
    opacity: 1;
    visibility: visible;
}

.nav-menu {
    display: flex;
    align-items: stretch;
}

@media screen and (max-width: 768px) {
    /* ========== 容器移动端适配 ========== */
    .container {
        width: 100%;
        padding: 0 15px;
    }

    /* ========== 移动端头部 - 固定定位 ========== */
    .header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }

    .header-main {
        width: 100%;
    }

    .header-container {
        width: 100% !important;
        height: 56px !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    .logo img {
        height: 32px !important;
        width: auto;
    }

    .slogan {
        display: none !important;
    }

    /* 联系按钮 */
    .header-left::after {
        content: '400-618-4000';
        font-size: 12px;
        color: #FE720A;
        font-weight: 500;
        padding: 4px 10px;
        background: rgba(254, 114, 10, 0.1);
        border-radius: 20px;
        white-space: nowrap;
    }

    /* 汉堡菜单按钮 - 强制显示 */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        z-index: 1001;
        position: relative;
        background: transparent;
        border: none;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2.5px;
        background: #333;
        margin: 3px 0;
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* 移动端搜索图标美化 */
    .search-icon-btn {
        width: 38px;
        height: 38px;
        background: linear-gradient(135deg, #FE720A, #ff8c3a);
        border-radius: 50%;
        margin-left: 6px;
        box-shadow: 0 2px 8px rgba(254, 114, 10, 0.3);
        transition: all 0.3s ease;
    }

    .search-icon-btn:hover {
        transform: scale(1.08);
        box-shadow: 0 4px 12px rgba(254, 114, 10, 0.4);
    }

    .search-icon-btn:active {
        transform: scale(0.95);
    }

    .search-icon-btn svg {
        width: 18px;
        height: 18px;
        color: #fff;
    }

    /* 移动端搜索框样式 - 输入框外观 */
    .mobile-search-box {
        display: none;
        flex: 1;
        max-width: calc(100% - 100px);
        height: 36px;
        align-items: center;
        gap: 8px;
        padding: 0 14px;
        background: #f5f5f5;
        border-radius: 18px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-search-box svg {
        width: 16px;
        height: 16px;
        color: #999;
        flex-shrink: 0;
    }

    .mobile-search-box span {
        font-size: 13px;
        color: #999;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-search-box:active {
        background: #eee;
    }

    /* 导航菜单 - 侧边抽屉式设计 */
    .header-nav {
        position: fixed !important;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        flex: initial;
        justify-content: flex-start;
    }

    .header-nav.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100%;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        margin: 0;
        padding: 0;
        list-style: none;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .header-nav.active .nav-menu {
        transform: translateX(0);
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #eee;
        font-size: 15px;
    }

    .nav-item > a {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px !important;
        color: #333;
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s;
        width: 100%;
    }

    .nav-item.has-dropdown > a::after {
        content: '›';
        font-size: 20px;
        color: #999;
        position: absolute;
        top: 30%;
        border: none !important;
        transform: none !important;
    }

    .nav-item.has-dropdown.active > a::after,
    .nav-item.has-dropdown.open > a::after {
        transform: rotate(90deg) !important;
    }

    .nav-item.active > a {
        color: #FE720A;
    }

    /* 下拉菜单 - 移动端 */
    .dropdown-menu {
        display: none !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        background: #f8f9fb !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .nav-item.has-dropdown.open > .dropdown-menu,
    .nav-item.has-dropdown.active > .dropdown-menu {
        display: block !important;
    }

    .dropdown-menu a {
        display: flex !important;
        align-items: center;
        padding: 12px 15px 12px 30px !important;
        border-bottom: 1px solid #eee;
        font-size: 14px;
        color: #666;
        text-decoration: none;
        height: auto !important;
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }

    .dropdown-menu a img {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        border-radius: 4px;
        position: absolute;
        left: 15px;
    }

    .dropdown-menu a span {
        font-size: 14px;
    }

    /* 隐藏全部课程下拉 */
    .dropdown-full {
        display: none !important;
    }

    /* 给移动端内容区添加顶部间距 */
    body {
        padding-top: 56px;
    }
}

/* ========== 搜索弹窗（桌面端居中显示） ========== */
.search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 560px;
    max-width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 20px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
}

.search-overlay.show {
    display: block;
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.search-modal-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 24px;
    padding: 0 6px 0 20px;
    transition: border-color 0.2s;
}

.search-modal-input-wrap:focus-within {
    border-color: #FE720A;
}

.search-modal-input {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
}

.search-modal-input::placeholder {
    color: #aaa;
}

.search-modal-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, #FE720A, #ff8c3a);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(254, 114, 10, 0.3);
}

.search-modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(254, 114, 10, 0.4);
}

.search-modal-btn svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.search-modal-cancel {
    font-size: 15px;
    color: #888;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.search-modal-cancel:hover {
    color: #333;
}

.search-modal-body {
    padding: 20px 24px 24px;
    max-height: calc(80vh - 90px);
    overflow-y: auto;
}

/* 分类导航 */
.search-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-category {
    display: inline-block;
    padding: 8px 18px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.search-category:hover {
    background: #fff;
    border-color: #FE720A;
    color: #FE720A;
}

.search-category.active {
    background: linear-gradient(135deg, #FE720A, #ff8c3a);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(254, 114, 10, 0.3);
}

/* 热门搜索 */
.search-hot-section {
    text-align: left;
}

.search-hot-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 16px;
}

.search-hot-title svg {
    width: 16px;
    height: 16px;
    color: #FE720A;
}

.search-hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-hot-tags .hot-tag {
    display: inline-block;
    padding: 10px 18px;
    font-size: 13px;
    color: #555;
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
}

.search-hot-tags .hot-tag:hover {
    background: linear-gradient(135deg, #FE720A, #ff8c3a);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 114, 10, 0.3);
}

/* 搜索结果 */
.search-results-section {
    text-align: left;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.search-results-count {
    font-size: 13px;
    color: #999;
}

.search-results-count strong {
    color: #FE720A;
    font-weight: 600;
}

.search-results-tip {
    font-size: 12px;
    color: #bbb;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #fff5ee, #fff);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.search-result-icon.course { background: linear-gradient(135deg, #FE720A, #ff8c3a); }
.search-result-icon.news { background: linear-gradient(135deg, #4a90e2, #6bb3ff); }
.search-result-icon.resource { background: linear-gradient(135deg, #52c41a, #73d13d); }
.search-result-icon.faq { background: linear-gradient(135deg, #722ed1, #9254de); }

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title em {
    color: #FE720A;
    font-style: normal;
    font-weight: 600;
    background: rgba(254, 114, 10, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    font-size: 12px;
    color: #999;
}

.search-no-results {
    text-align: center;
    padding: 30px 20px;
}

.search-no-results svg {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 12px;
}

.search-no-results p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 头部两侧内容更紧凑 */
    .header-left::after {
        display: none !important;
    }

    .header-left {
        gap: 0;
    }

    .logo img {
        height: 30px !important;
    }

    /* 隐藏桌面端圆形搜索按钮，显示输入框样式 */
    .search-icon-btn {
        display: none !important;
    }

    .mobile-search-box {
        display: flex !important;
    }

    .mobile-menu-toggle {
        margin-left: 4px;
    }

    /* 搜索弹窗宽度更大 */
    .search-modal {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-modal.show {
        transform: translateY(0);
    }

    .search-modal-header {
        padding: 14px 20px;
        background: #fff;
    }

    .search-modal-input-wrap {
        padding: 0 8px 0 16px;
    }

    .search-modal-input {
        font-size: 16px;
    }

    .search-modal-body {
        padding: 20px;
    }

    .search-category {
        padding: 8px 16px;
        font-size: 13px;
    }

    .search-hot-tags .hot-tag {
        padding: 10px 16px;
        font-size: 13px;
    }
}
