/* === 全局与基础样式 === */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 80px;
    /* padding-bottom: 80px; */
    transition: right 0.4s ease;
    position: relative;
    right: 0;
}

body.sidenav-open {
    overflow: hidden;
    right: 250px;
}

/* 当 body 被标记为侧边栏打开时，让侧边栏滑入可视区域 */
body.sidenav-open .sidenav {
    right: 0;
}

/* === 顶部导航栏 (所有页面共享) === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #002fa7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    z-index: 100;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, left 0.4s ease;
}

.site-header.scrolled {
    background-color: rgba(0, 47, 167, 0.35);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.header-left-group {
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
    margin-right: 15px;
    border-radius: 8px;
}

.site-name {
    font-family: 'Ma Shan Zheng', cursive;
    color: #ffffff;
    font-size: 2.2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6), 0 0 3px rgba(255, 255, 255, 0.5), 0 0 15px rgba(173, 216, 230, 0.4);
}

.nav-links {
    display: flex;
    align-items: center;
    margin-left: 100px;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #d1e2ff;
}

.nav-link.active {
    color: #ffffff;
    font-weight: bold;
    border-bottom-color: #ffffff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.action-item {
    position: relative;
}

.action-icon {
    height: 24px;
    width: 24px;
    cursor: pointer;
}

.qr-popup {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50px;
    right: 50%;
    transform: translateX(50%);
    width: 160px;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.action-item:last-child .qr-popup {
    right: 0;
    transform: translateX(0);
}

@media (hover: hover) {
    .action-item:hover .qr-popup {
        visibility: visible;
        opacity: 1;
    }

    .action-icon:hover {
        transform: scale(1.1);
    }
}

.qr-popup.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.qr-popup img {
    width: 100%;
    display: block;
}

.qr-popup p {
    margin: 10px 0 0 0;
    font-size: 14px;
    color: #333;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    z-index: 102;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: white;
    transition: all 0.4s ease;
}

.sidenav {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 101;
    top: 0;
    right: -250px;
    background-color: rgba(0, 31, 95, 0.85);
    overflow-x: hidden;
    transition: right 0.4s ease;
    padding-top: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidenav a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 1.2rem;
    color: #a7c5ff;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #f1f1f1;
}

.site-footer-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #001f5f;
    color: #a7c5ff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    z-index: 100;
    box-sizing: border-box;
    transition: left 0.4s ease;
}

.footer-links a,
.footer-info a {
    color: #a7c5ff !important;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover,
.footer-info a:hover {
    text-decoration: underline;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 20px;
}


/* === 响应式调整 (最终修正版) === */
@media screen and (max-width: 992px) {

    /* 核心修正1：不再使用 display: none，而是用下面的方法来隐藏 */
    .nav-links,
    .header-actions {
        position: absolute;
        left: -9999px;
        /* 把它们移出屏幕外，但保持“存在” */
        opacity: 0;
        /* 彻底隐藏 */
    }

    .hamburger-menu {
        display: block;
    }
}

@media screen and (max-width: 768px) {
    .site-footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }

    .footer-info {
        flex-direction: column;
        gap: 8px;
    }
}

@media screen and (max-width: 600px) {
    /* 核心修正2：移除隐藏网站名称的规则 */
    /* .site-name { display: none; } <-- 已删除 */

    /* 调整 Logo 和网站名大小，以适应手机屏幕 */
    .logo {
        height: 40px;
        margin-right: 10px;
    }

    .site-name {
        font-size: 1.8rem;
    }
}

.sidenav .closebtn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}