/*!
 * Vditor - A markdown editor written in TypeScript.
 *
 * MIT License
 *
 * Copyright (c) 2018-present B3log 开源, b3log.org
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

/* Default content theme: merges vditor's light.css and dark.css, and follows the
 * system color scheme automatically (light by default, dark via prefers-color-scheme). */

.vditor-reset {
    --callout-note-color: #0969da;
    --callout-note-background-color: rgba(9, 105, 218, 0.08);
    --callout-tip-color: #1a7f37;
    --callout-tip-background-color: rgba(26, 127, 55, 0.08);
    --callout-important-color: #8250df;
    --callout-important-background-color: rgba(130, 80, 223, 0.08);
    --callout-warning-color: #9a6700;
    --callout-warning-background-color: rgba(154, 103, 0, 0.08);
    --callout-caution-color: #cf222e;
    --callout-caution-background-color: rgba(207, 34, 46, 0.08);
}

.vditor-reset h1, .vditor-reset h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eaecef;
}

.vditor-reset hr {
    background-color: #eaecef;
}

.vditor-reset blockquote {
    color: #6a737d;
    border-left: .25em solid #eaecef
}

.vditor-reset iframe {
    border: 1px solid #d1d5da
}

/* default 主题表格（GitHub 风格，自适应宽度，符合当前主题） */
.vditor-reset table {
    width: max-content;
    max-width: 100%;
    display: table;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.vditor-reset table tr {
    background-color: #ffffff;
}

.vditor-reset table th {
    background-color: #f6f8fa;
    color: #24292e;
    font-weight: 600;
}

.vditor-reset table td,
.vditor-reset table th {
    padding: 8px 16px;
    border-top: none;
    border-left: none;
    border-right: 1px solid #d8dee4;
    border-bottom: 1px solid #d8dee4;
}

.vditor-reset table th:last-child,
.vditor-reset table td:last-child {
    border-right: none;
}

.vditor-reset table tbody tr:last-child td {
    border-bottom: none;
}

/* display:table 时 overflow 不裁剪，圆角由四角单元格承担 */
.vditor-reset table thead tr:first-child th:first-child {
    border-top-left-radius: 6px;
}

.vditor-reset table thead tr:first-child th:last-child {
    border-top-right-radius: 6px;
}

.vditor-reset table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

.vditor-reset table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

.vditor-reset table tbody tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.vditor-reset table tbody tr:hover {
    background-color: #f3f4f6;
}

.vditor-reset code:not(.hljs):not(.highlight-chroma) {
    background-color: rgba(27, 31, 35, .05);
}

.vditor-reset pre > code {
    border: 1px solid #d0d7de;
}

.vditor-reset kbd {
    color: #24292e;
    background-color: #fafbfc;
    border: solid 1px #d1d5da;
    box-shadow: inset 0 -1px 0 #d1d5da;
}

.vditor-speech {
    background-color: #f6f8fa;
    border: 1px solid #d1d5da;
    color: #586069;
}

.vditor-speech--current, .vditor-speech:hover {
    color: #4285f4;
}

.vditor-linkcard a {
    background-color: #f6f8fa;
}

.vditor-linkcard a:visited .vditor-linkcard__abstract {
    color: rgba(88, 96, 105, 0.36);
}

.vditor-linkcard__title {
    color: #24292e;
}

.vditor-linkcard__abstract {
    color: #586069;
}

.vditor-linkcard__site {
    color: #4285f4;
}

.vditor-linkcard__image {
    background-color: rgba(88, 96, 105, 0.36);
}

/* -------------------------------------------------------------------------
 * 深色调色板（由 JS 通过根元素 data-vditor-mode 驱动：跟随系统或临时强制）
 * ---------------------------------------------------------------------- */
:root[data-vditor-mode="dark"] {
    .vditor-body.theme-default {
        background-color: #1d2125;
        color: #d1d5da;
    }

    .vditor-reset {
        color: #d1d5da;
        --callout-note-color: #58a6ff;
        --callout-note-background-color: rgba(56, 139, 253, 0.15);
        --callout-tip-color: #3fb950;
        --callout-tip-background-color: rgba(46, 160, 67, 0.15);
        --callout-important-color: #a371f7;
        --callout-important-background-color: rgba(163, 113, 247, 0.15);
        --callout-warning-color: #d29922;
        --callout-warning-background-color: rgba(187, 128, 9, 0.15);
        --callout-caution-color: #f85149;
        --callout-caution-background-color: rgba(248, 81, 73, 0.15);
    }

    .vditor-reset a, .vditor-ir__link {
        color: #4285f4;
    }

    .vditor-reset h1, .vditor-reset h2 {
        padding-bottom: 0.3em;
        border-bottom: 1px solid #d1d5da
    }

    .vditor-reset hr {
        background-color: #d1d5da
    }

    .vditor-reset blockquote {
        padding: 0 1em;
        color: #b9b9b9;
        border-left: .25em solid #d1d5da
    }

    .vditor-reset iframe {
        border: 1px solid #141414
    }

    .vditor-reset table {
        width: max-content;
        max-width: 100%;
        display: table;
        border: 1px solid #30363d;
        border-radius: 6px;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
    }

    .vditor-reset table tr {
        background-color: #0d1117;
    }

    .vditor-reset table th {
        background-color: #161b22;
        color: #f0f6fc;
        font-weight: 600;
    }

    .vditor-reset table td,
    .vditor-reset table th {
        border-top: none;
        border-left: none;
        border-right: 1px solid #30363d;
        border-bottom: 1px solid #30363d;
    }

    .vditor-reset table tbody tr:nth-child(2n) {
        background-color: #161b22;
    }

    .vditor-reset table tbody tr:hover {
        background-color: #151b23;
    }

    .vditor-reset code:not(.hljs):not(.highlight-chroma) {
        background-color: rgba(66, 133, 244, .36);
    }

    .vditor-reset pre > code {
        border: 1px solid #30363d;
    }

    .vditor-reset .language-abc svg,
    .vditor-reset .language-abc path {
        fill: currentColor;
        color: #d1d5da;
    }

    .language-graphviz polygon {
        fill: rgba(66, 133, 244, .36);
    }

    .vditor-reset kbd {
        color: #d1d5da;
        background-color: #2f363d;
        border: 1px solid #141414;
        box-shadow: inset 0 -1px 0 #141414
    }

    .vditor-copy svg {
        color: #b9b9b9
    }

    .vditor-speech {
        background-color: #1d2125;
        border: 1px solid #141414;
        color: #b9b9b9
    }

    .vditor-speech--current, .vditor-speech:hover {
        color: #fff
    }

    .vditor-linkcard a {
        background-color: #1d2125;
    }

    .vditor-linkcard a:visited .vditor-linkcard__abstract {
        color: hsla(0, 0%, 72.5%, .36)
    }

    .vditor-linkcard__title {
        color: #d1d5da
    }

    .vditor-linkcard__abstract {
        color: #b9b9b9
    }

    .vditor-linkcard__site {
        color: #fff
    }

    .vditor-linkcard__image {
        background-color: hsla(0, 0%, 72.5%, .36)
    }
}
