/* app/web/user/css/user-comments.css */

/* 整个评论区 */
.comment-panel {
  margin-top: 26px;
  padding: 0 0 36px;
  border-top: 1px solid #e5e7eb;
}

/* 评论标题行 */
.comment-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 34px;
  padding-top: 24px;
  margin-bottom: 22px;
}

.comment-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-head strong {
  font-size: 24px;
  line-height: 1;
  color: #18191c;
  font-weight: 700;
}

.comment-head span {
  font-size: 15px;
  color: #9499a0;
}

.comment-sort {
  display: flex;
  align-items: center;
  gap: 0;
}

.comment-sort-btn {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #61666d;
  font-size: 14px;
  padding: 0 14px;
  line-height: 20px;
}

.comment-sort-btn + .comment-sort-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 1px;
  height: 14px;
  background: #d8dce0;
}

.comment-sort-btn.active {
  color: #00aeec;
  font-weight: 700;
}

.comment-sort-btn:hover {
  color: #00aeec;
}

/* 输入框区域 */
.comment-editor {
  display: flex;
  gap: 18px;
  margin-bottom: 34px;
  padding-right: 0;
}

.comment-editor-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #edf0f3;
}

.comment-editor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 兼容老结构：如果页面里没有 comment-editor-avatar */
.comment-editor > textarea:first-child {
  margin-left: 0;
}

.comment-editor-main {
  flex: 1;
  min-width: 0;
}

.comment-editor textarea {
  width: 100%;
  height: 58px;
  min-height: 58px;
  resize: none;
  display: block;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  padding: 14px 16px;
  outline: none;
  font-size: 15px;
  line-height: 1.5;
  color: #18191c;
  background: #f1f2f3;
  transition: border-color .18s ease, background .18s ease, height .18s ease;
}

.comment-editor textarea::placeholder {
  color: #9499a0;
}

.comment-editor textarea:focus {
  height: 64px;
  background: #fff;
  border-color: #c9ccd0;
}

.comment-editor-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.comment-editor-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9499a0;
  font-size: 13px;
}

.comment-tool-btn {
  width: 32px;
  height: 28px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #fff;
  color: #61666d;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.comment-tool-btn:hover {
  color: #00aeec;
  border-color: #00aeec;
  background: #f5fbff;
}

.comment-forward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #61666d;
  cursor: pointer;
  user-select: none;
  margin-left: 6px;
}

.comment-forward input {
  width: 14px;
  height: 14px;
  margin: 0;
}

#commentSendBtn {
  width: 82px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: #00aeec;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: background .18s ease, opacity .18s ease;
}

#commentSendBtn:hover {
  background: #00a1d6;
}

#commentSendBtn:disabled {
  background: #7fd6f5;
  cursor: not-allowed;
  opacity: .75;
}

/* 如果你没改 HTML，老结构兜底 */
.comment-editor > textarea:first-child + #commentSendBtn {
  width: 86px;
  height: 58px;
  align-self: flex-start;
}

/* 评论列表 */
.comment-list {
  display: flex;
  flex-direction: column;
}

/* 一级评论 */
.comment-item {
  display: flex;
  gap: 18px;
  padding: 18px 0 20px;
  border-bottom: 1px solid #f1f2f3;
}

.comment-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #edf0f3;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 7px;
  font-size: 14px;
  color: #fb7299;
  font-weight: 700;
}

.comment-content {
  font-size: 15px;
  color: #18191c;
  line-height: 1.75;
  word-break: break-word;
  white-space: pre-wrap;
}

.comment-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #9499a0;
  font-size: 13px;
}

.comment-action {
  border: 0;
  background: transparent;
  color: #9499a0;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.comment-action:hover,
.comment-action.active {
  color: #00aeec;
}

/* 二级回复 */
.comment-replies {
  margin-top: 14px;
  padding-left: 0;
}

.comment-reply-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
}

.comment-reply-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #edf0f3;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-reply-main {
  flex: 1;
  min-width: 0;
}

.comment-reply-content {
  font-size: 14px;
  color: #18191c;
  line-height: 1.65;
  word-break: break-word;
}

.comment-reply-content .reply-name {
  color: #fb7299;
  font-weight: 700;
  margin-right: 4px;
}

.comment-reply-content .reply-to {
  color: #9499a0;
  margin: 0 4px;
}

.comment-more-reply {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: #00aeec;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.comment-more-reply:hover {
  color: #008ac5;
}

/* 回复输入框 */
.comment-reply-editor {
  margin-top: 14px;
  gap: 10px;
}

