/* ============================================================
 * 划线、句读与评论（含底部 sticky dock / 快速留言）
 * selection-comments.css
 * 阅读壳、masthead 阅读态、工具条见 article.css
 * ============================================================ */
/* 正文选区：图1 白卡片浮动条 + 已标记虚线 */
.article-body,
.article-body-html,
[data-article-body]{
    -webkit-touch-callout: none !important;
}

.article-body ::selection,
.article-body ::-moz-selection{
    background: #e8d8b5;
    color: var(--ink)
}

/* 粗指针清掉原生选区后，用 CSS Highlight / temp mark 保留划选高亮（与 ::selection 同色） */
::highlight(sentence-toolbar-sel){
    background-color: #e8d8b5;
    color: var(--ink)
}

mark[data-h5-sel-mark]{
    background: #e8d8b5;
    color: inherit;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone
}

/* 自定义选区起止手柄：温润米色圆钮 + 同色竖杆，贴合划选高亮 */

.selection-toolbar{
    position: absolute;
    z-index: 40;
    width: max-content;
    max-width: min(420px, calc(100vw - 24px));
    padding: .45rem;
    border: 1px solid rgba(23, 27, 31, .08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(23, 27, 31, .12), 0 1px 2px rgba(23, 27, 31, .04);
    transform: translate(-50%, calc(-100% - 12px));
    animation: selection-toolbar-in .16s ease-out
}

@keyframes selection-toolbar-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-100% - 4px))
    }
    to {
        opacity: 1;
        transform: translate(-50%, calc(-100% - 12px))
    }
}

.selection-toolbar[hidden]{
    display: none !important
}

.selection-toolbar-actions{
    display: flex;
    flex-wrap: wrap;
    gap: .35rem
}

.selection-toolbar-actions button{
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    min-height: 32px;
    padding: 0 .7rem;
    border: 1px solid #d8dde2;
    border-radius: 8px;
    background: #fff;
    color: #3a424a;
    font: 500 .86rem/1 var(--sans);
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0
}

/* 图标改由模板内联 SVG；禁用按钮默认 ::before */
.selection-toolbar-actions button::before{
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important
}

.selection-toolbar-actions .selection-action-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: .78rem;
    height: .78rem;
    flex: 0 0 auto;
    color: currentColor;
    opacity: .72
}

.selection-toolbar-actions .selection-action-icon svg{
    width: 100%;
    height: 100%;
    display: block
}

.selection-toolbar-actions .selection-action-meta{
    display: inline-flex;
    align-items: baseline;
    gap: .28rem
}

.selection-toolbar-actions .selection-action-meta [data-sentence-comment-count][hidden],
.selection-toolbar-actions .selection-action-meta [data-sentence-like-count][hidden],
.selection-toolbar-actions .selection-action-meta [data-sentence-dislike-count][hidden]{
    display: none !important
}

.selection-toolbar-actions button:hover,
.selection-toolbar-actions button:focus-visible{
    border-color: var(--red);
    color: var(--red);
    background: #fff8f6
}

/* 嵌套划线：内层虚线叠在外层上，句中徽章保持行内 */

mark.selection-mark .sentence-comment-badge,
mark.selection-mark .sentence-vote-badge{
    vertical-align: middle;
}

.sentence-comment-badge{
    display: inline-flex;
    gap: .08rem;
    margin: 0 0 0 .18rem;
    padding: 0.2rem 0.4rem;
    min-height: 1.65em;
    border: 0;
    border-radius: 999px;
    background: rgba(180, 56, 47, .1);
    color: var(--red);
    font: 600 .82rem var(--sans);
    cursor: pointer;
    white-space: nowrap
}

.sentence-comment-badge svg{
    width: .82rem;
    height: .82rem;
    flex: 0 0 auto
}

.sentence-comment-badge:hover,
.sentence-comment-badge:focus-visible{
    background: rgba(180, 56, 47, .18)
}

.sentence-vote-badge{
    display: inline-flex;
    align-items: center;
    gap: .08rem;
    margin: 0 0 0 .18rem;
    padding: 0.1rem 0.4rem;
    min-height: 1.4em;
    border: 0;
    border-radius: 999px;
    background: rgba(180, 56, 47, .1);
    color: var(--red);
    font: 600 .82rem var(--sans);
    cursor: pointer;
    white-space: nowrap;
}

.sentence-vote-badge.is-down{
    background: rgba(17, 50, 74, .1);
    color: var(--navy);
}

.sentence-vote-badge svg{
    width: .78rem;
    height: .78rem;
    flex: 0 0 auto;
    display: block
}

.sentence-vote-badge:hover,
.sentence-vote-badge:focus-visible{
    background: rgba(180, 56, 47, .16)
}

.sentence-vote-badge.is-down:hover,
.sentence-vote-badge.is-down:focus-visible{
    background: rgba(17, 50, 74, .14)
}

.selection-toolbar-actions button[data-selection-action="upvote"].is-active,
.selection-toolbar-actions button[data-selection-action="downvote"].is-active{
    border-color: var(--red);
    color: var(--red);
    background: #fff8f6
}

/* 留言 / 认同 / 反对数量：同一套纯文字样式（0 时由 hidden 隐藏） */
.selection-toolbar-actions [data-sentence-comment-count]:not([hidden]),
.selection-toolbar-actions [data-sentence-like-count]:not([hidden]),
.selection-toolbar-actions [data-sentence-dislike-count]:not([hidden]){
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit
}

.annotation-hover-panel{
    position: absolute;
    z-index: 40;
    width: min(600px, calc(100% - 1.5rem));
    max-width: 600px;
    max-height: min(72vh, calc(100vh - 24px));
    padding: 2.15rem 0 .75rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fffdf9;
    box-shadow: 0 8px 22px rgba(20, 28, 36, .1);
    transform: translate(-50%, calc(-100% - 8px));
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
    isolation: isolate
}

