

/* 评论区头部 */
.xu5-comments-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 24px 28px;
   background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
   border-bottom: 2px solid #e5e7eb;
}

.xu5-comments-title {
   display: flex;
   align-items: center;
   gap: 12px;
   font-size: 1.3rem;
   font-weight: 700;
   color: #1f2937;
}


.xu5-comments-title .comments-count {
   font-size: 0.7em;
   font-weight: 500;
   color: #6b7280;
   background: rgba(64,158,255,0.1);
   padding: 4px 12px;
   border-radius: 20px;
}

.comment-sort-select {
   padding: 6px 12px;
   border: 1px solid #d1d5db;
   border-radius: 8px;
   background: #fff;
   color: #374151;
   font-size: 14px;
   cursor: pointer;
   transition: all 0.2s;
}

.comment-sort-select:hover {
   border-color: #409eff;
}

.comment-sort-select:focus {
   outline: none;
   border-color: #409eff;
   box-shadow: 0 0 0 3px rgba(64,158,255,0.1);
}



/* 加载更多按钮 */
.xu5-load-more-comments {
   text-align: center;
   padding: 20px;
   border-top: 1px solid #e5e7eb;
   background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
}

.xu5-load-more-btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 10px 24px;
   background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
   border: 2px solid #409eff;
   border-radius: 20px;
   color: #409eff;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.3s ease;
   box-shadow: 0 2px 8px rgba(64,158,255,0.15);
}

