.pages ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 替代 Bootstrap 的 .my-4（站点无此工具类） */
.pages nav[aria-label] {
    margin: 2.25rem 0 0;
}

/* --------------------------------------------------------------------------
   2. 分页条容器：水平居中、可换行（窄屏自动折行）
   -------------------------------------------------------------------------- */
.pages .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   3. 页码按钮：40px 方块，与皮肤 .pages ul li a 规范一致
      同时覆盖两种写法：
        <a class="page-item page-link">首页</a>   （文字页码）
        <a class="page-num">2</a>                 （数字页码）
   -------------------------------------------------------------------------- */
.pages .pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 40px;
    height: 40px;
    padding: 0 16px;                    /* 「首页 / 上一页」等两字按钮需要横向留白 */
    background: #f8f8f8;
    border: 1px solid #e2e2e2;
    color: #666;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.pages .pagination a:hover {
    background: #0069ba;
    border-color: #0069ba;
    color: #fff;
}

.pages .pagination a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 105, 186, .25);
}

/* 数字页码：固定 40px 宽的正方块 */
.pages .pagination a.page-num {
    padding: 0;
}

/* 当前页：蓝底白字，不可再点 */
.pages .pagination a.page-num-current,
.pages .pagination a.page-num-current:hover {
    background: #0069ba;
    border-color: #0069ba;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

/* --------------------------------------------------------------------------
   4. 禁用态：模板对「不可上一页」输出的是 href="javascript:;"，
      用属性选择器精准识别并置灰（避免误导用户点击）
   -------------------------------------------------------------------------- */
.pages .pagination a[href="javascript:;"],
.pages .pagination a[href="javascript:;"]:hover {
    background: #f8f8f8;
    border-color: #e2e2e2;
    color: #bfbfbf;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   5. 窄屏适配：小屏时按钮略缩小，避免折行拥挤
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
    .pages .pagination {
        gap: 6px;
    }
    .pages .pagination a {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }
    .pages .pagination a.page-num {
        padding: 0;
    }
}
 

/* ==========================================================================
   1. 主题变量
   ========================================================================== */
.comment-area,
#reply {    margin-top: 50px ;
 
    --cmt-accent: #0dcaf0;                        /* 主色，与按钮 btn-info 呼应 */
    --cmt-accent-dark: #0aa2c0;                   /* 主色加深，用于 hover / 强调文字 */
    --cmt-accent-soft: rgba(13, 202, 240, .12);   /* 主色浅底，用于聚焦光晕 / 悬停底色 */

    --cmt-text: #1f2733;                          /* 正文 */
    --cmt-text-sub: #5c6773;                      /* 次级文字 */
    --cmt-muted: #98a2b3;                         /* 时间、占位符 */

    --cmt-line: #edf0f4;                          /* 实线分隔 */
    --cmt-line-dashed: #e4e9ef;                   /* 虚线分隔（子评论） */
    --cmt-bg: #ffffff;                            /* 卡片背景 */
    --cmt-bg-soft: #f7f9fc;                       /* 输入框 / 子评论浅底 */

    --cmt-radius: 14px;                           /* 大圆角 */
    --cmt-radius-sm: 10px;                         /* 小圆角 */
    --cmt-shadow: 0 8px 30px rgba(23, 43, 77, .07);
    --cmt-transition: .22s ease;
}

/* ==========================================================================
   2. 卡片容器
   ========================================================================== */
.comment-area .comment-card,
.comment-area > .shadow-sm {
    padding: clamp(1rem, 2.5vw, 1.75rem) !important;
    border: 1px solid var(--cmt-line);
    border-radius: var(--cmt-radius) !important;
    background: var(--cmt-bg);
    box-shadow: var(--cmt-shadow) !important;   /* BS5 工具类带 !important，需同步覆盖 */
    color: var(--cmt-text);
    scroll-margin-top: 96px;                    /* 锚点跳转避开固定导航 */
}

/* ==========================================================================
   3. 小标题（发表评论： / 评论记录：）
   ========================================================================== */
.comment-area h4 {
    position: relative;
    margin: 0 0 .9rem;
    padding-left: .8rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--cmt-text);
}
.comment-area h4::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 1.05em;
    transform: translateY(-50%);
    border-radius: 2px;
    background: linear-gradient(180deg, var(--cmt-accent), var(--cmt-accent-dark));
}
.comment-area h4:not(:first-child) {
    margin-top: 2rem;
}

/* ==========================================================================
   4. 表单：输入框 / textarea / 验证码
   ========================================================================== */