.annotation-hover-panel.is-below{
    transform: translate(-50%, 8px)
}

.annotation-hover-panel.is-top-pinned{
    transform: translate(-50%, 0)
}

.annotation-hover-close{
    appearance: none;
    position: absolute;
    top: .35rem;
    right: .4rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #5c6b78;
    line-height: 1;
    cursor: pointer
}

.annotation-hover-close svg{
    display: block;
    width: 1rem;
    height: 1rem
}

.annotation-hover-close:hover,
.annotation-hover-close:focus-visible{
    color: var(--ink);
    background: rgba(23, 27, 31, .06)
}

.annotation-hover-panel[hidden]{
    display: none !important
}

/* 主体：基础流式布局；.is-fill 增强见下方 */
.annotation-hover-tree{
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow: visible
}

.annotation-hover-tree-content{
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    padding: 0 1rem
}

.annotation-hover-quote-block{
    position: relative;
    flex: 0 0 auto;
    margin: 0 0 .35rem
}

.annotation-hover-quote{
    margin: 0;
    color: var(--navy);
    font: 500 .88rem/1.55 var(--sans)
}

/* 弹窗引言：收起态最多两行 */
.annotation-hover-quote-block .discussion-clamp.is-collapsed [data-discussion-clamp-body]{
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: calc(1.55em * 2)
}

.annotation-hover-replies-title{
    display: block;
    margin: 0;
    color: var(--ink);
    font: 700 .95rem/1.3 var(--sans)
}

.annotation-hover-footer{
    display: block;
    flex: 0 0 auto;
    margin-top: .25rem;
    padding: .55rem 1rem 0;
    border-top: 1px solid rgba(23, 27, 31, .06);
    background: #fffdf9
}

.annotation-hover-composer-trigger{
    appearance: none;
    display: flex !important;
    align-items: center;
    width: 100% !important;
    min-height: 40px;
    margin: 0 !important;
    padding: 0 .85rem !important;
    color: #7a8792 !important;
    font: normal .86rem/1.3 var(--sans) !important;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box
}

.annotation-hover-compose.is-footer{
    margin: 0;
    animation: annotation-hover-compose-in .26s ease-out
}

@keyframes annotation-hover-compose-in {
    from {
        opacity: 0;
        transform: translateY(8px)
    }
    to {
        opacity: 1;
        transform: none
    }
}

.annotation-hover-compose-context{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .35rem;
    color: var(--navy);
    font: 600 .82rem/1.3 var(--sans)
}

.annotation-hover-compose-context button{
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a949c;
    font: 500 .78rem/1.2 var(--sans);
    cursor: pointer
}

.annotation-hover-reply.is-replying{
    outline: 1px dashed rgba(180, 56, 47, .35);
    outline-offset: 4px;
    border-radius: 6px
}

.annotation-hover-compose{
    display: grid;
    gap: .45rem;
    margin: .55rem 0 .15rem;
    padding: .7rem .75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff
}

.annotation-hover-compose[hidden]{
    display: none !important
}

[data-annotation-hover-join-slot]:empty,
.annotation-hover-reply-main > [data-annotation-hover-reply-slot]:empty{
    display: none
}

.annotation-hover-reply-main > [data-annotation-hover-reply-slot]:not(:empty){
    margin-top: .35rem
}

.annotation-hover-reply-main > [data-annotation-hover-reply-slot] .annotation-hover-compose{
    margin: 0
}

.annotation-hover-compose textarea{
    display: block;
    width: 100%;
    min-height: calc(.88rem * 1.55);
    max-height: calc(.88rem * 1.55 * 5);
    margin: 0;
    padding: 0;
    border: 0;
    resize: none;
    overflow-y: hidden;
    background: transparent;
    color: var(--ink);
    font: .88rem/1.55 var(--sans);
    outline: none;
    transition: height .24s ease;
    -webkit-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important
}

.annotation-hover-compose textarea::placeholder{
    color: #9aa3ab
}

.annotation-hover-compose-actions{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem
}

.annotation-hover-compose-actions button[type="submit"]{
    min-height: 32px;
    padding: 0 .9rem;
    border: 0;
    border-radius: 4px;
    background: #2f6fed;
    color: #fff;
    font: 600 .82rem/1 var(--sans);
    cursor: pointer
}

.annotation-hover-compose-actions button[type="submit"]:hover,
.annotation-hover-compose-actions button[type="submit"]:focus-visible{
    background: #245fd4
}

.annotation-hover-empty{
    margin: .55rem 0 0;
    color: #8a949c;
    font: .86rem/1.45 var(--sans)
}

.annotation-quote-block{
    display: grid;
    gap: .45rem;
    min-width: 0
}

/* 划线句子卡片：引用 + 定位 + 回复/赞踩 */
.annotation-item-quote{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .4rem;
    width: 100%;
    margin: 0;
    padding: .6rem;
    border: 0;
    border-radius: 10px;
    background: rgb(243 238 227 / 0.5);
    box-sizing: border-box;
}

.annotation-item-quote-top{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    width: 100%;
    min-width: 0
}

.annotation-item-quote-text{
    margin: 0;
    color: #5c4a2f;
    font: 650 0.88rem/1.45 var(--serif);
    overflow-wrap: anywhere;
    word-break: break-word
}

.annotation-item-quote-mark{
    margin-right: .18rem;
    color: #5c4a2f;
    font: 700 1.12em/1 var(--serif)
}

.annotation-item-quote-jump{
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9a8550;
    font: 500 .82rem var(--sans);
    cursor: pointer;
    text-align: left;
    min-width: 0
}

.annotation-item-quote-jump:hover,
.annotation-item-quote-jump:focus-visible{
    color: #7d6a3d;
    outline: none
}

.annotation-item-quote-jump-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: .95rem;
    height: .95rem;
    line-height: 0
}

