/* ========================================
   桂林理工大学外国语学院 - 全站通用样式
   ======================================== */

/* ── 全局重置 ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f0f4f8;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================
   页头样式 (site-header)
   ======================================== */
.site-header {
    background: linear-gradient(120deg, #0a2540 0%, #018fdb 100%);
    padding: 0;
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 86px;
    width: auto;
    filter: brightness(0) invert(1) opacity(.9);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.header-title .en {
    font-size: 11px;
    color: rgba(255, 255, 255, .65);
    letter-spacing: 1px;
    margin-top: 5px;
}

.header-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-links .search {
    display: flex;
}

.header-links input {
    border: none;
    border-radius: 20px 0 0 20px;
    padding: 7px 14px;
    font-size: 13px;
    width: 180px;
    outline: none;
}

.header-links button {
    background: rgba(255, 255, 255, .2);
    border: none;
    border-radius: 0 20px 20px 0;
    padding: 7px 14px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-left: none;
}

.header-links button:hover {
    background: rgba(255, 255, 255, .35);
}

.header-links .links {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.header-links .links a {
    color: rgba(255, 255, 255, .75);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 3px;
    padding: 2px 10px;
}

.header-links .links a:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

/* ========================================
   导航栏样式 (nav-bar)
   ======================================== */
.nav-bar {
    background: rgba(10, 37, 64, .95);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 100;
    border-bottom: 2px solid #018fdb;
}

.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
}

.nav-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-item {
    list-style: none;
    font-size: 18px;
    font-weight: 500;
}

.nav-item > a {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 15px;
    color: rgba(255, 255, 255, .85);
    transition: .2s;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav-item > a:hover {
    color: #fff;
    background: rgba(1, 143, 219, .3);
}

.nav-item.has-sub {
    position: relative;
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #055c90;
    min-width: 140px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    z-index: 200;
    border-top: 2px solid #018fdb;
}

.sub-menu li {
    list-style: none;
}

.sub-menu li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, .8);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sub-menu li a:hover {
    background: #018fdb;
    color: #fff;
}

.nav-item.has-sub:hover .sub-menu {
    display: block;
}

/* 滚动导航品牌标识 */
.scroll-nav-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-right: 8px;
    flex-shrink: 0;
}

.scroll-nav-brand img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1) opacity(.85);
    vertical-align: middle;
}

.scroll-nav-brand span {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 1px;
    vertical-align: middle;
}

.nav-bar.scrolled {
    position: fixed;
    width: 100%;
    top: 0;
}

.nav-bar.scrolled .scroll-nav-brand {
    display: flex;
}

.nav-bar.scrolled .nav-inner {
    max-width: none;
}

.nav-bar.scrolled .nav-list {
    margin-left: auto;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
}

/* ========================================
   页脚样式 (footer)
   ======================================== */
footer {
    background: #0a2540;
    color: #6a8aa8;
    padding: 28px 0 0;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
}

footer h4 {
    color: #b0d0f0;
    margin-bottom: 10px;
    font-size: 13px;
}

footer a,
footer p {
    font-size: 13px;
    line-height: 2;
    color: #6a8aa8;
    display: block;
}

footer a:hover {
    color: #018fdb;
}

.footer-bottom {
    border-top: 1px solid #1a3a5c;
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: #3a5a78;
}

/* ========================================
   响应式设计
   ======================================== */

/* 1024px 以下 - 移动端导航 */
@media (max-width: 1024px) {
    /* 隐藏原有页头 Banner */
    .site-header {
        display: none;
    }

    /* 导航栏调整 */
    .nav-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-inner {
        max-width: 100%;
        height: 100%;
        justify-content: space-between;
        padding: 0 15px;
    }

    /* 移动端 Logo 区域 (始终显示) */
    .scroll-nav-brand {
        display: flex !important;
        margin-right: 0;
    }

    .scroll-nav-brand img {
        height: 40px;
    }

    .scroll-nav-brand span {
        font-size: 18px;
    }

    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: block;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #fff;
        font-size: 20px;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
        z-index: 102;
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* 导航菜单容器 (默认隐藏/折叠) */
    .nav-list {
        display: none;
        position: absolute;
        top: 60px;
        right: 0;
        background: #0a2540;
        width: 300px;
        height: calc(100vh - 60px);
        overflow-y: auto;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 101;
    }

    .nav-list.active {
        display: flex;
    }

    /* 导航项重置 */
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-item > a {
        height: 45px;
        justify-content: space-between;
    }

    .nav-item > a::after {
        content: '\f107';
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        opacity: 0.7;
    }

    .nav-item.has-sub > a::after {
        display: inline-block;
    }

    /* 子菜单重置为静态块 */
    .sub-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-top: none;
        min-width: 100%;
    }

    .sub-menu.open {
        display: block;
    }

    .sub-menu li a {
        padding-left: 40px;
    }

    /* 搜索框嵌入菜单第一行 */
    .mobile-search-box {
        display: flex;
        padding: 10px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 5px;
    }

    .mobile-search-box input {
        flex: 1;
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
        padding: 6px 10px;
        border-radius: 4px 0 0 4px;
        outline: none;
    }

    .mobile-search-box button {
        background: #018fdb;
        border: none;
        color: #fff;
        padding: 6px 12px;
        border-radius: 0 4px 4px 0;
        cursor: pointer;
    }
}

/* 800px 以下调整 */
@media (max-width: 800px) {
    .nav-list {
        width: 100%;
    }

    /* 页脚重新设计 */
    .footer-inner {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    /* 介绍部分占满整行 */
    .footer-inner > div:first-child {
        grid-column: 1 / 4;
        text-align: center;
    }

    /* 后三列内部链接横向排列 */
    .footer-inner > div:not(:first-child) {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-inner > div:not(:first-child) h4 {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .footer-inner > div:not(:first-child) a {
        display: inline-block;
        margin: 0 5px;
        line-height: 1.8;
        font-size: 12px;
    }
}

/* 小于 360px 时完全纵向排列 */
@media (max-width: 360px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-inner > div:first-child {
        grid-column: auto;
        text-align: left;
    }

    .footer-inner > div:not(:first-child) {
        display: block;
        align-items: flex-start;
    }

    .footer-inner > div:not(:first-child) a {
        display: inline-block;
        margin-right: 1em;
        padding: 2px 0;
    }
}