.comment-area .form-control,
#reply .form-control {
    padding: .7rem .9rem;
    border: 1px solid var(--cmt-line);
    border-radius: var(--cmt-radius-sm);
    background: var(--cmt-bg-soft);
    color: var(--cmt-text);
    font-size: .95rem;
    line-height: 1.6;
    box-shadow: none;
    transition: border-color var(--cmt-transition), background var(--cmt-transition), box-shadow var(--cmt-transition);
}
.comment-area .form-control::placeholder,
#reply .form-control::placeholder {
    color: var(--cmt-muted);
}
.comment-area .form-control:hover,
#reply .form-control:hover {
    border-color: #dbe2ea;
}
.comment-area .form-control:focus,
#reply .form-control:focus {
    border-color: var(--cmt-accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--cmt-accent-soft);
    outline: 0;
}
.comment-area textarea.form-control,
#reply textarea.form-control {
    min-height: 118px;    width: 100%;
    resize: vertical;                            /* 只允许纵向拉伸 */
}
#reply textarea.form-control {
    min-height: 104px;
}

/* 验证码图片：模板内联了 height:33px，这里只补边框 / 光标 / 交互 */
.comment-area .codeimg,
#reply .codeimg {
 
    border: 1px solid var(--cmt-line);
     
    background: #fff;
    cursor: pointer;
    object-fit: cover;
    vertical-align: top;
    transition: border-color var(--cmt-transition), transform var(--cmt-transition);
    -webkit-user-select: none;
    user-select: none;
}
.comment-area .codeimg:hover,
#reply .codeimg:hover {
    border-color: var(--cmt-accent);
}
.comment-area .codeimg:active,
#reply .codeimg:active {
    transform: scale(.97);
}

/* ==========================================================================
   5. 按钮
   ========================================================================== */
.comment-area .btn-info,
#reply .btn-info {    float: right;
    margin-top: 6px;
    padding: .55rem 1.6rem;
    border: 0;
    border-radius: 50rem;
    background-color: var(--cmt-accent);
    color: #062a33;
    font-weight: 600;
    letter-spacing: .02em;
    box-shadow: 0 6px 16px rgba(13, 202, 240, .28);
    transition: background-color var(--cmt-transition), color var(--cmt-transition), transform var(--cmt-transition), box-shadow var(--cmt-transition);
}
.comment-area .btn-info:hover,
#reply .btn-info:hover {
    background-color: var(--cmt-accent-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(13, 202, 240, .34);
}
.comment-area .btn-info:active,
#reply .btn-info:active {
    transform: translateY(0);
}
.comment-area .btn-info:focus-visible,
#reply .btn-info:focus-visible {
    box-shadow: 0 0 0 4px var(--cmt-accent-soft);
}
.comment-area .btn-info[disabled],
#reply .btn-info[disabled] {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   6. 评论列表
   ========================================================================== */
.comment-area .comment-list {
    margin-top: .25rem;
}
.comment-area .comment-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin: 0 -.75rem;
    padding: 1.1rem .75rem;
    border-bottom: 1px solid var(--cmt-line);
    border-radius: var(--cmt-radius-sm);
    transition: background-color var(--cmt-transition);
    animation: cmt-in .32s ease both;
}
.comment-area .comment-item:last-child {
    border-bottom: 0;
}
.comment-area .comment-item:hover {
    background: var(--cmt-bg-soft);
}
.comment-area .comment-body {
    flex: 1 1 auto;
    min-width: 0;                                 /* 防止长串字符撑破布局 */
}

/* 头像 */
.comment-area .comment-avatar,
#reply .comment-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--cmt-bg-soft);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--cmt-line);
}
.comment-area .comment-avatar-sm {
    width: 30px;
    height: 30px;
}

/* 昵称 / 时间 */
.comment-area .comment-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .3rem;
}
.comment-area .comment-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--cmt-text);
    word-break: break-all;
}
.comment-area .comment-time {
    font-size: .78rem;
    color: var(--cmt-muted);
}

/* 评论正文：内层保留换行，外层保持行内排版 */
.comment-area .comment-text {
    margin: 0 0 .5rem;
    font-size: .94rem;
    line-height: 1.8;
    color: var(--cmt-text);
    word-break: break-word;
    overflow-wrap: anywhere;
}
.comment-area .comment-text-inner {
    white-space: pre-wrap;                        /* 用户在 textarea 里的换行原样显示 */
}
.comment-area .comment-reply-to {
    color: var(--cmt-accent-dark);
    font-weight: 600;
}