.annotation-item-quote-jump-icon svg{
    display: block;
    width: 100%;
    height: 100%
}

.annotation-item-quote-actions{
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: .15rem .35rem;
    margin: 0 0 0 auto;
    flex: 0 0 auto
}

.annotation-item-quote-reply{
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 0;
    padding: 0 .1rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a949c;
    font: 500 .86rem/1 var(--sans);
    cursor: pointer
}

.annotation-item-quote-reply:hover,
.annotation-item-quote-reply:focus-visible{
    color: var(--red);
    outline: none
}

.annotation-item-quote-actions .discussion-vote-btn{
    color: #8a949c
}

.annotation-item-quote-actions .discussion-vote-btn:hover,
.annotation-item-quote-actions .discussion-vote-btn:focus-visible,
.annotation-item-quote-actions .discussion-vote-btn.is-active{
    color: var(--red)
}

.annotation-meta-row > .discussion-comment-meta{
    margin: 0;
    flex: 1 1 auto;
    min-width: 0
}

.annotation-meta-row > .discussion-item-actions{
    margin-left: auto;
    flex: 0 0 auto
}

.annotation-source-vote .discussion-vote,
.annotation-hover-source-vote .discussion-vote{
    display: inline-flex;
    flex-wrap: wrap;
    gap: .3rem
}

.annotation-hover-replies{
    display: flex;
    flex-direction: column;
    align-content: start;
    gap: .55rem;
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed #d9e0e6;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible
}

.annotation-hover-reply{
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.5rem;
    box-sizing: border-box
}

.annotation-hover-reply > .discussion-avatar{
    flex: 0 0 auto
}

.annotation-hover-reply-main{
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .14rem
}

/* 桌面端：短内容收拢；长内容 .is-fill 钉高，列表单独滚动，底栏留在面板内 */

.annotation-hover-panel.is-fill .annotation-hover-tree{
    flex: 1 1 0;
    overflow: hidden
}

.annotation-hover-panel.is-fill .annotation-hover-tree-content{
    flex: 1 1 0;
    overflow: hidden
}

.annotation-hover-panel.is-fill .annotation-hover-replies{
    flex: 1 1 0;
    min-height: 120px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch
}

.annotation-hover-footer{
    background: #fffdf9
}

.annotation-hover-note{
    margin: 0;
    color: var(--ink);
    font: 0.88rem/1.4 var(--sans)
}

.annotation-hover-meta-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem .5rem;
    margin: 0;
    width: 100%
}

.annotation-hover-meta{
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    color: #555;
    font: 500 .82rem/1.3 var(--sans)
}

.annotation-hover-vote{
    display: inline-flex;
    align-items: center;
    gap: .15rem .2rem;
    margin: 0 0 0 auto;
    flex: 0 0 auto
}

.annotation-hover-reply-btn{
    padding: 0.26rem .35rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a949c;
    font: 500 .82rem/1 var(--sans);
    white-space: nowrap;
    cursor: pointer
}

.annotation-hover-reply-btn:hover,
.annotation-hover-reply-btn:focus-visible{
    color: var(--red);
    background: rgba(180, 56, 47, .06)
}

.annotation-hover-vote .discussion-vote-btn,
.annotation-hover-source-vote .discussion-vote-btn{
    min-height: 24px;
    padding: 0 .28rem;
    font-size: .82rem
}

.annotation-hover-vote .discussion-icon-btn{
    min-height: 28px
}

/* 句读讨论列表：同一原句归为一组，原文在上、回应在下 */

.annotation-item-replies{
    display: grid;
    gap: .35rem
}

.annotation-item-reply{
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr) auto;
    column-gap: .4rem;
    align-items: start
}

.discussion-feed-item .annotation-item-reply [data-annotation-remove],
.discussion-feed-item .discussion-item-actions [data-comment-remove]{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 24px;
    min-height: 24px;
    margin: 0;
    padding: 0 0.28rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a949c;
    font: 500 .82rem/1 var(--sans);
    cursor: pointer
}

.discussion-feed-item .annotation-item-reply [data-annotation-remove]:hover,
.discussion-feed-item .annotation-item-reply [data-annotation-remove]:focus-visible,
.discussion-feed-item .discussion-item-actions [data-comment-remove]:hover,
.discussion-feed-item .discussion-item-actions [data-comment-remove]:focus-visible{
    color: var(--red);
    background: rgba(180, 56, 47, .06)
}

.discussion-module-head{
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    width: 100%;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--navy);
}

.discussion-module-title{
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem 1rem;
    min-width: 0
}

.discussion-module-head h2{
    margin: 0;
    font: 600 1.35rem/1.2 var(--serif)
}

.discussion-module-meta{
    margin: 0;
    color: var(--muted);
    font: 650 .82rem/1.4 var(--sans)
}

/* 众声 / 潮声留言空状态 */
.topic-discuss-empty{
    margin: 0;
    padding: 1.15rem 0;
    color: var(--muted);
    font: .9rem/1.65 var(--serif);
    text-align: left;
    background: transparent;
    border: 0
}

.topic-discuss-empty .topic-discuss-empty-compose,
.list-empty-text .topic-discuss-empty-compose{
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--red);
    font: inherit;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    line-height: inherit;
    vertical-align: baseline
}

.topic-discuss-empty .topic-discuss-empty-compose::after,
.list-empty-text .topic-discuss-empty-compose::after{
    border: none
}

.discussion-feed{
    display: grid;
    gap: .75rem
}

.discussion-feed-more{
    position: relative
}

.comment-sticky-discuss-body .discussion-feed-more,
.comment-sticky-discuss-body .home-feed-more{
    padding: .85rem 0 .55rem
}

.discussion-feed-item{
    margin: 0;
    padding-top: .5rem;
    background: #fff;
    overflow: visible
}

