/* 源库 · 消息星枢：深空银星毛玻璃双栏消息中心 + 星芒通知流 */

/* 侧栏「消息」按钮未读微光角标 */
body > header nav button { position: relative; display: flex; align-items: center; justify-content: space-between; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: linear-gradient(135deg, #eef3fc, #b9c9e8);
  color: #070a12; font-size: 11px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 12px rgba(190, 212, 255, 0.55);
}

.msg-page { max-width: 1160px; margin: 0 auto; }
.msg-shell { display: flex; flex-direction: column; gap: 18px; }

/* 顶部统领栏 */
.msg-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 24px;
  border: 1px solid var(--line); border-radius: 20px;
  background: rgba(6, 9, 17, 0.58);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.msg-header-title small { display: block; font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.msg-header-title h1 { font: 500 30px/1.25 var(--serif); margin: 3px 0 0; }

.msg-seg {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 300px;
}
.msg-seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3);
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(135deg, #f2f5fb, #cfd9ec);
  box-shadow: 0 0 18px rgba(196, 216, 255, 0.28);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.msg-seg.is-noti .msg-seg-thumb { transform: translateX(100%); }
.msg-seg.is-rec .msg-seg-thumb { transform: translateX(200%); }
html[data-theme="dark"] .msg-seg-btn,
.msg-seg-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 4px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color .24s ease;
}
html[data-theme="dark"] .msg-seg-btn:hover,
.msg-seg-btn:hover { color: var(--ink); background: transparent; transform: none; box-shadow: none; }
html[data-theme="dark"] .msg-seg-btn.active,
.msg-seg-btn.active { background: transparent; color: #070a12; font-weight: 600; box-shadow: none; }
.msg-seg-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: #ff6b5e; color: #fff; font-size: 10px; font-weight: 700;
  transition: background .24s ease, color .24s ease;
}
.msg-seg-btn.active .msg-seg-badge { background: #0b0e18; color: #eef2fa; }

/* 水平双面板平滑滑动视口 */
.msg-viewport { width: 100%; overflow: hidden; border-radius: 22px; }
.msg-track {
  display: flex; width: 300%; align-items: flex-start;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.msg-track.is-noti { transform: translateX(-33.3333%); }
.msg-track.is-rec { transform: translateX(-66.6667%); }
.msg-slide-pane { width: 33.3333%; flex: none; min-width: 0; }
.msg-loading { padding: 48px 20px; text-align: center; color: var(--muted); }

.msg-chat-back { display: none; border: 0; background: transparent; padding: 4px 8px; min-height: 32px; font-size: 20px; color: var(--muted); }

.msg-header-tools { display: flex; align-items: center; gap: 10px; }
.msg-search-input { width: 220px; min-height: 38px; padding: 6px 14px; font-size: 13px; }
.msg-new-btn { min-height: 38px; padding: 6px 18px; font-size: 13px; white-space: nowrap; }

/* 私信双栏沉浸聊天舱 */
.msg-workspace {
  display: grid; grid-template-columns: 350px minmax(0, 1fr);
  min-height: calc(100vh - 230px);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: rgba(6, 9, 18, 0.62);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48);
}
.msg-list-pane {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  background: rgba(4, 6, 13, 0.34);
}
.msg-conv-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 232px); }

.msg-conv-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; text-decoration: none; text-align: left;
  color: inherit; border: 0; border-bottom: 1px solid rgba(215, 226, 248, 0.08);
  border-radius: 0; background: transparent; position: relative; min-height: auto;
  transition: background .18s;
}
.msg-conv-item:hover { background: rgba(215, 228, 252, 0.07); transform: none; box-shadow: none; }
.msg-conv-item.on { background: rgba(215, 228, 252, 0.13); }
.msg-conv-item.on::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #f0f5ff, #8fa6cc);
  box-shadow: 0 0 12px rgba(195, 216, 255, 0.75);
}
.msg-conv-item .user-avatar { box-shadow: 0 0 0 1px rgba(215, 226, 248, 0.24); }

