
/* 页面左右边距 */
#pageMessage {
  padding-left: 20px;
  padding-right: 20px;
}

/* App 环境下确保与 .is-plus-app .page-content 一致 */
.is-plus-app #pageMessage {
  padding-top: calc(12px + var(--app-safe-area-top, 0px));
}

/* 顶部标题区：不再额外添加顶部内边距，直接贴合上方 safe-area */
.message-header-bar {
  position: relative;
  background: transparent;
  padding: 0 0 20px;
  color: #1f2b3a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2b3a;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.4;
}

.message-header-title::after {
  content: "掌握动态，一切尽在掌握";
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(31, 43, 58, 0.55);
  letter-spacing: 0;
}

#pageMessage .page-content-inner {
  padding: 4px 0 24px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* 标签栏：采用胶囊分段控件风格，主色高亮 */
.message-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 16px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(60, 90, 120, 0.08);
}

#pageMessage .page-content-inner > .message-tabs {
  display: flex;
  justify-content: center;
  width: fit-content;
}

.message-tab {
  padding: 8px 22px;
  background: transparent;
  border-radius: 999px;
  color: #667;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
}

.message-tab.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

/* 消息列表 */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(60, 90, 120, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.message-item:active {
  transform: scale(0.985);
  box-shadow: 0 2px 8px rgba(60, 90, 120, 0.1);
}

/* 未读消息小红点（可通过 data-unread="1" 触发） */
.message-item[data-unread="1"]::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.message-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(60, 90, 120, 0.12);
}

.message-icon svg {
  width: 22px;
  height: 22px;
}

.message-icon svg path {
  fill: #fff;
}

.message-icon-repair {
  background: linear-gradient(135deg, #ffb057 0%, #ff9f43 100%);
}

.message-icon-pay {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.message-icon-visitor {
  background: linear-gradient(135deg, #8b7ff0 0%, #6c5ce7 100%);
}

.message-icon-star {
  background: linear-gradient(135deg, #ffe066 0%, #ffd93d 100%);
}

.message-icon-notice {
  background: linear-gradient(135deg, #7cc8f5 0%, #5eb9f0 100%);
}

.message-icon-system {
  background: linear-gradient(135deg, #8b7ff0 0%, #6c5ce7 100%);
}

.message-body {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

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

.message-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2b3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  flex: none;
  font-size: 12px;
  color: #a3adbb;
}

.message-desc {
  margin: 0;
  font-size: 13px;
  color: #8a95a5;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 空状态 */
.message-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0 40px;
  color: #8a95a5;
  font-size: 14px;
}

.message-empty svg {
  opacity: 0.6;
}

.message-empty.is-hidden {
  display: none;
}

.message-empty p {
  margin: 12px 0 0;
  color: #8a95a5;
}

/* 消息中心 - 顶部“全部已读”按钮 */
.message-header-bar {
  justify-content: center;
}

/* 消息 tab 上的未读徽标 */
.message-tab {
  position: relative;
}

.message-tab-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 4px;
  font-style: normal;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #ff6b6b;
  border-radius: 999px;
  font-weight: 600;
  vertical-align: middle;
}

.message-tab-badge.is-hidden {
  display: none;
}

.message-tab.active .message-tab-badge {
  background: #fff;
  color: var(--primary-color, #4ecdc4);
}

/* 底部导航“信息”红点 */
.bottom-nav .nav-item .nav-badge-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 0 2px #fff;
  font-style: normal;
}

/* 加载态 */
.message-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: #8a95a5;
  font-size: 13px;
}

.message-loading.is-hidden {
  display: none;
}

.message-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(78, 205, 196, 0.2);
  border-top-color: var(--primary-color, #4ecdc4);
  border-radius: 50%;
  animation: message-spin 0.8s linear infinite;
}

@keyframes message-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 消息详情独立页面 */
#pageMessageDetail .page-content-inner {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

#pageMessageDetail .message-detail-body {
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  min-height: calc(100vh - 200px);
}

.message-detail-time {
  font-size: 12px;
  color: #a3adbb;
  margin-bottom: 12px;
}

.message-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2b3a;
  margin-bottom: 16px;
  line-height: 1.4;
}

.message-detail-content {
  font-size: 15px;
  line-height: 1.7;
  color: #4a5568;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-detail-delete-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ff6b6b;
  transition: opacity 0.2s ease;
}

.message-detail-delete-btn:hover {
  opacity: 0.7;
}

.message-detail-delete-btn:active {
  transform: scale(0.95);
}
