/* header的样式 */
.header {
    position: relative;
    /* 让汉堡绝对定位 */
    display: flex;
    justify-content: space-between;
    height: 15vh;
    min-height: 100px;
    align-items: center;
    padding: 0 20px;
    border-radius: 0 0 4vh 4vh;
    border-bottom: 4px solid rgb(166, 84, 241);
    z-index: 20;
}

/* Logo容器样式 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* -----------------------左侧部分------------------------ */

/* ----------header左侧区域A部分:logo---------- */
.icon-rocket {
    font-size: 40px;
    color: rgb(166, 84, 241);
}

.s1 {
    font-size: 40px;
    font-weight: 700;
    margin: 0;
}

.main-icon-a {
    min-width: 330px;
    overflow: hidden;
}

/* ----------header左侧区域B部分:导航栏---------- */
.navbar-desktop {
    margin-left: 10px;
}

.navbar-menu {
    margin-left: 10px;
}

/* 导航项目样式 */
.navbar-item {
    border-radius: 20px;
}

.navbar-item:hover {
    transform: scale(1.1);
}

.icon-gonggao09 {
    color: rgb(185, 185, 185);
}

.a-anounce:hover {
    background-color: rgba(185, 185, 185, 0.2);
}

.icon-xunzhang {
    color: rgb(199, 240, 88);
}

.a-prize:hover {
    background-color: rgb(199, 240, 88, 0.2);
}

.icon-a-lujing37238 {
    color: rgb(88, 169, 240);
}

.a-rule:hover {
    background-color: rgb(88, 169, 240, 0.2);
}

.icon-terminal-box-fill {
    color: rgb(252, 144, 144);
}

.a-kaifa:hover {
    background-color: rgb(252, 144, 144, 0.2);
}

.icon-renminbi1 {
    color: rgb(85, 241, 202);
}

.a-serve:hover {
    background-color: rgb(85, 241, 202, 0.2);
}

.icon-huodong {
    color: rgb(240, 137, 40);
}

.a-activity:hover {
    background-color: rgb(240, 137, 40, 0.2);
}

.icon-name {
    font-weight: 700;
}

.navbar-link {
    border-radius: 20px;
}

/* -----------------------右侧部分------------------------ */

/* 主题切换按钮 */
.theme-switch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
}

.icon-ai250 {
    font-size: xx-large;
    font-weight: 500;
}

/* 登录按钮 */
#login-btn {
    height: 6vh;
    border-radius: 3vh;
    font-size: medium;
    border: none;
}

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.role-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
}

.role-tag.user {
    background: #4CAF50;
    color: white;
}

.role-tag.admin {
    background: #F44336;
    color: white;
}

/* ========== 汉堡菜单 ========== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    height: 21px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    background: rgb(166, 84, 241);
    /* 汉堡线颜色 */
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

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

/* ========== 移动端侧边栏 ========== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    backdrop-filter: blur(24px);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

/* 移动端侧边栏项目 */
.mobile-sidebar-item {
    padding: 15px;
    margin: 5px 0;
    background: rgba(166, 84, 241, 0.1);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
}

.mobile-sidebar-item:hover {
    background: rgba(166, 84, 241, 0.2);
    transform: scale(0.95);
}

a.mobile-sidebar-item {
    text-decoration: none;
    color: inherit;
}

