/**
 * 评论系统样式 - YIA风格
 * Comments CSS - Modern Minimalist Design
 */

/* ==================== 评论区域容器 ==================== */
.comments-area {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-top: 25px;
}

body.dark-mode .comments-area {
  background: rgba(26, 29, 41, 0.8);
}

/* 评论标题 */
.comments-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.comments-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-title svg {
  flex-shrink: 0;
  color: var(--primary-color);
}

body.dark-mode .comments-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ==================== 评论数量 ==================== */
.comments-count {
  font-size: 13px;
  color: #999;
  margin: 20px 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

body.dark-mode .comments-count {
  color: #888;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ==================== 评论列表 ==================== */
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 评论项 */
.simple-comment {
  margin-bottom: 12px;
  list-style: none;
}

.comment-wrapper {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #fafafa;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.comment-wrapper:hover {
  background: #f5f5f5;
}

body.dark-mode .comment-wrapper {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .comment-wrapper:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* 评论头像 */
.comment-avatar {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.comment-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

/* 头像徽章 */
.avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.avatar-badge svg {
  width: 9px;
  height: 9px;
}

body.dark-mode .avatar-badge {
  border-color: rgba(26, 29, 41, 0.9);
}

.admin-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #fff;
}

.registered-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.qq-badge {
  background: linear-gradient(135deg, #56b4d3 0%, #348ac7 100%);
  color: #fff;
}

/* 评论主体 */
.comment-main {
  flex: 1;
  min-width: 0;
}

.admin-comment .comment-content {
  background: linear-gradient(135deg, rgba(94, 114, 228, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-left: 3px solid var(--primary-color);
}

/* 评论内容 */
.comment-content {
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-color);
  word-wrap: break-word;
}

body.dark-mode .comment-content {
  background: rgba(255, 255, 255, 0.05);
}

.comment-content p {
  margin: 0 0 0.8em 0;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* 等待审核 */
.comment-awaiting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(251, 99, 64, 0.1);
  color: #f86538;
  border-radius: 6px;
  font-size: 12px;
  font-style: normal;
  margin-bottom: 8px;
}

.comment-awaiting svg {
  flex-shrink: 0;
}

/* 评论元信息 */
.comment-meta-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #999;
  padding-left: 4px;
}

.comment-author-name a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

.comment-author-name a:hover {
  color: var(--primary-color);
}

.comment-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999;
}

.comment-time svg {
  flex-shrink: 0;
}

.comment-reply-link-inline a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.comment-reply-link-inline a:hover {
  color: var(--primary-color);
  background: rgba(94, 114, 228, 0.08);
}

.comment-reply-link-inline svg {
  flex-shrink: 0;
}

/* 嵌套评论 */
.children {
  list-style: none;
  padding-left: 26px;
  margin-top: 10px;
}

body.dark-mode .children .comment-wrapper {
  background: rgba(255, 255, 255, 0.02);
}

/* ==================== 评论表单 ==================== */
.comment-respond {
  margin-top: 15px;
}

.comment-reply-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  display: none !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

body.dark-mode .comment-reply-title {
  background: rgba(255, 255, 255, 0.05);
}

/* 当是回复状态时显示 */
.comment-reply-title.show {
  display: flex !important;
}

/* 取消回复链接 */
.cancel-comment-reply a {
  color: #999;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cancel-comment-reply a:hover {
  color: var(--primary-color);
  background: rgba(94, 114, 228, 0.1);
}

/* 表单容器 */
#commentform {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 隐藏默认提示和Cookie同意 */
#commentform .comment-notes,
#commentform .required-field-message,
#commentform .comment-form-cookies-consent,
#commentform p.comment-form-cookies-consent {
  display: none !important;
}

/* 隐藏昵称和邮箱字段 */
#commentform p:has(#author),
#commentform p:has(#email) {
  display: none !important;
}

/* 用户信息标识栏 */
.comment-user-info {
  margin-bottom: 12px;
  display: none;
}

/* ==================== 登录选项 ==================== */
/* 评论表单容器 */
.comment-form-container {
  background: #fafafa;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

/* 已登录用户信息（融入式） */
.logged-in-user-info-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
  color: #999;
  padding: 6px;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 13px;
  color: var(--text-color);
  font-weight: 600;
}

.user-status {
  font-size: 11px;
  color: #999;
}

.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-profile-link-inline,
.logout-link-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
}

.edit-profile-link-inline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.logout-link-inline:hover {
  background: #ff4757;
  color: white;
  transform: translateY(-2px);
}

