/**
 * 评论样式
 * @package Westlife
 * @version 1.0.0
 */

/* 变量定义
------------------------------------------ */
:root {
  /* 颜色 */
  --bubble-primary: #EBF5FF; /* 回复气泡(浅蓝色) */
  --bubble-border: #d0e3ff; /* 回复气泡边框颜色 */
  --border-color: #e5e5e5;
  --color-text: #333;
  --text-light: #666;
  --card-background: #fff;
  --primary-color: #002fa7;
  --primary-color-rgb: 0, 47, 167; /* 新增 RGB 值用于透明度设置 */

  /* 阴影 */
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* 尺寸 */
  --avatar-size: 40px;
  --avatar-size-mobile: 32px;
  --bubble-radius: 12px;
  --card-radius: 8px;
}

/* 深色模式变量 */
[data-theme="dark"] {
  --bubble-primary: #2a2a2a; /* 改为深灰色 */
  --bubble-border: #3a3a3a; /* 改为中灰色 */
  --bubble-secondary: #2c2c2c;
  --card-background: #1a1a1a;
  --border-color: #333;
  --color-text: #fff;
  --text-light: #999;
}

/* 评论区基础布局
------------------------------------------ */
.comments-area {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* 评论头部
------------------------------------------ */
.comments-header {
  padding: 1.0rem;
  background: var(--card-background);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column; /* 垂直排列 */
  gap: 0.5rem; /* 元素之间的间距 */
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

/* 标题 */
.comments-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.25rem;
}

.comments-title i {
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* 评论统计 */
.comments-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item i {
  color: var(--color-primary);
  font-size: 1rem;
}

.meta-count {
  font-weight: 600;
  color: var(--color-text);
}

.meta-text {
  color: var(--text-light);
  font-size: 0.875rem;
}

.meta-divider {
  width: 1px;
  height: 1rem;
  background: var(--border-color);
}

/* 评论列表
------------------------------------------ */
.comment-list,
.comment-list ol {
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}

.comment-list {
  padding: 0.5rem 0;
}

.comment-list .children {
  margin-left: 3.5rem;
}

.comment-item {
  position: relative;
  margin: 1.5rem 0;
  width: 100%;
  max-width: 100%;
}

.comment-wrap {
  position: relative;
  background: var(--card-background);
}

.comment-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* 默认评论(左侧) */
.comment-main:not(.is-child) {
  flex-direction: row;
  margin-right: 3.5rem;
}

/* 回复评论(右侧) */
.comment-main.is-child {
  flex-direction: row-reverse;
}

/* 头像 */
.comment-avatar {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  overflow: visible;
  margin-top: 0.5rem;
}

.comment-avatar img,
.comment-avatar .avatar-img {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

/* 悬浮放大效果  */
.comment-avatar:hover img,
.comment-avatar:hover .avatar-img {
  transform: scale(1.15);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .comment-avatar:hover img,
  .comment-avatar:hover .avatar-img {
    transform: scale(1.1); 
  }
}

/* 评论气泡样式 - 浅色模式 */
/* 普通评论气泡 */
.comment-bubble {
  position: relative;
  flex: 1;
  width: calc(100% - var(--avatar-size) - 1rem);
  max-width: calc(100% - var(--avatar-size) - 1rem);
  padding: 0.75rem 1rem;
  border-radius: var(--bubble-radius);
  border: 1px solid var(--border-color);
  overflow: visible; 
  background: #FFFFFF;
}

/* 回复评论气泡 */
.comment-main.is-child .comment-bubble {
  background: var(--bubble-primary); 
  border: 1px solid var(--bubble-border); 
  box-shadow: var(--card-shadow);
}

/* 评论箭头通用样式 */
.bubble-arrow {
  position: absolute;
  top: 20px;
  width: 16px; 
  height: 16px; 
  background: inherit; 
  border: inherit;
  z-index: 1;
  pointer-events: none; 
}

/* 普通评论箭头 - 左侧 */
.comment-main:not(.is-child) .bubble-arrow {
  left: -9px; 
  border-width: 0 0 1px 1px;
  transform: rotate(45deg); 
}

/* 回复评论箭头 - 右侧 */
.comment-main.is-child .bubble-arrow {
  right: -9px;
  border-width: 1px 1px 0 0; 
  transform: rotate(45deg);
}

/* 深色模式 - 普通评论气泡 */
[data-theme="dark"] .comment-bubble {
  background-color: var(--card-background);
  border-color: var(--border-color);
}

/* 深色模式 - 普通评论箭头 */
[data-theme="dark"] .comment-main:not(.is-child) .bubble-arrow {
  background-color: var(--card-background);
  border-color: var(--border-color);
}

/* 深色模式 - 回复评论气泡 */
[data-theme="dark"] .comment-main.is-child .comment-bubble {
  background-color: var(--bubble-primary);
  border-color: var(--bubble-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 深色模式 - 回复评论箭头 */
[data-theme="dark"] .comment-main.is-child .bubble-arrow {
  background-color: var(--bubble-primary);
  border-color: var(--bubble-border);
}

/* 确保深色模式下所有评论内文字颜色正确 */
[data-theme="dark"] .comment-content,
[data-theme="dark"] .comment-author,
[data-theme="dark"] .comment-time {
  color: rgba(255, 255, 255, 0.85);
}

/* 深色模式下的回复评论气泡中的文字颜色 */
[data-theme="dark"] .comment-main.is-child .comment-content,
[data-theme="dark"] .comment-main.is-child .comment-author,
[data-theme="dark"] .comment-main.is-child .comment-time {
  color: rgba(255, 255, 255, 0.85); /* 改为白色系 */
}

/* 评论内容
------------------------------------------ */
/* 评论内容 */
.comment-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-top: 0.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
  display: flex; /* 添加 Flexbox 布局 */
  align-items: center; /* 垂直居中对齐 */
}

/* 回复目标 */
.reply-to {
  font-size: 0.8rem;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* 评论元信息组 */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 30px;
}

/* 评论者名称 */
.comment-author {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-style: normal;
}

/* 博主认证图标 */
.author-badge {
  position: relative;
  color: #002FA7;  /* 修改为指定颜色 */
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  cursor: help;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 炫酷悬浮效果 */
.author-badge:hover {
  color: #002FA7;
  animation: badge-pulse 1s infinite;
  text-shadow: 0 0 8px rgba(0, 47, 167, 0.5);
}

/* 添加提示文字 */
.author-badge::after {
  content: "博主";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #002FA7;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 显示提示文字 */
.author-badge:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 脉冲动画 */
@keyframes badge-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* 深色模式适配 */
[data-theme="dark"] .author-badge {
  color: #64b5f6;
}

[data-theme="dark"] .author-badge:hover {
  color: #90caf9;
  text-shadow: 0 0 8px rgba(100, 181, 246, 0.5);
}

[data-theme="dark"] .author-badge::after {
  background: #64b5f6;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* 评论信息 */
.comment-info {
  display: inline-flex; /* 修改为 inline-flex */
  align-items: center;
  gap: 0.5rem; /* 调整间距 */
  font-size: 0.8rem;
  color: var(--text-light);
}

.comment-info > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-info img {
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  margin-right: 2px;
}

/* 评论时间 */
.comment-time {
  position: relative; /* 确保提示信息相对于时间元素定位 */
}

/* 操作系统和浏览器信息 */
.comment-os-info,
.comment-browser-info {
  cursor: pointer;
  position: relative;
}

/* 版本提示信息 */
.comment-os-info:hover::after,
.comment-browser-info:hover::after,
.comment-time:hover::after { /* 添加评论时间悬浮提示 */
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  white-space: nowrap;
  z-index: 10;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment-meta {
    margin-bottom: 0.5rem;
    flex-direction: column; /* 垂直排列 */
    align-items: flex-start; /* 左对齐 */
  }

  .comment-reply {
    align-self: flex-end;
    margin-top: 0.5rem;
  }
}

/* 深色模式适配 */
[data-theme="dark"] .comment-author {
  color: #fff;
}

[data-theme="dark"] .user-badge {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .comment-content {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .comment-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* 回复按钮 */
.comment-reply {
  transition: all 0.25s ease;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: inline-flex; /* 修改为 inline-flex */
  align-items: center; /* 垂直居中对齐 */
}

.comment-bubble {
  position: relative; 
}

.comment-bubble:hover .comment-reply {
  opacity: 1;
  visibility: visible;
}

/* 回复按钮基础样式 */
.comment-reply a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--primary-color);
  font-size: 0.875rem;
  padding: 0.35rem;
  border-radius: 4px;
  transition: all 0.25s ease;
}

/* 图标样式 */
.comment-reply a i {
  font-size: 1rem;
  transition: all 0.25s ease;
  border-radius: 50%;
  width: 28px;  /* 添加固定宽度 */
  height: 28px; /* 添加固定高度 */
  display: flex; /* 使用 flex 布局 */
  align-items: center;
  justify-content: center;
}

/* 悬浮到图标上时的效果 */
.comment-reply a:hover i {
  background-color: var(--color-primary);
  color: #fff;
  transform: scale(1.1);
}

/* 确保回复文本不显示 */
.comment-reply a span {
  display: none;
}

/* 深色模式适配 */
[data-theme="dark"] .comment-reply a:hover i {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 移动端适配 - 始终显示回复按钮 */
@media (max-width: 768px) {
  .comment-reply {
    opacity: 1;
    visibility: visible;
    top: 0.35rem; /* 在移动端稍微调整位置 */
    right: 0.35rem;
  }
}

/* 辅助元素
------------------------------------------ */

/* 无评论占位：诙谐提示 + 跳动沙发（FA7 Pro 支持） */
.no-comments.fun {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 3rem 0 1.5rem;
  color: var(--color-text-light);
  text-align: center;
}

/* 容器：给弹跳留空间 */
.no-comments .sofa-wrapper,
.no-comments .bench-wrapper { 
  position: relative;
  height: 44px;
}

/* 沙发/板凳图标：更大 + 弹跳（强制开启） */
.no-comments .sofa-icon,
.no-comments .bench-icon {
  display: inline-block;
  font-size: 44px;
  line-height: 1;
  color: var(--color-primary);
  transform-origin: center bottom;
  will-change: transform;
  animation: sofa-bounce .9s ease-in-out infinite alternate !important;
}

/* FA7 Pro Duotone 颜色 */
.no-comments .fa-duotone.sofa-icon {
  --fa-primary-color: var(--color-primary);
  --fa-secondary-color: var(--color-primary);
  --fa-primary-opacity: 1;
  --fa-secondary-opacity: .35;
}

/* 文案与按钮 */
.no-comments .no-comments-text { font-size: .95rem; }

.no-comments .go-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-primary);
  background: rgba(var(--color-primary-rgb), .06);
  color: var(--color-primary);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.no-comments .go-comment-btn i { font-size: 1rem; }
.no-comments .go-comment-btn .arrow { transition: transform .18s ease; }
.no-comments .go-comment-btn:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), .24);
  transform: translateY(-1px);
}
.no-comments .go-comment-btn:hover .arrow { transform: translateX(2px); }

/* 弹跳动画（统一定义一次） */
@keyframes sofa-bounce {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* 兼容旧动画名 */
@keyframes bench-bounce {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* 尊重“减少动效” */
@media (prefers-reduced-motion: reduce) {
  .no-comments .sofa-icon,
  .no-comments .bench-icon {
    animation: none !important;
  }
}

/* 兜底：强制“暂无评论”沙发上下跳动（更高优先级 + 放在文件末尾） */
.comments-area .no-comments.fun .sofa-icon {
  display: inline-block !important;
  transform-origin: center bottom !important;
  animation: sofa-bounce .9s ease-in-out infinite alternate !important;
}

/* 若系统开启“减少动效”，此处仍放行沙发动效（仅此一处保留） */
@media (prefers-reduced-motion: reduce) {
  .comments-area .no-comments.fun .sofa-icon {
    animation: sofa-bounce .9s ease-in-out infinite alternate !important;
  }
}

/* 评论分页 */
.comment-navigation {
  margin: 2rem 0;
  text-align: center;
}

/* 响应式调整
------------------------------------------ */
@media (max-width: 768px) {
  .header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .comments-meta {
    width: 100%;
  }

  .comment-list .children {
    margin-left: 1.5rem;
  }

  .comment-avatar img,
  .comment-avatar .avatar-img {
    width: var(--avatar-size-mobile);
    height: var(--avatar-size-mobile);
  }

  .comment-bubble {
    padding: 0.875rem;
  }

  .comment-form-info {
    flex-direction: column;
  }

  .submit-comment {
    width: 100%;
    justify-content: center;
  }
}


/* 统一使用 fadeIn 动画 */
.comment-fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  animation-fill-mode: forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-wrapper input:focus {
  border-color: var(--color-primary); 
  outline: none;
}
@keyframes highlight-comment {
  0% {
    background-color: rgba(var(--color-primary-rgb), 0.1);
    transform: translateY(-5px);
  }
  70% {
    background-color: rgba(var(--color-primary-rgb), 0.1);
  }
  100% {
    background-color: transparent;
    transform: translateY(0);
  }
}


/*--------------------------------------------------------------
>>> 回复表单样式
--------------------------------------------------------------*/
/* 评论表单标题 */
.comment-reply-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-heading);
  position: relative;
}

.comment-reply-title i {
  color: var(--color-primary);
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

.comment-reply-title small {
  margin-left: auto;
  font-size: 0.875rem;
}

.comment-reply-title small a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: all 0.2s ease;
}

.comment-reply-title small a:hover {
  color: var(--color-primary);
}

/* 回复表单容器 */
.form-replying {
  position: relative;
  width: 100%;
  padding: 15px;
  margin-top: 15px;
  background: var(--card-background, #fff);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--card-radius, 8px);
  box-shadow: var(--card-shadow, 0 5px 20px rgba(0, 0, 0, 0.1));
  display: block;
  box-sizing: border-box;
}

/* 回复表单动画 */
.comment-form-animated {
  transition: all 0.3s ease-out;
  will-change: transform, opacity;
}

/* 回复信息提示容器 */
.replying-to-info {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 两端对齐 */
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--color-background-light, #f8f9fa);
  border-left: 3px solid var(--color-primary);
  border-radius: 6px;
  color: var(--color-text-light, #666);
  font-size: 0.9rem;
  width: 100%; /* 确保容器占满宽度 */
}

/* 回复信息左侧内容 */
.reply-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1; /* 让左侧内容占据剩余空间 */
}

/* 取消回复按钮样式 */
#cancel-comment-reply-link {
  display: none; /* 默认隐藏 */
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-background);
  color: var(--color-text-light);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* 图标样式 */
#cancel-comment-reply-link i {
  font-size: 0.85em;
  transition: transform 0.2s ease;
}

/* 悬停效果 */
#cancel-comment-reply-link:hover {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2);
}

/* 图标悬停动画 */
#cancel-comment-reply-link:hover i {
  transform: rotate(-180deg);
}

/* 深色模式适配 */
[data-theme="dark"] #cancel-comment-reply-link {
  background: var(--color-background);
  border-color: var(--color-border);
  color: var(--color-text-light);
}

