.tg-group-avatar-box {
  overflow: hidden;
  border-radius: 0.7rem;
}

.tg-group-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tg-group-initial,
.tg-topic-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.tg-group-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: flex-start;
  gap: 4px;
  width: auto;
  height: auto;
  margin: 12px 20px 0;
  padding: 3px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.tg-group-switch button {
  flex: 0 0 auto;
  width: auto;
  height: 32px;
  min-width: 84px;
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 32px;
  cursor: pointer;
}

.tg-group-switch button[aria-pressed="true"] {
  background: #eff6ff;
  color: #1d4ed8;
}

.tg-topic-mode [data-tg-group-row],
.tg-topic-mode [data-tg-group-select],
.tg-topic-mode [data-tg-group-tool],
.tg-channel-mode [data-tg-group-row],
.tg-channel-mode [data-tg-group-select],
.tg-channel-mode [data-tg-group-tool] {
  display: none !important;
}

.tg-topic-panel {
  display: none;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.tg-topic-mode .tg-topic-panel,
.tg-channel-mode .tg-topic-panel {
  display: block;
}

.tg-topic-hint {
  padding: 10px 14px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.tg-channel-refresh {
  border-color: #e5e7eb !important;
  color: #334155 !important;
}

.tg-topic-row.is-selected {
  box-shadow: inset 3px 0 0 #2563eb;
}

.tg-topic-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.tg-topic-tools button,
.tg-topic-row button {
  border: 1px solid #fecdd3;
  background: #fff;
  color: #e11d48;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.tg-topic-tools button:disabled,
.tg-topic-row button:disabled {
  opacity: 0.45;
  cursor: default;
}

.tg-topic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
  cursor: pointer;
}

.tg-topic-row.is-selected {
  background: #eff6ff;
}

.tg-topic-icon-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
}

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

.tg-topic-title {
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-topic-meta {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 11px;
}

.tg-topic-empty,
.tg-topic-note {
  padding: 18px 4px;
  color: #64748b;
  font-size: 13px;
}

.tg-topic-confirm {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}

.tg-topic-confirm section {
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.tg-topic-confirm h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
}

.tg-topic-confirm p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.tg-topic-confirm div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.tg-topic-confirm button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.tg-topic-confirm button[data-ok] {
  border-color: #e11d48;
  background: #e11d48;
  color: #fff;
}

.dark .tg-group-switch,
.dark .tg-topic-tools button,
.dark .tg-topic-row button,
.dark .tg-topic-confirm section,
.dark .tg-topic-confirm button {
  background: #111827;
  color: #e5e7eb;
  border-color: #334155;
}

.dark .tg-group-switch button[aria-pressed="true"] {
  background: #1e3a8a;
  color: #dbeafe;
}

.dark .tg-topic-title,
.dark .tg-topic-confirm h3 {
  color: #f8fafc;
}

.dark .tg-topic-panel,
.dark .tg-topic-tools {
  border-color: #1f2937;
  background: #0f172a;
}

.dark .tg-topic-row {
  border-top-color: #1f2937;
}

.dark .tg-topic-row.is-selected {
  background: rgba(30, 58, 138, 0.45);
}

.tg-topic-hint {
  margin: 0;
  padding: 8px 12px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.dark .tg-topic-hint {
  color: #94a3b8;
}

.tg-group-avatar-box > .tg-group-avatar,
.tg-group-avatar-box > .tg-group-initial {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.tg-group-avatar-under {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
