532 lines
11 KiB
CSS
532 lines
11 KiB
CSS
/* ============================================================
|
|
* Messages Center — 独立消息中心页面
|
|
* ============================================================ */
|
|
|
|
.messages-center {
|
|
display: grid;
|
|
grid-template-columns: 220px 1fr;
|
|
gap: 24px;
|
|
min-height: 60vh;
|
|
padding-top: 24px;
|
|
padding-bottom: 48px;
|
|
}
|
|
|
|
/* ---- 左侧导航 ---- */
|
|
.messages-center__nav {
|
|
position: sticky;
|
|
top: calc(var(--nav-height, 60px) + 24px);
|
|
align-self: start;
|
|
background: var(--surface-card, #fff);
|
|
border-radius: 12px;
|
|
padding: 16px 12px;
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
.messages-nav__list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.messages-nav__item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 10px 12px;
|
|
border-radius: 8px;
|
|
color: var(--color-ink);
|
|
text-decoration: none;
|
|
font-size: 14px;
|
|
transition: background 0.15s, color 0.15s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.messages-nav__item:hover {
|
|
background: var(--surface-hover, rgba(0, 0, 0, 0.04));
|
|
}
|
|
|
|
.messages-nav__item.is-active {
|
|
background: var(--color-primary-light, rgba(59, 130, 246, 0.08));
|
|
color: var(--color-primary, #3b82f6);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.messages-nav__badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 20px;
|
|
height: 20px;
|
|
padding: 0 6px;
|
|
border-radius: 10px;
|
|
background: var(--color-primary, #3b82f6);
|
|
color: #fff;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
line-height: 1;
|
|
}
|
|
|
|
.messages-nav__badge:empty,
|
|
.messages-nav__badge[data-count="0"] {
|
|
display: none;
|
|
}
|
|
|
|
.messages-nav__actions {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
margin-top: 16px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid var(--color-line);
|
|
}
|
|
|
|
.messages-nav__action-btn {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
background: var(--surface-hover, rgba(0, 0, 0, 0.04));
|
|
color: var(--color-ink-3, #666);
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
text-align: center;
|
|
transition: background 0.15s;
|
|
}
|
|
|
|
.messages-nav__action-btn:hover {
|
|
background: var(--surface-active, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
/* ---- 右侧内容 ---- */
|
|
.messages-center__content {
|
|
min-width: 0;
|
|
outline: none;
|
|
transition: opacity 0.15s ease;
|
|
}
|
|
|
|
.messages-center.is-loading .messages-center__content {
|
|
opacity: 0.55;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.messages-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1px;
|
|
background: var(--surface-card, #fff);
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
.message-item {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 12px;
|
|
padding: 16px 20px;
|
|
background: var(--surface-card, #fff);
|
|
border-bottom: 1px solid var(--color-border-light, #f3f4f6);
|
|
transition: background 0.15s;
|
|
}
|
|
|
|
.message-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.message-item:hover {
|
|
background: var(--surface-hover, rgba(0, 0, 0, 0.02));
|
|
}
|
|
|
|
.message-item.is-unread {
|
|
border-left: 3px solid var(--color-primary, #3b82f6);
|
|
}
|
|
|
|
.message-item.is-unread .message-item__title {
|
|
font-weight: 600;
|
|
}
|
|
|
|
.message-item__icon {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
min-width: 36px;
|
|
border-radius: 50%;
|
|
background: var(--color-primary-light, rgba(59, 130, 246, 0.1));
|
|
color: var(--color-primary, #3b82f6);
|
|
font-size: 14px;
|
|
}
|
|
|
|
.message-item__body {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.message-item__title {
|
|
font-size: 14px;
|
|
color: var(--color-ink);
|
|
margin-bottom: 4px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
button.message-item__title {
|
|
width: 100%;
|
|
padding: 0;
|
|
border: 0;
|
|
background: transparent;
|
|
font-family: inherit;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
}
|
|
|
|
button.message-item__title:hover {
|
|
color: var(--color-primary, #3b82f6);
|
|
}
|
|
|
|
.message-item__new-badge {
|
|
display: inline-block;
|
|
padding: 1px 6px;
|
|
border-radius: 3px;
|
|
background: var(--color-danger, #ef4444);
|
|
color: #fff;
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
/* ---- 消息详情(右侧 DOM 视图,不改变地址) ---- */
|
|
.message-detail {
|
|
min-height: 360px;
|
|
padding: 28px 32px;
|
|
background: var(--surface-card, #fff);
|
|
border-radius: 12px;
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
.message-detail__header {
|
|
position: relative;
|
|
padding: 48px 0 22px;
|
|
border-bottom: 1px solid var(--color-line);
|
|
text-align: center;
|
|
}
|
|
|
|
.message-detail__back {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
padding: 7px 10px;
|
|
border: 0;
|
|
border-radius: 6px;
|
|
background: var(--surface-hover, rgba(0, 0, 0, 0.04));
|
|
color: var(--color-ink-3, #666);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.message-detail__icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 52px;
|
|
height: 52px;
|
|
margin-bottom: 14px;
|
|
border-radius: 50%;
|
|
background: var(--color-primary-light, rgba(59, 130, 246, 0.1));
|
|
color: var(--color-primary, #3b82f6);
|
|
font-size: 20px;
|
|
}
|
|
|
|
.message-detail__title {
|
|
margin: 0 0 8px;
|
|
color: var(--color-ink);
|
|
font-size: 22px;
|
|
}
|
|
|
|
.message-detail__meta {
|
|
margin: 0;
|
|
color: var(--color-ink-4, #999);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.message-detail__content {
|
|
min-height: 140px;
|
|
padding: 28px 4px;
|
|
color: var(--color-ink-2, #444);
|
|
font-size: 15px;
|
|
line-height: 1.9;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.message-detail__content p {
|
|
margin: 0 0 1em;
|
|
}
|
|
|
|
.message-detail__actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: 10px;
|
|
padding-top: 18px;
|
|
border-top: 1px solid var(--color-line);
|
|
}
|
|
|
|
.message-detail__primary {
|
|
padding: 8px 16px;
|
|
border-radius: 6px;
|
|
background: var(--color-primary, #3b82f6);
|
|
color: #fff;
|
|
text-decoration: none;
|
|
}
|
|
|
|
html.dark .message-detail {
|
|
background: var(--surface-1);
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.message-item__desc {
|
|
font-size: 13px;
|
|
color: var(--color-ink-3, #666);
|
|
margin-bottom: 4px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.message-item__time {
|
|
font-size: 12px;
|
|
color: var(--color-ink-4, #999);
|
|
}
|
|
|
|
.message-item__actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.message-item__action-btn {
|
|
padding: 4px 10px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: var(--color-ink-3, #666);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
transition: background 0.15s, color 0.15s;
|
|
}
|
|
|
|
.message-item__action-btn:hover {
|
|
background: var(--surface-hover, rgba(0, 0, 0, 0.06));
|
|
color: var(--color-primary, #3b82f6);
|
|
}
|
|
|
|
.message-item__action-btn--danger:hover {
|
|
color: var(--color-danger, #ef4444);
|
|
}
|
|
|
|
/* ---- 空状态 ---- */
|
|
.messages-empty {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 64px 24px;
|
|
background: var(--surface-card, #fff);
|
|
border-radius: 12px;
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
.messages-empty__icon {
|
|
font-size: 48px;
|
|
color: var(--color-ink-4, #ccc);
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.messages-empty__text {
|
|
font-size: 14px;
|
|
color: var(--color-ink-3, #666);
|
|
}
|
|
|
|
.messages-empty__hint {
|
|
margin-top: 4px;
|
|
font-size: 12px;
|
|
color: var(--color-ink-4, #999);
|
|
}
|
|
|
|
/* ---- 分页 ---- */
|
|
.messages-pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
/* ---- 响应式 ---- */
|
|
@media (max-width: 767px) {
|
|
.messages-center {
|
|
grid-template-columns: 1fr;
|
|
gap: 16px;
|
|
padding-top: 16px;
|
|
}
|
|
|
|
.messages-center__nav {
|
|
position: static;
|
|
padding: 12px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.messages-nav__list {
|
|
display: flex;
|
|
overflow-x: auto;
|
|
gap: 4px;
|
|
scrollbar-width: none;
|
|
}
|
|
|
|
.messages-nav__list::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
.messages-nav__item {
|
|
white-space: nowrap;
|
|
padding: 8px 12px;
|
|
font-size: 13px;
|
|
border-radius: 20px;
|
|
}
|
|
|
|
.messages-nav__actions {
|
|
flex-direction: row;
|
|
margin-top: 12px;
|
|
padding-top: 10px;
|
|
}
|
|
|
|
.message-item {
|
|
padding: 12px 14px;
|
|
}
|
|
|
|
.message-item__actions {
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.message-detail {
|
|
min-height: 300px;
|
|
padding: 20px 16px;
|
|
}
|
|
|
|
.message-detail__title {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.message-detail__actions {
|
|
align-items: stretch;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.message-detail__primary,
|
|
.message-detail__actions .message-item__action-btn {
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
/* ---- 暗色模式 ---- */
|
|
html.dark .messages-center__nav,
|
|
html.dark .messages-center__nav {
|
|
background: var(--surface-1);
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
html.dark .messages-nav__item:hover,
|
|
html.dark .messages-nav__item:hover {
|
|
background: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
html.dark .messages-nav__item.is-active,
|
|
html.dark .messages-nav__item.is-active {
|
|
background: var(--color-primary-soft, rgba(240, 68, 148, 0.16));
|
|
}
|
|
|
|
html.dark .messages-nav__action-btn,
|
|
html.dark .messages-nav__action-btn {
|
|
background: var(--surface-2);
|
|
color: var(--color-ink-3);
|
|
}
|
|
|
|
html.dark .messages-nav__action-btn:hover,
|
|
html.dark .messages-nav__action-btn:hover {
|
|
background: var(--surface-3);
|
|
}
|
|
|
|
html.dark .messages-list,
|
|
html.dark .messages-list {
|
|
background: var(--surface-1);
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
html.dark .message-item,
|
|
html.dark .message-item {
|
|
background: var(--surface-1);
|
|
border-bottom-color: var(--color-line);
|
|
}
|
|
|
|
html.dark .message-item:hover,
|
|
html.dark .message-item:hover {
|
|
background: var(--surface-2);
|
|
}
|
|
|
|
html.dark .message-item__icon,
|
|
html.dark .message-item__icon {
|
|
background: var(--color-primary-soft, rgba(240, 68, 148, 0.16));
|
|
}
|
|
|
|
html.dark .message-item__action-btn:hover,
|
|
html.dark .message-item__action-btn:hover {
|
|
background: var(--surface-3);
|
|
}
|
|
|
|
html.dark .messages-empty,
|
|
html.dark .messages-empty {
|
|
background: var(--surface-1);
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
html.dark .messages-nav__actions,
|
|
html.dark .messages-nav__actions {
|
|
border-top-color: var(--color-line);
|
|
}
|
|
|
|
/* Page header */
|
|
.messages-center__header {
|
|
margin: 8px 0 16px;
|
|
}
|
|
.messages-center__title {
|
|
margin: 0 0 6px;
|
|
font-size: 22px;
|
|
font-weight: 700;
|
|
color: var(--color-ink, #1f2937);
|
|
}
|
|
.messages-center__subtitle {
|
|
margin: 0;
|
|
font-size: 14px;
|
|
color: var(--color-ink-3, #6b7280);
|
|
}
|
|
|
|
.messages-center--disabled {
|
|
display: block;
|
|
min-height: 40vh;
|
|
}
|
|
|
|
.message-item__new-badge {
|
|
display: inline-block;
|
|
margin-left: 6px;
|
|
padding: 1px 6px;
|
|
border-radius: 999px;
|
|
background: var(--color-primary, #3b82f6);
|
|
color: #fff;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
vertical-align: middle;
|
|
}
|