@charset "UTF-8";

/* noto-serif-sc-regular - chinese-simplified_latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: '思源宋体';
    font-style: normal;
    font-weight: normal;
    src: local('Source Han Serif CN Light'), local('Source Han Serif SC Light'), /*如果可能，调用本地字体*/
         url('fonts/noto-serif-sc-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* noto-serif-sc-700 - chinese-simplified_latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: '思源宋体';
    font-style: normal;
    font-weight: bold;
    src: local('Source Han Serif CN Bold'), local('Source Han Serif SC Bold'), /*如果可能，调用本地字体*/
         url('fonts/noto-serif-sc-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

span.katex, div.katex {
    font-size: 1em;      /* 或者 0.9em / 0.95em，看你喜欢多大 */
    line-height: inherit; /* 可选，防止行高怪异 */
}

body, html {
    font-family: Arial, sans-serif;
    margin: 0px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    height: 100%;
    width: 100%;
    padding: 0%;
    background-color: #888888;
    overflow: hidden;
}

#top {
    display: flex;
    height: 5%;
}

.body-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 0;
}

header {
    display: flex;                /* 使用flex布局 */
    justify-content: space-between; /* 使logo和menu-toggle在左右两侧 */
    width: 100%;
    background-color: #333;
    color: white;
    padding: 10px 0px;
    text-align: center;

    h1 {
        display: flex;
        margin: auto;
    }
    
    a {
        margin: 0%;
        text-decoration: none;   /* 去掉下划线 */
        color: white;
        cursor: pointer;        /* 鼠标悬停时显示为手指形状 */
    }

    span {
        color: rgb(181, 181, 181)
    }

    .menu-toggle {
        display: none;
    }
}

footer {
    display: flex;
    background-color: #333;
    color: white;
    justify-content: center;
    padding: 10px 0px;
    width: 100%;
    bottom: 0;

    p {
        text-align: center;
        margin-top: 4px;
        margin-bottom: 4px;
    }
}

.bar {
    width: 30px;
    height: 4px;
    background-color: white;
    border-radius: 2px;
}