/* 留言默认头像：昵称首字 + 稳定分色（众声 / 潮声共用） */
.discussion-feed-row{
    display: flex;
    align-items: flex-start;
    gap: .7rem
}

.discussion-avatar{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .16rem;
    border-radius: 50%;
    border: 1px solid rgba(17, 50, 74, .1);
    background: #e8eef3;
    color: var(--navy);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
    overflow: hidden
}

.discussion-avatar.has-img{
    color: transparent;
    box-shadow: none
}

.discussion-avatar-img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%
}

.discussion-avatar[data-tone="1"]{
    background: #f3ebe8;
    border-color: rgba(180, 56, 47, .14);
    color: var(--red)
}

.discussion-avatar[data-tone="2"]{
    background: #e9f0ec;
    border-color: rgba(42, 74, 58, .14);
    color: #2a4a3a
}

.discussion-avatar[data-tone="3"]{
    background: #f0eee8;
    border-color: rgba(90, 78, 54, .14);
    color: #5a4e36
}

.discussion-avatar-letter{
    font: 650 .82rem/1 var(--sans);
    text-transform: uppercase;
    user-select: none
}

.discussion-avatar.is-reply{
    width: 1.35rem;
    height: 1.35rem;
    margin-top: .12rem
}

.discussion-avatar.is-reply .discussion-avatar-letter{
    font-size: .68rem
}

.discussion-feed-main{
    flex: 1 1 auto;
    min-width: 0
}

.discussion-feed-item .comment-item-reply:has(> .discussion-avatar),
.discussion-feed-item .annotation-item-reply:has(> .discussion-avatar){
    grid-template-columns: 1.35rem minmax(0, 1fr);
    column-gap: .5rem
}

.discussion-feed-item + .discussion-feed-item{
    border-top: 1px solid var(--line);
}

.discussion-feed-head .discussion-item-actions{
    margin-left: auto
}

.discussion-feed-body{
    margin: 0;
    color: var(--ink);
    font: .92rem/1.65 var(--serif)
}

.discussion-feed-parent{
    color: var(--ink);
    font: 400 0.88rem/1.5 var(--serif)
}

.discussion-comment-lead{
    display: block;
}

.discussion-comment-lead .discussion-feed-parent{
    margin: 0;
    min-width: 0
}

.discussion-comment-meta-row,
.comment-item-reply-meta-row,
.annotation-item-reply-meta-row{
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: .35rem .75rem;
    margin: 0 0 0.4rem 0;
    width: 100%;
}

.discussion-comment-meta{
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .2rem .35rem;
    min-width: 0;
    flex: 1 1 auto;
    color: #555;
    font: .88rem/1.3 var(--sans);
    overflow: hidden
}

.discussion-comment-meta strong{
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0
}

.discussion-comment-meta time{
    color: inherit;
    flex: 0 0 auto;
    white-space: nowrap
}

.discussion-comment-meta-row > .discussion-item-actions,
.comment-item-reply-meta-row > .discussion-item-actions,
.annotation-item-reply-meta-row > .discussion-item-actions{
    margin-left: auto;
    flex: 0 0 auto
}

.comment-inline-reply{
    margin: .55rem 0 .2rem;
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff
}

.comment-inline-reply[hidden]{
    display: none !important
}

.comment-inline-reply textarea{
    display: block;
    width: 100%;
    min-height: 4.2rem;
    margin: 0;
    padding: 0;
    border: 0;
    resize: vertical;
    background: transparent;
    color: var(--ink);
    font: .88rem/1.55 var(--sans);
    outline: none
}

.comment-inline-reply-actions{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    margin-top: .55rem
}

.comment-inline-reply-actions [data-topic-discuss-reply-cancel],
.comment-inline-reply-actions [data-comment-reply-cancel]{
    min-height: 32px;
    padding: 0 .55rem;
    border: 0;
    background: transparent;
    color: #8a949c;
    font: 650 .82rem/1 var(--sans);
    cursor: pointer
}

.comment-inline-publish{
    min-height: 30px;
    padding: 0 .6rem;
    border: 0;
    border-radius: 4px;
    background: var(--red);
    color: #fff;
    font: 600 .82rem/1 var(--sans);
    cursor: pointer
}

.comment-inline-publish:hover,
.comment-inline-publish:focus-visible{
    background: #245fd4
}

.comment-inline-publish:disabled{
    opacity: .45;
    cursor: not-allowed
}

.discussion-feed-item .annotation-item-replies,
.discussion-feed-item .comment-item-replies{
    display: grid;
    gap: .8rem;
    padding-top: .6rem;
    /*border-top: 1px dashed #d9e0e6*/
}

.discussion-feed-item .annotation-item-reply,
.discussion-feed-item .comment-item-reply{
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    column-gap: .4rem;
    align-items: start
}

.discussion-feed-item .comment-item-reply-main,
.discussion-feed-item .annotation-item-reply-main{
    min-width: 0;
    display: grid;
}

.discussion-feed-item .comment-item-reply-body{
    margin: 0;
    color: var(--ink);
    font: 0.88rem/1.55 var(--sans)
}

.comment-reply-to-name{
    margin: 0 0 0 0.2rem;
    color: #8a949c;
}

.discussion-feed-item .comment-item-reply-main > [data-comment-reply-slot]:empty,
.discussion-feed-item .annotation-item-reply-main > [data-annotation-reply-slot]:empty{
    display: none
}

.discussion-feed-item .comment-item-reply-main > [data-comment-reply-slot]:not(:empty),
.discussion-feed-item .annotation-item-reply-main > [data-annotation-reply-slot]:not(:empty){
    margin-top: .35rem
}

.discussion-clamp{
    display: grid;
    gap: .2rem;
    min-width: 0
}

.discussion-clamp.is-collapsed [data-discussion-clamp-body]{
    display: -webkit-box !important;
    /* autoprefixer 可能丢掉该属性，导致多行截断失效 */
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
    /* line-clamp 失效时的兜底：约 5 行 */
    max-height: calc(1.55em * 5)
}

