/**
 *Copyright (C), 2025, GOSUN CL
 *file: comments.css
 *brief: 视评图说主题
 *Theme URI: https://faq7777.com
 *author: 视评图说
 *date: 2025年7月7日
 *version: 7.7.0
 */

/* 全局盒模型重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 评论表单容器样式 */
#respond {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 20px 0;
  border: none;
}

/* comments module extracted for per-page loading */

/* 警告信息样式 */
.warning {
  font-size: 12px;
  color: #999;
  line-height: 2em;
  clear: both;
  margin-bottom: 2%;
}

/* 评论列表样式 */
#comments {
  overflow: hidden;
  padding: 0 12px;
  margin-top: 20px;
}

#comments li {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid #f6f6f6;
  overflow: hidden;
  list-style: none;
}

#comments .gravatar {
  float: left;
  padding: 3px 0;
}

#comments .gravatar img {
  width: 40px;
  height: 40px;
  display: block;
}

#comments .info {
  margin-left: 55px;
  overflow: hidden;
}

#comments .meta {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35em;
  color: #999;
  margin-bottom: 10px;
}

#comments .meta span {
  display: block;
  float: left;
}

#comments .meta .reply {
  float: right;
}

#comments .meta a {
  color: #006abe;
}

#comments .name {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.5em;
  color: #333;
  margin-bottom: 5px;
}

#comments .name a {
  color: #333;
}

#comments .text {
  font-size: 14px;
  line-height: 2em;
  color: #666;
}

#comments .text li {
  margin-left: 0;
}

/* 多级评论嵌套优化 */
#comments li li {
  margin: 15px 0 5px 55px;
  background-color: #f9f9f9;
  padding: 15px;
  border-bottom: none;
}

#comments li li li {
  margin: 10px 10px 5px;
  background-color: #fff;
  border: 1px solid #e5e5e5;
}

.comments-area {
  margin-top: 18px;
}

/* COMMENT FORM STYLES */
.comment-login-tip {
  max-width: 760px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #8d6e63;
  font-size: 14px;
}

.comments-area .comment-form #sptsz-captcha-img:hover {
  transform: scale(1.05);
}

/* 移动端验证码样式调整 */
@media (max-width: 768px) {
  .comments-area .comment-form .comment-form-captcha {
    grid-template-columns: 1fr;
  }

  .comments-area .comment-form .comment-form-captcha input#sptsz_comment_captcha {
    width: 100%;
    margin-bottom: 10px;
  }

  .comments-area .comment-form #sptsz-captcha-img {
    display: block;
    margin: 0 auto;
  }
}

.comments-area .comment-form label {
  font-size: 13px;
  color: #555;
}

/* 统一按钮样式 */
.comments-area .comment-form .submit,
.comments-area .comment-form input[type="submit"],
#respond input.submit,
#respond button.submit,
.comment-form .submit {
  display: inline-block;
  min-width: 128px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 20px;
  background: var(--spt-grad);
  color: #fff;
  border: none;
  box-shadow: 0 6px 14px rgba(47, 134, 255, 0.25);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  vertical-align: middle;
  font-size: 16px;
  font-weight: bold;
  padding: 0 16px;
  margin: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  position: relative;
  z-index: 1;
  transform: translateY(0);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

.comments-area .comment-form .submit:hover,
.comments-area .comment-form input[type="submit"]:hover,
#respond input.submit:hover,
#respond button.submit:hover,
.comment-form .submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(47, 134, 255, 0.35);
}

/* 按钮焦点样式 - 无障碍支持 */
.comments-area .comment-form .submit:focus,
.comments-area .comment-form input[type="submit"]:focus,
#respond input.submit:focus,
#respond button.submit:focus,
.comment-form .submit:focus {
  outline: 2px solid var(--spt-primary);
  outline-offset: 2px;
}

/* 评论标题 */
.comments-area .comments-title {
  max-width: 760px;
  margin: 10px auto 12px;
  font-size: 18px;
  line-height: 1.6;
}

.comments-area .comment-list {
  max-width: 760px;
  margin: 0 auto 16px;
}

