/* ==========================================================================
   Anatole Theme - Comment Styles
   ========================================================================== */

#comments {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--comment-border, #eee);
}

.theme--light #comments {
    --comment-border: #e9ecef;
    --comment-bg: #f8fafc;
    --comment-box-bg: #ffffff;
    --comment-text: #374151;
    --comment-text-muted: #94a3b8;
    --comment-primary: #6086b4;
    --comment-primary-hover: #4e729e;
    --comment-input-bg: #ffffff;
    --comment-input-border: #e2e8f0;
    --comment-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.theme--dark #comments {
    --comment-border: rgba(255, 255, 255, 0.08);
    --comment-bg: #1c2932;
    --comment-box-bg: #152028;
    --comment-text: #e2e8f0;
    --comment-text-muted: #8292a2;
    --comment-primary: #6086b4;
    --comment-primary-hover: #7ba3d0;
    --comment-input-bg: #1c2932;
    --comment-input-border: rgba(255, 255, 255, 0.12);
    --comment-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 评论标题 */
.comment-header {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 28px 0 16px;
    color: var(--comment-text, #374151);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 发表评论表单 */
.comment-post {
    margin-bottom: 32px;
}

.commentform {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.commentform textarea.log_comment {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--comment-text, #374151);
    background-color: var(--comment-input-bg, #fff);
    border: 1px solid var(--comment-input-border, #e2e8f0);
    border-radius: 0;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.commentform textarea.log_comment:focus {
    border-color: var(--comment-primary, #6086b4);
    box-shadow: 0 0 0 2px rgba(96, 134, 180, 0.15);
}

/* 游客信息输入框栏 */
.comment-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-info .com_control {
    flex: 1 1 140px;
    height: 40px;
    padding: 8px 12px;
    font-size: 1.3rem;
    color: var(--comment-text, #374151);
    background-color: var(--comment-input-bg, #fff);
    border: 1px solid var(--comment-input-border, #e2e8f0);
    border-radius: 0;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.comment-info .com_control:focus {
    border-color: var(--comment-primary, #6086b4);
    box-shadow: 0 0 0 2px rgba(96, 134, 180, 0.15);
}

/* 验证码容器 */
.captcha-container {
    display: flex;
    align-items: center;
    height: 40px;
    background-color: var(--comment-input-bg, #fff);
    border: 1px solid var(--comment-input-border, #e2e8f0);
    border-radius: 0;
    padding: 0 8px;
    gap: 8px;
    box-sizing: border-box;
}

.captcha-container img#captcha {
    height: 28px;
    border-radius: 0;
    cursor: pointer;
    vertical-align: middle;
}

.captcha-container .captcha_input {
    border: none;
    outline: none;
    background: transparent;
    height: 100%;
    width: 60px;
    font-size: 1.3rem;
    color: var(--comment-text, #374151);
}

/* 提交按钮区域 */
.com_submit_p {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.com_submit_p .btn-comment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    font-size: 1.3rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    outline: none;
    text-decoration: none;
}

.com_submit_p .btn-submit {
    background-color: var(--comment-primary, #6086b4);
    border: 1px solid var(--comment-primary, #6086b4);
    color: #ffffff;
}

.com_submit_p .btn-submit:hover {
    background-color: var(--comment-primary-hover, #4e729e);
    border-color: var(--comment-primary-hover, #4e729e);
}

.com_submit_p .btn-cancel {
    background-color: transparent;
    border: 1px solid var(--comment-input-border, #e2e8f0);
    color: var(--comment-text-muted, #94a3b8);
}

.com_submit_p .btn-cancel:hover {
    border-color: var(--comment-primary, #6086b4);
    color: var(--comment-primary, #6086b4);
}

.login-comment-notice {
    font-size: 1.3rem;
    color: var(--comment-text-muted, #94a3b8);
}

.login-comment-notice a {
    color: var(--comment-primary, #6086b4);
    text-decoration: underline;
}

/* 评论列表 */
.comment-list-wrapper {
    margin-top: 24px;
}

.comment {
    position: relative;
    margin-bottom: 18px;
    display: block;
}

.comment-item-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.comment .avatar {
    flex-shrink: 0;
}

.comment .avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--comment-border, #eee);
    background-color: var(--comment-input-bg, #fff);
}

.comment .comment-infos {
    flex: 1;
    background-color: var(--comment-bg, #f8fafc);
    border: 1px solid var(--comment-border, #e9ecef);
    border-radius: 0;
    padding: 14px 16px;
    position: relative;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment .comment-infos:hover {
    border-color: rgba(96, 134, 180, 0.35);
    box-shadow: var(--comment-shadow);
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.comment-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--comment-text, #374151);
}

.comment-author a {
    color: inherit;
    text-decoration: none;
}

.comment-author a:hover {
    color: var(--comment-primary, #6086b4);
    text-decoration: underline;
}

.comment-time {
    font-size: 1.2rem;
    color: var(--comment-text-muted, #94a3b8);
}

.comment-content {
    font-size: 1.4rem;
    line-height: 1.7;
    color: var(--comment-text, #374151);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.comment-reply {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.comment-reply .com-reply {
    background: transparent;
    border: 1px solid var(--comment-input-border, #e2e8f0);
    border-radius: 0;
    padding: 3px 10px;
    font-size: 1.15rem;
    color: var(--comment-text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-reply .com-reply:hover {
    border-color: var(--comment-primary, #6086b4);
    color: var(--comment-primary, #6086b4);
}

/* 子评论层级嵌套 */
.comment-children {
    margin-left: 54px;
    margin-top: 14px;
    position: relative;
    border-left: 2px solid var(--comment-border, #e9ecef);
    padding-left: 14px;
}

.comment-children .comment .avatar img {
    width: 32px;
    height: 32px;
}

.comment-children .comment .comment-infos {
    padding: 10px 14px;
}

/* 评论移动至子节点时的临时表单样式 */
.comment .comment-post {
    margin-top: 14px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px dashed var(--comment-border, #eee);
}

/* 评论分页 */
#comments #pagenavi {
    margin-top: 24px;
    text-align: center;
}

#comments #pagenavi a,
#comments #pagenavi span {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 3px;
    font-size: 1.2rem;
    border: 1px solid var(--comment-input-border, #e2e8f0);
    border-radius: 0;
    color: var(--comment-text, #374151);
    text-decoration: none;
}

#comments #pagenavi span.current {
    background-color: var(--comment-primary, #6086b4);
    border-color: var(--comment-primary, #6086b4);
    color: #ffffff;
}

@media (max-width: 560px) {
    .comment-children {
        margin-left: 16px;
        padding-left: 8px;
    }

    .comment-info .com_control {
        flex: 1 1 100%;
    }

    .captcha-container {
        width: 100%;
    }
}