.discussion-clamp.is-expanded [data-discussion-clamp-body]{
    /* 与折叠态的 !important 对齐，避免展开后仍被 -webkit-box 截断 */
    display: block !important;
    -webkit-box-orient: unset !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important
}

.discussion-clamp-toggle,
.discussion-replies-toggle{
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    width: fit-content;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a949c;
    font: 500 .82rem/1.3 var(--sans);
    cursor: pointer
}

.discussion-clamp-toggle[hidden],
.discussion-replies-toggle[hidden]{
    display: none !important
}

.discussion-replies-toggle svg{
    width: .72rem;
    height: .72rem;
    display: block;
    flex: 0 0 auto
}

/* 折叠态只露首条回复预览；第 2 条起隐藏 */
[data-reply-fold]:not(.is-expanded) > .comment-item-reply:nth-child(n+2),
[data-reply-fold]:not(.is-expanded) > .annotation-item-reply:nth-child(n+2){
    display: none
}

.discussion-replies-toggle{
    margin-top: .15rem;
    padding: .1rem 0 .1rem 2rem;
}

/* 未登录无子回复正文，去掉与回复头像对齐的左缩进 */
.discussion-feed.is-guest-limited .discussion-replies-toggle{
    padding: 0
}

.discussion-feed-item .comment-item-reply-meta,
.discussion-feed-item .annotation-item-reply-meta{
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    color: #555;
    font: 500 .82rem/1.3 var(--sans);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.discussion-item-actions{
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: .1rem .2rem;
    flex: 0 0 auto
}

.discussion-item-actions button{
    min-height: 24px;
    padding: 0 .4rem;
    border: 0;
    background: transparent;
    color: #8a949c;
    font: 500 .86rem var(--sans);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 4px;
}

.discussion-item-actions button:hover,
.discussion-item-actions button:focus-visible{
    color: var(--red);
    background: rgba(180, 56, 47, .06);
}

.discussion-vote{
    display: inline-flex;
    align-items: center;
    gap: .2rem
}

.discussion-vote-btn,
.discussion-item-actions .discussion-vote-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    min-height: 24px;
    padding: 0 .28rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a949c;
    font: 600 .7rem/1 var(--sans);
    cursor: pointer;
    white-space: nowrap
}

.discussion-vote-btn > span,
.discussion-item-actions .discussion-vote-btn > span{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.08rem;
}

.discussion-vote-btn svg,
.discussion-item-actions .discussion-vote-btn svg{
    width: .85rem;
    height: .85rem;
    flex: 0 0 auto;
    display: block
}

.discussion-vote-btn:hover,
.discussion-vote-btn:focus-visible,
.discussion-item-actions .discussion-vote-btn[data-vote-value="up"]:hover,
.discussion-item-actions .discussion-vote-btn[data-vote-value="up"]:focus-visible{
    color: var(--navy);
    background: rgba(20, 40, 70, .05)
}

.discussion-vote-btn[data-vote-value="down"]:hover,
.discussion-vote-btn[data-vote-value="down"]:focus-visible,
.discussion-item-actions .discussion-vote-btn[data-vote-value="down"]:hover,
.discussion-item-actions .discussion-vote-btn[data-vote-value="down"]:focus-visible{
    color: var(--red);
    background: rgba(180, 56, 47, .06)
}

.discussion-vote-btn.is-active[data-vote-value="up"],
.discussion-item-actions .discussion-vote-btn.is-active[data-vote-value="up"]{
    color: var(--red)
}

.discussion-vote-btn.is-active[data-vote-value="down"],
.discussion-item-actions .discussion-vote-btn.is-active[data-vote-value="down"]{
    color: var(--navy)
}

.discussion-icon-btn,
.discussion-feed-item .discussion-icon-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a949c;
    cursor: pointer;
    font: 650 .82rem / 1 var(--sans);
}

.discussion-icon-btn svg,
.discussion-feed-item .discussion-icon-btn svg,
.discussion-feed-item .annotation-item-reply [data-annotation-remove] svg,
.discussion-feed-item .discussion-item-actions [data-comment-remove] svg{
    width: .9rem;
    height: .9rem;
    display: block
}

.discussion-icon-btn:hover,
.discussion-icon-btn:focus-visible,
.discussion-feed-item .discussion-icon-btn:hover,
.discussion-feed-item .discussion-icon-btn:focus-visible{
    color: var(--red);
}

/* 阅读壳 / masthead / 工具条 / 字号跟随已迁至 article.css */

.article-participation{
    max-width: none;
    width: 100%;
    padding: 1.6rem 0 0;
}

.article-participation .v6-comment-section{
    margin-top: 0;
    padding-top: 0;
}

.article-participation .v6-comment-section > p{
    display: none
}

@keyframes comment-compose-in {
    from {
        opacity: .35;
        transform: translateY(6px)
    }
    to {
        opacity: 1;
        transform: none
    }
}

/* 阅读中途底部快捷入口：对齐 main.page 宽度并居中 */
.comment-sticky-dock{
    position: fixed;
    z-index: 18;
    left: 50%;
    right: auto;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    width: min(1240px, calc(100% - (var(--page-gutter) * 2)));
    max-width: 1240px;
    padding: 0;
    background: #fff;
    color: var(--ink);
    font: 500 1.05rem/1.35 var(--sans);
    opacity: 0;
    pointer-events: none;
    /* 收起态允许分享菜单向上溢出；展开留言面板时再裁剪 */
    overflow: visible;
    box-sizing: border-box;
    transform: translateX(-50%) translateY(12px);
    border: 1px solid rgba(17, 50, 74, .12);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, #fff 42%);
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 0 rgba(17, 50, 74, .03), 0 10px 28px rgba(10, 17, 32, .18);
}

