.sdl-comments {
  --sdl-c-accent: #ff4d4f;
  --sdl-c-text: #1f1f1f;
  --sdl-c-sub: rgba(0, 0, 0, 0.45);
  --sdl-c-line: #f0f0f0;
  --sdl-c-bg: #ffffff;
  --sdl-c-chip: #f6f6f6;
  --sdl-c-like: #ff4d4f;
  width: 100%;
  margin: 24px 0 40px;
  background: var(--sdl-c-bg);
  border-radius: 12px;
  box-sizing: border-box;
  padding: 20px 22px 12px;
  color: var(--sdl-c-text);
  text-align: left;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.sdl-comments.sdl-comments--dark {
  --sdl-c-text: rgba(255, 255, 255, 0.88);
  --sdl-c-sub: rgba(255, 255, 255, 0.45);
  --sdl-c-line: rgba(255, 255, 255, 0.08);
  --sdl-c-bg: #1a1a2a;
  --sdl-c-chip: #262634;
}

.sdl-comments[hidden] {
  display: none !important;
}

.sdl-c-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.sdl-c-title {
  font-size: 18px;
  font-weight: 600;
}

.sdl-c-count {
  font-size: 13px;
  color: var(--sdl-c-sub);
}

.sdl-c-composer {
  position: relative;
  margin-bottom: 18px;
  border: 1px solid var(--sdl-c-line);
  border-radius: 12px;
  background: var(--sdl-c-chip);
}

.sdl-c-composer textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--sdl-c-text);
  border-radius: 12px 12px 0 0;
  padding: 12px 14px 8px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 22px;
  outline: none;
}

.sdl-c-composer textarea:focus {
  box-shadow: none;
}

.sdl-c-composer:focus-within {
  border-color: var(--sdl-c-accent);
}

.sdl-c-pending {
  padding: 0 12px;
}

.sdl-c-composer-bar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--sdl-c-line);
}

.sdl-c-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sdl-c-tool,
.sdl-c-at {
  appearance: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--sdl-c-line);
  border-radius: 16px;
  background: var(--sdl-c-bg);
  color: var(--sdl-c-text);
  cursor: pointer;
  font-size: 13px;
  line-height: 30px;
  white-space: nowrap;
}

.sdl-c-tool:hover,
.sdl-c-at:hover {
  border-color: var(--sdl-c-accent);
  color: var(--sdl-c-accent);
}

.sdl-c-send {
  appearance: none;
  flex: none;
  border: 0;
  background: var(--sdl-c-accent);
  color: #fff;
  height: 32px;
  min-width: 72px;
  padding: 0 18px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.sdl-c-send:hover {
  filter: brightness(1.06);
}

.sdl-c-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sdl-c-mention {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: var(--sdl-c-bg);
  border: 1px solid var(--sdl-c-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow: auto;
  margin-top: 4px;
}

.sdl-c-mention[hidden] {
  display: none !important;
}

.sdl-c-mention button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--sdl-c-text);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
}

.sdl-c-mention button:hover,
.sdl-c-mention button.active {
  background: var(--sdl-c-chip);
}

.sdl-c-mention-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffccc7;
  color: #cf1322;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.sdl-c-mention-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sdl-c-mention-meta b {
  font-weight: 600;
}

.sdl-c-mention-meta small {
  color: var(--sdl-c-sub);
  font-size: 12px;
}

.sdl-c-mention-empty {
  padding: 14px;
  color: var(--sdl-c-sub);
  font-size: 13px;
}

.sdl-c-empty {
  padding: 28px 0 20px;
  text-align: center;
  color: var(--sdl-c-sub);
  font-size: 13px;
}

.sdl-c-item {
  padding: 14px 0;
  border-top: 1px solid var(--sdl-c-line);
}

.sdl-c-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sdl-c-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffccc7;
  color: #cf1322;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sdl-c-name {
  font-size: 14px;
  font-weight: 600;
}

.sdl-c-reply-to {
  font-size: 12px;
  color: var(--sdl-c-sub);
  font-weight: 400;
}

.sdl-c-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--sdl-c-sub);
}

.sdl-c-body {
  font-size: 14px;
  line-height: 22px;
  padding-left: 40px;
  word-break: break-word;
}

.sdl-c-atname {
  color: #1677ff;
  font-weight: 500;
}

.sdl-c-actions {
  display: flex;
  gap: 16px;
  padding: 8px 0 0 40px;
}

.sdl-c-actions button {
  border: 0;
  background: transparent;
  color: var(--sdl-c-sub);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.sdl-c-actions button.liked {
  color: var(--sdl-c-like);
}

.sdl-c-replies {
  margin: 8px 0 0 40px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--sdl-c-line);
}

.sdl-c-item.reply .sdl-c-body,
.sdl-c-item.reply .sdl-c-actions {
  padding-left: 40px;
}

.sdl-c-pin {
  font-size: 11px;
  color: #ff4d4f;
  background: #fff1f0;
  border-radius: 4px;
  padding: 0 6px;
  margin-left: 4px;
  font-weight: 600;
}

.sdl-comments--dark .sdl-c-pin {
  background: rgba(255, 77, 79, 0.18);
}

.sdl-c-item.pinned {
  background: rgba(255, 77, 79, 0.04);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.sdl-c-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 0 40px;
}

.sdl-c-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--sdl-c-chip);
  border: 1px solid var(--sdl-c-line);
}

.sdl-c-file,
.sdl-c-video {
  width: 220px;
  min-height: 64px;
  border: 1px solid var(--sdl-c-line);
  background: var(--sdl-c-chip);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: inherit;
}

.sdl-c-file b,
.sdl-c-video b {
  font-size: 13px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sdl-c-file span,
.sdl-c-video span {
  font-size: 12px;
  color: var(--sdl-c-sub);
}

.sdl-c-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.sdl-c-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sdl-c-chip);
  border: 1px solid var(--sdl-c-line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}

.sdl-c-chip button {
  border: 0;
  background: transparent;
  color: var(--sdl-c-sub);
  cursor: pointer;
}

.sdl-c-preview {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sdl-c-preview[hidden] {
  display: none !important;
}

.sdl-c-preview img,
.sdl-c-preview iframe,
.sdl-c-preview embed {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  border: 0;
  border-radius: 8px;
  background: #111;
}

.sdl-c-preview img {
  object-fit: contain;
  cursor: zoom-out;
}

.sdl-c-preview iframe,
.sdl-c-preview embed {
  width: min(1100px, 92vw);
  height: 86vh;
  background: #fff;
}

.sdl-c-preview-close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 8px;
  height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

.sdl-c-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  background: var(--sdl-c-bg);
  border: 1px solid var(--sdl-c-line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  max-height: 280px;
  overflow: auto;
  margin-top: 4px;
}

.sdl-c-picker[hidden] {
  display: none !important;
}

.sdl-c-picker input {
  width: calc(100% - 16px);
  margin: 8px;
  height: 32px;
  border: 1px solid var(--sdl-c-line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--sdl-c-chip);
  color: var(--sdl-c-text);
}

.sdl-c-picker button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--sdl-c-text);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

.sdl-c-picker button:hover {
  background: var(--sdl-c-chip);
}

@media (max-width: 768px) {
  .sdl-comments {
    margin: 12px 0 16px;
    padding: 14px 12px 8px;
    border-radius: 8px;
  }
  .sdl-c-body,
  .sdl-c-actions,
  .sdl-c-media {
    padding-left: 0;
  }
  .sdl-c-replies {
    margin-left: 8px;
  }
  .sdl-c-img {
    width: 96px;
    height: 96px;
  }
}
