/* 小队通 - 微信风格界面 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #333;
  background: #ededed;
  overflow: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; outline: none; }

/* ---------- 登录页 ---------- */
#login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2b3a 0%, #2c3e50 60%, #3b5365 100%);
}
.login-card {
  width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px 44px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: #07c160;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  line-height: 64px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: #999; font-size: 13px; margin-bottom: 26px; }
.form-item { margin-bottom: 14px; }
.form-item input {
  width: 100%;
  height: 42px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  transition: border-color .2s;
}
.form-item input:focus { border-color: #07c160; }
.login-error { color: #e64340; font-size: 12px; height: 18px; margin-bottom: 6px; }
.login-btn {
  width: 100%;
  height: 44px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  letter-spacing: 4px;
}
.login-btn:hover { background: #06ad56; }
.login-btn:disabled { background: #9fd9b6; cursor: not-allowed; }

/* ---------- 主框架 ---------- */
#app { display: flex; height: 100vh; }

/* 左侧导航栏 */
.nav-rail {
  width: 60px;
  background: #2e2e2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
}
.logo {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: #07c160;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  line-height: 38px;
  margin-bottom: 26px;
}
.nav-tabs { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  color: #7c7c7c;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover { color: #bbb; }
.nav-btn.active { color: #07c160; }
.nav-bottom { margin-bottom: 4px; }

/* 头像 */
.avatar {
  width: 40px; height: 40px;
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  position: relative;
}
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.lg { width: 46px; height: 46px; font-size: 18px; }
.avatar .dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.avatar .dot.online { background: #07c160; }
.avatar .dot.offline { background: #c0c0c0; }

/* ---------- 会话/联系人列表 ---------- */
.list-panel {
  width: 260px;
  background: #f7f7f7;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}
.search-box { padding: 10px 10px 6px; }
.search-box input {
  width: 100%;
  height: 30px;
  border: none;
  border-radius: 5px;
  background: #e2e2e2;
  padding: 0 10px;
  font-size: 13px;
}
.search-box input:focus { background: #fff; }
.list-scroll { flex: 1; overflow-y: auto; }

.list-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  gap: 10px;
}
.list-item:hover { background: #ececec; }
.list-item.active { background: #c7c7c7; }
.li-body { flex: 1; min-width: 0; }
.li-top { display: flex; justify-content: space-between; align-items: center; }
.li-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.li-time { font-size: 11px; color: #b0b0b0; flex-shrink: 0; }
.li-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.li-preview {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.li-badge {
  min-width: 16px; height: 16px;
  background: #fa5151;
  color: #fff;
  border-radius: 8px;
  font-size: 11px;
  text-align: center;
  line-height: 16px;
  padding: 0 4px;
  flex-shrink: 0;
}
.li-section {
  padding: 10px 12px 4px;
  font-size: 12px;
  color: #999;
}
.li-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #576b95;
  font-size: 13px;
  cursor: pointer;
}
.li-action:hover { background: #ececec; }

/* ---------- 聊天区 ---------- */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  min-width: 0;
}
.empty-hint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #bbb;
}
.empty-icon { font-size: 52px; margin-bottom: 12px; }

.chat-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}
.chat-title { font-size: 15px; font-weight: 500; }
.chat-sub { font-size: 11px; color: #999; margin-top: 2px; }

/* 消息列表 */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 10px;
  background: #f5f5f5;
}
.date-divider { text-align: center; margin: 6px 0 16px; }
.date-divider span {
  display: inline-block;
  background: #dadada;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
}
.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.msg-row.mine { flex-direction: row-reverse; }
.msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 62%;
  min-width: 0;
}
.msg-row.mine .msg-body { align-items: flex-end; }
.msg-meta { font-size: 11px; color: #b0b0b0; margin-bottom: 4px; }
.bubble {
  position: relative;
  background: #fff;
  padding: 9px 12px;
  border-radius: 6px;
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.msg-row.mine .bubble { background: #95ec69; }

/* 输入区 */
.input-area {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}
.input-area textarea {
  flex: 1;
  height: 62px;
  border: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 1.55;
  padding: 4px 2px;
  color: #333;
}
.input-actions { display: flex; align-items: flex-end; }
#send-btn {
  width: 78px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background: #07c160;
  color: #fff;
  font-size: 13px;
}
#send-btn:hover { background: #06ad56; }
#send-btn:disabled { background: #a9dfc0; cursor: not-allowed; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: maskIn .15s ease-out;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 340px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 8px;
  padding: 22px 22px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.modal .form-item { margin-bottom: 12px; }
.modal .form-item input { height: 38px; font-size: 13px; }
.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.btn-cancel, .btn-ok {
  height: 32px;
  padding: 0 18px;
  border-radius: 4px;
  font-size: 13px;
}
.btn-cancel { background: #fff; border: 1px solid #ddd; color: #666; }
.btn-cancel:hover { background: #f5f5f5; }
.btn-ok { background: #07c160; border: 1px solid #07c160; color: #fff; }
.btn-ok:hover { background: #06ad56; border-color: #06ad56; }
.btn-ok:disabled { background: #a9dfc0; border-color: #a9dfc0; cursor: not-allowed; }
.modal-error {
  color: #e64340;
  font-size: 12px;
  min-height: 18px;
  line-height: 18px;
}
.modal-tip { color: #999; font-size: 11px; margin-top: 10px; }
.member-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.member-check:hover { background: #f7f7f7; }
.member-check input { width: 16px; height: 16px; accent-color: #07c160; cursor: pointer; }

/* 账号设置弹窗 */
.account-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.account-name { font-size: 14px; font-weight: 500; }
.account-sub { font-size: 12px; color: #999; margin-top: 3px; }
.modal-btns.between { justify-content: space-between; align-items: center; }
.btns-right { display: flex; gap: 10px; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: #576b95;
  font-size: 13px;
}
.btn-link:hover { color: #3f5faf; text-decoration: underline; }
#my-avatar { cursor: pointer; }
#my-avatar:hover { outline: 2px solid rgba(255, 255, 255, .25); }

/* ---------- 轻提示 ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 18px;
  border-radius: 6px;
  max-width: 70vw;
  text-align: center;
  z-index: 1200;
  pointer-events: none;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9c9c9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b5b5b5; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .list-panel { width: 200px; }
  .msg-body { max-width: 74%; }
  .modal { width: calc(100vw - 40px); }
}

/* ---------- 群设置 / 群公告 ---------- */
.btn-header {
  height: 30px; padding: 0 14px;
  border: 1px solid #d8d8d8; border-radius: 5px;
  background: #fff; color: #576b95; font-size: 12px;
}
.btn-header:hover { background: #f2f2f2; }
.announcement-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  background: #fff7e6; border-bottom: 1px solid #ffe0a3;
  font-size: 12px; color: #7a5b1e;
}
.announcement-bar.empty { background: #fafafa; border-bottom-color: #eee; color: #aaa; }
.ann-label {
  flex-shrink: 0; background: #ffb020; color: #fff;
  padding: 2px 6px; border-radius: 3px; font-size: 11px;
}
.announcement-bar.empty .ann-label { background: #ccc; }
.ann-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-edit { background: none; border: none; color: #576b95; font-size: 12px; padding: 0; }
.ann-edit:hover { text-decoration: underline; }

/* ---------- 输入区工具 ---------- */
.input-tools { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.tool-btn {
  height: 28px; padding: 0 8px;
  border: 1px solid #ddd; border-radius: 4px;
  background: #fff; color: #666; font-size: 11px;
}
.tool-btn:hover { border-color: #07c160; color: #07c160; }

/* ---------- 附件消息 ---------- */
.bubble-attachment { padding: 6px; }
.msg-image {
  display: block; max-width: 240px; max-height: 240px;
  border-radius: 4px; cursor: zoom-in;
}
.file-card {
  display: flex; align-items: center; gap: 10px;
  min-width: 210px; padding: 4px 2px;
  text-decoration: none; color: #333;
}
.file-icon {
  width: 36px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #e8f0fe; color: #4a76b8; border-radius: 4px; font-size: 11px;
}
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.file-size { font-size: 11px; color: #999; }
.file-dl { font-size: 12px; color: #576b95; flex-shrink: 0; }
.file-card:hover .file-dl { text-decoration: underline; }

/* ---------- 已读回执 / 撤回 ---------- */
.read-receipt { font-size: 11px; color: #9a9a9a; margin-top: 4px; }
.msg-actions { margin-top: 3px; }
.btn-recall { background: none; border: none; padding: 0; color: #9a9a9a; font-size: 11px; }
.btn-recall:hover { color: #576b95; text-decoration: underline; }
.msg-row.recalled { justify-content: center; margin: 10px 0; }
.recalled-tip {
  background: #e4e4e4; color: #999; font-size: 12px;
  padding: 4px 12px; border-radius: 4px;
}
.lightbox { background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }

/* ---------- 弹窗扩展 ---------- */
.modal.wide { width: 420px; }
.modal-section-title {
  font-size: 12px; color: #888; margin: 16px 0 8px;
  padding-bottom: 5px; border-bottom: 1px solid #eee;
}
.ann-input {
  width: 100%; height: 64px; resize: vertical;
  border: 1px solid #ddd; border-radius: 6px;
  padding: 8px 10px; font-size: 13px; line-height: 1.5;
}
.ann-input:focus { border-color: #07c160; }
.ann-input:disabled { background: #f7f7f7; color: #999; }
.member-list, .member-pick { max-height: 150px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 5px 2px; font-size: 13px; }
.owner-tag {
  margin-left: auto; font-style: normal; font-size: 11px;
  color: #07c160; background: #eaf8f0; padding: 1px 6px; border-radius: 3px;
}
.confirm-text { font-size: 13px; line-height: 1.7; color: #555; margin-bottom: 8px; }
.btn-ok.danger { background: #e64340; border-color: #e64340; }
.btn-ok.danger:hover { background: #d53936; border-color: #d53936; }
.btn-remove {
  flex-shrink: 0; background: none; border: 1px solid #e6c3c3;
  color: #c55; border-radius: 4px; font-size: 11px; padding: 3px 7px;
}
.btn-remove:hover { background: #fdf0f0; border-color: #e64340; }
