/**
 * component-comments.css - 评论区组件（Joe 原版样式）
 */

/* ==============================
   评论区容器
   ============================== */
.joe_comment {
    background: var(--card-bg, #fff);
    border-radius: var(--radius-wrap, 8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 15px;
}

.joe_comment__title {
    font-weight: 500;
    text-align: center;
    font-size: 24px;
    color: var(--text-primary, #333);
    text-shadow: var(--text-shadow, none);
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    margin-bottom: 15px;
    padding-bottom: 15px;
}

.joe_comment__close {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #999);
    gap: 6px;
    padding: 20px 0;
}

.joe_comment__close svg {
    fill: var(--text-muted, #999);
    margin-right: 5px;
}

/* ==============================
   评论表单
   ============================== */
.joe_comment__respond {
    margin-bottom: 20px;
}

@keyframes showComment {
    from { opacity: 0; }
    to { opacity: 1; }
}

.joe_comment__respond-type {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.joe_comment__respond-type .item {
    background: var(--bg-secondary, #f5f6f7);
    padding: 0 15px;
    height: 32px;
    line-height: 32px;
    color: var(--text-primary, #333);
    border: none;
    transition: color 0.35s, background 0.35s;
    cursor: pointer;
    font-size: 13px;
}

.joe_comment__respond-type .item:first-child {
    border-radius: var(--radius-md, 4px) 0 0 0;
}

.joe_comment__respond-type .item:last-child {
    border-radius: 0 var(--radius-md, 4px) 0 0;
}

.joe_comment__respond-type .item.active {
    color: #fff;
    background: var(--accent-primary, #409eff);
}

.joe_comment__respond-form {
    border-radius: 6px 0 6px 6px;
    background: var(--bg-secondary, #f5f6f7);
}

.joe_comment__respond-form .head {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color, #e8e8e8);
}

.joe_comment__respond-form .head .list {
    flex: 1;
}

.joe_comment__respond-form .head .list input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0 15px;
    height: 40px;
    color: var(--text-secondary, #666);
    font-size: 13px;
    outline: none;
}

.joe_comment__respond-form .head .list input::placeholder {
    color: var(--text-muted, #999);
}

.joe_comment__respond-form .head .list:nth-child(2) {
    position: relative;
}

.joe_comment__respond-form .head .list:nth-child(2)::after,
.joe_comment__respond-form .head .list:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 1px;
    height: 15px;
    background: var(--border-color, #e8e8e8);
}

.joe_comment__respond-form .head .list:nth-child(2)::before {
    left: 0;
}

.joe_comment__respond-form .head .list:nth-child(2)::after {
    right: 0;
}

.joe_comment__respond-form .body {
    padding: 15px;
}

.joe_comment__respond-form .body .text {
    width: 100%;
    height: 200px;
    border: none;
    resize: none;
    vertical-align: middle;
    color: var(--text-secondary, #666);
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.joe_comment__respond-form .body .text::placeholder {
    color: #bbb;
}

.joe_comment__respond-form .body .draw {
    position: relative;
    width: 100%;
}

.joe_comment__respond-form .body .draw .line {
    display: flex;
    align-items: center;
    position: absolute;
    top: 10px;
    left: 10px;
    -webkit-user-select: none;
    user-select: none;
    gap: 10px;
}

.joe_comment__respond-form .body .draw .line li {
    cursor: pointer;
    color: var(--text-primary, #333);
    transition: color 0.35s;
    font-size: 14px;
}

.joe_comment__respond-form .body .draw .line li.active {
    color: var(--accent-primary, #409eff);
}

.joe_comment__respond-form .body .draw .color {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 10px;
    left: 10px;
    gap: 5px;
}

.joe_comment__respond-form .body .draw .color li {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: box-shadow 0.35s;
}

.joe_comment__respond-form .body .draw .color li.active {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.joe_comment__respond-form .body .draw .color li:nth-child(1) { background: #303133; }
.joe_comment__respond-form .body .draw .color li:nth-child(2) { background: #67c23a; }
.joe_comment__respond-form .body .draw .color li:nth-child(3) { background: #e6a23c; }
.joe_comment__respond-form .body .draw .color li:nth-child(4) { background: #f56c6c; }

.joe_comment__respond-form .body .draw .icon {
    position: absolute;
    right: 10px;
    cursor: pointer;
    fill: var(--text-muted, #999);
    -webkit-user-select: none;
    user-select: none;
}

.joe_comment__respond-form .body .draw .icon-undo {
    top: 10px;
}

.joe_comment__respond-form .body .draw .icon-animate {
    bottom: 10px;
}

.joe_comment__respond-form .body .draw canvas {
    background: var(--card-bg, #fff);
    border-radius: var(--radius-md, 4px);
    width: 100%;
}

.joe_comment__respond-form .foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px 15px;
}

.joe_comment__respond-form .foot .owo {
    min-height: 32px;
    padding-top: 3px;
}

.joe_comment__respond-form .foot .submit {
    position: absolute;
    top: 0;
    right: 15px;
    white-space: nowrap;
}

.joe_comment__respond-form .foot .submit .cancle {
    display: none;
    color: var(--text-primary, #333);
    cursor: pointer;
    margin-right: 10px;
    transition: color 0.35s;
}

.joe_comment__respond-form .foot .submit .cancle:hover {
    color: var(--accent-primary, #409eff);
}

.joe_comment__respond-form .foot .submit button {
    border-radius: 3px;
    height: 32px;
    padding: 0 15px;
    border: none;
    background: var(--accent-primary, #409eff);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.35s;
}

.joe_comment__respond-form .foot .submit button:hover {
    -webkit-animation: shaked 5s ease-in-out infinite;
    animation: shaked 5s ease-in-out infinite;
}

@keyframes shaked {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* ==============================
   OWo 表情
   ============================== */
.joe_owo__contain {
    position: relative;
}

.joe_owo__contain .seat {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    text-align: center;
    color: var(--text-secondary, #666);
    height: 26px;
    line-height: 26px;
    background: var(--card-bg, #fff);
    opacity: 0.85;
    border-radius: 13px;
    width: 70px;
    display: inline-block;
    font-size: 13px;
}

.joe_owo__contain .box {
    width: 100%;
    display: none;
    background: var(--card-bg, #fff);
    border-radius: var(--radius-md, 4px);
    overflow: hidden;
    margin-top: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.joe_owo__contain .box .scroll {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: none;
    padding: 5px;
}

.joe_owo__contain .box .scroll.active {
    display: block;
}

.joe_owo__contain .box .scroll .item {
    text-align: center;
    width: calc(100% / 18);
    display: inline-block;
    padding: 5px;
    cursor: pointer;
    border-radius: var(--radius-md, 4px);
    transition: background 0.25s;
}

.joe_owo__contain .box .scroll .item img {
    max-width: 100%;
    max-height: 100%;
}

.joe_owo__contain .box .scroll .item:hover {
    background: var(--bg-secondary, #f5f6f7);
}

.joe_owo__contain .box .bar {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color, #f0f0f0);
}

.joe_owo__contain .box .bar .item {
    line-height: 30px;
    padding: 0 10px;
    cursor: pointer;
    color: var(--text-secondary, #666);
    transition: background 0.25s, color 0.25s;
    font-size: 13px;
}

.joe_owo__contain .box .bar .item.active {
    color: #fff;
    background: var(--accent-primary, #409eff);
}

/* ==============================
   评论列表
   ============================== */
.joe_comment .comment-list {
    padding-top: 15px;
    list-style: none;
    margin: 0;
}

.joe_comment .comment-list__item {
    margin-bottom: 5px;
}

.joe_comment .comment-list__item-contain .term {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.joe_comment .comment-list__item-contain .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    padding: 3px;
    border: 1px solid var(--border-color, #f0f0f0);
    object-fit: cover;
    flex-shrink: 0;
}

.joe_comment .comment-list__item-contain .content {
    min-width: 0;
    flex: 1;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    padding-bottom: 15px;
}

.joe_comment .comment-list__item-contain .content .user {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    line-height: 20px;
    color: var(--text-primary, #333);
    gap: 10px;
}

.joe_comment .comment-list__item-contain .content .user .author {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 10px;
    font-size: 14px;
}

.joe_comment .comment-list__item-contain .content .user .author a {
    color: #409eff;
    text-decoration: none;
}

.joe_comment .comment-list__item-contain .content .user .author a:hover {
    text-decoration: underline;
}

.joe_comment .comment-list__item-contain .content .user .owner {
    flex-shrink: 0;
    background: var(--accent-primary, #409eff);
    color: #fff;
    padding: 0 5px;
    border-radius: 2px;
    font-style: normal;
    font-size: 11px;
}

.joe_comment .comment-list__item-contain .content .user .agent {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted, #999);
    white-space: nowrap;
}

.joe_comment .comment-list__item-contain .content .user .waiting {
    color: #e6a23c;
    font-style: normal;
    font-size: 12px;
}

.joe_comment .comment-list__item-contain .content .substance {
    width: 100%;
    background: var(--bg-secondary, #f5f6f7);
    padding: 12px 15px;
    border-radius: 0 var(--radius-md, 4px) var(--radius-md, 4px) 10px;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
    word-break: break-word;
    line-height: 24px;
    font-size: 14px;
}

.joe_comment .comment-list__item-contain .content .substance .parent {
    color: #388bff;
    margin-bottom: 5px;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 500;
    font-size: 13px;
}

.joe_comment .comment-list__item-contain .content .substance .parent span {
    vertical-align: 1px;
    margin-right: 2px;
}

.joe_comment .comment-list__item-contain .content .substance .owo_image {
    height: 22px;
    vertical-align: top;
    display: inline;
}

.joe_comment .comment-list__item-contain .content .substance .draw_image {
    max-width: 100%;
    border-radius: var(--radius-md, 4px);
}

.joe_comment .comment-list__item-contain .content .handle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted, #999);
    font-size: 12px;
}

.joe_comment .comment-list__item-contain .content .handle .date {
    margin-right: 10px;
}

.joe_comment .comment-list__item-contain .content .handle .reply {
    display: flex;
    align-items: center;
    color: var(--text-primary, #333);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.35s;
}

.joe_comment .comment-list__item-contain .content .handle .reply svg {
    margin-right: 5px;
    transition: fill 0.35s;
}

.joe_comment .comment-list__item-contain .content .handle .reply:hover {
    color: var(--accent-primary, #409eff);
}

.joe_comment .comment-list__item-contain .content .handle .reply:hover svg {
    fill: var(--accent-primary, #409eff);
}

/* ==============================
   子评论嵌套
   ============================== */
.joe_comment .comment-list__item-children {
    padding-left: 63px;
}

.joe_comment .comment-list__item-children .comment-list__item-children {
    padding-left: 0;
}

/* 回复表单嵌入 */
.joe_comment .comment-list__item .joe_comment__respond {
    margin-left: 63px;
    margin-bottom: 15px;
    -webkit-animation: showComment 0.5s;
    animation: showComment 0.5s;
}

.joe_comment .comment-list .comment-list {
    padding-top: 0;
}

/* ==============================
   分页
   ============================== */
.joe_comment .joe_pagination {
    padding-top: 0;
}

.joe_pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 15px;
    list-style: none;
    margin: 0;
}

.joe_pagination li {
    display: inline-block;
}

.joe_pagination a,
.joe_pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    text-align: center;
    border-radius: 4px;
    color: var(--text-primary, #333);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid var(--border-color, #e8e8e8);
    transition: all 0.35s;
    padding: 0 10px;
}

.joe_pagination a:hover {
    color: #fff;
    background: var(--accent-primary, #409eff);
    border-color: var(--accent-primary, #409eff);
}

.joe_pagination .active a,
.joe_pagination .active span {
    background: var(--accent-primary, #409eff);
    color: #fff;
    border-color: var(--accent-primary, #409eff);
}

.joe_pagination .prev a,
.joe_pagination .next a {
    display: flex;
    align-items: center;
}

/* ==============================
   深色模式
   ============================== */
.dark .joe_comment {
    background: var(--card-bg, #1e1e1e);
}

.dark .joe_comment__respond-form {
    background: rgba(255, 255, 255, 0.06);
}

.dark .joe_comment__respond-form .head {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .joe_comment__respond-form .head .list:nth-child(2)::before,
.dark .joe_comment__respond-form .head .list:nth-child(2)::after {
    background: rgba(255, 255, 255, 0.1);
}

.dark .joe_comment__respond-form .body .text {
    color: var(--text-secondary, #e0e0e0);
}

.dark .joe_comment__respond-form .head .list input {
    color: var(--text-secondary, #e0e0e0);
}

.dark .joe_comment__respond-form .head .list input::placeholder {
    color: var(--text-muted, #666);
}

.dark .joe_comment__respond-form .body .text::placeholder {
    color: var(--text-muted, #666);
}

.dark .joe_comment__respond-type .item {
    background: rgba(255, 255, 255, 0.06);
}

.dark .joe_comment .comment-list__item-contain .content {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .joe_comment .comment-list__item-contain .content .substance {
    background: rgba(255, 255, 255, 0.06);
}

.dark .joe_comment .comment-list__item-contain .avatar {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .joe_pagination a,
.dark .joe_pagination span {
    border-color: rgba(255, 255, 255, 0.12);
}

.dark .joe_owo__contain .seat {
    background: rgba(255, 255, 255, 0.06);
}

.dark .joe_owo__contain .box {
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .joe_owo__contain .box .bar {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.dark .joe_owo__contain .box .scroll .item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dark .joe_comment__respond-form .body .draw canvas {
    background: #1e1e1e;
}

/* ==============================
   响应式
   ============================== */
@media (max-width: 768px) {
    .joe_comment {
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
    }

    .joe_comment__respond-form .head {
        flex-direction: column;
    }

    .joe_comment__respond-form .head .list {
        width: 100%;
        border-bottom: 1px solid var(--border-color, #e8e8e8);
    }

    .joe_comment__respond-form .head .list:last-child {
        border-bottom: none;
    }

    .joe_comment__respond-form .head .list:nth-child(2)::before,
    .joe_comment__respond-form .head .list:nth-child(2)::after {
        display: none;
    }

    .joe_comment .comment-list__item-contain .term {
        gap: 10px;
    }

    .joe_comment .comment-list__item-contain .avatar {
        width: 36px;
        height: 36px;
        padding: 2px;
        margin-right: 10px;
    }

    .joe_comment .comment-list__item-contain .content .user .agent {
        display: none;
    }

    .joe_comment .comment-list__item-contain .content .user .author {
        font-size: 13px;
    }

    .joe_comment .comment-list__item-contain .content .substance {
        font-size: 13px;
        padding: 10px 12px;
    }

    .joe_comment .comment-list__item-children {
        padding-left: 28px;
    }

    .joe_comment .comment-list__item .joe_comment__respond {
        margin-left: 0;
    }
}