/* 折叠容器：默认折叠显示前几屏高度 */
.comments-collapsible.is-collapsed .comment-list {
  max-height: 520px;
  overflow: hidden;
  position: relative;
}

.comments-collapsible.is-collapsed .comment-list::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
}

.comments-toggle {
  display: block;
  margin: 0 auto 12px;
  min-width: 160px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  border-radius: 19px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  width: fit-content;
  transition: box-shadow 0.18s ease;
}

.comments-toggle:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.comments-toggle:focus {
  outline: 2px solid var(--spt-primary);
  outline-offset: 2px;
}

/* 评论列表卡片化 */
.comments-area .comment-list > li {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  font-size: 14px;
}

.comments-area .comment-list li li {
  background: #f9fafc;
  border-color: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
}

/* 未登录提示：增加明显的登录按钮 */
.comment-login-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-login-tip .btn-login {
  flex: none;
  display: inline-block;
  min-width: 108px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 18px;
  background: var(--spt-grad);
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 6px 14px rgba(47, 134, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  border: none;
  font-size: 14px;
}

.comment-login-tip .btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(47, 134, 255, 0.35);
}

.comment-login-tip .btn-login:focus {
  outline: 2px solid var(--spt-primary);
  outline-offset: 2px;
}

/* 已登录提示行（资料/退出） */
.comment-logged-as {
  margin-bottom: 8px;
  font-size: 13px;
  color: #666;
}

.comment-logged-as a {
  color: var(--spt-primary);
}

.comment-logged-as a:hover {
  color: var(--spt-primary-dark);
}

/* 提交区域与按钮 */
.comments-area .comment-form .form-submit {
  margin-top: 0;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 40px;
  gap: 12px;
  width: 100%;
}

.comments-area .comment-form {
  max-width: 760px;
  margin: 20px auto;
  padding: 16px 18px 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.90));
  backdrop-filter: blur(4px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: none;
}

.comments-area .comment-form p {
  margin: 0 0 12px;
}

.comments-area .comment-form textarea,
.comments-area .comment-form input[type="text"],
.comments-area .comment-form input[type="email"],
.comments-area .comment-form input[type="url"],
.comments-area .comment-form input#sptsz_comment_captcha {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px !important;
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* 输入框焦点样式 - 无障碍支持 */
.comments-area .comment-form textarea:focus,
.comments-area .comment-form input[type="text"]:focus,
.comments-area .comment-form input[type="email"]:focus,
.comments-area .comment-form input[type="url"]:focus,
.comments-area .comment-form input#sptsz_comment_captcha:focus {
  outline: none;
  border-color: var(--spt-primary);
  box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.1);
}

/* 验证码区域 - 统一使用flex布局 */
.comments-area .comment-form .comment-form-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  min-height: 40px;
  width: 100%;
}

.comments-area .comment-form .comment-form-captcha label {
  flex-shrink: 0;
  font-size: 13px;
  color: #555;
  margin-right: 6px;
  line-height: 1;
}

.comments-area .comment-form .comment-form-captcha input#sptsz_comment_captcha {
  display: inline-block;
  width: 140px;
  min-width: 100px;
  height: 40px;
  vertical-align: middle;
}

/* 移动端响应式修复 */
@media (max-width: 768px) {
  .comments-area .comment-form {
    display: block;
  }

  .comments-area .comment-form .form-submit {
    display: block;
    width: 100%;
    text-align: right;
    margin-top: 8px;
  }

  .comments-area .comment-form .comment-form-captcha {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: 8px;
  }

  .comments-area .comment-form .comment-form-captcha input#sptsz_comment_captcha {
    width: 100%;
    margin-bottom: 10px;
  }

  .comments-area .comment-form #sptsz-captcha-img {
    display: block;
    margin: 0 auto;
  }

  /* 评论响应式样式修复 */
  #comments .gravatar {
    float: none;
    margin-right: 0;
    margin-bottom: 10px;
  }

  #comments .info {
    margin-left: 0;
  }

  .comment-form .submit {
    display: block;
    margin: 10px 0;
    width: 100%;
  }
}
