/* 评论样式
---------------------------------------------------*/
/* 评论表单容器优化 */
.commentform {
    background: var(--ifm-background-surface-color);
    border: 1px solid var(--ifm-color-emphasis-200);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.commentform:focus-within {
    border-color: var(--ifm-color-primary);
    box-shadow: 0 4px 16px rgba(53, 120, 229, 0.15);
}

#comments {
    margin-top: 60px;
}

/* 评论输入框优化 */
.log_comment {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--ifm-color-emphasis-300);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--ifm-background-color);
    color: var(--ifm-color-content);
}

.log_comment:focus {
    outline: none;
    border-color: var(--ifm-color-primary);
    box-shadow: 0 0 0 2px rgba(53, 120, 229, 0.2);
}

.comment-post #comment {
    width: 100%;
    border: 1px solid var(--ifm-color-emphasis-300);
    font-size: 14px;
    border-radius: 8px;
    height: 120px;
    resize: vertical;
    padding: 16px;
    font-family: var(--ifm-font-family-base);
    line-height: 1.6;
    background: var(--ifm-background-surface-color, #ffffff);
    color: var(--ifm-color-content);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.comment-post #comment:focus {
    outline: none;
    border-color: var(--ifm-color-primary);
    box-shadow: 0 0 0 3px rgba(53, 120, 229, 0.1);
    background: var(--ifm-background-surface-color, #ffffff);
}

.comment-post #comment::placeholder {
    color: var(--ifm-color-emphasis-600);
    opacity: 0.8;
}

/* 评论信息输入框布局优化 */
.comment-info {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.comment-info .com_control {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--ifm-color-emphasis-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--ifm-background-color);
    color: var(--ifm-color-content);
}

.comment-info .com_control:focus {
    outline: none;
    border-color: var(--ifm-color-primary);
    box-shadow: 0 0 0 2px rgba(53, 120, 229, 0.2);
}

.com_control {
    flex: 1;
    display: block;
    border-radius: 8px;
    border: 2px solid var(--ifm-color-emphasis-300);
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    font-family: var(--ifm-font-family-base);
    background: var(--ifm-background-surface-color, #ffffff);
    color: var(--ifm-color-content);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.com_control:focus {
    outline: none;
    border-color: var(--ifm-color-primary);
    box-shadow: 0 0 0 3px rgba(53, 120, 229, 0.1);
}

.comment-name {
    border-bottom-left-radius: 8px !important;
}

.comment-mail {
    border-bottom-right-radius: 8px !important;
}

/* 输入框占位符样式 */
.com_control::placeholder {
    color: var(--ifm-color-emphasis-600);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.com_control:focus::placeholder {
    opacity: 0.5;
}

@media (min-width: 578px) {
    .com_control::placeholder {
        text-align: left;
    }
}

/* 提交按钮区域优化 */
.comment-submit-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ifm-color-emphasis-200);
}

.comment-post #comment_submit {
    background: var(--ifm-color-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(53, 120, 229, 0.2);
    margin: 0;
    float: none;
}

.comment-post #comment_submit:hover {
    background: var(--ifm-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(53, 120, 229, 0.3);
}

.comment-post #comment_submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(53, 120, 229, 0.2);
}

/* 回复状态指示 */
.reply-indicator {
    color: var(--ifm-color-primary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    background: var(--ifm-color-primary-lightest);
    border-radius: 4px;
    display: none;
}

.reply-indicator.active {
    display: inline-block;
}

/* 取消回复按钮 */
.cancel-reply {
    color: var(--ifm-color-emphasis-600);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: none;
}

.cancel-reply:hover {
    color: var(--ifm-color-danger);
    /* 移除背景色变化 */
}

.cancel-reply.active {
    display: inline-block;
}

/* 评论头部样式 */
.comment-header {
    margin: 40px 0 30px 0;
    padding: 16px 0;
    border-bottom: 2px solid var(--ifm-color-emphasis-200);
}

.comment-header b {
    font-size: 18px;
    font-weight: 600;
    color: var(--ifm-color-content);
}

/* 评论项样式优化 */
.comment {
    margin: 20px 0;
    padding: 20px 0;
    font-size: 14px;
    overflow: hidden;
    color: var(--ifm-color-content);
    border-bottom: 1px solid var(--ifm-color-emphasis-200);
}

.comment:last-child {
    border-bottom: none;
}

.comment .avatar {
    float: left;
    margin: 5px 12px 5px 0;
}

.comment .avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    border: 2px solid var(--ifm-color-emphasis-200);
}

