/*
 * Copyright (c) Baidu, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @file markdown pc 独有的样式
 */

@import (reference) "tokens.less";
@import '../base.less';

.@{prefix}-markdown {
    &-clone {
        top: -9px;
    }
    &-content {
        margin-top: -9px;
        margin-bottom: -9px;
    }

    &-mask {
        bottom: -9px;
    }
    &-research {
        cursor: pointer;
        &-icon {
            .cos-space-mt-none();
            margin-left: 1px;
        }
    }
    
    &-search-more {
        &:hover {
            .cos-color-text-primary();
        }
    }

    &-search-more-re-search-ai,
    &-search-more-research {
        cursor: pointer;
        .cos-color-text-link();
        &-icon {
            .cos-space-mt-none();
            margin-left: 1px;
        }
        &:hover {
            .cos-color-text-primary();
        }
    }

    &-icon-wrapper {
        &:hover {
            .cos-color-text-primary();
            .cos-audio-player-init {
                .cos-color-text-primary();
            }
        }
    }

    &-audio-wrapper {
        .cos-audio-player-enhance {
            max-width: 66.67%;
        }
    }

    &-video{
        &-wrapper {
            .cos-rich-video-player-close-icon {
                .cos-hidden();
            }
        }

        &-duration {
            position: absolute;
            right: 8px;
            bottom: 0;
            font-size: var(--cos-text-caption);
            line-height: var(--cos-leading-body-lg-higher);
            .cos-color-text-inverse();
        }
        &-left {
            float: left;
            margin-right: 8px;
            width: 128px;
        }
    }

    @{markdownsdk} {
        h1,
        h2,
        h3 {
            .cos-space-mt-3xs();
            .cos-space-mb-3xs();
        }

        h1,
        h2 {
            line-height: 32px;
        }

        .cos-text-body-lg-higher();

        .marklang-paragraph {
            .cos-space-mt-3xs();
            .cos-space-mb-3xs();
            .cos-text-body-lg-higher();
        }

        li {
            line-height: var(--cos-leading-body-lg-higher);
            .cos-space-mt-3xs();
            .cos-space-mb-3xs();
        }

        ul>li {
            padding-left: 17px;
            &::before {
                position: absolute;
                margin: var(--cos-space-none) var(--cos-space-xs) var(--cos-space-none) 1px;
                width: 6px;
                height: 6px;
                font-size: var(--cos-leading-headline-sm);
                line-height: 25px;
            }
        }
        ol>li {
            .cos-space-pl-xl();
            &::before {
                position: absolute;
            }
        }
        ol>li>ul {
            margin-left: 4px;
        }

        .marklang-img[position="left"] {
            .cos-space-mr-sm();
            aspect-ratio: 1 / 1;
            border: .3px solid #dcdde04d;
            width: 128px;
            box-sizing: border-box;
        }

        ml-brief {
            .marklang-img {
                .cos-space-mr-sm();
                aspect-ratio: 1 / 1;
                width: 128px;
                box-sizing: border-box;
            }
        }

        .marklang-link {
            &[type="agent"] {
                &::after {
                    left: var(--cos-space-sm);
                }
            }
        }
        .cosd-markdown-table-header {
            &-right {
                .cos-icon:hover {
                    cursor: pointer;
                }
            }
        }
    }
}
