/* 页首样式 */
.header {
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
}

.menu-section {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-menu {
    display: flex;
    gap: 4px;
}

.menu-item {
    color: #555;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: #f0f4f8;
    color: #1a73e8;
}

.menu-item.active {
    background-color: #1a73e8;
    color: #fff;
}

.custom-functions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: #1a73e8;
    color: #1a73e8;
}

.theme-icon {
    font-size: 13px;
}

/* 汉堡菜单按钮 - 默认隐藏 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    border-color: #1a73e8;
}

.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #555;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* 侧滑菜单 */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 0 0 24px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2332;
}

.mobile-menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.mobile-menu-item {
    display: block;
    padding: 14px 20px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background-color: #f0f4f8;
    color: #1a73e8;
}

.mobile-menu-item.active {
    color: #1a73e8;
    border-left-color: #1a73e8;
    background-color: #f0f4f8;
}

.mobile-menu-divider {
    height: 1px;
    background-color: #eee;
    margin: 8px 20px;
}

.mobile-theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 0 20px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-theme-toggle:hover {
    border-color: #1a73e8;
    color: #1a73e8;
}

/* 暗色模式 */
body.dark-mode .header {
    background-color: #1e1e1e;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .logo-text {
    color: #e0e0e0;
}

body.dark-mode .menu-item {
    color: #b0b0b0;
}

body.dark-mode .menu-item:hover {
    background-color: #2a2a2a;
    color: #4da3ff;
}

body.dark-mode .menu-item.active {
    background-color: #1a73e8;
    color: #fff;
}

body.dark-mode .theme-toggle {
    border-color: #444;
    background-color: #1e1e1e;
    color: #b0b0b0;
}

body.dark-mode .theme-toggle:hover {
    border-color: #4da3ff;
    color: #4da3ff;
}

body.dark-mode .hamburger-btn {
    border-color: #444;
    background-color: #1e1e1e;
}

body.dark-mode .hamburger-btn:hover {
    border-color: #4da3ff;
}

body.dark-mode .hamburger-line {
    background-color: #b0b0b0;
}

body.dark-mode .mobile-menu {
    background-color: #1e1e1e;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .mobile-menu-header {
    border-bottom-color: #2a3140;
}

body.dark-mode .mobile-menu-title {
    color: #e0e0e0;
}

body.dark-mode .mobile-menu-close {
    color: #b0b0b0;
}

body.dark-mode .mobile-menu-close:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .mobile-menu-item {
    color: #c8d1dc;
}

body.dark-mode .mobile-menu-item:hover {
    background-color: #252d3a;
    color: #4da3ff;
}

body.dark-mode .mobile-menu-item.active {
    color: #4da3ff;
    border-left-color: #4da3ff;
    background-color: #252d3a;
}

body.dark-mode .mobile-menu-divider {
    background-color: #2a3140;
}

body.dark-mode .mobile-theme-toggle {
    border-color: #2a3140;
    background-color: #1e1e1e;
    color: #b0b0b0;
}

body.dark-mode .mobile-theme-toggle:hover {
    border-color: #4da3ff;
    color: #4da3ff;
}

/* 移动端响应式 */
@media (max-width: 850px) {
    .header-container {
        padding: 0 20px;
    }

    .main-menu {
        display: none;
    }

    .theme-toggle {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }
}