/* 置顶星芒通知条 */
.msg-noti-banner { background: linear-gradient(90deg, rgba(145, 168, 245, 0.10), transparent 85%); }
.msg-banner-icon {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(168, 146, 255, 0.28), rgba(82, 118, 210, 0.14));
  border: 1px solid rgba(188, 178, 255, 0.38);
  color: #c7beff; box-shadow: 0 0 18px rgba(154, 134, 255, 0.22);
}

.msg-conv-body { flex: 1; min-width: 0; }
.msg-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-conv-name-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msg-conv-top strong { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-conv-top time { font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
.msg-conv-last { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-unread-tag { color: #ff8a7d; font-weight: 600; }
.msg-unread-pill {
  flex: none; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: #ff6b5e; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(255, 107, 94, 0.45);
}
.msg-side-empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* 右侧聊天舱 */
.msg-chat-pane { display: flex; flex-direction: column; min-height: 0; }
.msg-chat-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
}
.msg-chat-back { display: none; font-size: 20px; color: var(--muted); text-decoration: none; }
.msg-chat-who { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.msg-chat-name { font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; }
.msg-chat-who small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.msg-chat-acts .ghost { min-height: 34px; padding: 4px 14px; font-size: 12px; }

.msg-thread {
  flex: 1; overflow-y: auto; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - 372px);
}
.msg-thread-empty { margin: auto; color: var(--muted); font-size: 14px; text-align: center; }
.msg-bubble-row { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.msg-bubble-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble-col { display: flex; flex-direction: column; gap: 4px; }
.msg-bubble {
  padding: 11px 16px; border-radius: 18px; font-size: 14px; line-height: 1.75;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: rgba(16, 22, 38, 0.84); border: 1px solid var(--line); color: var(--ink);
}
.msg-bubble-row:not(.mine) .msg-bubble { border-bottom-left-radius: 5px; }
.msg-bubble-row.mine .msg-bubble {
  background: linear-gradient(135deg, rgba(215, 228, 252, 0.22), rgba(168, 192, 236, 0.14));
  border-color: rgba(215, 228, 252, 0.36); color: #f6f8fd;
  border-bottom-right-radius: 5px;
}
.msg-bubble-col time { font-size: 10px; color: var(--muted); }
.msg-bubble-row.mine .msg-bubble-col time { text-align: right; }

.msg-composer {
  display: flex; gap: 10px; padding: 14px 20px; align-items: flex-end;
  border-top: 1px solid var(--line); background: rgba(4, 6, 13, 0.4);
}
.msg-composer textarea {
  flex: 1; border-radius: 16px; resize: none; min-height: 44px; max-height: 140px;
  font-size: 14px; padding: 11px 16px; line-height: 1.6;
}
.msg-composer button { flex: none; min-height: 44px; padding: 6px 24px; }

/* 聊天空态与快速推荐 */
.msg-chat-empty, .msg-empty-state, .msg-guest {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 52px 28px; gap: 10px; margin: auto;
}
.msg-guest {
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(6, 9, 17, 0.58); backdrop-filter: blur(14px);
  max-width: 540px; margin: 48px auto;
}
.msg-guest small { letter-spacing: .16em; color: var(--muted); font-size: 12px; }
.msg-guest h1 { font: 500 32px/1.3 var(--serif); margin: 2px 0; }
.msg-chat-empty h2, .msg-empty-state h2 { font-size: 22px; margin: 4px 0 0; }
.msg-chat-empty p, .msg-empty-state p, .msg-guest p { font-size: 14px; color: var(--muted); max-width: 380px; margin: 0 0 8px; line-height: 1.8; }
.msg-empty-star {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(205, 220, 255, 0.22), rgba(110, 136, 210, 0.08));
  border: 1px solid rgba(215, 228, 255, 0.28); color: #dce7ff;
  box-shadow: 0 0 28px rgba(175, 200, 255, 0.2);
}
.msg-quick-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; max-width: 460px; }
.msg-pick-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  background: rgba(12, 16, 30, 0.65); color: var(--ink); font-size: 13px;
  transition: border-color .18s, transform .18s;
}
.msg-pick-chip:hover { border-color: rgba(226, 236, 255, 0.52); transform: translateY(-1px); }

/* 互动通知流（星芒时间线） */
.msg-noti-shell {
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: rgba(6, 9, 18, 0.62); backdrop-filter: blur(14px);
}
.msg-noti-tabs {
  display: flex; gap: 6px; padding: 10px 22px 0;
  border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.msg-noti-tabs::-webkit-scrollbar { display: none; }
.msg-noti-tabs button {
  border: 0; border-radius: 0; background: transparent; color: var(--muted);
  min-height: 44px; padding: 0 16px; font-size: 14px; position: relative; white-space: nowrap;
}
.msg-noti-tabs button:hover { color: var(--ink); background: transparent; transform: none; box-shadow: none; }
.msg-noti-tabs button.active { color: var(--ink); font-weight: 600; }
.msg-noti-tabs button.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #b8c8f5, #f0f5ff);
}

.msg-noti-list { display: flex; flex-direction: column; }
.msg-noti-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid rgba(215, 226, 248, 0.09);
  transition: background .18s;
}
.msg-noti-item:hover { background: rgba(215, 228, 252, 0.04); }
.msg-noti-item:last-child { border-bottom: 0; }