.xu5-load-more-btn:hover {
   background: linear-gradient(135deg, #409eff 0%, #337ecc 100%);
   color: #fff;
   transform: translateY(-2px);
   box-shadow: 0 4px 16px rgba(64,158,255,0.3);
}

.xu5-load-more-btn:active {
   transform: translateY(0);
}

.xu5-load-more-btn .btn-count {
   font-size: 12px;
   opacity: 0.8;
}

/* 空状态 */
.xu5-comments-empty {
   text-align: center;
   padding: 60px 32px;
   background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.xu5-comments-empty .empty-icon {
   font-size: 4em;
   margin-bottom: 16px;
   opacity: 0.4;
   animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
   0%, 100% { transform: translateY(0); }
   50% { transform: translateY(-10px); }
}

.xu5-comments-empty .empty-text {
   font-size: 16px;
   color: #9ca3af;
   font-weight: 500;
}

/* 去掉所有列表原点 */
.xu5-tutorial-comments ul,
.xu5-tutorial-comments ol,
.xu5-tutorial-comments li {
   list-style: none !important;
   margin: 0;
   padding: 0;
}

.xu5-tutorial-comments .comment-list {
   list-style: none !important;
   margin: 0;
   padding: 0;
}

/* 评论项 - 独立卡片设计（紧凑版）*/
.xu5-tutorial-comments .xu5-comment-item {
   padding: 16px 20px;
   padding-left: 56px;
   position: relative;
   transition: all 0.3s ease;
   margin-bottom: 10px;
   background: #ffffff;
   border-radius: 10px;
   border: 1px solid rgba(0,0,0,0.08);
   box-shadow: 0 2px 8px rgba(0,0,0,0.04);
   list-style: none !important;
   counter-increment: comment-counter;
}

/* 楼层号样式 */
.xu5-tutorial-comments .floor-number {
    position: absolute;
    left: 14px;
    top: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #409eff;
    background: linear-gradient(135deg, #d9ecff, #b3d8ff);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(64,158,255,0.15);
}

/* 隐藏嵌套评论的楼层号 */
.xu5-tutorial-comments .children .floor-number {
    display: none !important;
}

/* 移除原有的 ::before 伪元素 */
.xu5-tutorial-comments .xu5-comment-item::before {
    display: none !important;
}

/* 重置计数器，只在顶级评论列表重置 */
.xu5-tutorial-comments > .comment-list {
    counter-reset: comment-counter;
}

/* 只在顶级评论显示楼层号 */
.xu5-tutorial-comments > .comment-list > .xu5-comment-item::before {
    content: '#' counter(comment-counter);
    position: absolute;
    left: 14px;
    top: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #409eff;
    background: linear-gradient(135deg, #d9ecff, #b3d8ff);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(64,158,255,0.15);
}

/* 作者评论特殊标记 */
.xu5-tutorial-comments .bypostauthor > .xu5-comment-item {
   border: 2px solid #10b981;
   background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.xu5-tutorial-comments .bypostauthor > .xu5-comment-item::before {
   background: linear-gradient(135deg, #10b981, #059669);
   color: #fff;
}

.xu5-tutorial-comments .bypostauthor .xu5-comment-author::after {
   content: '作者';
   display: inline-block;
   margin-left: 8px;
   background: linear-gradient(135deg, #10b981, #059669);
   color: #fff;
   font-size: 11px;
   padding: 2px 8px;
   border-radius: 10px;
   font-weight: 600;
}

.xu5-tutorial-comments .xu5-comment-item:hover {
   background: #fafbfc;
   border-color: rgba(64,158,255,0.2);
   box-shadow: 0 4px 16px rgba(0,0,0,0.08);
   transform: translateY(-1px);
}

.xu5-tutorial-comments .xu5-comment-item:last-child {
   margin-bottom: 0;
}

/* 评论头部 - 紧凑设计 */
.xu5-tutorial-comments .xu5-comment-header {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   margin-bottom: 8px;
   gap: 10px;
}

.xu5-tutorial-comments .xu5-comment-author {
   font-weight: 600;
   font-size: 14px;
   color: #1a1a1a;
   letter-spacing: -0.01em;
}

.xu5-tutorial-comments .xu5-comment-date {
   color: #6b7280;
   font-size: 12px;
   font-weight: 400;
   background: rgba(107,114,128,0.1);
   padding: 3px 8px;
   border-radius: 10px;
   white-space: nowrap;
}

.xu5-tutorial-comments .xu5-comment-await {
   color: #f59e0b;
   font-size: 12px;
   font-weight: 500;
   background: rgba(245,158,11,0.1);
   padding: 4px 10px;
   border-radius: 12px;
   border: 1px solid rgba(245,158,11,0.2);
}

/* 评论内容 - 紧凑排版 */
.xu5-tutorial-comments .xu5-comment-content {
   margin: 0;
}

.xu5-tutorial-comments .xu5-comment-content p {
   margin: 0;
   font-size: 14px;
   line-height: 1.5;
   color: #374151;
   font-weight: 400;
}

/* 回复按钮 - 精致设计 */
.xu5-tutorial-comments .xu5-comment-reply {
   display: inline-flex;
   align-items: center;
   gap: 4px;
   color: #409eff;
   text-decoration: none;
   font-size: 12px;
   font-weight: 500;
   margin-top: 8px;
   padding: 4px 10px;
   border-radius: 10px;
   background: rgba(64,158,255,0.05);
   border: 1px solid rgba(64,158,255,0.1);
   transition: all 0.2s ease;
}

.xu5-tutorial-comments .xu5-comment-reply:hover {
   background: #409eff;
   color: #ffffff;
   transform: translateY(-1px);
}

/* 嵌套评论 - 限制缩进层级 */
.xu5-tutorial-comments .children {
    margin-left: 30px;
    margin-top: 10px;
    position: relative;
    list-style: none !important;
}

/* 第2层及以后不再增加缩进 */
.xu5-tutorial-comments .children .children {
    margin-left: 0 !important;
}

/* 删除左侧竖线 */
.xu5-tutorial-comments .children::before {
    display: none;
}

.xu5-tutorial-comments .children .xu5-comment-item {
   background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
   border-radius: 8px;
   margin-bottom: 8px;
   border: 1px solid rgba(64,158,255,0.15);
   box-shadow: 0 2px 8px rgba(64,158,255,0.08);
   position: relative;
   list-style: none !important;
   padding: 14px 16px;
}

/* 嵌套评论的楼层号 - 不显示数字，改为"回复"标记 */
.xu5-tutorial-comments .children .xu5-comment-item::before {
    /* 完全删除或注释掉 */
    /* content: '↩️';
    position: absolute;
    left: 16px;
    top: 24px;
    font-size: 18px;
    background: #409eff;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(64,158,255,0.25); */
}

/* 调整嵌套评论的内边距 */
.xu5-tutorial-comments .children .xu5-comment-item {
    padding: 14px 16px;
}

/* 回复标记样式 */
.xu5-tutorial-comments .xu5-reply-to {
    color: #409eff;
    font-size: 13px;
    font-weight: 500;
    margin-right: 5px;
}
.xu5-tutorial-comments .xu5-reply-to .reply-name {
    background: rgba(64,158,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.xu5-tutorial-comments .children .xu5-comment-item:hover {
   background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
   border-color: rgba(64,158,255,0.25);
   box-shadow: 0 4px 16px rgba(64,158,255,0.12);
}

.xu5-tutorial-comments .children .xu5-comment-item:last-child {
   margin-bottom: 0;
}

/* 评论表单 - 独立表单设计 */
.xu5-tutorial-comments form.comment-form {
   background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
   padding: 32px;
   border-top: 2px solid rgba(64,158,255,0.1);
   position: relative;
   margin-top: 0;
}

/* 隐藏WordPress默认的标题 */
.xu5-tutorial-comments form.comment-form .comment-reply-title,
.xu5-tutorial-comments .comment-reply-title,
#reply-title {
   display: none !important;
}

.xu5-tutorial-comments form.comment-form::before {
   content: '✍️ 发表评论';
   position: absolute;
   top: -12px;
   left: 32px;
   background: linear-gradient(135deg, #409eff, #337ecc);
   color: #fff;
   padding: 6px 16px;
   font-weight: 600;
   font-size: 14px;
   border-radius: 20px;
   box-shadow: 0 2px 8px rgba(64,158,255,0.3);
}

/* 表单字段容器 */
.xu5-tutorial-comments form.comment-form .comment-form-comment {
   position: relative;
}

/* 字数统计 */
.xu5-tutorial-comments form.comment-form textarea {
   padding-bottom: 40px;
}

.xu5-tutorial-comments .char-counter {
   position: absolute;
   bottom: 28px;
   right: 16px;
   font-size: 12px;
   color: #9ca3af;
   pointer-events: none;
}

.xu5-tutorial-comments .char-counter.warning {
   color: #f59e0b;
}

.xu5-tutorial-comments .char-counter.error {
   color: #ef4444;
}

.xu5-tutorial-comments form.comment-form label {
   display: block;
   margin-bottom: 6px;
   font-weight: 500;
   font-size: 14px;
   color: #374151;
}

.xu5-tutorial-comments form.comment-form input,
.xu5-tutorial-comments form.comment-form textarea {
   width: 100%;
   padding: 12px;
   border: 1px solid rgba(0,0,0,0.1);
   border-radius: 10px;
   margin-bottom: 16px;
   font-size: 15px;
   font-family: inherit;
   background: #ffffff;
   transition: all 0.2s ease;
   box-sizing: border-box;
}

.xu5-tutorial-comments form.comment-form input:focus,
.xu5-tutorial-comments form.comment-form textarea:focus {
   outline: none;
   border-color: #409eff;
   box-shadow: 0 0 0 3px rgba(64,158,255,0.1);
}

.xu5-tutorial-comments form.comment-form textarea {
   min-height: 100px;
   resize: vertical;
}

.xu5-tutorial-comments form.comment-form input[type="submit"] {
   background: linear-gradient(135deg, #409eff 0%, #337ecc 100%);
   color: #ffffff;
   border: none;
   padding: 12px 24px;
   border-radius: 10px;
   font-size: 15px;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   box-shadow: 0 4px 12px rgba(64,158,255,0.3);
}

.xu5-tutorial-comments form.comment-form input[type="submit"]:hover {
   transform: translateY(-2px);
   box-shadow: 0 6px 20px rgba(64,158,255,0.4);
}

.xu5-tutorial-comments form.comment-form input[type="submit"]:active {
   transform: translateY(0);
}

/* 提示信息 */
.xu5-tutorial-comments .comment-notes {
   background: rgba(64,158,255,0.05);
   border: 1px solid rgba(64,158,255,0.1);
   border-radius: 10px;
   padding: 12px;
   margin-bottom: 20px;
   font-size: 14px;
   color: #374151;
}

.xu5-tutorial-comments .required {
   color: #ef4444;
}

/* PC端名称和邮箱显示在一行 - 使用flex布局 */
.xu5-tutorial-comments form.comment-form {
   display: flex;
   flex-wrap: wrap;
   gap: 16px;
}

.xu5-tutorial-comments form.comment-form > p {
   width: 100%;
   margin: 0;
}

.xu5-tutorial-comments form.comment-form > p.comment-form-author,
.xu5-tutorial-comments form.comment-form > p.comment-form-email {
   width: calc(50% - 8px);
   flex: 0 0 calc(50% - 8px);
}

/* 移动端恢复为上下排列 */
@media (max-width: 768px) {
   .xu5-tutorial-comments form.comment-form > p.comment-form-author,
   .xu5-tutorial-comments form.comment-form > p.comment-form-email {
      width: 100%;
      flex: 0 0 100%;
   }
}

/* Toast 提示框样式 */
#comment-toast {
   display: none;
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   background: #222;
   color: #fff;
   padding: 24px 48px;
   border-radius: 16px;
   box-shadow: 0 4px 32px rgba(0,0,0,0.18);
   font-size: 1.35rem;
   z-index: 9999;
   transition: opacity 0.3s;
   width: auto;
   max-width: 90vw;
   text-align: center;
}

/* 移动端优化 */
@media (max-width: 768px) {
   .xu5-tutorial-comments {
      margin: 32px 0;
      border-radius: 12px;
   }
   
   .xu5-comments-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
      padding: 20px;
   }
   
  
   
   .xu5-tutorial-comments .xu5-comment-item {
      padding: 16px;
      padding-left: 52px;
   }
   
   .xu5-tutorial-comments .xu5-comment-item::before {
      left: 10px;
      top: 14px;
      width: 30px;
      height: 30px;
      font-size: 13px;
   }
   
   .xu5-tutorial-comments .xu5-comment-header {
      gap: 6px;
      margin-bottom: 10px;
   }
   
   .xu5-tutorial-comments .xu5-comment-author {
      font-size: 13px;
      flex: 0 0 auto;
   }
   
   .xu5-tutorial-comments .xu5-comment-date {
      font-size: 11px;
      padding: 2px 6px;
   }
   
   .xu5-tutorial-comments .children {
      margin-left: 15px;
   }
   
   /* 移动端第2层及以后不再缩进 */
   .xu5-tutorial-comments .children .children {
      margin-left: 0 !important;
   }
   
   .xu5-tutorial-comments .children .xu5-comment-item {
      padding: 12px;
   }
   
   .xu5-tutorial-comments form.comment-form {
      padding: 24px;
   }
   
   .xu5-tutorial-comments form.comment-form::before {
      left: 24px;
   }
}

@media (max-width: 500px) {
   #comment-toast {
      font-size: 1rem !important;
      padding: 12px 10vw !important;
      border-radius: 8px !important;
      max-width: 96vw !important;
   }
}

@media (max-width: 480px) {
   .xu5-tutorial-comments .xu5-comment-item {
      padding: 16px;
   }
   .xu5-tutorial-comments form.comment-form {
      padding: 20px;
   }
   .xu5-tutorial-comments form.comment-form::before {
      left: 20px;
   }
} 

/* 评论模块交互和动画增强 */

/* 评论项鼠标悬停动画增强 */
.xu5-tutorial-comments .xu5-comment-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.xu5-tutorial-comments .xu5-comment-item:hover {
    transform: scale(1.02);  /* 轻微放大 */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f9fafb, #ffffff);
}

/* 回复按钮动态效果 */
.xu5-tutorial-comments .xu5-comment-reply {
    position: relative;
    overflow: hidden;
}

.xu5-tutorial-comments .xu5-comment-reply::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: all 0.5s;
}

.xu5-tutorial-comments .xu5-comment-reply:hover::before {
    left: 100%;
}

/* 评论内容选择高亮 */
.xu5-tutorial-comments .xu5-comment-content p::selection {
    background: rgba(64,158,255,0.2);
    color: #337ecc;
}

/* 嵌套评论层次感 */
.xu5-tutorial-comments .children {
    position: relative;
}

.xu5-tutorial-comments .children .xu5-comment-item {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.xu5-tutorial-comments .children .xu5-comment-item:hover {
    border-left-color: #409eff;
}

/* 字数统计增强 */
.xu5-tutorial-comments .char-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.xu5-tutorial-comments .char-counter::before {
    content: '✍️';
    font-size: 14px;
    opacity: 0.6;
}

.xu5-tutorial-comments .char-counter.warning::before,
.xu5-tutorial-comments .char-counter.error::before {
    content: '⚠️';
}

/* 提交按钮粒子效果 */
.xu5-tutorial-comments form.comment-form input[type="submit"] {
    position: relative;
    overflow: hidden;
}

.xu5-tutorial-comments form.comment-form input[type="submit"]::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
} 

/* 只在顶级评论显示楼层号 */
.xu5-tutorial-comments .children .xu5-comment-item::before {
    display: none !important;
}

/* 保留顶级评论的楼层号样式 */
.xu5-tutorial-comments .xu5-comment-item:not(.children .xu5-comment-item)::before {
    content: '#' counter(comment-counter);
    position: absolute;
    left: 14px;
    top: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #409eff;
    background: linear-gradient(135deg, #d9ecff, #b3d8ff);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(64,158,255,0.15);
} 

/* 移动端楼层号处理 */
@media (max-width: 768px) {
    .xu5-tutorial-comments .floor-number {
        display: none !important;
    }

    .xu5-tutorial-comments .xu5-comment-item {
        padding-left: 16px; /* 移除楼层号预留空间 */
    }
    
    /* 移动端回复标记样式 */
    .xu5-tutorial-comments .xu5-reply-to {
        display: block;
        font-size: 12px;
        margin-top: 2px;
    }
    
    /* 移动端评论头部换行 */
    .xu5-tutorial-comments .xu5-comment-header {
        flex-wrap: wrap;
    }
}

@media (min-width: 769px) {
    .xu5-tutorial-comments .floor-number {
        position: absolute;
        left: 14px;
        top: 16px;
        font-size: 14px;
        font-weight: 700;
        color: #409eff;
        background: linear-gradient(135deg, #d9ecff, #b3d8ff);
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(64,158,255,0.15);
    }

    .xu5-tutorial-comments .children .floor-number {
        display: none !important;
    }
} 