/* ============================================================
   仙路漫漫 · 独立社交系统样式（v1.3.8-6）
   说明：本文件仅供 #chat-system 使用，前缀 cs-，不直接依赖
   styles.css 的公共组件类（避免与其它界面共用 CSS 框架）。
   仅引用少量全局主题变量（--gold / --mut 等）。
   ============================================================ */
#chat-system{
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: #f4f1ea;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2a2622;
}
/* 顶部栏（v1.3.8-8：tab 已移到 #log-head，内部 head 不再使用） */
.cs-head{ display: none; }
.cs-close{ display: none; }
/* 主体 */
.cs-body{ flex: 1; min-height: 0; display: flex; position: relative; }
.cs-page{ position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.cs-page.active{ display: flex; }

/* ---------- 世界频道 ---------- */
.cs-msg-list{
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px 14px; line-height: 1.7; font-size: 14px;
  -webkit-overflow-scrolling: touch;
  background: #f4f1ea;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cs-msg-list:empty{ justify-content: center; }
.cs-sys{
  text-align: center; color: #b07d2b; font-size: 13px;
  margin: 6px 0 12px; padding: 8px 10px; border-radius: 10px;
  background: #fbf3df; border: 1px dashed #e3c578;
}
.cs-sys-label{
  color: #e0524a; font-weight: 700; letter-spacing: 1px;
}
.cs-empty{ text-align: center; color: #9a948a; padding: 30px 0; font-size: 13px; }
.cs-msg{ margin-bottom: 9px; word-break: break-word; }
.cs-msg .cs-time{ display: none; }
.cs-msg .cs-sender{ color: #3a6ea5; font-weight: 600; cursor: pointer; }
.cs-msg .cs-sender:active{ opacity: .6; }
.cs-msg .cs-realm{ color: #8a6a3a; font-size: 12px; margin-left: 2px; }
.cs-msg .cs-text{ color: #2a2622; }
.cs-msg.cs-mine .cs-sender{ color: #b07d2b; }
.cs-msg.cs-mine .cs-text{ color: #5a4a2a; }
.cs-sect-badge{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 5px; border-radius: 5px; border: 1px solid;
  font-weight: 600; line-height: 1.2; white-space: nowrap;
}

/* 输入行（世界 / 私聊共用） */
.cs-input-row{ flex-shrink: 0; display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #e2ddd2; }
.cs-input{
  flex: 1; min-width: 0; height: 42px; padding: 0 12px;
  border: 1px solid #d8d2c6; border-radius: 21px; font-size: 15px;
  outline: none; background: #fbfaf7; color: #2a2622;
}
.cs-input:focus{ border-color: #c9a44a; }
.cs-send{
  flex-shrink: 0; height: 42px; padding: 0 20px; border: none; border-radius: 21px;
  background: #c9a44a; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.cs-send:active{ background: #b8913c; }
.cs-send:disabled{ opacity: .5; cursor: not-allowed; }

/* ---------- 好友频道（左列表 + 右聊天） ---------- */
#cs-friend{ flex-direction: row; }
.cs-friend-left{
  width: 40%; min-width: 130px; max-width: 180px;
  display: flex; flex-direction: column;
  background: #efeae0; border-right: 1px solid #e2ddd2;
  min-height: 0;
}
.cs-collapse{ border-bottom: 1px solid #e2ddd2; }
.cs-collapse-hd{
  padding: 12px 12px; font-size: 14px; font-weight: 700; color: #4a443c;
  background: #e6e0d3; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.cs-collapse-bd{ max-height: 230px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#cs-stranger-list{ max-height: 100px; }   /* 陌生人列表窗口缩小，列表项少时不让它占一半空间 */
.cs-count{
  display: inline-block; min-width: 18px; text-align: center;
  background: #c9a44a; color: #fff; border-radius: 9px;
  font-size: 11px; padding: 1px 6px; font-weight: 600;
}
.cs-friend-item, .cs-stranger-item{
  padding: 11px 12px; cursor: pointer; border-bottom: 1px solid #f0ece2;
  display: flex; align-items: center; justify-content: space-between;
}
.cs-friend-item:active, .cs-stranger-item:active{ background: #e3ddcf; }
.cs-friend-item.active, .cs-stranger-item.active{ background: #fbf3df; }
.cs-fi-name{ font-size: 14px; color: #2a2622; }
.cs-fi-name.on{ color: #2e9e4f; }   /* 在线：绿色 */
.cs-fi-name.off{ color: #9a948a; }  /* 离线：灰色 */
.cs-fi-id{ font-size: 11px; color: #9a948a; margin-top: 2px; }
.cs-fi-unread{
  min-width: 16px; text-align: center; background: #e0524a; color: #fff;
  border-radius: 9px; font-size: 11px; padding: 1px 5px; font-weight: 600;
}
.cs-friend-btns{ margin-top: auto; display: flex; border-top: 1px solid #ddd6c8; }
.cs-btn{
  flex: 1; position: relative; padding: 13px 4px; border: none;
  background: #e6e0d3; color: #4a443c; font-size: 13px; cursor: pointer;
  border-right: 1px solid #ddd6c8;
}
.cs-btn:last-child{ border-right: none; }
.cs-btn:active{ background: #d8d1c2; }
.cs-btn.cs-primary{ background: #c9a44a; color: #fff; }
.cs-btn.cs-primary:active{ background: #b8913c; }

.cs-friend-right{ flex: 1; min-width: 0; display: flex; min-height: 0; position: relative; }
.cs-pm-empty{
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #9a948a; font-size: 13px; text-align: center; padding: 20px;
}
.cs-pm-box{ position: absolute; inset: 0; display: flex; flex-direction: column; background: #f4f1ea; min-height: 0; }
.cs-pm-head{
  flex-shrink: 0; padding: 10px 14px;
  background: #fff; border-bottom: 1px solid #e2ddd2;
}
.cs-pm-head .cs-pm-title{ font-size: 15px; font-weight: 700; color: #2a2622; }
.cs-pm-head .cs-pm-id{ font-size: 11px; color: #9a948a; font-weight: 400; margin-left: 6px; }
.cs-pm-head .cs-pm-meta{ display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.cs-pm-head .cs-pm-realm{ font-size: 11px; color: #8a6a3a; font-weight: 500; }
.cs-pm-list{
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px;
  line-height: 1.7; font-size: 14px; -webkit-overflow-scrolling: touch;
}
.cs-pm-msg{ margin-bottom: 9px; word-break: break-word; }
.cs-pm-msg .cs-pm-time{ color: #b3ada2; font-size: 11px; margin-right: 6px; }
.cs-pm-msg .cs-pm-text{ color: #2a2622; }
.cs-pm-msg.cs-pm-mine{ text-align: right; }
.cs-pm-msg.cs-pm-mine .cs-pm-text{
  display: inline-block; background: #c9a44a; color: #fff;
  padding: 6px 11px; border-radius: 12px; max-width: 80%; text-align: left;
}
.cs-pm-msg:not(.cs-pm-mine) .cs-pm-text{
  display: inline-block; background: #fff; color: #2a2622;
  padding: 6px 11px; border-radius: 12px; max-width: 80%;
}

/* 角标（好友 tab / 社交入口 / 好友申请按钮） */
.cs-badge{
  position: absolute; top: 2px; right: 8px;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  background: #e0524a; color: #fff; border-radius: 8px;
  font-size: 11px; padding: 0 4px; font-weight: 700;
}
.cs-friend-btns .cs-badge{ position: static; margin-left: 4px; }
/* 弹窗（好友申请 / 添加好友） */
.cs-overlay{
  position: fixed; inset: 0; z-index: 500;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
}
.cs-pop{
  width: 84%; max-width: 340px; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.cs-pop-ttl{ padding: 14px 16px; font-size: 16px; font-weight: 700; color: #2a2622; border-bottom: 1px solid #eee; }
.cs-pop-list{ max-height: 280px; overflow-y: auto; padding: 6px 0; }
.cs-pop-desc{ padding: 12px 16px 4px; font-size: 13px; color: #9a948a; }
.cs-pop-msg{ padding: 4px 16px 8px; font-size: 13px; color: #e0524a; min-height: 18px; }
/* v1.3.9：添加好友弹窗输入框居中，不要贴左边 */
.cs-pop .cs-input{ margin: 0 16px; width: calc(100% - 32px); text-align: center; }
.cs-pop-foot{ display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #eee; }
.cs-pop-foot .cs-btn{ border: none; border-radius: 10px; background: #e6e0d3; }
.cs-pop-foot .cs-primary{ background: #c9a44a; color: #fff; }

/* 世界消息点击名字弹出的气泡 */
.cs-user-menu{
  position: fixed; z-index: 600; background: #fff; border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,.28); padding: 6px; min-width: 140px;
}
.cs-user-menu .cs-um-name{ padding: 8px 10px 4px; font-size: 14px; font-weight: 700; color: #2a2622; }
.cs-user-menu .cs-um-id{ font-size: 11px; color: #9a948a; }
.cs-user-menu .cs-um-meta{ display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cs-user-menu .cs-um-realm{ font-size: 11px; color: #8a6a3a; font-weight: 500; }
.cs-user-menu .cs-um-btn{
  display: block; width: 100%; text-align: left; padding: 9px 10px;
  border: none; background: none; font-size: 14px; color: #3a6ea5; cursor: pointer; border-radius: 8px;
}
.cs-user-menu .cs-um-btn:active{ background: #f0f3f8; }
.cs-user-menu .cs-um-btn.cs-um-cancel{ color: #9a948a; }

/* 好友申请列表项 */
.cs-req-item{ display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #f0ece2; }
.cs-req-name{ font-size: 14px; color: #2a2622; }
.cs-req-id{ font-size: 11px; color: #9a948a; margin-top: 2px; }
.cs-req-acts{ display: flex; gap: 8px; flex-shrink: 0; }
.cs-req-acts .cs-btn{ border: none; border-radius: 10px; padding: 7px 12px; background: #c9a44a; color: #fff; }
.cs-req-acts .cs-btn.cs-um-cancel{ background: #e6e0d3; color: #4a443c; }