.comment-reply-editor .comment-editor-main {
  width: 100%;
}

.comment-reply-editor textarea {
  height: 48px;
  min-height: 48px;
  font-size: 14px;
}

.comment-reply-editor .comment-editor-bottom {
  margin-top: 8px;
}

.comment-reply-editor #commentSendBtn,
.comment-reply-editor button {
  height: 34px;
}

/* 加载更多 */
.comment-more-wrap {
  text-align: center;
  margin-top: 24px;
}

#commentMoreBtn {
  min-width: 136px;
  border: 1px solid #e3e5e7;
  background: #fff;
  border-radius: 999px;
  padding: 8px 26px;
  cursor: pointer;
  color: #61666d;
  font-size: 14px;
}

#commentMoreBtn:hover {
  color: #00aeec;
  border-color: #00aeec;
  background: #f5fbff;
}

/* 空状态 */
.comment-empty,
.comment-list .empty {
  padding: 34px 0;
  text-align: center;
  color: #9499a0;
  background: transparent;
  font-size: 15px;
}

/* 移动端 */
@media (max-width: 768px) {
  .comment-panel {
    margin-top: 18px;
    padding-bottom: 28px;
  }

  .comment-head {
    gap: 18px;
    padding-top: 18px;
    margin-bottom: 16px;
  }

  .comment-head strong {
    font-size: 21px;
  }

  .comment-editor {
    gap: 10px;
    margin-bottom: 24px;
  }

  .comment-editor-avatar {
    width: 40px;
    height: 40px;
  }

  .comment-editor textarea {
    height: 54px;
    min-height: 54px;
    font-size: 14px;
    padding: 12px;
  }

  .comment-editor-bottom {
    align-items: flex-start;
    gap: 10px;
  }

  .comment-editor-tools {
    flex-wrap: wrap;
    gap: 8px;
  }

  #commentSendBtn {
    width: 70px;
    height: 36px;
    flex-shrink: 0;
  }

  .comment-avatar {
    width: 40px;
    height: 40px;
  }

  .comment-item {
    gap: 10px;
  }

  .comment-meta {
    gap: 12px;
    flex-wrap: wrap;
  }
}

/* 评论 @ 用户面板 */
.comment-editor-main {
  position: relative;
}

.comment-mention-panel {
  position: absolute;
  left: 0;
  top: 68px;
  width: 360px;
  max-height: 360px;
  display: none;
  z-index: 60;
  border: 1px solid #e3e5e7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.comment-mention-search {
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f1f2f3;
  background: #fafafa;
}

.comment-mention-search input {
  width: 100%;
  height: 30px;
  border: 0;
  outline: none;
  background: transparent;
  color: #18191c;
  font-size: 14px;
}

.comment-mention-list {
  max-height: 300px;
  overflow-y: auto;
}

.comment-mention-list::-webkit-scrollbar {
  width: 6px;
}

.comment-mention-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #dcdfe6;
}

.comment-mention-item {
  width: 100%;
  height: 58px;
  padding: 0 12px;
  border: 0;
  background: #ffffff;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.comment-mention-item:hover {
  background: #f0fbff;
}

.comment-mention-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f2f3;
}

.comment-mention-info {
  min-width: 0;
}

.comment-mention-name {
  color: #18191c;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.comment-mention-sub {
  margin-top: 2px;
  color: #9499a0;
  font-size: 12px;
  line-height: 16px;
}

.comment-mention-state {
  height: 90px;
  color: #9499a0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-reply-editor .comment-mention-panel {
  top: 58px;
}

@media (max-width: 768px) {
  .comment-mention-panel {
    width: min(320px, calc(100vw - 80px));
    top: 64px;
  }
}

.comment-fan-badge {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.comment-fan-badge:hover {
    filter: brightness(0.98);
}

.comment-fan-badge:hover .comment-fan-badge-name {
    background: #ffe3ee;
}

.comment-fan-badge:hover .comment-fan-badge-level {
    background: #ff85a8;
}

/* 评论区 VIP / SVIP 标识 */
.comment-vip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff7aa8, #fb7299);
  color: #ffffff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 900;
  flex-shrink: 0;
  vertical-align: middle;
}

.comment-vip-badge.svip {
  background: linear-gradient(90deg, #ffe7a3, #ff9fc2);
  color: #6b3300;
}

/* 一级评论：昵称 + 粉丝牌 + VIP 对齐 */
.comment-user {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 二级回复里如果加了 VIP，也保持对齐 */
.comment-reply-content .comment-vip-badge {
  margin-left: 4px;
  transform: translateY(-1px);
}