.comment-logout-btn {
  border: none;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

/* 已登录用户信息（旧版，保留用于兼容） */
.logged-in-user-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

body.dark-mode .logged-in-user-info {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.logged-in-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.logged-in-content svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.logged-in-content strong {
  font-weight: 600;
}

.logged-in-actions {
  display: flex;
  gap: 8px;
}

.edit-profile-link,
.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 12px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.edit-profile-link:hover,
.logout-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.edit-profile-link svg,
.logout-link svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

body.dark-mode .edit-profile-link,
body.dark-mode .logout-link {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .edit-profile-link:hover,
body.dark-mode .logout-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 未登录用户提示 */
.comment-login-options {
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  border-left: 3px solid var(--primary-color);
}

/* 暗色主题 - 评论表单容器 */
body.dark-mode .comment-form-container {
  background: rgba(255, 255, 255, 0.03);
}

/* 暗色主题 - 融入式用户信息栏 */
body.dark-mode .logged-in-user-info-inline {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .user-avatar {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .user-avatar svg {
  color: #666;
}

body.dark-mode .user-name {
  color: #e0e0e0;
}

body.dark-mode .user-status {
  color: #888;
}

body.dark-mode .edit-profile-link-inline,
body.dark-mode .logout-link-inline {
  background: rgba(255, 255, 255, 0.05);
  color: #999;
}

body.dark-mode .edit-profile-link-inline:hover {
  background: var(--primary-color);
  color: white;
}

body.dark-mode .logout-link-inline:hover {
  background: #ff4757;
  color: white;
}

/* 暗色主题 - 评论输入框 */
body.dark-mode .comment-form-container #commentform textarea {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-mode .comment-form-container #commentform textarea:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(94, 114, 228, 0.3);
}

body.dark-mode .comment-form-container #commentform textarea::placeholder {
  color: #666;
}

body.dark-mode .comment-login-options {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.login-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
  margin: 0;
}

body.dark-mode .login-prompt {
  color: #aaa;
}

.login-prompt svg {
  flex-shrink: 0;
  color: var(--primary-color);
}

/* ==================== 评论输入框 ==================== */
.comment-input-wrapper {
  position: relative;
  width: 100%;
}

.comment-form-container #commentform textarea {
  width: 100%;
  padding: 12px 52px 12px 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 85px;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.comment-form-container #commentform textarea:focus {
  outline: none;
  box-shadow: 0 2px 6px rgba(94, 114, 228, 0.15);
}

#commentform textarea {
  width: 100%;
  padding: 14px 56px 14px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  transition: all 0.3s ease;
  background: #fafafa;
  line-height: 1.6;
  color: var(--text-color);
}

#commentform textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

#commentform textarea::placeholder {
  color: #bbb;
}

body.dark-mode #commentform textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #commentform textarea:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
}

/* 内联提交按钮 */
.submit-button-inline {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(94, 114, 228, 0.4);
}

.submit-button-inline svg {
  width: 16px;
  height: 16px;
}

.submit-button-inline:hover {
  background: #4c63d2;
  transform: scale(1.1) rotate(-10deg);
  box-shadow: 0 4px 16px rgba(94, 114, 228, 0.6);
}

.submit-button-inline:active {
  transform: scale(0.95) rotate(-10deg);
}

.submit-button-inline svg {
  transform: translateX(1px);
  flex-shrink: 0;
}

/* 暗色主题 - 提交按钮 */
body.dark-mode .submit-button-inline {
  background: var(--primary-color);
  box-shadow: 0 2px 8px rgba(94, 114, 228, 0.4);
}

body.dark-mode .submit-button-inline:hover {
  background: #4c63d2;
  box-shadow: 0 4px 16px rgba(94, 114, 228, 0.5);
}

/* 隐藏原提交按钮 */
.submit-button-hidden {
  display: none !important;
}

/* ==================== 评论分页 ==================== */
.comment-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.comment-pagination a,
.comment-pagination span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 14px;
}

.comment-pagination a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(94, 114, 228, 0.3);
}

.comment-pagination svg {
  flex-shrink: 0;
}

body.dark-mode .comment-pagination a,
body.dark-mode .comment-pagination span {
  background: rgba(255, 255, 255, 0.05);
}

