/* ========================================== */
/*           聊天应用内多页签与会话列表          */
/* ========================================== */
.chat-app-body {
  position: relative;
  display: flex;
  flex-direction: column;
}
.chat-tab-panel {
  display: none; width: 100%; height: 100%;
}
.chat-tab-panel.active { display: block; }

/* 微信会话列表 */
.session-list {
  display: flex;
  flex-direction: column;
}
.session-item {
  background-color: var(--surface);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.session-avatar {
  width: 48px; height: 48px; border-radius: 6px !important; 
  object-fit: cover; margin-right: 12px;
}
.session-detail { flex: 1; }
.session-row {
  display: flex; justify-content: space-between; align-items: center;
}
.session-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.session-time { font-size: 11px; color: var(--text-secondary); }
.session-msg {
  font-size: 12px; color: var(--text-secondary); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 220px;
}

/* 仿微信单聊覆盖页 */
.chat-dialog-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: #ededed; 
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  z-index: 300; pointer-events: none;
}
.chat-dialog-overlay.active { transform: translateX(0); pointer-events: auto; }

.dialog-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}

/* 微信式气泡 */
.msg-bubble {
  display: flex; align-items: flex-start; max-width: 85%;
  cursor: pointer;
  user-select: none;
}
.msg-bubble.self { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble.other { align-self: flex-start; }

.msg-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 6px !important; 
  object-fit: cover !important;
  flex-shrink: 0;
}
.msg-bubble.self .msg-avatar { margin-left: 10px; }
.msg-bubble.other .msg-avatar { margin-right: 10px; }

.msg-text {
  padding: 10px 14px; border-radius: 6px;
  font-size: 14px; line-height: 1.4; word-break: break-all;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.msg-bubble.self .msg-text {
  background-color: #95ec69; 
  color: #191919;
}
.msg-bubble.other .msg-text {
  background-color: #ffffff; 
  color: #191919;
}
.msg-img {
  max-width: 150px; border-radius: 8px; margin-top: 4px;
}

/* 微信输入控制栏 */
.dialog-input-container {
  background-color: #f7f7f7;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex; flex-direction: column;
}
.input-main-row {
  display: flex; align-items: center; gap: 8px;
}
.dialog-input-container textarea {
  flex: 1; border-radius: 8px; padding: 8px 10px;
  border: none; background-color: #ffffff;
  resize: none; font-size: 14px; max-height: 80px;
}

/* 线下白描输入自适应高度重塑 (物理4行锁定对齐) */
#offline-input-text {
  height: 36px;
  min-height: 36px !important;
  max-height: 90px !important;
  line-height: 1.4 !important;
  overflow-y: hidden;
  box-sizing: border-box !important;
}

/* 发送和获取回复 SVG 按钮 */
.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%; border: none;
  background-color: #07c160; 
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.chat-send-btn:active {
  transform: scale(0.92);
}
.chat-send-btn svg {
  width: 18px; height: 18px;
}
.chat-send-btn.reply {
  background-color: var(--primary); 
}
.chat-send-btn:hover { background-color: #059652; }
.chat-send-btn.reply:hover { background-color: #1565c0; }

/* 拓展功能面板 */
.expand-panel {
  display: none; margin-top: 10px;
  border-top: 1px solid var(--border); padding-top: 12px;
}
.expand-panel.active { display: block; }
.expand-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.expand-item {
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.expand-icon-wrapper {
  width: 48px; height: 48px; border-radius: 12px;
  background-color: #ffffff; border: 1.5px solid var(--border);
  display: flex; justify-content: center; align-items: center;
  color: var(--text-secondary);
}
.expand-icon-wrapper svg { width: 22px; height: 22px; }
.expand-item span { font-size: 10px; color: var(--text-secondary); margin-top: 4px; }

/* 我的 (Me) 专属页面样式 */
.me-header {
  background-color: var(--surface); padding: 20px 16px;
  border-bottom: 1px solid var(--border); text-align: center;
}
.me-profile-selector label {
  display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}

/* 弹出子面板 (表情包、收藏等) */
.me-sub-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-main);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), visibility 0s linear 0.3s;
  z-index: 400; display: flex; flex-direction: column; pointer-events: none;
}
.me-sub-overlay.active { transform: translateX(0); visibility: visible; pointer-events: auto; transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), visibility 0s linear 0s; }
.me-sub-container { display: flex; flex-direction: column; height: 100%; }