[data-theme="dark"] #cancel-comment-reply-link:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
  #cancel-comment-reply-link {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
  }
}

/*--------------------------------------------------------------
>>> 动画效果
--------------------------------------------------------------*/

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}
/*--------------------------------------------------------------
>>> 评论按钮 
--------------------------------------------------------------*/
/* 提交按钮 */
.submit-comment {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    overflow: hidden;
}

/* 悬浮效果 - 只保留放大 */
.submit-comment:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* 按钮内部图标 */
.submit-comment .submit-icon {
    transition: all 0.3s ease;
}

/* 加载中状态 */
.submit-comment.loading .submit-icon {
    opacity: 0;
    visibility: hidden;
}

.submit-comment.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
    border-radius: 50%;
    animation: submitSpin 0.6s linear infinite;
}

/* 加载动画 */
@keyframes submitSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 深色模式适配 */
[data-theme="dark"] .submit-comment {
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .submit-comment.loading::after {
  border-top-color: #fff;
  border-right-color: #fff;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .submit-comment {
    width: 32px;
    height: 32px;
    right: 12px;
    bottom: 12px;
  }
  
  .submit-comment .submit-icon {
    font-size: 0.9rem;
  }

  .submit-comment.loading::after {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
  }
  
  .comment-form textarea {
    padding: 1rem 50px 45px 1rem;
  }
}

