/* static/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); /* 像素字体 */

body {
    font-family: 'Press Start 2P', cursive; /* 使用像素字体 */
    background-color: #f0e0d0; /* 日本量产系配色基础色 */
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    cursor: url('../img/cursor.png'), auto; /* 自定义鼠标指针 */
}

a {
    color: #007bff; /* 链接颜色 */
    text-decoration: none;
    cursor: url('../img/link_cursor.png'), pointer; /* 链接鼠标指针 */
}

a:hover {
    text-decoration: underline;
}

/* 容器和卡片样式 */
.container {
    max-width: 960px;
    margin: 0 auto;
    background-color: #fff;
    border: 2px solid #a0a0a0; /* 边框 */
    box-shadow: 4px 4px 0px #808080; /* 像素阴影 */
    padding: 20px;
    position: relative;
}

.header {
    background-color: #ffd0e0; /* 标题背景色 */
    padding: 10px 20px;
    border-bottom: 2px solid #a0a0a0;
    margin: -20px -20px 20px -20px; /* 扩展到容器边缘 */
    text-align: center;
    position: relative;
    z-index: 10;
}

.header h1 {
    margin: 0;
    color: #6a0572; /* 标题文字颜色 */
    text-shadow: 2px 2px 0px #f9e1e1; /* 标题文字阴影 */
}

.nav {
    display: flex;
    justify-content: center;
    background-color: #c0c0e0; /* 导航背景色 */
    padding: 8px 0;
    border-bottom: 2px solid #a0a0a0;
    margin-bottom: 20px;
}

.nav a {
    color: #333;
    margin: 0 15px;
    font-size: 0.9em;
    padding: 5px 10px;
    border: 1px solid transparent;
}

.nav a:hover {
    background-color: #a0a0c0;
    border: 1px solid #707090;
    text-decoration: none;
}

/* 博客文章列表 */
.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background-color: #fefefe;
    border: 1px solid #d0d0d0;
    padding: 15px;
    box-shadow: 2px 2px 0px #e0e0e0;
    transition: transform 0.1s ease-out;
}

.article-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #c0c0c0;
}

.article-card h2 {
    margin-top: 0;
    font-size: 1.2em;
}

.article-meta {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 10px;
}

/* 文章和页面内容 */
.content {
    display: flex;
    gap: 30px;
}

.main-content {
    flex: 3;
    min-width: 0; /* 允许内容缩小 */
}

.sidebar {
    flex: 1;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 15px;
    position: sticky; /* 侧边栏固定 */
    top: 20px;
    max-height: calc(100vh - 40px); /* 限制高度 */
    overflow-y: auto; /* 允许滚动 */
}

.sidebar h3 {
    margin-top: 0;
    font-size: 1em;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    display: block;
    padding: 3px 0;
    color: #555;
}

.sidebar ul li a:hover {
    color: #007bff;
    text-decoration: none;
    background-color: #eef;
}

/* 页内目录样式 (根据H2, H3等生成) */
.toc-item {
    margin-left: 10px;
    font-size: 0.9em;
}

.toc-item.level-2 { margin-left: 0; font-weight: bold; }
.toc-item.level-3 { margin-left: 15px; }
.toc-item.level-4 { margin-left: 30px; }

/* 密码保护样式 */
.password-form {
    background-color: #ffe0f0;
    border: 2px dotted #ff80a0;
    padding: 30px;
    text-align: center;
    margin-top: 50px;
}

.password-form input[type="password"] {
    padding: 8px;
    border: 1px solid #ff80a0;
    outline: none;
    font-family: 'Press Start 2P', cursive;
    margin-right: 10px;
}

.password-form button {
    padding: 8px 15px;
    background-color: #ff80a0;
    color: white;
    border: 2px outset #ff4060;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
}

.password-form button:active {
    border: 2px inset #ff4060;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    .sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-top: 20px;
    }
    .nav {
        flex-wrap: wrap;
    }
    .nav a {
        margin: 5px 10px;
    }
}

/* 滚动条美化 (Webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-left: 1px solid #d0d0d0;
}
::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid #a0a0a0;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* 像素图标占位符，如果不需要可以删除 */
.icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #c0c0c0; /* 示例颜色 */
    border: 1px solid #808080;
    vertical-align: middle;
    margin-right: 5px;
}