/* static/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", sans-serif;
}
body {
    background: #f5f5f5;
}

/* ========== 顶部导航固定定位 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 998;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.header .menu-btn {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}
.header h1 {
    font-size: 20px;
    margin: 0;
    color: #333;
    font-weight: 600;
}
.header form {
    display: flex;
    align-items: center;
}
.header input {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #eee;
    border-radius: 4px 0 0 4px;
}
.header form button {
    height: 30px;
    width: 30px;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}
.header .toggle-btn {
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    margin-left: 10px;
    position: relative;
    cursor: pointer;
}
.header .toggle-btn::after {
    content: '';
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    left: 1px;
    top: 1px;
    transition: all 0.3s;
}

/* 主内容区域 */
.content {
    margin-top: 60px;
    transition: margin-left 0.3s ease;
}

/* ========== 侧边栏样式 ========== */
.side-menu {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #eee;
    z-index: 999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}
.side-menu.show {
    left: 0;
}
/* 侧边栏顶部：标题+关闭按钮 */
.side-header {
    padding: 20px 15px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #eee;
}
.side-header h2 {
    font-size: 18px;
    color: #333;
    margin: 0;
    font-weight: 500;
}
.side-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 搜索框区域 */
.side-search {
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.search-box {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border-radius: 4px;
    padding: 0 10px;
    height: 38px;
}
.search-box input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    padding: 0 5px;
}
.search-box input::placeholder {
    color: #999;
}
.search-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 菜单列表区域 */
.side-menu-list {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}
.menu-wrap {
    background: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}
.menu-wrap a {
    display: block;
    padding: 15px 20px;
    color: #333;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    line-height: 1.4;
}
.menu-wrap a:last-child {
    border-bottom: none;
}
.menu-wrap a:hover {
    background: #f5f5f5;
}
.menu-wrap a.active {
    color: #dc3545;
    font-weight: 500;
}
.menu-wrap a::before {
    content: "•";
    margin-right: 10px;
    color: #999;
}

/* Banner轮播 */
.banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}
.banner-slider {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
}
.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}
.banner-item.active {
    display: block;
}
.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-item .text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 10px;
    font-size: 14px;
}
.banner-indicators {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}
.banner-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
}
.banner-indicator.active {
    background: #fff;
}

/* 排序标签 */
.sort-tabs {
    max-width: 1200px;
    margin: 0 auto 15px;
    padding: 0 15px;
    display: flex;
    border-bottom: 1px solid #eee;
}
.sort-tabs a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    margin-right: 20px;
    border-bottom: 2px solid transparent;
}
.sort-tabs a.active {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

/* 文章列表 */
.article-list {
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
}
.article-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.article-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}
.article-item .cover {
    width: 100px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.article-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-item .content-wrap {
    flex: 1;
}
.article-item .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}
.article-item .tag.top {
    background: #dc3545;
    color: #fff;
}
.article-item .tag.latest {
    background: #007bff;
    color: #fff;
}
.article-link .title {
    color: #333;
    text-decoration: none;
    margin: 8px 0;
    font-size: 18px;
}
.article-link:hover .title {
    color: #dc3545;
}
.article-item .meta {
    font-size: 14px;
    color: #999;
}

/* 分页样式 */
.pagination {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}
.pagination .current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 面包屑导航样式 */
.breadcrumbs {
    max-width: 800px;
    margin: 15px auto;
    padding: 10px 20px;
    background: #f5f5f5;
    font-size: 14px;
    border-radius: 4px;
}
.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
    margin: 0 4px;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

/* 文章详情 */
.article-detail {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.article-detail .title {
    font-size: 22px;
    margin-bottom: 10px;
}
.article-detail .meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}
.article-detail .content {
    line-height: 1.8;
    color: #333;
}
.article-detail .content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

/* 字体缩放工具栏 */
.font-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.font-toolbar span {
    margin-right: auto;
    font-size: 16px;
    color: #666;
}
.font-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* 相关阅读样式 */
.related-reading {
    max-width: 800px;
    margin: 40px auto 20px;
    padding: 0 20px;
}
.related-reading h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.related-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.related-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    cursor: pointer;
}
.related-link:hover .related-item {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.related-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.related-item .title {
    padding: 10px 15px;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin: 0;
}
.related-item .date {
    padding: 0 15px 10px;
    font-size: 12px;
    color: #999;
}

/* 分类/搜索头部 */
.category-header, .search-header {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 15px;
    box-sizing: border-box;
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
}
.category-header::before, .search-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}
.category-header h1, .search-header h1 {
    font-size: 28px;
    margin: 0 0 10px 0;
    position: relative;
    z-index: 2;
}
.category-header p, .search-header p {
    font-size: 16px;
    margin: 0;
    position: relative;
    z-index: 2;
    text-align: center;
}
.category-breadcrumbs, .search-breadcrumbs {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2;
    white-space: nowrap;
}
.category-breadcrumbs a, .search-breadcrumbs a {
    color: #4dabf7;
    text-decoration: none;
}
.category-breadcrumbs a:hover, .search-breadcrumbs a:hover {
    text-decoration: underline;
}

/* 滚动按钮 */
.scroll-btn {
    position: fixed;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    display: none;
}
.scroll-btn.top {
    bottom: 80px;
}
.scroll-btn.bottom {
    bottom: 20px;
}