/*--------------------------------------------------------------
>>> 评论表单样式
--------------------------------------------------------------*/

/* 表单容器 */
.comment-respond {
  margin-top: 2rem;
  padding: 1.75rem;
  background: var(--card-background);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  position: relative;
}

/* 评论者信息区域 */
.comment-form-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* 输入框包装器 */
.input-wrapper {
  position: relative;
}

/* 输入框基础样式 */
.input-wrapper input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--theme-radius);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

/* 输入框图标 */
.input-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

/* 评论框容器 */
.textarea-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

/* 评论文本框 */
.comment-form textarea {
  width: 100%;
  height: 220px;
  padding: 1rem 60px 50px 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--theme-radius);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
}

#edit-commenter-info {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

/* 输入框交互状态 */
.input-wrapper input:hover,
.comment-form textarea:hover {
  border-color: var(--color-primary-light);
}

.input-wrapper input:focus,
.comment-form textarea:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.input-wrapper input:focus + .input-icon {
  color: var(--color-primary);
}

/* 深色模式适配 */
[data-theme="dark"] .comment-respond,
[data-theme="dark"] .input-wrapper input,
[data-theme="dark"] .comment-form textarea {
  background: var(--color-background);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .input-wrapper input:hover,
[data-theme="dark"] .comment-form textarea:hover {
  border-color: var(--color-primary-light);
}

[data-theme="dark"] .input-wrapper input:focus,
[data-theme="dark"] .comment-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

/* 错误状态 */
.input-wrapper.has-error input {
  border-color: #ff4d4f;
}

.input-wrapper.has-error .input-icon {
  color: #ff4d4f;
}

.input-error {
  position: absolute;
  left: 0;
  bottom: -1.5rem;
  font-size: 0.8rem;
  color: #ff4d4f;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .comment-respond {
    padding: 1.25rem;
  }

  .comment-form-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .input-wrapper input {
    padding: 0.75rem 1rem 0.75rem 2.25rem;
    font-size: 0.9rem;
  }

  .input-wrapper .input-icon {
    font-size: 0.9rem;
  }
  
  .comment-form textarea {
    padding: 1rem 50px 45px 1rem;
  }
}

