/* 消息中心前端样式 */

/* 消息中心主容器 */
.message-center-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
}

/* 页面居中布局 */
.user-center-content {
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.user-center-main {
    width: 100%;
    max-width: 1200px;
}

/* 消息中心头部 */
.message-center-header {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: #fff;
    padding: 20px;
    position: relative;
}

.message-center-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-center-title i {
    font-size: 28px;
}

.message-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 消息操作栏 */
.message-actions {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box button {
    padding: 8px 12px;
    white-space: nowrap;
}

/* 工具栏样式 */
.message-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.message-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.message-bulk-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007cba;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 消息列表 */
.message-list {
    max-height: 600px;
    overflow-y: auto;
}

/* 消息项动画 */
.message-item.animate-in {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 消息优先级样式 */
.message-item.high {
    border-left: 4px solid #dc3545;
}

.message-item.normal {
    border-left: 4px solid #28a745;
}

.message-item.low {
    border-left: 4px solid #6c757d;
}

.message-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.message-item:hover {
    background: #f8f9fa;
}

.message-item.unread {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.message-item.unread:hover {
    background: #ffeaa7;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.message-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.message-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.message-time {
    white-space: nowrap;
}

.message-priority {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.message-priority.high {
    background: #dc3545;
    color: #fff;
}

.message-priority.normal {
    background: #28a745;
    color: #fff;
}

.message-priority.low {
    background: #6c757d;
    color: #fff;
}

.priority-high {
    background: #dc3545;
    color: #fff;
}

.priority-normal {
    background: #28a745;
    color: #fff;
}

.priority-low {
    background: #6c757d;
    color: #fff;
}

.message-category {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    background: #007cba;
    color: #fff;
}

.message-category.system {
    background: #17a2b8;
    color: #fff;
}

.message-category.notice {
    background: #ffc107;
    color: #212529;
}

.message-category.promotion {
    background: #e83e8c;
    color: #fff;
}

.message-content.preview {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-preview {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.message-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-checkbox {
    margin-right: 10px;
}

.message-buttons {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-item:hover .message-buttons {
    opacity: 1;
}

.message-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-item:hover .message-item-actions {
    opacity: 1;
}

.btn-message {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-message:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-decoration: none;
}

.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.action-btn.read {
    background: #28a745;
    color: #fff;
}

.action-btn.delete {
    background: #dc3545;
    color: #fff;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 消息详情弹窗 */
.message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.message-modal.show {
    opacity: 1;
    visibility: visible;
}

.message-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.message-modal.show .message-modal-content {
    transform: scale(1);
}

.message-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.message-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.message-modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.message-modal-body {
    padding: 20px;
}

.message-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-label {
    font-weight: 600;
    color: #333;
}

.meta-value {
    color: #666;
}

.message-content {
    line-height: 1.6;
    color: #333;
    font-size: 15px;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.message-content p {
    margin-bottom: 15px;
}

.message-content a {
    color: #007cba;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 空状态 */
.message-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.message-empty i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.message-empty h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.message-empty p {
    margin: 0;
    font-size: 14px;
}

/* 加载状态 */
.message-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分页 */
.message-pagination {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state .icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px;
}

.pagination {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    color: #007cba;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.pagination .current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* 通知徽章 */
.message-unread-badge {
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
    display: inline-block;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* 简洁的右上角Toast提示 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px 16px;
    max-width: 280px;
    z-index: 10000;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #007cba;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.message-toast.show {
    transform: translateX(0);
}

.message-toast.success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
}

.message-toast.error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #ffffff 100%);
}

.message-toast.info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #f8fcff 0%, #ffffff 100%);
}

.message-toast.warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffdf8 0%, #ffffff 100%);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-icon.success {
    color: #28a745;
}

.toast-icon.error {
    color: #dc3545;
}

.toast-icon.info {
    color: #17a2b8;
}

.toast-icon.warning {
    color: #ffc107;
}

.toast-message {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .message-center-header {
        padding: 15px;
    }
    
    .message-center-title {
        font-size: 20px;
    }
    
    .message-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .message-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .message-filters,
    .message-bulk-actions {
        justify-content: center;
    }
    
    .message-item {
        padding: 12px 15px;
    }
    
    .message-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .message-meta {
        flex-wrap: wrap;
    }
    
    .message-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .message-modal-header,
    .message-modal-body,
    .message-modal-footer {
        padding: 15px;
    }
    
    .message-detail-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .message-toast {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .message-toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .message-center-header {
        padding: 12px;
    }
    
    .message-center-title {
        font-size: 18px;
    }
    
    .message-item {
        padding: 10px 12px;
    }
    
    .message-title {
        font-size: 14px;
    }
    
    .message-preview {
        font-size: 13px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .message-modal-content {
        max-height: 90vh;
    }
}

/* 自定义模态框样式 - 优化居中显示 */
.zpro-message-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    padding: 20px;
    box-sizing: border-box;
}

.zpro-message-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.zpro-message-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 25px rgba(0, 0, 0, 0.15);
    max-width: 650px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.8) translateY(-30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zpro-message-modal-overlay.show .zpro-message-modal {
    transform: scale(1) translateY(0);
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalFadeIn {
    0% {
        transform: scale(0.8) translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.zpro-modal-header {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.zpro-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    padding-right: 20px;
}

.zpro-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.zpro-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zpro-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.zpro-modal-body .message-detail {
    line-height: 1.6;
}

.zpro-modal-body .message-meta {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.zpro-modal-body .badge {
    margin-right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.zpro-modal-body .message-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.zpro-modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.zpro-modal-footer .btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zpro-modal-footer .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.zpro-modal-footer .btn-secondary:hover {
    background: #545b62;
}

.zpro-modal-footer .btn-danger {
    background: #dc3545;
    color: #fff;
}

.zpro-modal-footer .btn-danger:hover {
    background: #c82333;
}

/* 注意事项区域样式优化 */
.container.py-5 {
    text-align: center;
    padding: 40px 20px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.container.py-5 h4 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.container.py-5 h5 {
    margin: 15px 0;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    font-weight: 500;
}

/* 移除注意事项上方的图标 */
.bg-title::before,
.bg-title i {
    display: none !important;
}

/* 空状态样式 */
.empty-messages,
.message-empty {
    text-align: center;
    padding: 100px 20px;
    color: #95a5a6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.empty-messages i {
    font-size: 80px;
    color: #cbd5e0;
    margin-bottom: 25px;
    display: block;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-messages h3 {
    font-size: 22px;
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.empty-messages p {
    font-size: 16px;
    margin: 0;
    color: #718096;
    line-height: 1.6;
    max-width: 400px;
    opacity: 0.9;
}

/* 响应式模态框 - 优化移动端居中显示 */
@media (max-width: 768px) {
    .zpro-message-modal-overlay {
        padding: 15px;
    }
    
    .zpro-message-modal {
        width: 100%;
        max-width: 95vw;
        max-height: 90vh;
        margin: 0;
        border-radius: 12px;
    }
    
    .zpro-modal-header,
    .zpro-modal-body,
    .zpro-modal-footer {
        padding: 15px;
    }
    
    .zpro-modal-title {
        font-size: 16px;
        padding-right: 15px;
    }
    
    .zpro-modal-body {
        max-height: 60vh;
    }
    
    .zpro-modal-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .zpro-message-modal-overlay {
        padding: 10px;
    }
    
    .zpro-message-modal {
        max-width: 98vw;
        max-height: 95vh;
        border-radius: 10px;
    }
    
    .zpro-modal-header,
    .zpro-modal-body,
    .zpro-modal-footer {
        padding: 12px;
    }
    
    .zpro-modal-title {
        font-size: 15px;
    }
    
    .zpro-modal-body {
        max-height: 65vh;
    }
    
    .empty-messages {
        padding: 60px 15px;
        min-height: 250px;
    }
    
    .empty-messages i {
        font-size: 60px;
    }
    
    .empty-messages h3 {
        font-size: 18px;
    }
    
    .empty-messages p {
        font-size: 14px;
    }
}