/* 移动端子菜单 */
.mobile-sidebar-submenu {
    display: none;
    padding: 10px 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.mobile-sidebar-submenu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mobile-sidebar-submenu a {
    display: block;
    padding: 10px 20px;
    margin: 5px 0;
    background: rgba(166, 84, 241, 0.05);
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
}

.mobile-sidebar-submenu a:hover {
    background: rgba(166, 84, 241, 0.1);
    transform: scale(0.95);
}

/* ========== 响应式 ========== */
@media screen and (min-width: 1470px) {
    .header-left {
        display: flex;
        align-items: center;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .theme-switch-mobile {
        display: none;
    }
}

@media screen and (max-width: 1469px) {
    .header {
        height: 12vh;
        min-height: 80px;
    }

    .s1 {
        font-size: 32px;
    }

    .header-logo {
        height: 50px;
    }

    .navbar-desktop {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .header-right .button:not(.theme-switch) {
        display: none !important;
    }

    .header-right {
        display: flex;
        align-items: center;
    }

    /* 在移动端隐藏桌面端的用户信息显示 */
    .user-info {
        display: none !important;
    }

    /* 在移动端隐藏桌面端的主题切换按钮 */
    .theme-switch {
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    .s1 {
        font-size: 28px;
    }

    .header-logo {
        height: 45px;
    }

    .main-icon-a {
        min-width: 280px;
    }

    .mobile-sidebar {
        width: 280px;
    }
}

@media screen and (max-width: 480px) {
    .header {
        padding: 0 10px;
    }

    .s1 {
        font-size: 24px;
    }

    .header-logo {
        height: 40px;
    }

    .main-icon-a {
        min-width: 240px;
    }

    .mobile-sidebar {
        width: 260px;
        padding: 15px;
    }
}

/* 深浅转换 */
[data-theme=light],
.theme-light {
    .icon-name {
        color: #202020;
    }

    .s1 {
        color: #202020;
    }

    .is-risecolor {
        background-color: #f5f5f5;
    }

    .theme-switch {
        background-color: #f5f5f5;
    }

    .theme-switch:hover {
        background-color: #7c7c7c46;
    }

    .navbar {
        background-color: transparent;
    }

    .navbar-item {
        background-color: transparent;
    }

    .navbar-dropdown {
        background-color: rgba(255, 255, 255, 0.95);
        border-radius: 8px;
    }

    .navbar-divider {
        border-top: 1px solid #dbdbdb;
    }

    .mobile-sidebar {
        background: rgba(255, 255, 255, 0.8);
    }

    .mobile-sidebar-item {
        background: rgba(166, 84, 241, 0.1);
        color: #333;
    }

    .mobile-sidebar-item:hover {
        background: rgba(166, 84, 241, 0.2);
    }

    .mobile-sidebar-submenu a {
        background: rgba(166, 84, 241, 0.05);
        color: #333;
    }

    .mobile-sidebar-submenu a:hover {
        background: rgba(166, 84, 241, 0.1);
    }
}

/* 深色模式 */
[data-theme=dark],
.theme-dark {
    .icon-name {
        color: #f5f5f5;
    }

    .s1 {
        color: #f5f5f5;
    }

    .is-risecolor {
        background-color: #1a1a1a;
    }

    .theme-switch {
        background-color: #1a1a1a;
    }

    .theme-switch:hover {
        background-color: #7c7c7c46;
    }

    .navbar {
        background-color: transparent;
    }

    .navbar-item {
        background-color: transparent;
    }

    .navbar-dropdown {
        background-color: rgba(30, 30, 30, 0.95);
        border-radius: 8px;
    }

    .navbar-divider {
        border-top: 1px solid #4a4a4a;
    }

    .footerlink-button {
        background-color: rgb(166, 84, 241);
    }

    .ga {
        color: #aaaaaa;
        font-weight: 500;
    }

    .ga:hover {
        color: rgb(166, 84, 241);
        font-weight: 700;
    }

    .mobile-sidebar {
        background: rgba(30, 30, 30, 0.9);
    }

    .mobile-sidebar-item {
        background: rgba(166, 84, 241, 0.2);
        color: #f5f5f5;
    }

    .mobile-sidebar-item:hover {
        background: rgba(166, 84, 241, 0.3);
    }

    .mobile-sidebar-submenu {
        background: rgba(30, 30, 30, 0.9);
    }

    .mobile-sidebar-submenu a {
        background: rgba(166, 84, 241, 0.1);
        color: #f5f5f5;
    }

    .mobile-sidebar-submenu a:hover {
        background: rgba(166, 84, 241, 0.2);
    }
}