/* 表情包网格 */
.sticker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px;
}
.sticker-item {
  background-color: var(--surface); border-radius: 8px; overflow: hidden;
  height: 70px; display: flex; justify-content: center; align-items: center;
  position: relative;
}
.sticker-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 朋友圈专属 */
.moment-cover {
  height: 160px; background-color: #2c3e50; position: relative;
}
.moment-user-info {
  position: absolute; right: 16px; bottom: -16px; display: flex; align-items: center; gap: 8px;
}
.moment-user-info span { color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.8); font-weight: 700; font-size: 14px;}
.avatar-sm { width: 48px; height: 48px; border-radius: 8px; border: 2px solid white; object-fit: cover;}

/* 单聊详情设置面板 */
.chat-details-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-main);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), visibility 0s linear 0.3s;
  z-index: 500; display: flex; flex-direction: column; pointer-events: none;
}
.chat-details-overlay.active { transform: translateX(0); visibility: visible; pointer-events: auto; transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), visibility 0s linear 0s; }

/* 双击气泡呼出的工具菜单 */
.bubble-menu-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.bubble-menu-content {
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  width: 80%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-md);
}
.bubble-menu-content button {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.bubble-menu-content button:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}
.bubble-menu-content button.cancel-btn {
  border: none;
  color: var(--text-secondary);
}

/* 多选状态下的控制面板 */
.multi-select-action-bar {
  background-color: #ffffff;
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  z-index: 999;
}
.msg-select-checkbox {
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.msg-select-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* 微信底栏横向平铺样式 */
.win-footer.chat-tabs {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: center !important;
  height: 56px !important;
  background-color: #f7f7f7 !important; 
  border-top: 1px solid #e5e5e5 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  box-sizing: content-box !important;
}
.win-footer.chat-tabs .tab-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  color: #515151 !important;
  cursor: pointer !important;
  padding: 4px 0 !important;
  flex: 1 !important;
  width: auto !important;
}
.win-footer.chat-tabs .tab-item.active {
  color: #07c160 !important; 
}
.win-footer.chat-tabs .tab-item svg {
  width: 24px !important;
  height: 24px !important;
  margin-bottom: 2px !important;
}
.win-footer.chat-tabs .tab-item span {
  font-size: 10px !important;
  font-weight: 500 !important;
}

/* “输入中”动效 */
@keyframes typing-dots {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}
.header-typing::after {
  content: ".";
  animation: typing-dots 1.5s infinite steps(1);
}

/* ==========================================================================
   线下分段式卡片排版
   ========================================================================== */

.offline-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f5f6f8;
}

.offline-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.05);
  padding: 16px 18px;
  width: 100%;
  max-width: 600px;
  align-self: center;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1), box-shadow 0.2s;
  cursor: pointer;
  box-sizing: border-box;
}

.offline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.offline-card.user {
  border-left: 4px solid var(--primary); 
  background: #fbfdff;
}

.offline-card.char {
  border-left: 4px solid #07c160; 
  background: #fcfefe;
}

.offline-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
  padding-bottom: 6px;
}

.offline-card-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: #1e293b;
  word-break: break-all;
  white-space: pre-wrap; 
}

/* 多选状态调整 */
.offline-select-checkbox {
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.offline-select-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.offline-messages-container.multi-selecting .offline-card {
  transform: translateX(30px);
  max-width: calc(100% - 35px);
}

/* ========================================== */
/*             长周期记忆与总结样式库            */
/* ========================================== */
.summary-item-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.summary-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}
.summary-item-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.summary-keyword-tag {
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}