/* 回复按钮 */
.comment-area .comment-reply-btn,
.comment-area .replybtn {
    display: inline-flex;
    align-items: center;
    margin-left: .35rem;
    padding: .16rem .65rem;
    border: 1px solid var(--cmt-line);
    border-radius: 50rem;
    background: var(--cmt-bg-soft);
    color: var(--cmt-text-sub);
    font-size: .78rem;
    line-height: 1.6;
    white-space: nowrap;
    cursor: pointer;
    vertical-align: middle;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color var(--cmt-transition), color var(--cmt-transition), border-color var(--cmt-transition);
}
.comment-area .comment-reply-btn:hover,
.comment-area .replybtn:hover {
    border-color: var(--cmt-accent);
    background: var(--cmt-accent);
    color: #062a33;
}

/* ==========================================================================
   7. 子评论（回复层级）
   ========================================================================== */
.comment-area .comment-reply-item {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px dashed var(--cmt-line-dashed);
}
.comment-area .comment-reply-item .comment-text {
    font-size: .9rem;
    margin-bottom: .35rem;
}
/* 兼容旧模板里的 .border-top-dashed（Bootstrap 5 并无此类，必须自己定义） */
.comment-area .border-top-dashed,
.comment-area .border-top-dashed.pt-3 {
    border-top: 1px dashed var(--cmt-line-dashed) !important;
    margin-top: .85rem !important;
    padding-top: .85rem !important;
}

/* ==========================================================================
   8. 锚点 / 空状态 / 分页
   ========================================================================== */
.comment-area .comment-anchor {
    display: block;
    height: 0;
    overflow: hidden;
    scroll-margin-top: 96px;
}
.comment-area .comment-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: .92rem;
    color: var(--cmt-muted);
}

.comment-area .comment-pager {
    margin: 1.5rem 0 .25rem;
}
.comment-area .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
}
.comment-area .pagination > li {
    margin: 0;
    list-style: none;
}
/* 同时兼容 <li class="page-item"><a class="page-link"> 与旧写法 <a class="page-item page-link"> */
.comment-area .pagination > li > .page-link,
.comment-area .pagination > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 1rem;
    border: 1px solid var(--cmt-line);
    border-radius: 50rem;
    background: #fff;
    color: var(--cmt-text-sub);
    font-size: .88rem;
    text-decoration: none;
    transition: background-color var(--cmt-transition), color var(--cmt-transition), border-color var(--cmt-transition);
}
.comment-area .pagination > li > .page-link:hover,
.comment-area .pagination > a:hover {
    border-color: var(--cmt-accent);
    background: var(--cmt-accent-soft);
    color: var(--cmt-accent-dark);
}
.comment-area .pagination > li.active > .page-link,
.comment-area .pagination .page-link.active {
    border-color: var(--cmt-accent);
    background: var(--cmt-accent);
    color: #062a33;
    font-weight: 600;
}
.comment-area .pagination > li.disabled > .page-link {
    opacity: .45;
    pointer-events: none;
}

/* ==========================================================================
   9. 回复弹框
   ========================================================================== */
#reply .modal-content {
    border: 0;
    border-radius: var(--cmt-radius);
    box-shadow: 0 24px 64px rgba(23, 43, 77, .18);
    overflow: hidden;
}
#reply .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cmt-line);
}
#reply .modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cmt-text);
}
#reply .modal-body {
    padding: 1.25rem;
}
#reply .modal-footer {
    gap: .5rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--cmt-line);
}
#reply .modal-footer > * {
    margin: 0;
}
#reply .btn-secondary {
    padding: .5rem 1.4rem;
    border: 1px solid var(--cmt-line);
    border-radius: 50rem;
    background: #f1f4f8;
    color: var(--cmt-text-sub);
    font-weight: 500;
    transition: background-color var(--cmt-transition), color var(--cmt-transition);
}
#reply .btn-secondary:hover {
    background: #e8edf4;
    color: var(--cmt-text);
    border-color: var(--cmt-line);
}
#reply .btn-close:focus {
    box-shadow: 0 0 0 3px var(--cmt-accent-soft);
}
.modal-backdrop.show {
    opacity: .45;
}

/* ==========================================================================
   10. 动效 & 响应式
   ========================================================================== */
@keyframes cmt-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .comment-area .comment-item {
        gap: .65rem;
        margin: 0 -.5rem;
        padding: 1rem .5rem;
    }
    .comment-area .comment-avatar {
        width: 32px;
        height: 32px;
    }
    .comment-area .comment-avatar-sm {
        width: 26px;
        height: 26px;
    }
    .comment-area .comment-text {
        font-size: .9rem;
        line-height: 1.75;
    }
    .comment-area .btn-info,
    #reply .btn-info {
        width: 100%;
    }
    .comment-area .pagination > li > .page-link,
    .comment-area .pagination > a {
        min-width: 2.1rem;
        height: 2.1rem;
        padding: 0 .7rem;
        font-size: .82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .comment-area .comment-item {
        animation: none;
    }
    .comment-area *,
    #reply * {
        transition: none !important;
    }
}

