/* 评论列表与原位卡均由可信外壳浮层绘制，不改变正文或 iframe 布局。 */
.comment-list{position:fixed;z-index:85;width:350px;max-width:calc(100vw - 20px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:14px;border:1px solid var(--line-2,#ccd3e2);border-radius:13px;background:#fff;box-shadow:0 10px 40px #10204b33;font:400 14px/1.5 var(--sans,sans-serif)}
.comment-list[hidden]{display:none}
.comment-list-header{position:relative;display:flex;align-items:center;gap:8px;margin-bottom:12px}
.comment-tabs{display:flex;flex:1;min-width:0;gap:3px;padding:3px;border-radius:9px;background:#eef1f7}
.comment-tab{flex:1;border:0;border-radius:7px;padding:6px 10px;background:none;color:var(--ink-3,#67718a);font:500 13px/1.3 var(--sans,sans-serif);cursor:pointer}
.comment-tab[aria-selected="true"]{background:#fff;color:var(--ink,#1c2944);box-shadow:0 1px 4px #10204b14}

/* 按钮层级：primary 每个界面只放一个；其余为描边或无边框。 */
.comment-button{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:5px 11px;border:1px solid var(--line-2,#ccd3e2);border-radius:7px;color:var(--ink-2,#45506a);background:#fff;font:500 13px/1.2 var(--sans,sans-serif);cursor:pointer}
.comment-button:hover{background:var(--surface-3,#e9edf7)}
.comment-button:disabled{opacity:.5;cursor:default}
.comment-button.primary{background:var(--blue,#386bef);border-color:transparent;color:#fff}
.comment-button.primary:hover{background:#2f5ed6}
.comment-button.ghost{border-color:transparent;background:none;color:var(--ink-3,#67718a)}
.comment-button.ghost:hover{background:var(--surface-3,#e9edf7);color:var(--ink,#1c2944)}
.comment-button.danger{border-color:#d9a3a3;color:#a12a2a;background:#fff}
.comment-button.danger:hover{background:#fbeaea}
.comment-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:none;color:var(--ink-2,#45506a);cursor:pointer}
.comment-icon-button:hover{background:var(--surface-3,#e9edf7)}
.comment-icon-button:disabled{opacity:.5;cursor:default}
.comment-icon-button .ic{width:16px;height:16px}
.comment-toggle{position:relative;white-space:nowrap}
.comment-toggle.has-unread::after{content:'';position:absolute;width:7px;height:7px;right:2px;top:1px;background:var(--blue,#386bef);border:2px solid #f3f4f8;border-radius:50%}
.comment-new.comment-icon-button{flex:none;background:#111;color:#fff}
.comment-new.comment-icon-button:hover{background:#333}
.comment-menu{position:absolute;z-index:3;right:0;top:100%;min-width:180px;padding:5px;border:1px solid var(--line,#dde1ea);border-radius:10px;background:#fff;box-shadow:0 8px 28px #10204b26}
.comment-menu-item{display:block;width:100%;padding:8px 10px;border:0;border-radius:7px;background:none;text-align:left;font:500 13px/1.2 var(--sans,sans-serif);color:var(--ink,#1c2944);cursor:pointer}
.comment-menu-item:hover{background:var(--surface-3,#e9edf7)}
.comment-confirm{margin:0 0 14px;padding:12px;border:1px solid #e0b4b4;border-radius:9px;background:#fff7f7;font-size:13px;line-height:1.5}
.comment-confirm-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.comment-note,.comment-feedback,.comment-empty{margin:9px 0 14px;color:var(--ink-3,#67718a);font-size:13px;line-height:1.5}
.comment-feedback{padding:9px;border-radius:7px;background:#fff3dc;color:#735214}

/* 浮动评论列表 */
.comment-group{margin-top:20px}
.comment-group h3{font-size:13px;font-weight:600;color:var(--ink-3,#67718a);margin-bottom:9px}
.comment-thread-row{display:flex;flex-direction:column;gap:5px;text-align:left;width:100%;padding:12px 11px;border:1px solid var(--line,#e2e4eb);border-radius:10px;background:#fff;margin-top:8px;cursor:pointer;font:inherit}
.comment-thread-row:hover{border-color:var(--blue,#386bef)}
.comment-thread-row[aria-current="true"]{border-color:var(--blue,#386bef);box-shadow:0 0 0 2px #386bef33;background:#f3f6ff}
.comment-thread-row.is-unread{border-left:4px solid var(--blue,#386bef)}
.comment-thread-top{display:flex;align-items:center;gap:7px;min-width:0}
.comment-number{flex:none;min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;border-radius:10px;background:var(--blue,#386bef);color:#fff;font:600 12px/20px var(--sans,sans-serif);text-align:center}
.comment-thread-author{font-size:13px;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.comment-unread-chip{flex:none;padding:1px 6px;border-radius:9px;background:#e4ecff;color:#2a4fb3;font-size:12px;font-weight:600}
.comment-thread-time{margin-left:auto;flex:none;font-size:12px;color:var(--ink-3,#67718a)}
.comment-thread-preview,.comment-thread-latest{font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.comment-thread-latest{-webkit-line-clamp:2;padding-left:8px;border-left:2px solid #d8dfea;color:var(--ink-2,#45506a);font-size:13px}
.comment-thread-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;color:var(--ink-3,#67718a)}
.comment-channel:not(:empty){display:inline-block;padding:0 6px;border-radius:9px;background:#eef1f7;color:var(--ink-2,#45506a);font-size:12px}
.comment-thread-anchor{font-size:12px;line-height:1.4;color:var(--ink-3,#67718a);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}

/* 页面上的标注 */
.comment-overlay{position:fixed;inset:0;z-index:55;pointer-events:none;overflow:hidden}
.comment-pin{position:absolute;width:24px;height:24px;padding:0;border:2px solid #fff;border-radius:50% 50% 4px 50%;background:var(--blue,#386bef);box-shadow:0 1px 5px #14264c40;color:#fff;font:600 12px/1 var(--sans,sans-serif);pointer-events:auto;cursor:pointer}
.comment-pin.active{background:#1b3f9e;box-shadow:0 0 0 3px #386bef55,0 1px 5px #14264c40;transform:scale(1.12)}
.comment-highlight{position:absolute;border:0;padding:0;background:#ffd65966;box-shadow:inset 0 -1px #d4a313;pointer-events:auto;cursor:pointer;border-radius:2px}
.comment-highlight:hover{background:#ffd659aa}
.comment-highlight.active{background:#ffc83c99;box-shadow:inset 0 -2px #b88400}
.comment-highlight.pending{pointer-events:none;background:#9db8ff66;box-shadow:inset 0 -2px #386bef}
.comment-selecting{cursor:crosshair}
.comment-hover-box{position:fixed;z-index:54;pointer-events:none;box-sizing:border-box;border:2px solid var(--blue,#386bef);border-radius:5px;background:#386bef14}
.comment-hover-box[hidden]{display:none}

/* 浮层必须不透明：--surface 是半透明色，不能直接用。 */
.comment-popover{position:fixed;z-index:80;width:350px;max-width:calc(100vw - 24px);max-height:calc(100vh - 88px);overflow:auto;box-sizing:border-box;padding:16px;border:1px solid var(--line-2,#ccd3e2);border-radius:13px;background:#fff;box-shadow:0 10px 40px #10204b33;font-family:var(--sans,sans-serif);font-size:14px}
.comment-popover[hidden]{display:none}
/* 评论内部保留滚动能力，只隐藏原生滚动条，不影响产物正文。 */
.comment-popover,.comment-popover *,.comment-list,.comment-list *{scrollbar-width:none}
.comment-popover::-webkit-scrollbar,.comment-popover *::-webkit-scrollbar,.comment-list::-webkit-scrollbar,.comment-list *::-webkit-scrollbar{display:none;width:0;height:0}
.comment-new-popover{padding:6px}
.comment-popover-title{font-size:15px;font-weight:600}
.comment-thread-view:focus{outline:none}
.comment-quote{margin:9px 0 10px;padding:1px 0 1px 9px;border-left:3px solid #f1cc5d;color:var(--ink-3,#67718a);font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;max-height:100px;overflow:auto}
.comment-message{display:flex;align-items:flex-start;gap:10px;padding:0 0 17px}
.comment-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;border-radius:50%;background:#e4ebfb;color:#35518b;font:600 13px/1 var(--sans,sans-serif)}
.comment-message-content{position:relative;flex:1;min-width:0}
.comment-message-meta{display:flex;align-items:center;gap:7px;min-height:30px;font-size:12px;line-height:1.5;color:var(--ink-3,#67718a)}
.comment-message-meta strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink,#1c2944);font-weight:600;font-size:13px}
.comment-message-meta time{flex:none;white-space:nowrap;font-size:11px}
.comment-message-tools{display:flex;align-items:center;flex:none;margin-left:auto;gap:1px;opacity:0;pointer-events:none}
.comment-message-tools .comment-icon-button{width:25px;height:26px}
.comment-message-manage{display:inline-flex}
.comment-message:hover .comment-message-tools,.comment-message:focus-within .comment-message-tools{opacity:1;pointer-events:auto}
@media(hover:none),(pointer:coarse){.comment-message-tools{opacity:1;pointer-events:auto}}
.comment-message-body{margin:4px 0 0;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.comment-message-actions{position:relative;display:flex;align-items:center;gap:5px;margin-top:6px}
.comment-message-actions.comment-delete-confirm{display:block}
.comment-message-actions .comment-button{min-height:26px;padding:2px 7px;font-size:12px}
.comment-confirm-text{font-size:13px;color:var(--ink-2,#45506a)}
.comment-composer{position:relative;margin:2px 0 0}
.comment-composer-field{position:relative}
.comment-input{display:block;width:100%;box-sizing:border-box;min-height:43px;max-height:35vh;resize:none;padding:11px 43px 10px 11px;border:1px solid var(--line-2,#ccd3e2);border-radius:9px;font:400 14px/1.5 var(--sans,sans-serif);color:var(--ink,#1c2944);background:#fff}
.comment-input:focus{outline:2px solid #8eaef3;outline-offset:1px}
.comment-new-popover .comment-input{border-color:transparent;resize:none}
.comment-new-popover .comment-input:focus{outline:none}
.comment-send.comment-icon-button{position:absolute;right:8px;bottom:8px;width:27px;height:27px;border-radius:50%;background:var(--blue,#386bef);color:#fff}
.comment-send.comment-icon-button:disabled{background:#dfe3eb;color:#fff;opacity:1}
.comment-send.comment-icon-button:not(:disabled):hover{background:#2f5ed6}
.comment-edit-cancel{margin-top:5px}
.comment-popover-status .comment-feedback,.comment-popover-status .comment-pending{margin-bottom:0;font-size:12px}
.comment-popover-status .comment-note{font-size:12px}
.comment-selection{position:fixed;z-index:81;max-width:calc(100vw - 16px);min-height:28px;height:auto;white-space:normal;border:1px solid var(--line-2,#ccd3e2);color:var(--ink,#0c1130);box-shadow:0 3px 14px #14264c29;background:#fff}
.comment-selection[hidden]{display:none}
.comment-thread-actions{display:flex;gap:7px;margin-top:13px}
.comment-resolution{font-size:12px;line-height:1.5;margin:0 0 12px 40px;color:var(--ink-3,#67718a)}
.comment-resolution summary{cursor:pointer;color:#507557}
.comment-resolution p{white-space:pre-wrap;overflow-wrap:anywhere}
.comment-version{font-size:12px;color:var(--ink-3,#67718a)}
.comment-pending{margin:10px 0;padding:9px;border:1px solid #dec692;border-radius:8px;font-size:12px;line-height:1.5;background:#fffaf0}
.comment-pending code{display:block;overflow-wrap:anywhere;margin:5px 0}
.comment-anchor-screenshot{display:block;max-width:100%;max-height:160px;object-fit:contain}

/* 评论模式提示条与撤销提示，均为不透明浮层。 */
.comment-hint,.comment-toast{position:fixed;z-index:82;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:6px 8px 6px 14px;border:1px solid var(--line-2,#ccd3e2);border-radius:999px;background:#fff;box-shadow:0 6px 24px #10204b2e;font:500 13px/1.3 var(--sans,sans-serif);color:var(--ink,#1c2944)}
.comment-hint{top:72px}
.comment-toast{bottom:24px;padding-right:6px}
.comment-hint[hidden],.comment-toast[hidden]{display:none}

.comment-toggle:focus-visible,.comment-tab:focus-visible,.comment-pin:focus-visible,.comment-highlight:focus-visible,.comment-thread-row:focus-visible,.comment-button:focus-visible,.comment-icon-button:focus-visible,.comment-menu-item:focus-visible{outline:2px solid #386bef;outline-offset:2px}

@media(max-width:760px){
 .comment-list{z-index:95}
 .comment-hint{border-radius:12px;flex-wrap:wrap;justify-content:center}
 .comment-popover{z-index:95}
}

.comment-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; display: block; }
