* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f2f4f7; color: #1d2129; font-size: 15px;
}
button, input, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* 登录 */
#login-view {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100%; padding: 32px 24px;
  background: linear-gradient(160deg, #1b3b6f 0%, #245a94 55%, #2f79b8 100%);
}
.brand { text-align: center; color: #fff; margin-bottom: 28px; }
.brand .logo {
  width: 66px; height: 66px; line-height: 66px; margin: 0 auto 14px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  border-radius: 18px; font-size: 30px; font-weight: 700; letter-spacing: 1px;
}
.brand h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: 2px; }
.brand p { margin: 0; font-size: 13px; opacity: .82; }
.login-card { background: #fff; border-radius: 16px; padding: 20px 18px; box-shadow: 0 12px 32px rgba(11,32,64,.22); }
.login-card input {
  width: 100%; padding: 13px 14px; margin-bottom: 12px; border: 1px solid #e3e6eb;
  border-radius: 10px; outline: none; background: #fafbfc; transition: border-color .15s;
}
.login-card input:focus { border-color: #2f79b8; background: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border: 0; border-radius: 10px; background: #2f79b8; color: #fff;
  font-weight: 500; cursor: pointer; width: 100%;
}
.btn:active { opacity: .86; }
.btn.ghost { background: #eef3f9; color: #245a94; }
.btn.mini { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #e04b4b; }
.login-switch { text-align: center; margin-top: 14px; font-size: 13px; color: #5c6b80; }
.login-switch a { color: #2f79b8; text-decoration: none; }
.tip { margin-top: 14px; text-align: center; font-size: 12px; color: #8a97a8; }
.err { color: #e04b4b; font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* 主界面 */
#main-view { display: flex; flex-direction: column; height: 100%; }
.topbar {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: #1b3b6f; color: #fff;
}
.topbar .title { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.tabbody { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tabbar {
  flex: 0 0 54px; display: flex; background: #fff; border-top: 1px solid #e8ebf0;
}
.tabbar button {
  flex: 1; border: 0; background: none; color: #8a97a8; font-size: 11px; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.tabbar button .ico { font-size: 18px; line-height: 20px; }
.tabbar button.active { color: #2f79b8; }

/* 列表 */
.section-title { padding: 12px 14px 6px; font-size: 12px; color: #8a97a8; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: #fff;
  border-bottom: 1px solid #f0f2f5; cursor: pointer;
}
.row:active { background: #f7f9fc; }
.avatar {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: #2f79b8;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.group { background: #4a9d7f; }
.row .info { flex: 1 1 auto; min-width: 0; }
.row .name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12px; color: #8a97a8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { flex: 0 0 auto; text-align: right; font-size: 11px; color: #a6b0bd; }
.badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: #e04b4b; color: #fff; border-radius: 9px; font-size: 11px; text-align: center;
  margin-top: 5px;
}
.empty { padding: 40px 20px; text-align: center; color: #a6b0bd; font-size: 13px; }

/* 聊天 */
#chat-view { display: flex; flex-direction: column; height: 100%; background: #eceff4; }
.chat-top {
  flex: 0 0 52px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: #1b3b6f; color: #fff;
}
.chat-top .back { background: none; border: 0; color: #fff; font-size: 22px; padding: 4px 8px; cursor: pointer; }
.chat-top .ctitle { font-size: 16px; font-weight: 600; }
.chat-top .csub { font-size: 11px; opacity: .75; }
.chat-top .more { margin-left: auto; background: none; border: 0; color: #fff; font-size: 13px; padding: 6px; cursor: pointer; }
.chat-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 4px; }
.msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg .who { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: #2f79b8; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.msg.mine .who { background: #1b3b6f; }
.msg .who img { width: 100%; height: 100%; object-fit: cover; }
.bubble-wrap { max-width: 74%; }
.msg .sender { font-size: 11px; color: #8a97a8; margin-bottom: 3px; }
.bubble {
  background: #fff; padding: 9px 12px; border-radius: 10px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap; font-size: 14px;
}
.msg.mine .bubble { background: #c9e2ff; }
.bubble img { max-width: 180px; border-radius: 8px; display: block; }
.bubble .time { display: block; font-size: 10px; color: #9aa5b1; margin-top: 4px; text-align: right; }
.sys-msg { text-align: center; margin: 8px 0 14px; }
.sys-msg span { display: inline-block; background: rgba(0,0,0,.06); color: #6b7683; font-size: 11px; padding: 4px 10px; border-radius: 8px; }
.chat-input {
  flex: 0 0 auto; background: #f7f8fa; border-top: 1px solid #e3e6eb; padding: 8px 10px;
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid #dfe3e9; border-radius: 10px; padding: 9px 10px;
  max-height: 90px; min-height: 38px; outline: none; background: #fff; line-height: 1.4;
}
.chat-input .send { width: 62px; flex: 0 0 62px; padding: 9px 0; }
.btn-plus {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; border: 1px solid #dfe3e9;
  background: #fff; color: #4a5a70; font-size: 24px; line-height: 1; padding: 0 0 2px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.btn-plus.active { transform: rotate(45deg); background: #eaf2fb; color: #2f79b8; border-color: #cfe0f2; }
.chat-plus {
  display: none; flex: 0 0 auto; background: #f7f8fa; border-top: 1px solid #e3e6eb;
  padding: 14px 10px 16px; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.chat-plus.open { display: grid; }
.plus-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.plus-item:active .pi { background: #eef3f9; }
.plus-item .pi {
  width: 54px; height: 54px; border-radius: 16px; background: #fff; border: 1px solid #e6eaf0;
  display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1;
}
.plus-item em { font-style: normal; font-size: 12px; color: #5c6b80; }
.icp { text-align: center; font-size: 12px; color: #8a97a8; padding: 14px 0 18px; }
.icp a { color: #8a97a8; text-decoration: none; }
#login-view .icp { color: rgba(255,255,255,.72); margin-top: 10px; padding: 0; }
#login-view .icp a { color: rgba(255,255,255,.86); }

/* 我的 */
.card { background: #fff; border-radius: 12px; margin: 10px 12px; padding: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: #1d2129; }
.card .line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: #4a5a70; border-bottom: 1px dashed #eef1f5; }
.card .line:last-child { border-bottom: 0; }
.card input { width: 100%; padding: 10px; border: 1px solid #e3e6eb; border-radius: 8px; margin-bottom: 8px; }
.notice-item { padding: 10px 0; border-bottom: 1px dashed #eef1f5; font-size: 13px; }
.notice-item .nt { font-weight: 600; margin-bottom: 4px; }
.notice-item .nb { color: #5c6b80; white-space: pre-wrap; }
.notice-item .nd { color: #a6b0bd; font-size: 11px; margin-top: 5px; }

/* 弹层 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.38); display: flex; align-items: center;
  justify-content: center; padding: 24px; z-index: 50;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 360px; padding: 16px; max-height: 78vh; overflow-y: auto; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal .field { margin-bottom: 10px; }
.modal .field label { display: block; font-size: 12px; color: #8a97a8; margin-bottom: 5px; }
.modal input[type=text], .modal input[type=password], .modal textarea {
  width: 100%; padding: 10px; border: 1px solid #e3e6eb; border-radius: 8px; outline: none;
}
.modal .actions { display: flex; gap: 8px; margin-top: 14px; }
.modal .actions .btn { flex: 1; }
.pick-list { max-height: 34vh; overflow-y: auto; border: 1px solid #eef1f5; border-radius: 8px; }
.pick-list label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 13px; border-bottom: 1px solid #f4f6f9; }
.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: rgba(29,33,41,.86); color: #fff; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; z-index: 90; max-width: 80%; text-align: center;
}