/**
 * 工具导航（工具 / 资源 / Skill）评论区
 *
 * 输入条在顶部、不要「N 条评论」；收起 = 扁胶囊 + 上箭头；
 * 展开 = 小圆角正常框（不要大胶囊）；点扁条才打开。
 * 图片/表情 + 灰取消；发送空着是灰，有内容才红。
 * 社区话题条 / 知识库章节评论不要用这套。
 */

.mytb-comments {
  margin-top: 32px;
  padding-top: 0;
  border-top: none;
}

.mytb-comments .myt-reply-composer {
  margin-top: 0;
}

.mytb-comments .myt-reply-composer--pill {
  padding: 8px 8px 8px 18px;
  border-radius: 9999px;
}

.mytb-comments .myt-reply-composer--pill.is-expanded {
  padding: 16px 18px 14px;
  border-radius: 14px;
  border-color: #cccccc;
}

.mytb-comments .myt-reply-composer--pill.myt-reply-composer--guest {
  padding: 14px 20px;
  border-radius: 14px;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-collapsed-row {
  min-height: 36px;
  gap: 8px;
}

.mytb-comments .myt-reply-placeholder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-collapsed-row:focus-visible {
  border-radius: 9999px;
}

/* 收起行 / 表单换层；外盒不做高度插值。 */
.myt-reply-js .mytb-comments .myt-reply-composer--pill:not(.is-expanded) .myt-reply-collapsed-row {
  display: flex;
}

.myt-reply-js .mytb-comments .myt-reply-composer--pill.is-expanded .myt-reply-collapsed-row {
  display: none;
}

.myt-reply-js .mytb-comments .myt-reply-composer--pill:not(.is-expanded) .myt-reply-composer__form {
  display: none;
}

.myt-reply-js .mytb-comments .myt-reply-composer--pill.is-expanded .myt-reply-composer__form {
  display: block;
  animation: mytb-composer-pop 0.14s ease-out;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-composer__input {
  min-height: 64px;
}

@keyframes mytb-composer-pop {
  from {
    opacity: 0.01;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mytb-comments .myt-reply-send-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  color: #999999;
}

.mytb-comments .myt-reply-send-icon svg {
  width: 18px;
  height: 18px;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-cancel,
.mytb-comments .myt-reply-composer--pill .myt-reply-submit {
  border-radius: 9999px;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-submit {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-submit,
.mytb-comments .myt-reply-composer--pill .myt-reply-submit:disabled {
  background: #ededed;
  color: #999999;
  opacity: 1;
  cursor: default;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-submit:not(:disabled) {
  background: #e03030;
  color: #ffffff;
  cursor: pointer;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-submit:hover:not(:disabled) {
  background: #c52a2a;
}

.mytb-comments .myt-reply-composer--pill .myt-reply-submit:focus-visible {
  outline-color: #111111;
}

.mytb-reply-to {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 330;
  line-height: 1.4;
  color: #666666;
}

.mytb-reply-to[hidden] {
  display: none;
}

.mytb-reply-to__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #999999;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.mytb-reply-to__clear:hover {
  background: #f5f5f5;
  color: #222222;
}

.mytb-reply-to__clear:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 2px;
}

.mytb-comments__rule {
  height: 0;
  margin: 16px 0 4px;
  border: 0;
  border-top: 1px solid #ededed;
}

.mytb-comments__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mytb-comments__list > li {
  border-top: 1px solid #ededed;
}

.mytb-comments__list > li:first-child {
  border-top: none;
}

.mytb-comments__item.is-replyable {
  cursor: pointer;
}

.mytb-comments__reply {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #666666;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.mytb-comments__reply:hover,
.mytb-comments__reply:focus-visible {
  color: #e03030;
}

.mytb-comments__reply:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 2px;
}

.mytb-comments .comment-reply-link {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 767px) {
  .mytb-comments .myt-reply-composer--pill .myt-reply-collapsed-row {
    min-height: 44px;
  }

  .mytb-comments .myt-reply-send-icon,
  .mytb-reply-to__clear {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .myt-reply-js .mytb-comments .myt-reply-composer--pill.is-expanded .myt-reply-composer__form,
  .mytb-comments .myt-reply-composer--pill .myt-reply-submit {
    animation: none;
    transition: none;
  }
}
