.clearfix::after {
    content: '';
    display: table;
    clear: both;
}
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.2);
}
.btn-primary:active {
    transform: translateY(0);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}
.checkbox {
    margin-right: 8px;
    accent-color: #165DFF;
}

#comment-container {
    max-width: 1000px;
    margin: 30px auto;
}

#commentlist dl {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    display: flex;
    gap: 16px;
}
#commentlist dl:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
#commentlist dt {
    flex-shrink: 0;
}
#commentlist dt img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f2f5;
    transition: border-color 0.3s ease;
}
#commentlist dl:hover dt img {
    border-color: #165DFF;
}
#commentlist dd {
    flex: 1;
}
.parent {
    position: relative;
}
.parent cite {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-right: 12px;
}
.parent small {
    font-size: 13px;
    color: #94a3b8;
    margin-right: 16px;
}
.parent .reply {
    font-size: 13px;
    color: #165DFF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.parent .reply::before {
    content: '@';
    margin-right: 4px;
}
.parent .reply:hover {
    color: #0E42D2;
    text-decoration: underline;
}
.parent p {
    font-size: 15px;
    color: #475569;
    line-height: 1.8;
    white-space: pre-line;
    padding: 8px 0;
    border-top: 1px solid #f8f9fa;
}
.loadmore-nodata {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 15px;
}
.loadmore-tips {
    display: inline-block;
    padding: 8px 24px;
    background-color: #f8f9fa;
    border-radius: 30px;
}

#commentpager {
    margin-bottom: 40px;
    text-align: center;
}
#commentpager .pagination {
    display: inline-flex;
    gap: 8px;
    list-style: none;
}
#commentpager .pagination li a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 6px;
    background-color: #fff;
    color: #475569;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
#commentpager .pagination li.active a {
    background-color: #165DFF;
    color: #fff;
    font-weight: 500;
}
#commentpager .pagination li a:hover:not(.active) {
    background-color: #f8f9fa;
    color: #165DFF;
}

#postcomment {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
#cancel {
    cursor: pointer;
    color: #ccc;
}
#postcomment h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#postcomment h3 small {
    font-size: 14px;
    font-weight: 400;
    color: #94a3b8;
    cursor: pointer;
}
#postcomment h3 small:hover {
    color: #165DFF;
}
#postform .form-group {
    margin-bottom: 20px;
}
#commentcontent {
    min-height: 120px;
    resize: vertical;
}
#commentcontent::placeholder {
    color: #94a3b8;
}
.form-group:last-of-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#actiontips {
    margin-left: 16px;
    font-size: 13px;
    color: #94a3b8;
}
.checkbox + label {
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
}

@media (max-width: 768px) {
    #commentlist dl {
        padding: 16px;
        gap: 12px;
    }
    #commentlist dt img {
        width: 50px;
        height: 50px;
    }
    .parent cite {
        font-size: 15px;
    }
    .parent p {
        font-size: 14px;
    }
    #postcomment {
        padding: 20px;
    }
    #postcomment h3 {
        font-size: 18px;
    }
    .form-group:last-of-type {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    #actiontips {
        margin-left: 0;
    }
    #commentpager .pagination li a {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
    }
}
.page-link{
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 6px;
    background-color: #fff;
    color: #475569;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.pagination{
    display: inline-flex;
    gap: 4px;
    list-style: none;
    margin: 20px 0;
    padding: 0;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.btn-loading {
    position: relative;
    padding-left: 36px;
}
.btn-loading::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}