.comment-sticky-dock.is-on-footer{
    box-shadow: 0 1px 0 rgba(17, 50, 74, .03),
    0 10px 28px rgba(10, 17, 32, .18);
}

@media (max-width: 780px){.comment-sticky-dock{
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        border: 0;
        border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(12px);
        box-shadow: none
    }

    .comment-sticky-dock.is-on-footer{
        box-shadow: none
    }

    .comment-sticky-dock.is-visible{
        transform: translateY(0)
    }

    /* 移动端底栏 / 展开表单不显示头像 */
    .comment-sticky-compose-avatar,
.comment-sticky-bar > .comment-sticky-compose-avatar{
        display: none !important
    }
}

.comment-sticky-inner{
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0 1rem;
    box-sizing: border-box
}

.comment-sticky-dock.is-visible{
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto
}

.comment-sticky-dock.is-suppressed{
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(120%) !important
}

.comment-sticky-bar{
    width: 100%;
    padding: .6rem 0;
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.comment-sticky-bar > .comment-sticky-compose-avatar{
    margin: 0;
}

/* 展开后表单左侧已有头像；收起态头像留在 bar 前 */
.comment-sticky-dock.is-open .comment-sticky-bar > .comment-sticky-compose-avatar{
    display: none;
}

.comment-sticky-trigger{
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 500 1.05rem/1.3 var(--sans);
    text-align: left;
    cursor: pointer
}

.comment-sticky-trigger-field{
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: .45rem 1rem;
    border-radius: 8px;
}

.comment-sticky-trigger-copy{
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0
}

.comment-sticky-trigger-title{
    display: none;
    color: var(--ink);
    font: 700 1.08rem/1.2 var(--sans)
}

.comment-sticky-trigger-hint{
    overflow: hidden;
    color: #5f6b74;
    font: 500 .92rem/1.3 var(--sans);
    text-overflow: ellipsis;
    white-space: nowrap
}

.comment-sticky-metrics{
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .2rem 1.2rem;
    position: relative;
    z-index: 5;
    overflow: visible
}

.comment-sticky-metric{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    min-width: 2.7rem;
    margin: 0;
    padding: .15rem .4rem;
    border: 0;
    background: transparent;
    color: #6b757e;
    font: inherit;
    cursor: default
}

button.comment-sticky-metric{
    cursor: pointer
}

.comment-sticky-metric-icon{
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    color: #5f6b74
}

.comment-sticky-metric-icon svg{
    display: block;
    width: 1.2rem;
    height: 1.2rem
}

.comment-sticky-metric strong{
    color: #6b757e;
    font: 500 .9rem/1 var(--sans);
    font-variant-numeric: tabular-nums
}

.comment-sticky-metric.is-collect.is-active,
.comment-sticky-metric.is-collect.is-active .comment-sticky-metric-icon,
.comment-sticky-metric.is-collect.is-active strong{
    color: var(--red)
}

/* 分享：悬停/点击菜单（复制链接 / LINE / Facebook） */
.comment-sticky-share{
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 6
}

.comment-sticky-share-menu{
    position: absolute;
    bottom: calc(100% + .55rem);
    left: 50%;
    z-index: 8;
    display: grid;
    min-width: 9.6rem;
    padding: .4rem;
    border: 1px solid rgba(23, 27, 31, .1);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(17, 50, 74, .14), 0 2px 6px rgba(17, 50, 74, .06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, .25rem);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease
}

.comment-sticky-share-menu::after{
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: .7rem
}

.comment-sticky-share:hover .comment-sticky-share-menu,
.comment-sticky-share.is-open .comment-sticky-share-menu{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0)
}

.comment-sticky-share-item{
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    margin: 0;
    padding: .55rem .65rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink, #171b1f);
    font: 600 .86rem/1.2 var(--sans, sans-serif);
    text-align: left;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease
}

.comment-sticky-share-item::after{
    border: none
}