.comment .comment-infos {
    background: var(--ifm-background-surface-color, #ffffff);
    padding: 16px 20px;
    border-radius: 12px;
    margin-left: 72px;
    color: var(--ifm-color-content);
    border: 1px solid var(--ifm-color-emphasis-200);
    position: relative;
}

/* 评论气泡箭头 */
.arrow {
    position: absolute;
    margin-top: 8px;
    margin-left: -21px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: var(--ifm-color-emphasis-200);
}

.arrow::after {
    content: '';
    position: absolute;
    top: -9px;
    left: 1px;
    width: 0;
    height: 0;
    border: 9px solid transparent;
    border-right-color: var(--ifm-background-surface-color, #ffffff);
}

.comment .comment-content {
    margin: 12px 0 8px 0;
    word-break: break-word;
    color: var(--ifm-color-content);
    line-height: 1.6;
}

.comment .comment-time {
    color: var(--ifm-color-emphasis-600);
    font-size: 12px;
    margin-left: 8px;
}

.comment .comment-reply {
    float: right;
    font-size: 12px;
    cursor: pointer;
    margin-top: -8px;
    /* 移除背景色变化 */
}

.comment .comment-reply:hover {
    color: var(--ifm-color-primary);
    text-decoration: none;
    /* 移除背景色变化 */
}

/* 子评论样式 */
.comment-children {
    margin: 16px 0 16px 40px;
    clear: both;
    border: none;
    padding: 0;
}

.comment-children .comment-infos {
    background: var(--ifm-color-emphasis-100);
    border-color: var(--ifm-color-emphasis-300);
}

.comment-children .arrow::after {
    border-right-color: var(--ifm-color-emphasis-100);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .commentform {
        padding: 16px;
        margin: 16px 0;
    }
    
    .comment-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .comment-info .com_control {
        min-width: auto;
    }
    
    .comment-submit-area {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .comment-post #comment_submit {
        width: 100%;
        padding: 14px;
    }
    
    .comment .comment-infos {
        margin-left: 60px;
        padding: 12px 16px;
    }
    
    .comment .avatar img {
        width: 40px;
        height: 40px;
    }
    
    .comment-children {
        margin-left: 20px;
    }
}

@media (max-width: 480px) {
    .log_comment {
        min-height: 100px;
        padding: 12px;
    }
    
    .commentform {
        padding: 12px;
    }
    
    .comment .comment-infos {
        margin-left: 0;
        margin-top: 12px;
    }
    
    .comment .avatar {
        float: none;
        text-align: center;
        margin: 0 0 8px 0;
    }
    
    .arrow {
        display: none;
    }
}

.form-controls {
    display: block;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--borderColor);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-in-out
}

.comment-post {
    clear: both
}

.comment-post p {
    margin: 5px 0px
}

.comment-post small {
    font-size: 12px;
    color: #999
}

.comment-post input {
    padding: 7px 40px;
    font-size: small;
    color: #848797;
    width: 50%
}

.comment-post .input {
    width: 100px
}

.comment span {
    color: var(--fontColor);
}

.comment .comment-infos-unGravatar {
    padding: 5px
}

.com-bottom {
    margin-bottom: 80px;
}

.comment .comment-post {
    width: 90%;
    margin: 15px auto
}

/* 验证码模态框样式 */
#myModal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

#myModal .modal-dialog {
    position: relative;
    width: auto;
    margin: 10% auto;
    max-width: 500px;
}

#myModal .modal-content {
    background-color: var(--ifm-background-surface-color, #ffffff);
    border: 1px solid var(--ifm-color-emphasis-200);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block;
    position: relative;
    padding: 0;
    margin: 0;
}

#myModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ifm-color-emphasis-200);
    background-color: var(--ifm-background-surface-color, #ffffff);
    border-radius: 12px 12px 0 0;
}

#myModal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ifm-color-content);
    margin: 0;
}

#myModal .close {
    color: var(--ifm-color-emphasis-600);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#myModal .close:hover {
    color: var(--ifm-color-danger);
    background-color: var(--ifm-color-danger-lightest);
}

#myModal .modal-body {
    padding: 20px;
    text-align: center;
}

#myModal .modal-body img {
    margin: 10px 0;
    border: 1px solid var(--ifm-color-emphasis-300);
    border-radius: 4px;
}

#myModal .modal-body input[type="text"] {
    width: 100%;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--ifm-color-emphasis-300);
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

#myModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--ifm-color-emphasis-200);
    background-color: var(--ifm-background-surface-color, #ffffff);
    border-radius: 0 0 12px 12px;
}

#myModal .btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

#myModal .btn-secondary {
    background-color: var(--ifm-color-emphasis-200);
    color: var(--ifm-color-content);
    border-color: var(--ifm-color-emphasis-300);
}

#myModal .btn-secondary:hover {
    background-color: var(--ifm-color-emphasis-300);
}

#myModal .btn-primary {
    background-color: var(--ifm-color-primary);
    color: #ffffff;
    border-color: var(--ifm-color-primary);
}

#myModal .btn-primary:hover {
    background-color: var(--ifm-color-primary-dark);
    border-color: var(--ifm-color-primary-dark);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #myModal .modal-dialog {
        margin: 5% auto;
        max-width: 90%;
    }
    
    #myModal .modal-header,
    #myModal .modal-footer {
        padding: 12px 16px;
    }
    
    #myModal .modal-body {
        padding: 16px;
    }
}