.container {
    flex: 1 1 auto; /* main部分占用剩余空间 */
    /* height: 300px; 固定main的高度 */
    overflow-y: auto; /* 使main内部可滚动 */
    min-height: 0;
    width: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

/* 样式提升 */
.sidebar {
    background-color: #f4f4f4;
    width: 25%;
    height: 95%;
    position: static; /* 固定位置 */
    top: 0px; /* 留出header空间 */
    padding: 5px 20px;
    box-sizing: border-box;
    overflow-y: auto; /* 让目录可以垂直滚动 */

    ul {
        list-style: none;
        padding: 0;

        li {
            margin: 10px 0;
    
            a {
                text-decoration: none;
                color: #333;

                &:hover {
                    color: #007bff;
                }
            }

            &.ct-h2 a{
                font-weight: bold;
                padding-left: 0px;
                font-size: 18px;
            }
    
            &.ct-h3 a{
                padding-left: 8px;
                font-size: 16px;
            }

            &.ct-h4 a{
                padding-left: 15px;
                font-size: 14px;
            }
        }
    }

}

.content {
    background-color: #f4f4f4;
    width: 75%;
    height: 95%;
    padding: 0px 20px;
    overflow-y: auto; /* 让目录可以垂直滚动 */

    line-height: 1.6;
    font-size: 20px;
	font-family:"Times New Roman", '思源宋体', serif;

    h1, h2, h3, h4, h5, h6{
        margin-top: 0;
        margin-bottom: 0;
    }

    h1 {
        margin-top: 5%;
        font-size: 30px;
    }

    h2 {
        margin-top: 5%;
        font-size: 30px;
    }
    
    h3 {
        font-size: 24px;
    }
    
    h4 {
        font-size: 20px;
    }
    
    ol, ul {
        padding-left: 5%;
        margin-top: 0.2em;
        margin-bottom: 0.5em;
    }
    
    .plain-text {
        display: block;
        text-indent: 2em;
    }

    .ul-content {
        /* width: 60%; */
        margin-left: 5%;
        margin-right: 5%;
    }

    li.time-li {
        margin-top: 1%;
        margin-bottom: 0em;
    }

    .article-cell {
        /* margin-top: 1%;
        margin-bottom: 0em; */
        border-top: 1px dotted #ddd;
        border-bottom: 1px dotted #ddd;
        padding: 6px 10px;
        font-size: 20px;
    }
    
    .article-div {
        display: flex;
        flex-direction: row;
    }

    .article-main {
        display: flex;
        align-items: center;        /* 垂直居中 */
    }

    .article-info {
        margin-left: auto;          /* 关键：把这一整块推到最右边 */
        display: flex;
    }

    .article-mtime {
        display: flex;
        margin-top: 2px;
        font-size: 16px;
        color: #999;
    }

    p {
        display: inline;
        line-height: 1.6;
    }
    
    a {
        text-decoration: none;   /* 去掉下划线 */
        color: rgb(30, 126, 130) ;
        cursor: pointer;        /* 鼠标悬停时显示为手指形状 */
        margin: auto;
    }

    a.tag-link {
        margin: auto 0.2em;
    }

    span.keyword {
        font-weight: bold;
        margin: auto 0.2em;
    }
    
    figure.fig {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* margin-bottom: 15px; */

        figcaption.fig {
            font-size: 16px;
            text-align: center;
        }
        
        img.fig-image {
            max-width: 80%;
            max-height: 960px;
        }

        video.fig-video {
            max-width: 80%;
            max-height: 960px;
        }
    }
    
    table caption.table-caption {
        margin: 0.5em auto 0.5em;
        font-size: 16px;
    }

    table.multihead-table {
        margin: 1em auto;
        font-size: 18px;
    
        th, td {
            padding: 6px 20px;
            border-bottom: 1px dotted lightgray
        }
    
        .bottom-1 {
            border-bottom: 1px solid darkgray;
        }

        .bottom-2 {
            border-bottom: 1px solid;
        }
        
        .bottom-3 {
            border-bottom: 2px solid;
        }

        tr:first-child th {
            border-top: 2px solid;
        }

        tr:first-child td {
            border-top: 1px solid;
        }
    }

    .spantime {
        /* position: absolute;
        left: 0; */
        font-family: 'Courier New', Courier, monospace;
        margin-right: 10px;
        font-weight: bold;
        color: #444488;
        /* font-size: 14px; */
    }
    
    .hashtag {
        display: inline;
        margin-left: 5px;
        margin-right: 5px;
        color: #007BFF;
        text-decoration: none;
        cursor: pointer;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
    }

    .sidebar {
        display: none; /* 在窄屏幕上隐藏目录 */
    }

    header {
        justify-content: space-between;
        align-items: center;

        h1 {
            margin-left: 20px;
            font-size: 18px;
        }

        a {
            margin: 0;
        }

        .menu-toggle {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            width: 20px;
            height: 20px;
            margin: 5px;
            margin-right: 30px;
        }
    }

    footer {
        display: none;
    }
    
    .content {
        width: 90%;
        font-size: 16px;
        height: 100%;
        
        strong {
            font-weight: bold;
        }

        h1, h2, h3{
            margin: 0;
        }

        h4, h5, h6{
            margin: 0;
            font-weight: normal;
        }

        h1 {
            margin-top: 5%;
            text-align: center;
            font-size: 24px;
        }
    
        h2 {
            margin-top: 5%;
            text-align: center;
            font-size: 24px;
        }
        
        h3 {
            font-size: 20px;
        }
        
        h4 {
            font-size: 18px;
        }
        
        ol, ul {
            padding-left: 5%;
            margin: 0 0;
            margin-bottom: 30px;
        }

        li.time-li {
            margin-top: 1%;
            margin-bottom: 0em;;
        }
        
        .ul-content {
            /* width: 60%; */
            padding-left: 0%;
            margin-left: 0%;
            margin-right: 0%;
            list-style: none;
        }

        .article-cell {
            font-size: 14px;
        }

        .article-mtime {
            font-size: 12px;
        }

        p {
            display: inline;
            line-height: 1.6;
        }
        
        figure.fig {
            display: flex;
            flex-direction: column;
            align-items: center;
            
            figcaption.fig {
                font-size: 12px;
                text-align: center;
            }

            img.fig-image {
                max-width: 100%;
                max-height: 1000px;
            }

            video.fig-video {
                max-width: 100%;
                max-height: 1000px;
            }
        }

        table.multihead-table {
            font-size: 14px;
            
            th, td {
                padding: 3px 10px;
            }
        }
    }
}

/* 弹窗样式 */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000px;
    width: 200px;
}

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#popup-close {
    margin-top: 10px;
    padding: 5px 10px;
    cursor: pointer;
}


/* 弹出的目录菜单样式 */
.popup-menu {
    max-height: 50%;      /* 设置最大高度为 200px */
    overflow-y: auto;       /* 使超出部分可以垂直滚动 */
    position: fixed;
    top: 6.5%;
    right: -70%;  /* 初始位置在视口右侧外 */
    width: 65%;
    background-color: #333;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: right 0.3s ease;
    z-index: 999px;

    &.open {
        right: 0;  /* 菜单完全展示 */
    }

    nav ul {
        list-style-type: none;
        padding: 0;
        margin: 0;

        li {
            margin: 5% 0;

            a {
                color: white;
                text-decoration: none;
                font-size: 14px;
                padding-left: 10%;
            }

            &.ct-h2 a{
                font-weight: bold;
                padding-left: 10px;
                font-size: 18px;
            }
            
            &.ct-h3 a{
                padding-left: 15px;
                font-size: 16px;
            }
            
            &.ct-h4 a{
                padding-left: 20px;
                font-size: 14px;
            }
        }
    }
}
