/* ============================================
   LS Comment - 全新评论区样式
   ============================================ */

/* 评论区容器 */
.ls-comment-box {
    padding: 16px;
    border-top: 1px solid #f4f4f5;
}

/* ---- 菜单栏 ---- */
.ls-comment-menu {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.ls-comment-count {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-right: auto;
}

.ls-comment-count em {
    font-style: normal;
}

.ls-comment-tabs {
    display: flex;
    background: #f4f4f5;
    border-radius: 6px;
    padding: 2px;
}

.ls-comment-tabs .tab-item {
    padding: 4px 12px;
    font-size: 12px;
    color: #71717a;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}

.ls-comment-tabs .tab-item:hover {
    color: #3f3f46;
}

.ls-comment-tabs .tab-item.on {
    background: #fff;
    color: #18181b;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ---- 评论输入框 ---- */
.ls-comment-form {
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.15s;
}

.ls-comment-form:focus-within {
    border-color: #a1a1aa;
}

.ls-comment-form .ls-comment-textarea {
    width: 100%;
    padding: 12px 14px 6px;
    border: none;
    background: transparent;
    resize: none;
    height: 44px;
    max-height: 180px;
    font-size: 13px;
    line-height: 1.6;
    color: #18181b;
    outline: none;
}

.ls-comment-form .ls-comment-textarea::placeholder {
    color: #a1a1aa;
}

/* 图片上传列表 */
.ls-comment-img-list {
    display: inline-flex;
    gap: 6px;
    padding: 0 14px;
    flex-wrap: wrap;
}

.ls-comment-img-list:empty {
    display: none;
}

.ls-comment-img-list li {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.ls-comment-img-list li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ls-comment-img-list li .close {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.55);
    border-radius: 0 8px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
}

.ls-comment-img-list li:hover .close {
    opacity: 1;
}

/* 图片拖拽排序 */
.ls-comment-img-list li.ls-img-sort-ghost {
    opacity: 0.35;
}
.ls-comment-img-list li.ls-img-sort-chosen {
    cursor: grabbing;
}
.ls-comment-img-list li.ls-img-sort-drag {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* 工具栏 */
.ls-comment-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 6px;
}

.ls-comment-toolbar .toolbar-left {
    display: flex;
    gap: 2px;
}

.ls-comment-toolbar .tool-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    color: #a1a1aa;
    transition: all 0.15s;
    font-size: 17px;
}

.ls-comment-toolbar .tool-btn:hover {
    color: #52525b;
    background: #f4f4f5;
}

/* 提交按钮 */
.ls-comment-submit {
    padding: 0 18px;
    height: 30px;
    border: none;
    border-radius: 15px;
    background: var(--ls-primary, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 30px;
}

.ls-comment-submit:hover {
    filter: brightness(1.08);
}

.ls-comment-submit.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* @用户列表 */
.ls-comment-at-box:empty {
    display: none;
}

.ls-comment-at-box {
    padding: 4px 14px 8px;
}

/* ---- 评论列表 ---- */
.ls-comment-list {
    display: flex;
    flex-direction: column;
}

/* ---- 评论项 ---- */
.ls-comment-item {
    display: flex;
    gap: 10px;
    padding: 14px 0;
}

.ls-comment-list > .ls-comment-item + .ls-comment-item {
    border-top: 1px solid #f4f4f5;
}

/* 闪烁 */
.ls-comment-item.fade {
    animation: ls-fade 1.2s ease;
}

@keyframes ls-fade {
    0%, 40% { background: rgba(37, 99, 235, 0.04); }
    100% { background: transparent; }
}

/* 头像 */
.ls-ci-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
}

.ls-ci-avatar img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.ls-ci-avatar .ls-verify-icon {
    position: absolute;
    right: 0px;
    bottom: 0px;
    width: 14px;
    height: 16px;
    line-height: 1;
    display: block;
}

.ls-comment-item .ls-ci-avatar .ls-verify-icon img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    object-fit: contain;
}

/* 主体 */
.ls-ci-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 用户信息 */
.ls-ci-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ls-ci-user {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 500;
    color: #18181b;
}

.ls-ci-user:hover {
    color: var(--jinsom-theme-color, #2563eb);
}

.ls-ci-nickname {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-ci-header .ls-mark {
    font-size: 10px;
    padding: 0 4px;
    line-height: 16px;
    border-radius: 3px;
}

/* 评论内容 */
.ls-ci-content {
    font-size: 14px;
    line-height: 1.7;
    color: #27272a;
    word-break: break-word;
}

.ls-ci-text .comment-sticky {
    display: inline-block;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    color: #f43f5e;
    border: 1px solid #fda4af;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 500;
}

/* 引用回复 */
.ls-ci-reply-ref {
    background: #fafafa;
    border-left: 2px solid #e4e4e7;
    border-radius: 0 6px 6px 0;
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #71717a;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-ci-reply-ref:hover {
    background: #f4f4f5;
}

/* @用户 */
.ls-ci-at-list {
    display: inline;
}

.ls-ci-at {
    color: var(--jinsom-link-color, #2563eb);
    margin-right: 2px;
    font-size: inherit;
    font-weight: 500;
}

.ls-ci-at:hover {
    text-decoration: underline;
}

/* 评论图片 */
.ls-ci-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 280px;
    margin-top: 6px;
}

.ls-ci-images.img-1 {
    grid-template-columns: 1fr;
    max-width: 160px;
}

.ls-ci-images.img-2 {
    grid-template-columns: 1fr 1fr;
    max-width: 220px;
}

.ls-ci-images a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
}

.ls-ci-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.ls-ci-images a:hover img {
    transform: scale(1.03);
}

.ls-ci-images k.gif {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* ---- 操作栏 ---- */
.ls-ci-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.ls-ci-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a1a1aa;
}

.ls-ci-bar-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ls-ci-bar-right > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    color: #a1a1aa;
    transition: all 0.15s;
}

.ls-ci-bar-right > span:hover {
    background: #f4f4f5;
    color: #52525b;
}

.ls-ci-bar-right > span i {
    font-size: 14px;
}

.ls-ci-bar-right > span em {
    font-style: normal;
}

/* 点赞激活 */
.ls-ci-up.is-up {
    color: #f43f5e !important;
}

.ls-ci-up.is-up:hover {
    color: #f43f5e !important;
    background: #fff1f2 !important;
}

/* ---- 子评论 ---- */
.ls-ci-child-toggle {
    margin-top: 2px;
}

.ls-ci-expand {
    font-size: 12px;
    color: var(--jinsom-theme-color, #2563eb);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 0;
}

.ls-ci-expand:hover {
    opacity: 0.8;
}

.ls-ci-expand i {
    font-size: 14px;
    transition: transform 0.2s;
}

.ls-ci-expand.is-expanded i {
    transform: rotate(180deg);
}

.ls-ci-child-list {
    margin-top: 6px;
    margin-left: 4px;
    padding-left: 12px;
    border-left: 2px solid #f4f4f5;
}

.ls-ci-child-list:empty {
    display: none;
}

.ls-ci-child-list .ls-comment-item {
    padding: 10px 0;
}

.ls-ci-child-list .ls-ci-avatar {
    width: 24px;
    height: 24px;
}

.ls-ci-child-list .ls-ci-avatar img {
    width: 24px;
    height: 24px;
}

.ls-ci-child-list .ls-ci-avatar .ls-verify-icon {
    width: 12px;
    height: 12px;
    right: -2px;
    bottom: -2px;
}

.ls-ci-child-list .ls-ci-content {
    font-size: 13px;
}

/* 子评论操作按钮 */
.ls-ci-child-more {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.ls-ci-child-more span {
    font-size: 12px;
    color: var(--jinsom-theme-color, #2563eb);
    cursor: pointer;
    transition: opacity 0.15s;
}

.ls-ci-child-more span:hover {
    opacity: 0.7;
}

.ls-ci-child-fold {
    color: #a1a1aa !important;
}

/* ---- 加载更多 ---- */
.ls-comment-load-more {
    text-align: center;
    padding: 8px 0 0;
}

.ls-comment-load-more span {
    font-size: 13px;
    color: var(--jinsom-theme-color, #2563eb);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    transition: opacity 0.15s;
}

.ls-comment-load-more span:hover {
    opacity: 0.7;
}

.ls-comment-load-more span i {
    font-size: 16px;
}

/* 空状态 */
.ls-comment-empty {
    text-align: center;
    padding: 36px 0;
    color: #a1a1aa;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ls-comment-empty i {
    font-size: 32px;
    color: #d4d4d8;
}

/* 加载中 */
.ls-comment-loading {
    text-align: center;
    padding: 20px 0;
}

/* ---- 回复框 ---- */
.ls-comment-reply-form {
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
    transition: border-color 0.15s;
}

.ls-comment-reply-form:focus-within {
    border-color: #a1a1aa;
}

.ls-comment-reply-form .ls-comment-textarea {
    width: 100%;
    padding: 10px 12px 4px;
    border: none;
    background: transparent;
    resize: none;
    height: 38px;
    max-height: 120px;
    font-size: 13px;
    line-height: 1.5;
    color: #18181b;
    outline: none;
}

.ls-comment-reply-form .ls-comment-toolbar {
    padding: 2px 6px 4px;
}

.ls-comment-reply-form .ls-comment-submit {
    height: 26px;
    padding: 0 14px;
    font-size: 12px;
    line-height: 26px;
    border-radius: 13px;
}

.ls-comment-reply-form .tool-btn {
    width: 26px;
    height: 26px;
    font-size: 15px;
}

/* ---- LSEditor 编辑器 ---- */
.ls-editor {
    border: none;
    background: transparent;
}

/* 主评论框 LSEditor */
.ls-comment-form .ls-editor {
    min-height: 44px;
    max-height: 180px;
    padding: 12px 14px 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #18181b;
    outline: none;
    word-break: break-word;
    overflow-y: auto;
}

/* 回复框 LSEditor */
.ls-comment-reply-form .ls-editor {
    min-height: 38px;
    max-height: 120px;
    padding: 10px 12px 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #18181b;
    outline: none;
    word-break: break-word;
    overflow-y: auto;
}

.ls-editor:empty:not(:focus)::before {
    content: attr(data-placeholder);
    color: #a1a1aa;
    pointer-events: none;
}

.ls-editor .ls-emoji {
    width: auto;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}

/* 评论内容中的表情 */
.ls-ci-content .ls-emoji {
    width: auto;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}
