/* ===== Header ===== */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    height: 33px;
    width: auto;
}

.logo-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 300;
    color: var(--text-color);
    letter-spacing: 1px;
    line-height: 50px;
}

/* ===== Navigation Menu ===== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-item {
    font-size: 16px;
    position: relative;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-color);
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-hover);
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-separator {
    color: var(--border-color);
    font-size: 14px;
    user-select: none;
    padding: 0 5px;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Icon Button */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-color);
}

.icon-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.icon-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.icon-btn svg {
    display: block;
}

/* Text Toggle Button */
.text-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
}

.text-toggle-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.text-toggle-btn.active {
    background: var(--primary-color-alpha);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.text-toggle-btn span {
    display: block;
}

.offline-sync-btn,
.scroll-to-top-btn,
.announcements-btn,
.theme-toggle-btn {
    position: relative; /* 为badge提供定位上下文 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.offline-sync-btn svg,
.scroll-to-top-btn svg,
.announcements-btn svg,
.theme-toggle-btn svg {
    display: block;
}

.offline-sync-btn:hover,
.scroll-to-top-btn:hover,
.announcements-btn:hover,
.theme-toggle-btn:hover {
    color: var(--primary-hover);
}

.offline-sync-btn:active,
.scroll-to-top-btn:active,
.announcements-btn:active,
.theme-toggle-btn:active {
    transform: scale(0.97);
}

/* User Display with Avatar */
.user-display-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

/* Settings Button */
.btn-settings {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 15px;
    cursor: pointer;
    padding: 8px 15px;
    transition: var(--transition);
}

.btn-settings:hover {
    color: var(--primary-hover);
}

.announcements-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--btn-danger-color);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    min-width: 16px;
    text-align: center;
}
