* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #dfe9f3, #ffffff);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app {
  width: 1160px;
  height: 740px;
  background: #f7f7f7;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(0,0,0,0.08);
}

.sidebar {
  width: 100px;
  background: #1f2329;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 12px;
  gap: 18px;
}

.logo {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 20px;
}

.nav {
  width: 72px;
  padding: 11px 0;
  text-align: center;
  border-radius: 10px;
  color: #dbeafe;
  font-size: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top {
  height: 100px;
  background: #fff;
  border-bottom: 1px solid #e7e7e7;
  padding: 22px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top h1 {
  font-size: 30px;
  color: #111827;
}

.top p {
  color: #6b7280;
  margin-top: 5px;
  font-size: 17px;
}

.status {
  padding: 10px 18px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 16px;
}

.status.online {
  background: #dcfce7;
  color: #166534;
}

.status.offline {
  background: #fee2e2;
  color: #991b1b;
}

#appView {
  flex: 1;
  min-height: 0;
}

.content {
  height: 100%;
  overflow: auto;
  padding: 28px 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 26px 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
  border: 1px solid #eeeeee;
}

.card.wide {
  grid-column: 1 / -1;
}

.card h2 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #111827;
}

.card p {
  color: #4b5563;
  line-height: 1.7;
  font-size: 17px;
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.auth-card {
  width: 390px;
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  border: 1px solid #eee;
}

.auth-card h2 {
  margin-bottom: 22px;
  font-size: 24px;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

.auth-card input {
  margin-bottom: 14px;
}

input:focus {
  border-color: #22c55e;
}

button {
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #16a34a;
  color: white;
  font-size: 15px;
  cursor: pointer;
  padding: 0 18px;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-card button {
  width: 100%;
  margin-top: 6px;
}

.auth-card button.ghost {
  background: transparent;
  color: #16a34a;
}

.card button.danger {
  background: #ef4444;
  margin-top: 16px;
  width: 100%;
}

.msg {
  min-height: 24px;
  margin-top: 12px;
  color: #dc2626;
  font-size: 14px;
  text-align: center;
}

.msg.good {
  color: #16a34a;
}

.hidden {
  display: none !important;
}

.row {
  display: flex;
  gap: 12px;
}

.row input {
  flex: 1;
}

.list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list.empty {
  color: #6b7280;
  font-size: 15px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f9fafb;
  border: 1px solid #eeeeee;
  border-radius: 14px;
  padding: 12px 14px;
}

.user-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.user-meta {
  min-width: 0;
}

.user-name {
  font-weight: 700;
  color: #111827;
  font-size: 16px;
}

.user-sub {
  color: #6b7280;
  margin-top: 3px;
  font-size: 14px;
}

.user-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.user-actions button {
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
}

.user-actions .reject {
  background: #ef4444;
}

.chat-layout {
  height: 100%;
  display: flex;
  min-height: 0;
}

.chat-list-panel {
  width: 310px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  height: 62px;
  padding: 20px;
  font-size: 20px;
  font-weight: 800;
  border-bottom: 1px solid #f0f0f0;
}

.conversation-list {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

.conversation-list.empty {
  color: #6b7280;
  padding: 18px;
  font-size: 15px;
}

.conversation-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  align-items: center;
}

.conversation-item:hover,
.conversation-item.active {
  background: #f3f4f6;
}

.conversation-main {
  flex: 1;
  min-width: 0;
}

.conversation-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.conversation-name {
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  color: #9ca3af;
  font-size: 12px;
  flex: 0 0 auto;
}

.conversation-last {
  margin-top: 5px;
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  flex: 1;
  min-width: 0;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #6b7280;
}

.empty-title {
  font-size: 22px;
  font-weight: 800;
  color: #374151;
}

.empty-sub {
  margin-top: 8px;
  font-size: 15px;
}

.chat-box {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}

.chat-subtitle {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.voice-btn {
  background: #2563eb;
  height: 38px;
  border-radius: 10px;
}

.message-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.message-row {
  display: flex;
  margin-bottom: 14px;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 68%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.message-row.mine .message-bubble {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.message-content {
  color: #111827;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  margin-top: 5px;
  color: #6b7280;
  font-size: 11px;
  text-align: right;
}

.message-input-row {
  height: 72px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 12px;
  display: flex;
  gap: 10px;
}

.message-input-row input {
  flex: 1;
}

.message-input-row button {
  width: 90px;
}

.call-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.call-card {
  width: 340px;
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
}

.call-avatar {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 18px;
}

.call-title {
  font-size: 23px;
  font-weight: 900;
  color: #111827;
}

.call-status {
  margin-top: 8px;
  color: #6b7280;
  font-size: 15px;
}

.call-timer {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 900;
  color: #16a34a;
}

.call-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.call-actions button {
  min-width: 92px;
}

.call-accept {
  background: #16a34a;
}

.call-reject,
.call-hangup {
  background: #ef4444;
}

.call-mute {
  background: #374151;
}

@media (max-width: 768px) {
  body {
    align-items: stretch;
  }

  .app {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .sidebar {
    width: 74px;
    padding: 18px 8px;
  }

  .logo {
    width: 52px;
    height: 52px;
  }

  .nav {
    width: 58px;
    font-size: 14px;
  }

  .top {
    height: 88px;
    padding: 16px;
  }

  .top h1 {
    font-size: 23px;
  }

  .top p {
    font-size: 14px;
  }

  .content {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .card.wide {
    grid-column: auto;
  }

  .row {
    flex-direction: column;
  }

  .user-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-layout {
    flex-direction: column;
  }

  .chat-list-panel {
    width: 100%;
    height: 210px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .message-bubble {
    max-width: 86%;
  }

  .call-card {
    width: calc(100% - 36px);
  }
}

/* MOBILE_V5_PATCH_START */

/* 手机网页版适配补丁 */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f7f7f7;
  }

  body {
    display: block;
  }

  .app {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: block;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    height: 64px;
    z-index: 1000;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 7px 8px;
    gap: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  .logo {
    display: none;
  }

  .nav {
    width: 23%;
    height: 48px;
    padding: 0;
    font-size: 14px;
    border-radius: 12px;
  }

  .main {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 64px;
    width: 100vw;
    height: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .top {
    height: 72px;
    padding: 10px 14px;
    flex: 0 0 auto;
  }

  .top h1 {
    font-size: 22px;
    line-height: 1.1;
  }

  .top p {
    font-size: 13px;
    margin-top: 4px;
    max-width: 210px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status {
    font-size: 13px;
    padding: 7px 11px;
  }

  #appView {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  .auth-wrap {
    height: 100%;
    padding: 18px;
    align-items: center;
  }

  .auth-card {
    width: 100%;
    max-width: 390px;
    padding: 24px 20px;
    border-radius: 18px;
  }

  .content {
    height: 100%;
    display: block;
    overflow-y: auto;
    padding: 14px;
    padding-bottom: 22px;
  }

  .card {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 16px;
  }

  .card h2 {
    font-size: 19px;
    margin-bottom: 12px;
  }

  .card p {
    font-size: 15px;
  }

  .row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .row button {
    width: 100%;
  }

  .user-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .user-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-actions button {
    padding: 0 12px;
  }

  .chat-layout {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
  }

  .chat-list-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    border-right: none;
    border-bottom: none;
    background: #ffffff;
  }

  .panel-title {
    height: 54px;
    padding: 15px 16px;
    font-size: 20px;
  }

  .conversation-list {
    height: calc(100% - 54px);
    padding: 8px;
  }

  .conversation-item {
    padding: 12px;
    border-radius: 14px;
  }

  .chat-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }

  .chat-layout.mobile-chat-open .chat-list-panel {
    display: none;
  }

  .chat-layout.mobile-chat-open .chat-panel {
    z-index: 10;
  }

  .chat-header {
    height: 58px;
    padding: 8px 10px;
    gap: 8px;
  }

  .chat-title {
    font-size: 18px;
  }

  .chat-subtitle {
    font-size: 12px;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 38px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #111827;
    padding: 0;
    font-size: 20px;
    flex: 0 0 auto;
  }

  .voice-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    flex: 0 0 auto;
  }

  .message-list {
    padding: 12px;
  }

  .message-bubble {
    max-width: 82%;
    padding: 9px 12px;
    border-radius: 15px;
  }

  .message-content {
    font-size: 15px;
  }

  .message-input-row {
    height: 62px;
    padding: 8px;
    gap: 8px;
  }

  .message-input-row input {
    height: 44px;
    font-size: 15px;
  }

  .message-input-row button {
    width: 72px;
    height: 44px;
    padding: 0;
  }

  .chat-empty {
    padding: 20px;
    text-align: center;
  }

  .empty-title {
    font-size: 20px;
  }

  .empty-sub {
    font-size: 14px;
  }

  .call-modal {
    padding: 18px;
  }

  .call-card {
    width: 100%;
    max-width: 340px;
    border-radius: 22px;
    padding: 26px 20px;
  }

  .call-avatar {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    font-size: 30px;
  }

  .call-title {
    font-size: 21px;
  }

  .call-actions {
    gap: 10px;
  }

  .call-actions button {
    min-width: 86px;
    height: 42px;
    padding: 0 12px;
  }
}

@media (min-width: 769px) {
  .mobile-back-btn {
    display: none !important;
  }
}

/* MOBILE_V5_PATCH_END */


/* UNREAD_V5_PATCH_START */

.nav {
  position: relative;
}

.nav-unread-badge {
  position: absolute;
  top: 3px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239,68,68,0.35);
}

.conversation-time-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
}

.conversation-item.has-unread .conversation-name {
  font-weight: 900;
}

.conversation-item.has-unread .conversation-last {
  color: #111827;
  font-weight: 700;
}

@media (max-width: 768px) {
  .nav-unread-badge {
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 18px;
  }

  .unread-badge {
    min-width: 19px;
    height: 19px;
    font-size: 11px;
    line-height: 19px;
  }
}

/* UNREAD_V5_PATCH_END */

/* SOUND_FIX_V6_START */

.sound-unlock-btn {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 9998;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.sound-test-btn {
  margin-top: 12px;
  width: 100%;
  background: #f59e0b;
}

@media (max-width: 768px) {
  .sound-unlock-btn {
    right: 12px;
    bottom: 76px;
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }
}

/* SOUND_FIX_V6_END */


/* IMAGE_V5_PATCH_START */

.image-send-btn {
  width: 72px !important;
  background: #7c3aed;
  flex: 0 0 auto;
}

.chat-image-link {
  display: block;
  line-height: 0;
}

.chat-image {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 12px;
  object-fit: contain;
  cursor: pointer;
  background: #f3f4f6;
}

.message-row.mine .chat-image {
  background: #bbf7d0;
}

.image-uploading {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 768px) {
  .image-send-btn {
    width: 58px !important;
    padding: 0;
    font-size: 13px;
  }

  .chat-image {
    max-width: 210px;
    max-height: 230px;
  }

  .message-input-row {
    gap: 6px;
  }

  .message-input-row button {
    width: 64px;
  }
}

/* IMAGE_V5_PATCH_END */


/* PROFILE_V6_PATCH_START */

.user-avatar.has-avatar {
  background: #e5e7eb;
  overflow: hidden;
}

.user-avatar.has-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card {
  grid-column: 1 / -1;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.profile-avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-fields {
  flex: 1;
  min-width: 0;
}

.profile-fields label {
  display: block;
  color: #374151;
  font-weight: 800;
  margin-bottom: 8px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-actions button {
  min-width: 118px;
}

.avatar-upload-btn {
  background: #7c3aed;
}

.profile-save-btn {
  background: #16a34a;
}

@media (max-width: 768px) {
  .profile-row {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-avatar-preview {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    font-size: 28px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-actions button {
    width: 100%;
  }
}

/* PROFILE_V6_PATCH_END */


/* AVATAR_DISPLAY_FIX_V7_START */

.user-avatar.has-avatar,
.chat-message-avatar.has-avatar {
  background: #e5e7eb !important;
  overflow: hidden;
}

.user-avatar.has-avatar img,
.chat-message-avatar.has-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 聊天消息头像 */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-row.mine .chat-message-avatar {
  order: 2;
}

.chat-message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  flex: 0 0 auto;
  overflow: hidden;
}

.message-row.mine .chat-message-avatar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

@media (max-width: 768px) {
  .chat-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 13px;
  }

  .message-row {
    gap: 6px;
  }
}

/* AVATAR_DISPLAY_FIX_V7_END */


/* SELF_AVATAR_ENTRY_V7_START */

/* 只保留左侧导航顶部自己的头像入口 */
.logo.self-avatar-logo {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  user-select: none;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

.logo.self-avatar-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.24);
}

.logo.self-avatar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.logo.self-avatar-logo span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
}

.logo.self-avatar-logo::after {
  content: "编辑";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  line-height: 20px;
  background: rgba(0,0,0,0.48);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

/* 删除顶部中间那个头像按钮 */
#topSelfAvatarBtn,
.top-self-avatar-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .logo.self-avatar-logo {
    display: none;
  }
}

/* SELF_AVATAR_ENTRY_V7_END */




/* GROUP_REBUILD_V9_START */

/* 群聊重做版：只影响群聊页，不影响私聊、好友、设置 */
#groupsView.hidden {
  display: none !important;
}

#groupsView {
  width: 100%;
  height: calc(100vh - 114px);
  min-height: 620px;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #fff;
  box-sizing: border-box;
}

.yl-group-app {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.yl-group-left {
  min-width: 0;
  height: 100%;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yl-group-left-head {
  flex: 0 0 auto;
  padding: 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.yl-group-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yl-group-head-row h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
}

.yl-group-create-toggle {
  width: auto !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  background: #16a34a !important;
}

.yl-group-create {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.yl-group-create.hidden {
  display: none !important;
}

.yl-group-create input {
  width: 100%;
  box-sizing: border-box;
}

.yl-group-friend-list {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
}

.yl-group-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

.yl-group-check:hover {
  background: #f3f4f6;
}

.yl-group-check input {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 auto;
}

.yl-group-create-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.yl-group-create-actions button {
  flex: 1;
  height: 38px;
}

.yl-group-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background: #fff;
}

.yl-group-empty {
  padding: 28px 12px;
  text-align: center;
  color: #64748b;
  font-weight: 700;
}

.yl-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: 16px;
  cursor: pointer;
  position: relative;
  margin-bottom: 6px;
}

.yl-group-item:hover,
.yl-group-item.active {
  background: #f3f4f6;
}

.yl-group-logo {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.yl-group-item-main {
  min-width: 0;
  flex: 1;
}

.yl-group-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.yl-group-item-name {
  min-width: 0;
  color: #111827;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yl-group-item-time {
  color: #94a3b8;
  font-size: 12px;
  flex: 0 0 auto;
}

.yl-group-last {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yl-group-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}

.yl-group-right {
  min-width: 0;
  height: 100%;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yl-group-welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 800;
}

.yl-group-chat {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yl-group-chat.hidden,
.yl-group-welcome.hidden {
  display: none !important;
}

.yl-group-chat-head {
  flex: 0 0 auto;
  min-height: 76px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yl-group-back {
  display: none;
  width: auto !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  background: #e5e7eb !important;
  color: #111827 !important;
  flex: 0 0 auto;
}

.yl-group-title-wrap {
  min-width: 0;
  flex: 1;
}

.yl-group-title {
  font-size: 22px;
  line-height: 28px;
  color: #111827;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yl-group-sub {
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yl-group-members {
  max-width: 340px;
  color: #64748b;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yl-group-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafc;
  box-sizing: border-box;
}

.yl-group-input-row {
  flex: 0 0 auto;
  padding: 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.yl-group-img-btn {
  width: 72px !important;
  height: 48px !important;
  border-radius: 14px !important;
  background: #7c3aed !important;
  flex: 0 0 auto;
}

.yl-group-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  box-sizing: border-box;
}

.yl-group-send {
  width: 92px !important;
  height: 48px !important;
  border-radius: 14px !important;
  flex: 0 0 auto;
}

.yl-group-sender-name {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.message-row.mine .yl-group-sender-name {
  text-align: right;
}

.yl-group-nav-badge {
  position: absolute;
  top: 3px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 768px) {
  #groupsView {
    height: calc(100dvh - 70px);
    min-height: 0;
  }

  .yl-group-app {
    grid-template-columns: 1fr;
  }

  .yl-group-left {
    width: 100%;
    border-right: none;
  }

  .yl-group-app.yl-open .yl-group-left {
    display: none;
  }

  .yl-group-app:not(.yl-open) .yl-group-right {
    display: none;
  }

  .yl-group-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .yl-group-left-head {
    padding: 14px;
  }

  .yl-group-list {
    padding: 10px;
  }

  .yl-group-chat-head {
    min-height: 64px;
    padding: 10px 12px;
  }

  .yl-group-title {
    font-size: 18px;
    line-height: 24px;
  }

  .yl-group-members {
    display: none;
  }

  .yl-group-messages {
    padding: 12px;
  }

  .yl-group-input-row {
    padding: 10px;
    gap: 7px;
  }

  .yl-group-img-btn {
    width: 58px !important;
    height: 44px !important;
  }

  .yl-group-send {
    width: 64px !important;
    height: 44px !important;
  }

  .yl-group-input {
    height: 44px;
  }

  .yl-group-nav-badge {
    top: 4px;
    right: 8px;
    font-size: 10px;
  }
}

/* GROUP_REBUILD_V9_END */

/* GROUP_FULL_WIDTH_FINAL_V10_START */

/* 核心修复：groupsView 原本带 content 类，会被 display:grid 分成两列；
   群聊页必须像 messagesView 一样单独占满整个内容区域。 */
#appView > #groupsView.content.page-view:not(.hidden),
#appView > #groupsView.page-view:not(.hidden),
#groupsView:not(.hidden) {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}

#groupsView.hidden {
  display: none !important;
}

/* 群聊整体布局占满，左侧列表 + 右侧聊天 */
#groupsView .yl-group-app {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 350px minmax(0, 1fr) !important;
  overflow: hidden !important;
}

#groupsView .yl-group-left {
  width: 350px !important;
  min-width: 350px !important;
  max-width: 350px !important;
  height: 100% !important;
}

#groupsView .yl-group-right {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  overflow: hidden !important;
}

#groupsView .yl-group-chat {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
}

#groupsView .yl-group-chat:not(.hidden) {
  display: flex !important;
}

#groupsView .yl-group-messages {
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#groupsView .yl-group-input-row {
  width: 100% !important;
  min-width: 0 !important;
}

#groupsView .yl-group-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

#groupsView .yl-group-chat-head {
  width: 100% !important;
  min-width: 0 !important;
}

