/* Collaboration workspace enhancements */
#modal-host {
  display: contents;
}

.search-result-group {
  display: grid;
  gap: 5px;
  padding: 8px 10px 14px;
}

.search-result-group h3 {
  margin: 6px 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.search-result:hover { background: rgba(126, 194, 169, .13); }
.search-result > svg { width: 20px; color: #438b75; }
.search-result > span { display: grid; min-width: 0; }
.search-result strong, .search-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--text-muted); }

.composer-reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 10px 8px;
  padding: 9px 12px;
  border-left: 3px solid #57aa8f;
  border-radius: 8px;
  background: #eff9f4;
}

.composer-reply > span { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 7px; min-width: 0; }
.composer-reply svg { grid-row: span 2; width: 17px; }
.composer-reply small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.composer-reply button { border: 0; background: transparent; color: var(--text-muted); }

.message-action-menu > summary:hover { transform: translateY(-1px); }
.message-action-menu[open] .message-actions { animation: message-menu-in .14s ease-out both; }
@keyframes message-menu-in { from { opacity: 0; transform: translateY(-3px); } }
.message-actions button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 25px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #607870;
}
.message-actions button:hover { background: #eaf7f1; color: #18795e; }
.message-actions svg { width: 15px; height: 15px; }

.message-reference {
  display: grid;
  width: min(100%, 360px);
  margin-bottom: 5px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid rgba(29, 132, 99, .45);
  border-radius: 7px;
  background: rgba(243, 249, 246, .86);
  color: inherit;
  text-align: left;
}
.message-reference strong { font-size: 11px; color: #237e63; }
.message-reference span { overflow: hidden; font-size: 12px; color: #62756f; text-overflow: ellipsis; white-space: nowrap; }
.forward-label { display: flex; align-items: center; gap: 5px; margin: 0 4px 5px; color: #6e827b; font-size: 11px; }
.forward-label svg { width: 13px; }
.message-row.is-highlighted .message-stack { animation: message-highlight 1.8s ease; }
@keyframes message-highlight { 0%, 100% { filter: none; } 25% { filter: drop-shadow(0 0 12px rgba(244, 190, 65, .8)); } }

.audio-message { grid-template-columns: auto minmax(170px, 320px) auto; }
.audio-message audio { width: 100%; min-width: 170px; height: 34px; }
.audio-message [data-action="audio-rate"] {
  min-width: 36px;
  height: 28px;
  border: 1px solid #cbe1d9;
  border-radius: 999px;
  background: #fff;
  color: #27765f;
  font-weight: 700;
}

.video-message { overflow: hidden; width: min(420px, 72vw); border-radius: 14px; background: #18211e; }
.video-message video { display: block; width: 100%; max-height: 320px; background: #111; }
.video-message > span { display: flex; align-items: center; gap: 7px; padding: 8px 10px; color: #eef7f3; font-size: 12px; }
.video-message > span > button { display: grid; place-items: center; margin-left: auto; border: 0; background: transparent; color: inherit; }
.video-message svg { width: 16px; }

.gallery-dialog { width: min(980px, 94vw); }
.gallery-stage {
  display: grid;
  place-items: center;
  overflow: auto;
  min-height: 55vh;
  max-height: 72vh;
  background: radial-gradient(circle, #29332f, #111714);
}
.gallery-stage img { max-width: 90%; max-height: 65vh; object-fit: contain; transition: transform .18s ease; }
.gallery-toolbar { justify-content: center !important; }
.gallery-toolbar button, .gallery-toolbar a { min-width: 40px; }

.detail-wide-action, .pinned-message {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dceae4;
  border-radius: 10px;
  background: #f8fcfa;
  color: #315d50;
  text-align: left;
}
.detail-wide-action { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.detail-wide-action svg { width: 17px; }
.pinned-message { overflow: hidden; margin-top: 6px; text-overflow: ellipsis; white-space: nowrap; }
.pinned-message-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; gap: 5px; }
.pinned-message-row > button:last-child { display: grid; width: 28px; height: 28px; margin-top: 6px; place-items: center; border: 0; border-radius: 8px; background: #f2f6f4; color: var(--text-muted); }
.pinned-message-row svg { width: 14px; }
.favorites-dialog { width: min(620px, 92vw); }
.favorite-list { display: grid; gap: 7px; max-height: 60vh; overflow: auto; }
.favorite-list > button { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #dbe9e3; border-radius: 11px; background: #f9fcfa; color: inherit; text-align: left; }
.favorite-list > button > svg { width: 17px; color: #cf9a27; }
.favorite-list > button > span { display: grid; min-width: 0; }
.favorite-list small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }

.group-management-dialog { width: min(760px, 94vw); }
.group-add-member { display: flex; gap: 8px; }
.group-add-member select { flex: 1; }
.group-add-member select, .group-add-member button {
  min-height: 42px;
  border: 1px solid #d3e3dd;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
}
.group-member-admin-list { display: grid; gap: 7px; margin-top: 8px; }
.group-member-admin-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border-radius: 11px;
  background: #f7faf8;
}
.group-member-admin-list > div > span:not(.avatar) { display: grid; min-width: 80px; }
.group-member-admin-list small { color: var(--text-muted); }
.member-admin-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.member-admin-actions button {
  padding: 5px 7px;
  border: 1px solid #d7e5df;
  border-radius: 7px;
  background: #fff;
  color: #4b675e;
  font-size: 11px;
}
.setting-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #d9e8e2; border-radius: 11px; }
.setting-check input { margin-top: 3px; }
.setting-check span { display: grid; }
.setting-check small { color: var(--text-muted); }
.setting-check.is-danger { border-color: #f0d7d2; background: #fff8f6; }
.contact-picker-group { display: grid; gap: 4px; }
.contact-picker-group h4 { margin: 10px 8px 3px; color: var(--text-muted); font-size: 11px; }
.contact-picker label.is-blocked { opacity: .55; }

body.is-file-dragging::after {
  content: "松开即可批量发送文件";
  position: fixed;
  inset: 22px;
  z-index: 9999;
  display: grid;
  place-items: center;
  border: 3px dashed #3d9a7d;
  border-radius: 24px;
  background: rgba(232, 249, 241, .94);
  color: #176c53;
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 800;
  pointer-events: none;
}

@media (max-width: 420px) {
  .chat-actions .icon-button:nth-child(2) { display: none; }
  .profile-hero { display: flex; flex-direction: column; align-items: flex-start; }
  .profile-actions { width: 100%; }
  .profile-actions button { flex: 1; }
  .group-cover { display: flex; flex-direction: column; align-items: flex-start; }
  .group-metrics { width: 100%; }
  .content-header > div:last-child .button-primary span { display: none; }
  .safety-card { align-items: flex-start; flex-direction: column; }
  .setting-rows > label { align-items: flex-start; }
  .dialog-header, .blueprint-header { padding: 18px; }
  .dialog-search { margin-right: 18px; margin-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
