/* 收藏页 */

#view-favorites.view-favorites {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 !important;
  background: #f7f7f7 !important;
}

#main-app.silas-phone-root.favorites-active #view-favorites.view-favorites:not(.hidden) {
  position: absolute;
  inset: 0;
  z-index: 12;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

#app-root:has(#main-app.favorites-active:not(.hidden)) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

#main-app.silas-phone-root.favorites-active {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.favorites-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.favorites-top-bar {
  flex-shrink: 0;
  height: calc(76px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--ui-accent-bar, #efbfd6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  position: relative;
}

.favorites-top-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #4a3a42;
}

.favorites-hand-back {
  position: absolute;
  left: 18px;
  bottom: 10px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.42);
  font-size: 1.25rem;
  cursor: pointer;
}

.favorites-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px 0;
}

.favorites-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  color: #666;
}

.favorites-tab.is-active {
  background: var(--ui-accent-bar, #efbfd6);
  color: #4a3a42;
}

.favorites-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
}

#favorites-panel-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#favorites-messages-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  width: 100%;
}

#favorites-panel-moments {
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.favorites-card {
  position: relative;
  background: #fff;
  border: 2px solid var(--ui-accent-border, #efbfd6);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
}

.favorites-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.favorites-card-author {
  font-weight: 600;
  color: #444;
  font-size: 0.95rem;
}

.favorites-card-time {
  font-size: 0.75rem;
  color: #999;
}

.favorites-card-body {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.favorites-card-images {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.favorites-card-images img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.favorites-card-star {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #f0b429;
  font-size: 1rem;
}

.favorites-msg-card {
  position: relative;
  background: #fff;
  border: 2px solid var(--ui-accent-border, #efbfd6);
  border-radius: 16px;
  padding: 14px 40px 14px 16px;
}

.favorites-msg-meta {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #999;
}

.favorites-msg-unfav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.favorites-msg-batches {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.favorites-msg-contact-group {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.favorites-msg-contact-title {
  margin: 0;
  padding: 14px 16px 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #5a4a52;
  background: rgba(239, 191, 214, 0.22);
  border-bottom: 1px solid rgba(239, 191, 214, 0.35);
}

.favorites-msg-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.favorites-msg-batch-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.favorites-msg-batch-row {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  padding: 14px 12px 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.favorites-msg-batch-preview {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.favorites-msg-batch-meta {
  font-size: 0.75rem;
  color: #999;
}

.favorites-msg-menu-btn {
  flex-shrink: 0;
  width: 44px;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  align-self: stretch;
}

.favorites-msg-fav-menu {
  position: fixed;
  z-index: 1500;
  min-width: 140px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.favorites-msg-fav-menu.hidden {
  display: none !important;
}

.favorites-msg-fav-menu button {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #c0392b;
  cursor: pointer;
}

.favorites-msg-fav-menu button:active {
  background: rgba(239, 191, 214, 0.25);
}

.favorites-msg-detail-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 12px 4px;
  border-bottom: 1px solid rgba(239, 191, 214, 0.4);
  width: 100%;
  box-sizing: border-box;
}

.favorites-msg-detail-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #444;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 4px;
}

.favorites-msg-detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.favorites-msg-detail-back {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  color: #666;
  flex-shrink: 0;
}

.favorites-msg-thread-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 8px 24px;
  width: 100%;
  box-sizing: border-box;
}

.chat-profile-modal-root {
  z-index: 1400 !important;
}

.chat-profile-modal-root .moments-profile-card {
  position: relative;
  z-index: 1;
}

.avatar-chat-profile-tap {
  cursor: pointer;
}

#silas-header-avatar-ai.avatar-chat-profile-tap,
#silas-header-avatar-me.avatar-chat-profile-tap {
  cursor: pointer;
}

.favorites-msg-batches {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#favorites-msg-detail-thread.chat-thread {
  min-height: 100%;
}

.chat-profile-card .chat-profile-av-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0 auto 8px;
  display: block;
}

.chat-profile-card .chat-profile-av-wrap {
  margin-top: 18px;
}

.chat-profile-menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #666;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.chat-profile-menu {
  position: absolute;
  top: 48px;
  right: 10px;
  z-index: 3;
  min-width: 140px;
  padding: 6px 0;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chat-profile-menu.hidden {
  display: none !important;
}

.chat-profile-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: #333;
}

.chat-profile-menu-item:active {
  background: #f3f3f3;
}

.chat-profile-sig-btn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
}

.chat-profile-sig-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-profile-sig-btn:not(:disabled):active {
  opacity: 0.72;
}

.chat-profile-card-sig {
  min-height: 48px;
}

.chat-profile-sig-empty {
  color: #bbb;
  font-size: 0.85rem;
}

.avatar-chat-profile-tap {
  cursor: pointer;
}

.favorites-empty {
  text-align: center;
  color: #999;
  padding: 40px 16px;
  font-size: 0.9rem;
}