/* 隐藏但可访问的内容 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== 深色模式 ========== */
body.dark-mode {
    background: #1a1a1a;
    color: #fff;
}
body.dark-mode .header {
    background: #222;
    border-bottom-color: #333;
}
body.dark-mode .header h1 {
    color: #fff;
}
body.dark-mode .menu-btn {
    color: #fff;
}
body.dark-mode .header input {
    background: #333;
    border-color: #444;
    color: #fff;
}
body.dark-mode .header input::placeholder {
    color: #888;
}
body.dark-mode .header form button {
    background: #333;
    border-color: #444;
    color: #fff;
}
body.dark-mode .toggle-btn {
    background: #dc3545;
}
body.dark-mode .toggle-btn::after {
    left: 21px;
}
body.dark-mode .scroll-btn {
    background: #333;
    border-color: #444;
    color: #fff;
}

/* 侧边栏深色模式 */
body.dark-mode .side-menu {
    background: #222;
    border-right: 1px solid #333;
}
body.dark-mode .side-header {
    border-bottom: 1px solid #333;
}
body.dark-mode .side-header h2 {
    color: #fff;
}
body.dark-mode .side-close {
    color: #ccc;
}
body.dark-mode .side-search {
    border-bottom: 1px solid #333;
}
body.dark-mode .search-box {
    background: #333;
}
body.dark-mode .search-box input {
    color: #fff;
}
body.dark-mode .search-box input::placeholder {
    color: #ccc;
}
body.dark-mode .search-btn {
    color: #ccc;
}
body.dark-mode .menu-wrap {
    background: #333;
}
body.dark-mode .menu-wrap a {
    color: #fff;
    border-bottom: 1px solid #444;
}
body.dark-mode .menu-wrap a:hover {
    background: #444;
}
body.dark-mode .menu-wrap a.active {
    color: #f56c6c;
}
body.dark-mode .menu-wrap a::before {
    color: #aaa;
}

/* 文章相关深色模式 */
body.dark-mode .article-item {
    background: #2d2d2d;
    border-color: #444;
}
body.dark-mode .article-link .title {
    color: #fff;
}
body.dark-mode .article-link:hover .title {
    color: #f56c6c;
}
body.dark-mode .article-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.dark-mode .article-item .meta {
    color: #aaa;
}
body.dark-mode .article-detail {
    background: #2d2d2d;
    border-color: #444;
}
body.dark-mode .article-detail .content {
    color: #e0e0e0;
}
body.dark-mode .article-detail .content p {
    color: #e0e0e0;
}
body.dark-mode .article-detail .content img {
    filter: brightness(0.9);
}

/* 相关阅读深色模式 */
body.dark-mode .related-link:hover .related-item {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.dark-mode .related-item {
    background: #2d2d2d;
    border-color: #444;
}
body.dark-mode .related-item .title {
    color: #e0e0e0;
}
body.dark-mode .related-item .date {
    color: #aaa;
}
body.dark-mode .related-reading h3 {
    color: #fff;
    border-bottom-color: #444;
}

/* 切换栏深色模式 */
body.dark-mode .sort-tabs {
    border-bottom-color: #444;
}
body.dark-mode .sort-tabs a {
    color: #e0e0e0;
}
body.dark-mode .sort-tabs a.active {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

/* 分类标题深色模式 */
body.dark-mode .article-list h2 {
    color: #fff;
}

/* 分页深色模式 */
body.dark-mode .pagination a,
body.dark-mode .pagination span {
    background: #2d2d2d;
    border-color: #444;
    color: #fff;
}
body.dark-mode .pagination .current {
    background: #dc3545;
    border-color: #dc3545;
}

/* 字体工具栏深色模式 */
body.dark-mode .font-toolbar {
    border-bottom-color: #444;
}
body.dark-mode .font-toolbar span {
    color: #aaa;
}
body.dark-mode .font-btn {
    background: #333;
    border-color: #444;
    color: #fff;
}

/* 面包屑深色模式 */
body.dark-mode .breadcrumbs {
    background: #2d2d2d;
    color: #e0e0e0;
}
body.dark-mode .breadcrumbs a {
    color: #4dabf7;
}

/* 分类/搜索头部深色模式 */
body.dark-mode .category-breadcrumbs a,
body.dark-mode .search-breadcrumbs a {
    color: #4dabf7;
}

/* 切换按钮状态 */
.toggle-btn.dark {
    background: #dc3545;
}
.toggle-btn.dark::after {
    left: 21px;
}
.toggle-btn.light::after {
    left: 1px;
}

/* 无障碍访问优化 */
:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .article-item {
        border: 2px solid #000;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
    .banner-slider {
        height: 150px;
    }
    .article-item {
        padding: 12px;
        gap: 12px;
    }
    .article-item .cover {
        width: 80px;
        height: 70px;
    }
    .article-link .title {
        font-size: 16px;
    }
    .related-list {
        grid-template-columns: 1fr;
    }
    .related-item img {
        height: 140px;
    }
    .category-header, .search-header {
        height: 160px;
    }
    .category-header h1, .search-header h1 {
        font-size: 24px;
    }
}




.tag.hidden {
    display: none;
}