html {
    font-size: 62.5%; /* 10px */
}

* {
    margin: 0;
    padding: 0;
    line-height: 150%;
    text-decoration: none;
}

a:link, a:visited, a:active {
    color: rgb(18, 103, 125);
}
a:hover {
    color: rgb(100, 100, 100);
}

img {
    max-width: 100%;
}

html, body {
    height: 100%;
}

/*导航栏内容设置--------------------------------*/
nav .navbar {
    display: flex;
    flex-wrap: wrap;
    background-color: rgb(2, 48, 71);
    list-style: none;
    padding-left: 20%;
    padding-right: 20%;
	padding-top: 10px;
    padding-bottom: 10px;
    justify-content: space-around;
}
nav .navbar a:link, nav .navbar a:visited, nav .navbar a:active {
	font-family: "微软正黑体";
    font-size: 2rem;
    height: auto;
    text-decoration: none;
    text-align: center;
    color: rgb(255, 255, 255);
}
nav .navbar a:hover {
	background-color: rgb(100, 100, 100);
}
nav #navbar-toggle {
    display: none;
}

/*左侧目录内容设置--------------------------------*/
aside {
    margin-top: 20px;
	line-height: 1.4;
	font-family: "微软正黑体";
    font-size: 2rem;
    height: 40px;
    float: right;
    width: 28%;
    margin-right: 2%;
    position: fixed;
}
/* 目录容器 */
aside div {
	margin-top: 20px;
	border-radius: 20px;
	box-shadow: 2px 2px 2px #888888;
    float: right;
    padding: 20px;
    width: 40%;
    background-color: rgb(250, 250, 250);
    overflow-y: auto;
	max-height: 500px;
}
/* toc */
aside div ol {
    list-style: none;
}
aside div ol li a:link, aside div ol li a:visited, aside div ol li a:active {
    text-decoration: none;
    color: rgba(2, 48, 71, 0.686);
}
aside div ol li a:hover {
	color: rgb(100, 100, 100);
}
li.toc-level-1 {
    font-size: 2rem;
}
li.toc-level-2 {
	margin-left: 25px;
    font-size: 1.8rem;
    list-style-type: disc;
}
li.toc-level-3 {
	margin-left: 20px;
    font-size: 1.6rem;
    list-style-type: disc;
}


/*文章内容设置--------------------------------*/
#content {
    width: 40%;
    margin-left: 30%;
    margin-right: 30%;
    min-height: 100vh;
    font-size: 1.6rem;
}

#content li {
	margin-left: 20px;
}
#content .list_item_no_link {
    text-decoration: none;
    color: inherit;
}
h1 {
    font-size: 3rem;
    padding-top: 20px;
    padding-bottom: 20px;
}
h2 {
    font-size: 2.5rem;
    padding-top: 10px;
    padding-bottom: 10px;
}
h3 {
    font-size: 1.6rem;
    padding-top: 10px;
    padding-bottom: 10px;
}
/*段落间距*/
#content p {
    font-size: 1.6rem;
	margin-top: 0.5em; 
    margin-bottom: 0.5em; 
}
div.TagAndDate {
    margin-left: 30%;
    margin-right: 30%;
    width: 40%;
    margin-top: 10px;
    margin-bottom: 20px;
    font-family: Consolas, '微软雅黑', 'Courier New', monospace;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.5);
    font-weight: normal;
    font-size: 1.6rem;
    float: left;
}
div.TagAndDate div.tag {
    float: left;
}
div.TagAndDate div.date {
    float: right;
    margin-right: 20px;
    display: flex;
    gap: 15px; /* 创建时间和更新时间之间的间距 */
    flex-wrap: wrap; /* 允许换行 */
}

/*文章内容(无目录版)设置--------------------------------*/
#content_noTOC {
    font-size: 1.6rem;
    width: 40%;
    margin-left: 30%;
    margin-right: 30%;
    min-height: 100vh;
}
#content_noTOC ul {
    display: flex;
    flex-direction: column;
  }
#content_noTOC li {
    width: calc(100% - 30px);
	margin-left: 20px;
    margin-right: 10px;
}
#content_noTOC .list_item_no_link {
    text-decoration: none;
    color: inherit;
}
#content_noTOC .post_title {
    width: 80%;
    float: left;
}
#content_noTOC .post_date {
    width: 20%;
    float: right;
    text-align: right;
    font-family: Consolas, '微软雅黑', 'Courier New', monospace;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.592);
    font-weight: normal;
    font-size: 1.2rem;
}
/* 代码块设置 */
.highlight {
    background: #f5f5f5;
    border-radius: 5px;
    overflow: auto;
    margin: 3px 0px;
    border-radius: 10px;
    /* padding: 5px 10px; */
}
#content pre, code {
    background: #f5f5f5;
    font-family: Consolas;
    color: #333;
    margin: 0px 3px;
    padding: 0px 2px;
    border-radius: 5px;
    max-height: 500px;
    max-width: 100%;
}

/*主页内容设置--------------------------------*/
#homepage {
    width: 50%;
    margin-left: 20%;
    margin-right: 0%;
    float: left;
}

#homepage div.smallgraytext {
    font-family: Consolas, '黑体', 'Courier New', monospace;
    width: 100%;
    padding-left: 1%;
    padding-top: 1%;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.592);
    font-weight: normal;
    font-size: 1.6rem;
    float: left;
}

#homepage section {
	border-style: none;
	border-radius: 10px;
	float: left;
    width: 48%;
    height: 300px;
    margin: 1%;
	padding: 0px;
    background:rgb(255, 255, 255);
    box-shadow: 0px 0px 5px #888888;
}

#homepage section:hover {
	box-shadow: 2px 2px 2px #888888;
}