#groupsView .yl-group-title-wrap {
  min-width: 0 !important;
}

@media (max-width: 768px) {
  #groupsView:not(.hidden) {
    display: block !important;
    height: calc(100dvh - 70px) !important;
  }

  #groupsView .yl-group-app {
    grid-template-columns: 1fr !important;
  }

  #groupsView .yl-group-left {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  #groupsView .yl-group-app.yl-open .yl-group-left {
    display: none !important;
  }

  #groupsView .yl-group-app.yl-open .yl-group-right {
    display: flex !important;
  }

  #groupsView .yl-group-app:not(.yl-open) .yl-group-right {
    display: none !important;
  }
}

/* GROUP_FULL_WIDTH_FINAL_V10_END */

/* GROUP_MANAGE_V8_START */

.yl-group-manage-btn {
  width: auto !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  background: #2563eb !important;
  color: #fff !important;
  flex: 0 0 auto;
}

.yl-group-manage-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.yl-group-manage-mask.hidden {
  display: none !important;
}

.yl-group-manage-card {
  width: min(760px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  padding: 22px;
}

.yl-group-manage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.yl-group-manage-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 950;
  color: #111827;
}

.yl-group-manage-close {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  background: #e5e7eb !important;
  color: #111827 !important;
}

.yl-group-manage-section {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
  background: #f8fafc;
}

