/* 站内信样式 */

/* 消息中心标签页 */
.msg-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.msg-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.msg-tab:hover {
    color: #409eff;
}

.msg-tab.active {
    color: #409eff;
    font-weight: bold;
    border-bottom-color: #409eff;
}

.tab-badge {
    background: #f56c6c;
    color: white;
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 11px;
    margin-left: 4px;
}

/* 方向标签 */
.dir-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 6px;
    vertical-align: middle;
}

.dir-inbox {
    background: #ecf5ff;
    color: #409eff;
}

.dir-sent {
    background: #f0f9eb;
    color: #67c23a;
}

.unread-dot {
    color: #f56c6c;
    font-size: 10px;
}

/* 已回复高亮 */
.message-item.has-reply {
    border-left-color: #67c23a;
}

.badge-replied {
    background: #f0f9eb;
    color: #67c23a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-new-reply {
    background: #f56c6c;
    color: white;
    animation: pulse 1.5s infinite;
    font-weight: bold;
}

.badge-related {
    background: #fdf6ec;
    color: #e6a23c;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
}

.badge-related:hover {
    background: #e6a23c;
    color: white;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-item {
    background: white;
    border-radius: 6px;
    padding: 15px 20px;
    border-left: 4px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.message-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(5px);
}

.message-item.unread {
    border-left-color: #409eff;
    background: #f0f9ff;
}

.message-item.read {
    border-left-color: #ddd;
    background: white;
}

.message-item.deleted {
    opacity: 0.5;
    background: #f5f5f5;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.message-time {
    color: #909399;
    font-size: 13px;
    margin-left: 15px;
}

.message-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 14px;
}

.message-sender {
    font-weight: 500;
    color: #409eff;
}

.message-badges {
    display: flex;
    gap: 8px;
}

.badge-unread {
    background: #f56c6c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.badge-recalled {
    background: #e6a23c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* 消息详情 */
.message-detail {
    padding: 20px;
}

.message-detail-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.message-detail-subject {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.message-detail-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.message-detail-content {
    min-height: 200px;
    padding: 20px 0;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* 写信表单 */
.compose-form {
    max-width: 800px;
}

.compose-form .form-group {
    margin-bottom: 20px;
}

.receiver-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.receiver-tag {
    background: #ecf5ff;
    color: #409eff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.receiver-tag:hover {
    background: #409eff;
    color: white;
}

.receiver-tag.selected {
    background: #409eff;
    color: white;
}

/* 回复区域 */
.replies-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 撤回横幅 */
.recalled-banner {
    text-align: center;
    padding: 40px 20px;
    background: #fdf6ec;
    border-radius: 8px;
    color: #e6a23c;
    margin-bottom: 15px;
}

.badge-recalled {
    background: #e6a23c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.message-item.recalled {
    opacity: 0.6;
    border-left-color: #e6a23c;
    background: #fdf6ec;
}

.reply-item {
    background: #fafafa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.reply-user {
    font-weight: 500;
    color: #67c23a;
}

.reply-form {
    margin-top: 15px;
}

/* 操作按钮 */
.message-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* 未读消息提示：右上角红色圆形角标，由父元素提供定位上下文 */
.unread-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    line-height: 18px;
    box-sizing: border-box;
    padding: 0 5px;
    border-radius: 10px;
    background: #ff4d4f;
    color: #ffffff;
    border: 1px solid #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 响应式 */
@media (max-width: 768px) {
    .message-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .message-detail-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .receiver-selector {
        flex-direction: column;
    }
}