/* 无评论提示 */
.no-comments {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  background: #fafafa;
  border-radius: 12px;
  margin: 20px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.dark-mode .no-comments {
  background: rgba(255, 255, 255, 0.03);
  color: #888;
}

.no-comments svg {
  flex-shrink: 0;
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 768px) {
  .comments-area {
    padding: 20px;
    margin-top: 25px;
  }
  
  .comments-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  
  .comments-title {
    font-size: 16px;
  }
  
  .comments-title svg {
    width: 20px;
    height: 20px;
  }
  
  .comment-wrapper {
    padding: 12px;
    gap: 10px;
  }
  
  .comment-avatar {
    width: 36px;
    height: 36px;
  }
  
  .comment-avatar img {
    width: 36px;
    height: 36px;
  }
  
  .avatar-badge {
    width: 16px;
    height: 16px;
    bottom: -2px;
    right: -2px;
  }
  
  .avatar-badge svg {
    width: 9px;
    height: 9px;
  }
  
  .comment-content {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .comment-meta-bottom {
    font-size: 12px;
    gap: 10px;
  }
  
  .children {
    padding-left: 24px;
  }
  
  .submit-button-inline {
    width: 38px;
    height: 38px;
    bottom: 10px;
    right: 10px;
  }
  
  .submit-button-inline svg {
    width: 16px;
    height: 16px;
  }
  
  #commentform textarea {
    padding: 12px 52px 12px 12px;
    min-height: 80px;
    font-size: 13px;
  }
  
  .comment-form-container {
    padding: 10px;
  }
  
  .logged-in-user-info-inline {
    padding: 6px 8px;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
  }
  
  .user-name {
    font-size: 12px;
  }
  
  .user-status {
    font-size: 10px;
  }
  
  .edit-profile-link-inline,
  .logout-link-inline {
    width: 28px;
    height: 28px;
  }
  
  .edit-profile-link-inline svg,
  .logout-link-inline svg {
    width: 12px;
    height: 12px;
  }
  
  .comment-form-container #commentform textarea {
    min-height: 80px;
    font-size: 12px;
  }
  
  .logged-in-user-info,
  .comment-login-options {
    padding: 9px 12px;
  }
  
  .logged-in-content,
  .login-prompt {
    font-size: 12px;
  }
  
  .logged-in-actions {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
  
  .edit-profile-link,
  .logout-link {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* 手机 */
@media (max-width: 480px) {
  .comments-area {
    padding: 16px;
    margin-top: 20px;
    border-radius: 10px;
  }
  
  .comments-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom-width: 1px;
  }
  
  .comments-title {
    font-size: 15px;
    gap: 8px;
  }
  
  .comments-title svg {
    width: 18px;
    height: 18px;
  }
  
  .comments-count {
    font-size: 13px;
    margin: 20px 0 16px 0;
    padding-bottom: 12px;
  }
  
  .comment-wrapper {
    padding: 10px;
    gap: 8px;
    border-radius: 10px;
  }
  
  .comment-avatar {
    width: 32px;
    height: 32px;
  }
  
  .comment-avatar img {
    width: 32px;
    height: 32px;
  }
  
  .avatar-badge {
    width: 14px;
    height: 14px;
    bottom: -1px;
    right: -1px;
  }
  
  .avatar-badge svg {
    width: 8px;
    height: 8px;
  }
  
  .comment-content {
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
  }
  
  .comment-meta-bottom {
    font-size: 11px;
    gap: 8px;
  }
  
  .comment-author-name a,
  .comment-reply-link-inline a {
    font-size: 12px;
  }
  
  .comment-time svg,
  .comment-reply-link-inline svg {
    width: 11px;
    height: 11px;
  }
  
  .children {
    padding-left: 20px;
    margin-top: 10px;
  }
  
  .submit-button-inline {
    width: 36px;
    height: 36px;
    bottom: 8px;
    right: 8px;
  }
  
  .submit-button-inline svg {
    width: 15px;
    height: 15px;
  }
  
  #commentform textarea {
    padding: 10px 48px 10px 10px;
    min-height: 70px;
    font-size: 13px;
    border-radius: 10px;
  }
  
  .comment-form-container {
    padding: 8px;
  }
  
  .logged-in-user-info-inline {
    padding: 6px;
    flex-wrap: wrap;
  }
  
  .user-info-left {
    gap: 8px;
  }
  
  .user-avatar {
    width: 26px;
    height: 26px;
  }
  
  .user-name {
    font-size: 11px;
  }
  
  .user-status {
    font-size: 10px;
  }
  
  .user-actions {
    gap: 6px;
  }
  
  .edit-profile-link-inline,
  .logout-link-inline {
    width: 26px;
    height: 26px;
  }
  
  .edit-profile-link-inline svg,
  .logout-link-inline svg {
    width: 11px;
    height: 11px;
  }
  
  .comment-form-container #commentform textarea {
    min-height: 70px;
    font-size: 12px;
    padding: 10px 48px 10px 10px;
  }
  
  .logged-in-user-info,
  .comment-login-options {
    padding: 8px 10px;
    border-radius: 8px;
  }
  
  .logged-in-content {
    font-size: 11px;
    flex: 1 0 100%;
  }
  
  .logged-in-content svg {
    width: 13px;
    height: 13px;
  }
  
  .logged-in-actions {
    flex: 1 0 100%;
    gap: 6px;
  }
  
  .edit-profile-link,
  .logout-link {
    font-size: 10px;
    padding: 3px 6px;
    flex: 1;
    justify-content: center;
  }
  
  .edit-profile-link svg,
  .logout-link svg {
    width: 11px;
    height: 11px;
  }
  
  .login-prompt {
    font-size: 12px;
    margin-bottom: 10px;
  }
  
  .login-prompt svg {
    width: 14px;
    height: 14px;
  }
  
  
  .comment-awaiting {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .comment-awaiting svg {
    width: 12px;
    height: 12px;
  }
  
  .comment-pagination a,
  .comment-pagination span {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .comment-pagination svg {
    width: 14px;
    height: 14px;
  }
  
  .no-comments {
    padding: 30px 15px;
    font-size: 13px;
  }
  
  .no-comments svg {
    width: 18px;
    height: 18px;
  }
}
