/* 顶部工具栏 */
.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    margin-bottom: 0;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 15;
    overflow: visible; /* 确保子元素（如未读标志）不被截断 */
}

/* 头部按钮通用样式 */
.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 头部右侧按钮组 */
.header-right-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: visible; /* 确保未读标志不被截断 */
}

/* 配色方案选择器 */
.color-scheme-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-scheme-selector label {
    color: white;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#color-scheme-select {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}

#color-scheme-select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.color-scheme-selector select {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: white;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    height: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='18px' height='18px'%3e%3cpath d='M7 10l5 5 5-5H7z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.color-scheme-selector select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 联系我们按钮和弹出框 */
#contact-us-btn {
    position: relative;
}

.contact-us-popup {
    display: none;
    position: absolute;
    top: 100%; /* 位于按钮下方 */
    right: 0;
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 250px; /* 根据内容调整宽度 */
    margin-top: 5px;
}

.contact-us-popup p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-us-popup p:last-child {
    margin-bottom: 0;
}

/* 站内信按钮特殊样式 */
#messages-btn {
    position: relative;
    gap: 0.5rem;
    overflow: visible; /* 确保未读标志不被截断 */
}

#messages-btn i {
    font-size: 1.1rem;
}

/* 未读消息徽章 */
.unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    animation: pulse 2s infinite;
    z-index: 1000; /* 确保徽章显示在最上层 */
    box-sizing: border-box; /* 确保边框包含在尺寸内 */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .top-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .header-right-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .color-scheme-selector {
        width: 100%;
        justify-content: center;
    }
}

.contact-us-popup {
    display: none;
    position: absolute;
    top: 100%; /* 位于按钮下方 */
    right: 0;
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 250px; /* 根据内容调整宽度 */
}

.contact-us-popup p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-us-popup p:last-child {
    margin-bottom: 0;
}
