/* ============================================================
   MetaLab Messages Styles — 消息中心页样式
   左侧导航 + 右侧消息卡片列表
   ============================================================ */

/* ---------- Page Body ---------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Layout ---------- */
.msg-layout {
    display: flex;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 20px;
    gap: 2rem;
}

/* ---------- Left Sidebar ---------- */
.msg-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    padding: 1.25rem 1rem;
    align-self: flex-start;
}

.msg-sidebar-header {
    margin-bottom: .75rem;
}

.msg-sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.msg-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-sidebar-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1rem;
    border-radius: var(--radius);
    font-size: .92rem;
    color: var(--color-secondary);
    font-weight: 500;
    transition: all .15s ease;
}

.msg-sidebar-item:hover {
    background: rgba(52, 152, 219, .06);
    color: var(--color-accent);
}

.msg-sidebar-item.active {
    background: rgba(52, 152, 219, .1);
    color: var(--color-accent);
    font-weight: 600;
}

.msg-sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.msg-sidebar-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-accent);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ---------- Right Content Area ---------- */
.msg-main {
    flex: 1;
    min-width: 0;
}

/* ---------- System Message Section ---------- */
.msg-system-section {
    margin-bottom: 1.25rem;
}

.msg-system-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0 0 .5rem 0;
}

.msg-system-icon {
    color: var(--color-accent);
    flex-shrink: 0;
}

.msg-system-divider {
    height: 1px;
    background: linear-gradient(to right, var(--color-border), transparent);
    margin: 0;
}

/* ---------- Message Card Link ---------- */
.msg-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.msg-card-link:hover {
    text-decoration: none;
}

/* ---------- Toolbar ---------- */
.msg-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}

.msg-mark-all-btn {
    display: inline-flex;
    align-items: center;
    padding: .35rem .9rem;
    font-size: .82rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-accent);
    background: transparent;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s ease;
}

.msg-mark-all-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

.msg-mark-all-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------- Right Content Area ---------- */
.msg-main {
    flex: 1;
    min-width: 0;
}

/* ---------- Message Card ---------- */
.msg-card {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: .6rem;
    transition: background .15s ease, border-color .15s ease;
    position: relative;
    cursor: pointer;
}

.msg-card:hover {
    border-color: var(--color-accent);
    background: #f8fafe;
}

.msg-card.unread {
    background: #f0f6fe;
    border-left: 3px solid var(--color-accent);
    cursor: pointer;
}

.msg-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 152, 219, .1);
    border-radius: 8px;
    color: var(--color-accent);
    margin-top: 2px;
}

.msg-body {
    flex: 1;
    min-width: 0;
}

.msg-title {
    font-size: .92rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: .25rem;
}

.msg-content {
    font-size: .85rem;
    color: var(--color-secondary);
    line-height: 1.55;
    margin-bottom: .4rem;
}

.msg-meta {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    color: #aaa;
}

.msg-type {
    color: rgba(52, 152, 219, .7);
}

.msg-badge {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
    margin-top: 8px;
}

/* ---------- Pagination ---------- */
.msg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1.5rem 0;
}

.msg-page-btn {
    display: inline-flex;
    align-items: center;
    padding: .4rem 1rem;
    font-size: .85rem;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    font-weight: 500;
    transition: all .15s ease;
}

.msg-page-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

.msg-page-btn.disabled {
    color: #ccc;
    border-color: #ddd;
    cursor: not-allowed;
    pointer-events: none;
}

.msg-page-info {
    font-size: .85rem;
    color: var(--color-text-light);
}

/* ---------- Empty State ---------- */
.msg-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #bbb;
}

.msg-empty-icon {
    margin-bottom: 1rem;
    color: #ddd;
}

.msg-empty p {
    font-size: .92rem;
    color: #aaa;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .msg-layout {
        flex-direction: column;
        padding: 1rem 16px;
        gap: 1rem;
    }

    .msg-sidebar {
        width: 100%;
        align-self: auto;
    }

    .msg-sidebar-nav {
        flex-direction: row;
    }

    .msg-card {
        padding: .85rem 1rem;
    }
}