.comment-sticky-share-item:hover,
.comment-sticky-share-item:focus-visible,
.comment-sticky-share-wechat.is-open > .comment-sticky-share-item{
    background: rgba(17, 50, 74, .06);
    color: var(--navy, #11324a)
}

.comment-sticky-share-item-icon{
    display: inline-grid;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    color: #5f6b74;
    flex: 0 0 auto
}

.comment-sticky-share-item-icon svg{
    display: block;
    width: 1.05rem;
    height: 1.05rem
}

.comment-sticky-share-item-icon.is-line{
    color: #06c755
}

.comment-sticky-share-item-icon.is-facebook{
    color: #1877f2
}

.comment-sticky-share-item-icon.is-line img,
.comment-sticky-share-item-icon.is-facebook img{
    display: block;
    width: 1.05rem !important;
    height: 1.05rem !important
}

@media (max-width: 780px), ((hover: none) and (pointer: coarse)){
    /* 手机 H5：不显示 LINE / Facebook 菜单，点击分享走原来的复制弹窗 */
    .comment-sticky-share:hover .comment-sticky-share-menu,
    .comment-sticky-share.is-open .comment-sticky-share-menu{
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important
    }

    .comment-sticky-share-menu{
        display: none !important
    }
}

html.copy-share-dialog-open,
html.copy-share-dialog-open body{
    overflow: hidden
}

.copy-share-dialog-card{
    position: relative;
    width: min(22rem, 100%);
    padding: 1.15rem 1.15rem 1.25rem;
    border: 1px solid rgba(23, 27, 31, .08);
    border-radius: 16px;
    background: #fff;
    color: var(--ink, #171b1f);
    box-shadow: 0 18px 48px rgba(17, 50, 74, .16), 0 2px 8px rgba(17, 50, 74, .08)
}

.copy-share-dialog-head{
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 1.75rem;
    margin-bottom: .85rem
}

.copy-share-dialog-title{
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--ink, #171b1f);
    font: 600 1.08rem/1 var(--sans, sans-serif);
    letter-spacing: .02em
}

.copy-share-dialog-check{
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto
}

.copy-share-dialog-check svg{
    display: block;
    width: 1.35rem;
    height: 1.35rem
}

.copy-share-dialog-close{
    position: absolute;
    right: -.2rem;
    top: 50%;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(23, 27, 31, .42);
    font: 300 1.45rem/1 var(--sans, sans-serif);
    transform: translateY(-50%);
    cursor: pointer;
    transition: color .14s ease, background-color .14s ease
}

.copy-share-dialog-close:hover,
.copy-share-dialog-close:focus-visible{
    color: var(--ink, #171b1f);
    background: rgba(17, 50, 74, .06)
}

.copy-share-dialog-close::after{
    border: none
}

.copy-share-dialog-body{
    padding: .95rem 1.05rem;
    border: 1px solid rgba(23, 27, 31, .08);
    border-radius: 12px;
    background: #f5f6f7;
    color: var(--ink, #171b1f);
    font: 400 .82rem/1.6 var(--sans, sans-serif);
    letter-spacing: .01em;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere
}

.copy-share-dialog-or{
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.1rem 0 .95rem;
    color: var(--muted, #5d6870);
    font: 500 .88rem/1 var(--sans, sans-serif);
    letter-spacing: .12em;
    text-align: center
}

.copy-share-dialog-or::before,
.copy-share-dialog-or::after{
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(23, 27, 31, .12)
}

.copy-share-dialog-qr{
    display: grid;
    place-items: center
}

.copy-share-dialog-qr-frame{
    display: grid;
    place-items: center;
    width: 10rem;
    height: 10rem;
    padding: .55rem;
    border: 1px solid rgba(23, 27, 31, .1);
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box
}

.copy-share-dialog-qr-img,
.copy-share-dialog-qr-frame img{
    display: block;
    width: 100% !important;
    height: 100% !important
}

/* PC：更宽卡片、更大二维码与留白 */

.copy-share-dialog-card{
    width: min(26rem, calc(100vw - 4rem));
    padding: 1.35rem 1.4rem 1.5rem;
    border-radius: 18px
}

.copy-share-dialog-head{
    min-height: 1.9rem;
    margin-bottom: 1rem
}

.copy-share-dialog-title{
    font-size: 1.14rem;
    gap: .5rem
}

.copy-share-dialog-check,
.copy-share-dialog-check svg{
    width: 1.45rem;
    height: 1.45rem
}

.copy-share-dialog-body{
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
    font-size: .82rem;
    line-height: 1.65
}

.copy-share-dialog-or{
    margin: 1.25rem 0 1.1rem;
    font-size: 0.82rem
}

.copy-share-dialog-qr-frame{
    width: 10rem;
    height: 10rem;
    padding: .65rem;
    border-radius: 12px
}

/* 展开写留言/留言弹窗：隐藏 bar（含「写留言」标题），只留列表+输入 */
.comment-sticky-dock.is-open .comment-sticky-bar{
    display: none
}

.comment-sticky-discuss-panel{
    display: none;
    flex-direction: column;
    max-height: min(36vh, 400px);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.comment-sticky-dock.is-open.is-discuss-open{
    max-height: min(72vh, 720px);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0
}

.comment-sticky-dock.is-open.is-discuss-open .comment-sticky-inner{
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden
}

.comment-sticky-dock.is-open.is-discuss-open .comment-sticky-discuss-panel{
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    border-bottom: 0;
    animation: comment-compose-in .16s ease-out
}

.comment-sticky-dock.is-open.is-discuss-open .comment-sticky-form .comment-sticky-compose-avatar{
    width: 1.4rem;
    height: 1.4rem;
    margin: .15rem .7rem 0 0.2rem;
}

/* 留言列表仅在 is-open + is-discuss-open 时展示；关闭后回到底栏原始态 */

.comment-sticky-discuss-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 0 .1rem;
    flex: 0 0 auto
}

.comment-sticky-discuss-title{
    display: flex;
    align-items: baseline;
    gap: .45rem;
    min-width: 0
}

.comment-sticky-discuss-title strong{
    color: var(--ink);
    font: 700 1.08rem/1.2 var(--sans)
}

.comment-sticky-discuss-close{
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--navy);
    font-size: 1.4rem;
    cursor: pointer
}

.comment-sticky-discuss-close svg{
    width: 1.15rem;
    height: 1.15rem
}

.comment-sticky-discuss-close:hover,
.comment-sticky-discuss-close:focus-visible{
    color: var(--ink)
}

.comment-sticky-discuss-body{
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 .15rem .2rem
}

.comment-sticky-discuss-body .list-empty{
    margin: .15rem 0
}

/* sticky 弹窗内回复一律走 stickyCommentBodyInput，不展示内联输入 */
.comment-sticky-discuss-body .comment-inline-reply,
.comment-sticky-discuss-body [data-comment-reply-slot]:has(.comment-inline-reply),
.comment-sticky-discuss-body [data-annotation-reply-slot]:has(.comment-inline-reply){
    display: none !important
}

.comment-sticky-form{
    display: none;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.8rem 0 .85rem 0;
    background: #fff;
    box-sizing: border-box
}

.comment-sticky-compose-avatar{
    flex: 0 0 auto;
    display: block;
    width: 2rem;
    height: 2rem;
    margin: .15rem .7rem 0 0;
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box
}

.comment-sticky-compose-avatar-img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover
}

.comment-sticky-compose-avatar-letter{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    background: #8a9aa8;
    font: 650 .85rem/1 var(--sans)
}

.comment-sticky-compose-body{
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch
}

.comment-sticky-dock.is-open .comment-sticky-form{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    animation: comment-compose-in .16s ease-out
}

/* 议题 sticky：无头像横排结构，保持原纵向布局 */
[data-topic-sticky-compose].comment-sticky-dock.is-open .comment-sticky-form,
[data-topic-sticky-compose].comment-sticky-dock.is-open:not(.is-discuss-open) .comment-sticky-form,
[data-topic-sticky-compose].comment-sticky-dock.is-open.is-discuss-open .comment-sticky-form{
    flex-direction: column;
    align-items: stretch
}

.comment-sticky-form textarea{
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100px;
    max-height: 60vh;
    margin: 0;
    padding: .7rem .8rem;
    border: 1px solid rgba(17, 50, 74, .14);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: 0.92rem/1.4 var(--line-strong);
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    font-weight: normal;
}

/* 展开底栏：仅写留言时限高；列表+写留言另见 is-discuss-open */
.comment-sticky-dock.is-open:not(.is-discuss-open){
    display: flex;
    flex-direction: column;
    max-height: calc(60vh + 5.5rem);
    overflow: hidden;
}

.comment-sticky-dock.is-open:not(.is-discuss-open) .comment-sticky-form{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 0;
    overflow: hidden;
}

.comment-sticky-dock.is-open .comment-sticky-actions{
    flex: 0 0 auto;
    background: #fff;
}

.comment-sticky-dock.is-open.is-discuss-open .comment-sticky-form{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex: 0 0 auto;
    padding-top: 0.6rem;
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.comment-sticky-dock.is-open.is-discuss-open .comment-sticky-form textarea{
    height: 72px;
    min-height: 72px;
    max-height: 96px;
}

.comment-sticky-form textarea:focus{
    border-color: rgba(17, 50, 74, .24);
}

.comment-sticky-gate{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem .75rem;
    margin: 0 0 .65rem;
    padding: .7rem .85rem;
    border-radius: 8px;
    background: #f4f1ea;
    color: var(--ink);
    font: 500 1.02rem/1.45 var(--sans)
}

.comment-sticky-gate[hidden]{
    display: none !important
}

.comment-sticky-gate a{
    color: var(--red);
    font: 600 .82rem/1.4 var(--sans);
    text-decoration: none;
    border-bottom: 1px solid currentColor
}

.comment-sticky-actions{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: .6rem;
    box-sizing: border-box
}

.comment-sticky-actions button{
    min-height: 38px;
    min-width: 0;
    padding: .3rem 1rem;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 600 0.9rem/1.4 var(--sans);
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box
}

.comment-sticky-actions [data-sticky-submit]{
    background: var(--red);
    color: #fff;
    font: 600 0.92rem/1.2 var(--sans);
    border-radius: 999px;
}

.comment-sticky-actions [data-sticky-count]{
    margin-right: auto;
    color: var(--muted);
    font: 650 .82rem/1 var(--sans)
}

.comment-sticky-actions [data-sticky-cancel],
.comment-sticky-actions [data-topic-sticky-cancel]{
    min-height: 38px;
    min-width: 0;
    padding: .3rem .55rem;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 600 0.92rem/1.6 var(--sans);
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box
}

.comment-sticky-actions [data-sticky-cancel]:hover,
.comment-sticky-actions [data-topic-sticky-cancel]:hover{
    color: var(--ink)
}

.comment-sticky-actions button[type="submit"],
.comment-sticky-actions button.comment-sticky-submit{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 0;
    padding: .35rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font: 700 0.92rem/1 var(--sans);
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box
}

.comment-sticky-actions button[type="submit"]:hover:not(:disabled),
.comment-sticky-actions button[type="submit"]:focus-visible:not(:disabled),
.comment-sticky-actions button.comment-sticky-submit:hover:not(:disabled),
.comment-sticky-actions button.comment-sticky-submit:focus-visible:not(:disabled){
    background: #0c2436
}

.comment-sticky-actions button[type="submit"]:disabled,
.comment-sticky-actions button.comment-sticky-submit:disabled{
    opacity: .45;
    cursor: not-allowed
}

.comment-sticky-actions-lead{
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .65rem;
    min-width: 0;
}

.comment-sticky-dock.is-replying .comment-sticky-actions-lead{
    display: none
}

.comment-sticky-actions-lead .topic-discuss-compose-tags{
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .28rem .55rem;
    min-width: 0
}

.comment-sticky-actions-lead .topic-discuss-compose-tags[hidden]{
    display: none !important
}

.comment-sticky-actions .topic-discuss-compose-tag-chip{
    max-width: min(9.5rem, 42vw);
    color: var(--red);
    font: 500 .82rem/1.25 var(--sans)
}

.comment-sticky-actions .topic-discuss-compose-tag-add,
.comment-sticky-actions .topic-discuss-compose-tag-chip-remove{
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--red, #b4382f);
    font: 500 .82rem/1.2 var(--sans);
    white-space: nowrap
}

.comment-sticky-actions .topic-discuss-compose-tag-input-wrap{
    position: relative;
    flex: 0 1 12.5rem;
    min-width: 8.5rem;
    max-width: 100%;
}

.comment-sticky-context{
    display: none
}

.comment-sticky-dock.is-open .comment-sticky-context:not([hidden]){
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 0 .45rem
}

.comment-sticky-context-label{
    margin: 0;
    min-width: 0;
    color: var(--red);
    font: 650 .92rem/1.3 var(--sans)
}

.comment-sticky-context-clear{
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer
}

.comment-sticky-context-clear svg{
    width: 1rem;
    height: 1rem
}

.comment-sticky-context-clear:hover,
.comment-sticky-context-clear:focus-visible{
    color: var(--ink)
}

.article-participation .list-empty{
    margin: .15rem 0 .35rem
}

/* ============================================================
 * 留言流（公众号采集留言与站内留言合并展示，条目可回复、可表态）
 * 数据来源：zhengdangshi-data/zhengdangshi-comments.js
 * ============================================================ */
.discussion-feed-body{
    white-space: pre-wrap;
    overflow-wrap: anywhere
}