/* ==========================================================================
   11. 无 Bootstrap 兜底层（站点未引入 Bootstrap 时，本区独立生效）
   说明：目标站点（如 crm.jstaihe.com 自有 skin）没有 Bootstrap 5，
        模板用到的 .modal / .visually-hidden / .row+.col-* 均不存在，
        这里全部自绘。若站点本身有 BS5，本区也不会产生冲突。
   ========================================================================== */

/* --- 11.1 屏幕阅读器标签（替代 BS5 .visually-hidden） --- */
.comment-area .visually-hidden,
#reply .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- 11.2 表单栅格（替代 BS5 .row / .col-*） --- */
.comment-area .row,
#reply .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -.5rem;
}
.comment-area .row > *,
#reply .row > * {
    width: 50%;
    padding: 0 .5rem;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .comment-area .row > .col-md-3 {
        width: 25%;
    }
}

/* --- 11.3 按钮基础（站点无 .btn 时的最小兜底） --- */
.comment-area .btn,
#reply .btn {
    display: inline-block;
    border: 0;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* --- 11.4 弹框（替代 BS5 .modal 组件 + JS） ---
   结构：#reply.modal > .modal-dialog > .modal-content
   开关：给 #reply 加/移除 .show 即可，无需 Bootstrap JS
------------------------------------------------------------------ */
.modal#reply {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;                       /* 关键：默认隐藏，修复弹框平铺在页尾的 bug */
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background: rgba(15, 23, 42, .45);   /* 自带遮罩，不依赖 .modal-backdrop */
    opacity: 0;
    transition: opacity .2s ease;
}
.modal#reply.show {
    display: block;
    opacity: 1;
}
#reply .modal-dialog {
    display: flex;
    align-items: center;                 /* 替代 .modal-dialog-centered */
    justify-content: center;
    min-height: 100%;
    margin: 1.5rem auto;
    max-width: 520px;
    padding: 0 1rem;
    transform: translateY(14px);
    transition: transform .22s ease;
}
#reply.show .modal-dialog {
    transform: translateY(0);
}
#reply .modal-content {
    width: 100%;
    background: var(--cmt-bg, #fff);
}
#reply .modal-header,
#reply .modal-body,
#reply .modal-footer {
    box-sizing: border-box;
}
#reply .modal-header .modal-title {
    margin: 0;
}
/* BS5 的 .btn-close 是空按钮靠背景图画叉，无 BS 时自绘 */
#reply .btn-close {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cmt-muted, #98a2b3);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--cmt-transition), color var(--cmt-transition);
}
#reply .btn-close:hover {
    background: var(--cmt-bg-soft, #f7f9fc);
    color: var(--cmt-text, #1f2733);
}
#reply .btn-close::before {
    content: "\00d7";                    /* × */
    display: block;
    margin-top: -2px;
}

/* ==========================================================================
   12. 深色模式（可选）
   站点 <html data-bs-theme="dark"> 或给 body 加 .theme-dark 时生效，默认不启用
   ========================================================================== */[data-bs-theme="dark"] .comment-area,
[data-bs-theme="dark"] #reply,
.theme-dark .comment-area,
.theme-dark #reply {
    --cmt-text: #e7ecf3;
    --cmt-text-sub: #b3bcc9;
    --cmt-muted: #8b95a3;
    --cmt-line: #2c3440;
    --cmt-line-dashed: #333c48;
    --cmt-bg: #1c222b;
    --cmt-bg-soft: #232a34;
    --cmt-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
[data-bs-theme="dark"] .comment-area .comment-avatar,
.theme-dark .comment-area .comment-avatar {
    box-shadow: 0 0 0 2px #1c222b, 0 0 0 3px #2c3440;
}
[data-bs-theme="dark"] .comment-area .pagination > li > .page-link,
[data-bs-theme="dark"] .comment-area .pagination > a,
.theme-dark .comment-area .pagination > li > .page-link,
.theme-dark .comment-area .pagination > a {
    background: var(--cmt-bg-soft);
}
[data-bs-theme="dark"] #reply .btn-secondary,
.theme-dark #reply .btn-secondary {
    background: #2a323d;
    color: var(--cmt-text-sub);
}
[data-bs-theme="dark"] .modal#reply,
.theme-dark .modal#reply {
    background: rgba(0, 0, 0, .6);
}