#homepage section div.img {
    width: 100%;
    height: 230px;
    overflow: hidden;
}
#homepage section div.img img {
    width: 100%;
    height: 100%;
    float: center;
    object-fit: contain;
}
#homepage section div.img_text {
    height: 50px;
    padding: 10px;
    overflow: hidden;
}

#homepage section div.img_text div.post_title {
    font-family: Consolas, '黑体', 'Courier New', monospace;
    text-decoration: none;
    color: rgb(0, 0, 0);
    font-weight: normal;
    font-size: 2rem;
    width: 100%;
    max-height: 1.5em;
    overflow: hidden;
}

#homepage section div.img_text div.tag {
    font-family: Consolas, '微软雅黑', 'Courier New', monospace;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.716);
    font-weight: normal;
    font-size: 1.2rem;
    float: left;
    overflow: hidden;
}

#homepage section div.img_text div.date {
    font-family: Consolas, '微软雅黑', 'Courier New', monospace;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.592);
    font-weight: normal;
    font-size: 1.2rem;
    float: right;
}



/* 主页底部分页导航 */
#page-nav {
    margin-top: 40px;
    width: 100%;
    float: left;
    text-align: center;
    font-size: 2rem;
}
/* 分页链接样式 */
#page-nav a, #page-nav span {
    color: #000000;
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}
/* 悬停效果 */
#page-nav a:hover {
    background-color: #023047;
    color: white;
}
/* 活跃页码样式 */
#page-nav .current {
    background-color: #02304778;
    color: white;
    cursor: default;
    pointer-events: none;
}
/* "上一页" 和 "下一页" 的特殊样式 */
#page-nav .next,
#page-nav .prev {
    font-weight: bold;
}

/*主页右侧联系方式设置--------------------------------*/
#selfie {
    width: 8%;
    margin-left: 2%;
    margin-right: 20%;
    margin-top: 20px;
    float: right;
}
#selfie p {
    padding-top: 10px;
}
#selfie p.head img {
    width: 100%;
    border-radius: 5%;
    box-shadow: 0px 0px 5px #888888;
}
#selfie p.name {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: rgb(2, 48, 71);
}
#selfie p.email {
    text-align: center;
    color:rgb(100, 100, 100)
}
#selfie p {
    text-align: left;
    font-size: 1.2rem;
}
#selfie div.icon{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 2.5rem;
}


/* github仓库按钮 */
.github-button:link, .github-button:visited, .github-button:active {
    display: inline-block;
    background-color: #023047;
    color: rgb(255, 255, 255);
    font-size: 1.2rem;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}
.github-button:hover {
    background-color: #444;
}

/*尾注内容设置--------------------------------*/
footer {
    margin-top: 50px;
    float: left;
    width: 100%;
    background-color: #023047; /* Dark background */
    color: #fff; /* White text color */
    padding: 10px 0;
    font-size: 1.4rem;
}
footer .container a {
    color: #fff; /* White link color */
    text-decoration: none;
}
footer .container {
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}
.footer-copyright,
.footer-contact, 
.footer-social{
    margin: 5px 0;
}
.footer-contact a,
.footer-social a {
    color: #fff;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s ease;
}
.footer-contact a:hover,
.footer-social a:hover {
    color: #8e4caf; /* Change to your preferred color */
}
.footer-social a {
    font-size: 2rem; /* Adjust icon size as needed */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 20%; /* Could be more or less, depending on screen size */
}
.close {
    color: #aaa;
    float: right;
    font-size: 2.8rem;
    font-weight: bold;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}


/* 响应式布局 */
@media screen and (max-width: 1200px) {
    html {
        font-size: 125%; /* 放大基础字体 */
    }
    /* 手机端导航栏*/
    nav .navbar {
        position: fixed;
        justify-content: space-evenly;
        top: 0;
        left: -300px;
        width: 100px;
        height: 100vh;
        background: rgb(2, 48, 71);
        flex-direction: column;
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        z-index: 1000;
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    nav .navbar.nav-active {
        transform: translateX(300px);
    }
    nav .navbar a {
        padding: 15px 0;
        width: 100%;
        text-align: left;
    }

    /* 手机端导航栏按钮 */
    nav #navbar-toggle {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #023047;
        color: white;
        padding: 10px;
        text-align: center;
        cursor: pointer;
        font-size: 3rem;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
    }
    /* 添加隐藏状态的类 */
    nav #navbar-toggle.nav-hidden {
        transform: translateY(-100%);
    }

    /* 手机端无目录内容post */
    #content_noTOC {
        width: 80%;
        margin-left: 10%;
        margin-right: 10%;
        margin-top: 4rem; /* 添加顶部边距，避免被导航栏遮挡 */
    }
    
    /* 手机端post */
    div.TagAndDate {
        width: 80%;
        margin-left: 10%;
        margin-right: 10%;
    }
    div.TagAndDate div.date {
        flex-direction: column; /* 手机端垂直排列 */
        gap: 5px; /* 减小间距 */
    }
    #content {
        width: 80%;
        margin-left: 10%;
        margin-right: 10%;
        margin-top: 6rem; /* 添加顶部边距，避免被导航栏遮挡 */
    }

    /* 主页内容区域也需要添加顶部边距 */
    #homepage {
        width: 80%;
        margin-left: 10%;
        margin-right: 10%;
        margin-top: 6rem; /* 添加顶部边距 */
    }
    /* selfie隐藏 */
    #selfie {
        display: none;
    }
    #homepage section {
        width: 100%;
        height: 400px;
    }
    #homepage section div.img {
        height: 330px;
    }
    /* 目录隐藏 */
    aside div {
        display: none;
    }
    /* 页脚 */
    footer .container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}