/**
 * 消息中心页面样式
 * 文件: message.css
 * 说明: 消息中心页面特有样式
 */

/* ============================================
   1. 消息分类标签
   ============================================ */

.message-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-item {
    padding: 10px 17px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
}

.category-item:hover {
    background: #e5e7eb;
}

.category-item.active {
    background: #000;
    color: #facc15;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

/* ============================================
   2. 消息列表
   ============================================ */

.message-list {
    border-top: 1px solid #f3f4f6;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-item:hover {
    background-color: #f9fafb;
}

.message-item.unread {
    background-color: #fef9c3;
}

.message-item.unread:hover {
    background-color: #fef08a;
}

/* ============================================
   3. 消息图标
   ============================================ */

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-icon.system {
    background: #dbeafe;
    color: #2563eb;
}

.message-icon.order {
    background: #d1fae5;
    color: #059669;
}

.message-icon.activity {
    background: #fce7f3;
    color: #db2777;
}

.message-icon.task {
    background: #fef3c7;
    color: #d97706;
}

.message-icon.point {
    background: #e0e7ff;
    color: #6366f1;
}

.message-icon.feedback {
    background: #f3e8ff;
    color: #9333ea;
}

/* ============================================
   4. 消息内容
   ============================================ */

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    pointer-events: none;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
}

.message-body {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
    max-width: 100%;
}

/* ============================================
   5. 登录提示
   ============================================ */

.login-tip {
    text-align: center;
    padding: 60px 20px;
}

.login-tip-icon {
    margin-bottom: 16px;
    color: #9ca3af;
}

.login-tip-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

.login-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #000;
    color: #facc15;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #333;
}

/* ============================================
   7. 弹窗样式
   ============================================ */

.jw-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.jw-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.jw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.jw-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.jw-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
}

.jw-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* ============================================
   5. 分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding-bottom: 20px;
}

.page-btn {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #6b7280;
}

.page-btn:hover:not(:disabled) {
    border-color: #facc15;
    color: #000;
}

.page-btn.active {
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    border-color: transparent;
    color: #000;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   6. 移动端适配
   ============================================ */
@media (max-width: 768px) {
    .message-categories {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .category-item {
        padding: 10px 8px;
        font-size: 12px;
        flex: 1;
        text-align: center;
        min-width: 0;
    }
}
