:root {
    --width: 660px;
    --font-yahei: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, Arial, "PingFangSC-Regular", "Hiragino Sans GB", "Lantinghei SC", "Microsoft Yahei", "Source Han Sans CN", "WenQuanYi Micro Hei", SimSun, sans-serif;
    --font-fangsong: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
    --font-songti: Georgia, "Nimbus Roman No9 L", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
    --font-scale: 1em;
    --background-color: #fff;
    --comment-author-color: #eee;
    --heading-color: #222;
    --text-color: #444;
    --link-color: #3273dc;
    --visited-color: #8b6fcb;
    --code-background-color: #fff;
    --code-color: #222;
    --blockquote-color: #222;
    --gray-color: #999;
    --current-page-color: #88b6ff;
    --image-background-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #313131;
        --heading-color: #eee;
        --text-color: #ddd;
        --link-color: #6ab0e5;
        --visited-color: #8b6fcb;
        --code-background-color: #313131;
        --code-color: #ddd;
        --blockquote-color: #ccc;
        --gray-color: #999;
        --current-page-color: #a4d8ff;
        --comment-author-color: #606060;
        --image-background-color: #c0c0c0;
    }
}

body {
    font-family: var(--font-yahei);
    /* 可替换 --font-fangsong 或 --font-songti 字体 */
    font-size: var(--font-scale);
    margin: auto;
    padding: 20px;
    max-width: var(--width);
    text-align: left;
    background-color: var(--background-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
    color: var(--text-color);
}

html {
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    display: inherit
}

a {
    color: var(--link-color);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid transparent
}

a:hover,
nav .current {
    border-bottom: 1px solid
}

nav a {
    margin-right: 8px
}

strong,
b {
    color: var(--heading-color)
}

button {
    margin: 0;
    cursor: pointer
}

table {
    width: 100%
}

hr {
    border: 0;
    border-top: 1px dashed
}

img {
    max-width: 100%;
    height: auto
}

time,
.intro {
    color: var(--gray-color);
}

code {
    font-family: monospace;
    padding: 2px;
    background-color: var(--code-background-color);
    color: var(--code-color);
    border-radius: 4px
}

blockquote {
    border-left: 1px solid #999;
    color: var(--code-color);
    padding-left: 20px;
    font-style: italic
}

input {
    border-radius: 4px;
    border: 1px solid var(--gray-color);
    margin: 0 0 15px 0;
    padding: 10px;
    width: 50%
}

input:focus {
    outline: 0
}

input[type="submit"] {
    padding: 9px 10px 10px;
    text-align: center;
    width: 80px;
    display: inline-flex;
    background-color: var(--heading-color);
    color: var(--code-background-color);
    border: none
}

input[type="submit"]:hover {
    cursor: pointer;
    opacity: .7
}

header,
footer {
    padding: 20px 0
}

.title:hover {
    text-decoration: none;
    border: none
}

.title h1,
.title h2 {
    font-size: 1.5em
}

ul.posts {
    list-style-type: none;
    padding: unset
}

ul.posts li {
    display: flex;
    margin: 3px 0
}

ul.posts li span {
    flex: 0 0 115px
}

ul.posts li a:visited {
    color: var(--visited-color)
}

.tags {
    margin-top: 30px;
    color: var(--gray-color)
}

.tags a {
    margin: 0 5px 0 2px
}

.page-navigator {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.page-navigator li {
    display: block;
}

.current {
    color: var(--current-page-color);
    text-decoration: underline;
}

.tag_list .tag_item {
    display: inline-block;
    padding: 5px;
}

.heading-collapse-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.3em;
    font-size: 0.65em;
    cursor: pointer;
    color: var(--gray-color);
    border-radius: 3px;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
    vertical-align: middle;
    user-select: none;
    flex-shrink: 0;
}

.heading-collapse-arrow:hover {
    color: var(--heading-color);
    background-color: rgba(128, 128, 128, 0.15);
}

.heading-collapse-wrapper {
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.heading-collapse-wrapper.heading-collapsed {
    display: none;
}