/* =========================================
   消息中心 - 现代化布局
   ========================================= */

.messages-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  height: calc(100vh - 100px); /* 充满视口高度，减去导航栏高度 */
}

/* =========================================
   左侧导航栏
   ========================================= */
.msg-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: 16px;
  padding: 20px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  position: sticky;
  top: 90px;
}

.msg-menu-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding: 0 12px;
}

.msg-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.msg-menu-item:hover {
  background: #f9fbf9;
  color: var(--text-primary);
}

.msg-menu-item.active {
  background: rgba(76, 175, 80, 0.08);
  color: var(--primary-color);
  font-weight: bold;
}

.msg-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.msg-menu-left i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.msg-badge {
  background: #FF5252;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.3);
}

.msg-badge.green {
  background: #4CAF50;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

/* =========================================
   右侧内容区面板
   ========================================= */
.msg-content-area {
  flex: 1;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-tab-content {
  display: none;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.3s ease;
}

.msg-tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-header {
  padding: 20px 30px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  z-index: 10;
}

.msg-header h3 {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0;
}

.btn-read-all {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.btn-read-all:hover {
  color: var(--primary-color);
}

/* =========================================
   互动消息列表
   ========================================= */
.interaction-tabs {
  display: flex;
  gap: 30px;
}

.int-tab {
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  padding-bottom: 8px;
  transition: color 0.2s;
}

.int-tab:hover {
  color: var(--text-primary);
}

.int-tab.active {
  color: var(--primary-color);
  font-weight: bold;
}

.int-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px;
}

.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 30px 30px;
}

/* 自定义滚动条 */
.msg-list::-webkit-scrollbar {
  width: 6px;
}
.msg-list::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 10px;
}

.msg-item {
  display: flex;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
}

.msg-item:last-child {
  border-bottom: none;
}

.msg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #eee;
  flex-shrink: 0;
  cursor: pointer;
}

.msg-body {
  flex: 1;
}

.msg-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.msg-name {
  font-weight: bold;
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
}

.msg-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.msg-desc {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.msg-action-text {
  color: var(--text-secondary);
  margin-right: 8px;
}

.msg-target {
  background-color: #f9f9f9;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 3px solid #ddd;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.2s;
}

.msg-target:hover {
  background-color: #f0f0f0;
}

/* =========================================
   系统通知和热门推送图标
   ========================================= */
.sys-icon, .hot-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sys-icon {
  background-color: rgba(33, 150, 243, 0.1);
  color: #2196F3;
}

.hot-icon {
  background-color: rgba(255, 82, 82, 0.1);
  color: #FF5252;
}

/* =========================================
   私信聊天布局
   ========================================= */
.chat-layout {
  display: flex;
  height: 100%;
}

/* 左侧会话列表 */
.chat-list-col {
  width: 280px;
  border-right: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.chat-list-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.chat-search {
  width: 100%;
  background: white;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-search:focus {
  border-color: var(--primary-color);
}

.chat-sessions {
  flex: 1;
  overflow-y: auto;
}

.chat-session {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid #f5f5f5;
  position: relative;
}

.chat-session:hover {
  background: #f0f0f0;
}

.chat-session.active {
  background: white;
  border-left: 3px solid var(--primary-color);
}

.chat-session-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-size: cover;
  flex-shrink: 0;
  position: relative;
}

.unread-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #FF5252;
  border-radius: 50%;
  border: 2px solid white;
}

.chat-session-info {
  flex: 1;
  overflow: hidden;
}

.cs-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cs-name {
  font-weight: bold;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-time {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cs-msg {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧聊天窗口 */
.chat-window-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.chat-window-header {
  padding: 20px 30px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cw-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
}

.cw-actions i {
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  margin-left: 15px;
  transition: color 0.2s;
}

.cw-actions i:hover {
  color: var(--primary-color);
}

.chat-history {
  flex: 1;
  padding: 24px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #f9fbf9;
}

.chat-history::-webkit-scrollbar {
  width: 6px;
}
.chat-history::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 10px;
}

.chat-bubble-wrap {
  display: flex;
  gap: 12px;
  max-width: 75%;
}

.chat-bubble-wrap.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-wrap.other {
  align-self: flex-start;
}

.cb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  flex-shrink: 0;
  background-color: var(--primary-light);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.cb-content {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.chat-bubble-wrap.other .cb-content {
  border-top-left-radius: 4px;
  border: 1px solid #f0f0f0;
}

.chat-bubble-wrap.mine .cb-content {
  background: var(--primary-color);
  color: white;
  border-top-right-radius: 4px;
}

.chat-input-area {
  padding: 20px 30px;
  border-top: 1px solid #f0f0f0;
  background: white;
}

.chat-tools {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.chat-tools i {
  color: #999;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.chat-tools i:hover {
  color: var(--primary-color);
}

.chat-input-box {
  display: flex;
  flex-direction: column;
}

.chat-textarea {
  width: 100%;
  border: none;
  resize: none;
  outline: none;
  height: 80px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
}

.chat-send-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.chat-send-hint {
  font-size: 12px;
  color: #ccc;
}

.btn-send {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-send:hover {
  background: var(--primary-dark);
}

/* =========================================
   响应式
   ========================================= */
@media (max-width: 1024px) {
  .messages-container {
    height: auto;
    min-height: 80vh;
  }
}

@media (max-width: 768px) {
  .messages-container {
    flex-direction: column;
    height: auto;
  }
  .msg-sidebar {
    width: 100%;
    position: static;
    padding: 10px;
  }
  .msg-menu {
    flex-direction: row;
    overflow-x: auto;
  }
  .msg-menu-item {
    flex-shrink: 0;
  }
  .msg-content-area {
    min-height: 600px;
  }
  .chat-layout {
    flex-direction: column;
  }
  .chat-list-col {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .chat-window-col {
    height: 500px;
  }
}