/*--------------------------------------------------------------
>>> 评论EMOJI表情选择器
--------------------------------------------------------------*/

/* 表情选择器 */
.emoji-picker {
  position: absolute;
  left: 12px; 
  bottom: 10px;
  z-index: 2;
}

/* 表情触发按钮 */
.emoji-trigger {
  width: 36px;
  height: 36px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
  transform-origin: center;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 悬浮效果 - 只保留放大 */
.emoji-trigger:hover {
  opacity: 1;
  transform: scale(1.15); 
}

.emoji-trigger img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* 表情面板 */
.emoji-panel {
  position: absolute;
  bottom: calc(100% + 5px);
  width: 320px;
  height: 150px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 5px;
  opacity: 0;
  visibility: hidden;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1.5px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 表情项目 */
.emoji-item {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 2px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer; /* 修改光标样式 */
}

/* 表情图片 */
.emoji-item img {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
}

/* 面板激活状态 */
.emoji-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 表情悬停效果 */
.emoji-item:hover {
  transform: scale(1.3);
  z-index: 2;
}

/* 深色模式适配 */
[data-theme="dark"] .emoji-panel {
  background: var(--color-background);
  border-color: var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .emoji-panel {
    width: 280px;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px;
  }

  .emoji-item {
    padding: 4px;
  }

  .emoji-item img {
    width: 24px;
    height: 24px;
  }
}


/*--------------------------------------------------------------
>>> 欢迎信息和回复提示
--------------------------------------------------------------*/

/* 评论欢迎信息样式 */
.comment-welcome {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-background-light);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.welcome-user,
.welcome-guest {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.logout-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9em;
}

.edit-info-btn {
    padding: 4px 8px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 评论编辑按钮样式 */
.comment-edit {
    margin-left: auto;
}

.comment-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-edit-link:hover {
    color: var(--color-primary);
    background: var(--color-background-light);
}