.msg-noti-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.msg-noti-icon.kind-mention,
.msg-noti-icon.kind-reply {
  color: #c2b5ff; background: rgba(154, 134, 255, 0.14); border: 1px solid rgba(182, 168, 255, 0.34);
  box-shadow: 0 0 14px rgba(154, 134, 255, 0.22);
}
.msg-noti-icon.kind-like {
  color: #ff7f73; background: rgba(255, 107, 94, 0.14); border: 1px solid rgba(255, 127, 115, 0.32);
}
.msg-noti-icon.kind-follow {
  color: #5ee2a4; background: rgba(71, 217, 150, 0.14); border: 1px solid rgba(94, 226, 164, 0.32);
}
.msg-noti-icon.kind-request {
  color: #f2cf6c; background: rgba(242, 207, 108, 0.14); border: 1px solid rgba(242, 207, 108, 0.36);
}

.msg-noti-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-noti-head { display: flex; align-items: center; gap: 10px; }
.msg-noti-who { flex: 1; min-width: 0; }
.msg-noti-name { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.msg-noti-who span { font-size: 14px; color: var(--muted); }
.msg-noti-who time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.msg-noti-quote {
  display: block; padding: 12px 16px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--line); background: rgba(12, 16, 30, 0.55);
  transition: border-color .18s, background .18s;
}
.msg-noti-quote:hover { border-color: rgba(226, 236, 255, 0.42); background: rgba(16, 22, 40, 0.72); }
.msg-noti-quote strong { display: block; font-family: var(--serif); font-size: 15px; font-weight: 500; color: var(--ink); }
.msg-noti-quote p { margin: 5px 0 0; font-size: 13px; color: #b9c3d6; line-height: 1.75; overflow-wrap: anywhere; }

.msg-noti-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-noti-ops button { min-height: 34px; padding: 4px 16px; font-size: 13px; }

/* 发起对话弹窗 */
.msg-picker { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.msg-picker-search { display: flex; gap: 8px; }
.msg-picker-search input { flex: 1; }
.msg-picker-search button { flex: none; padding: 6px 20px; }
.msg-picker-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.msg-picker-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.msg-picker-info { flex: 1; min-width: 0; }
.msg-picker-info small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-picker-row button { flex: none; min-height: 34px; padding: 4px 14px; font-size: 13px; }

@media (max-width: 860px) {
  .msg-header { padding: 16px; }
  .msg-header-tools { width: 100%; }
  .msg-search-input { flex: 1; width: auto; }
  .msg-workspace { grid-template-columns: 1fr; min-height: calc(100vh - 220px); }
  .msg-workspace.chat-active .msg-list-pane { display: none; }
  .msg-workspace:not(.chat-active) .msg-chat-pane { display: none; }
  .msg-chat-back { display: inline-block; }
  .msg-conv-list, .msg-thread { max-height: none; }
  .msg-noti-item { padding: 16px; gap: 12px; }
}

.msg-noti-quote small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.msg-noti-quote.is-reply { border-left: 3px solid rgba(226, 236, 255, 0.4); }
.msg-rec-clear { align-self: flex-end; margin: 0 0 10px auto; min-height: 32px; padding: 4px 14px; font-size: 13px; }
.msg-rec-shell .msg-noti-list { display: flex; flex-direction: column; }