.yl-group-manage-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #111827;
}

.yl-group-name-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.yl-group-name-row input {
  flex: 1;
  min-width: 0;
}

.yl-group-name-row button {
  width: auto !important;
  min-width: 110px;
  height: 46px !important;
}

.yl-group-member-list,
.yl-group-invite-list {
  display: grid;
  gap: 8px;
}

.yl-group-member-row,
.yl-group-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}

.yl-group-member-left,
.yl-group-invite-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.yl-group-member-meta,
.yl-group-invite-meta {
  min-width: 0;
}

.yl-group-member-name,
.yl-group-invite-name {
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yl-group-member-sub,
.yl-group-invite-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.yl-group-owner-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 900;
}

.yl-group-remove-member,
.yl-group-danger-btn {
  width: auto !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  background: #ef4444 !important;
  color: #fff !important;
  flex: 0 0 auto;
}

.yl-group-invite-check {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 auto;
}

.yl-group-manage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.yl-group-manage-actions button {
  width: auto !important;
  min-width: 120px;
}

.yl-group-manage-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .yl-group-manage-mask {
    padding: 10px;
    align-items: flex-end;
  }

  .yl-group-manage-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 18px;
  }

  .yl-group-name-row {
    flex-direction: column;
  }

  .yl-group-name-row button,
  .yl-group-manage-actions button {
    width: 100% !important;
  }

  .yl-group-member-row,
  .yl-group-invite-row {
    align-items: flex-start;
  }

  .yl-group-manage-btn {
    height: 34px !important;
    padding: 0 12px !important;
  }
}

/* GROUP_MANAGE_V8_END */
