/* ========== 多彩清新现代版 ========== */
:root {
    --bg: #f5f7fb;
    --text: #1f2d3d;
    --muted: #64748b;
    --line: #e6edf7;
    --card: #ffffff;
    --blue: #3b82f6;
    --blue-deep: #2563eb;
    --cyan: #06b6d4;
    --violet: #8b5cf6;
    --pink: #ec4899;
    --amber: #f59e0b;
    --green: #10b981;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    --shadow-strong: 0 14px 34px rgba(37, 99, 235, 0.12);
}

html, body {
    background: radial-gradient(circle at top left, rgba(59,130,246,.08), transparent 18%),
                radial-gradient(circle at 85% 12%, rgba(236,72,153,.07), transparent 18%),
                radial-gradient(circle at 12% 80%, rgba(245,158,11,.07), transparent 18%),
                #f5f7fb !important;
    color: var(--text) !important;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: var(--blue);
    transition: all .2s ease;
}

a:hover {
    color: var(--blue-deep);
    text-decoration: none;
}

#home {
    max-width: 1220px;
    margin: 28px auto 0 !important;
}

/* ========== 顶部区域 ========== */
#header {
    background:
        linear-gradient(90deg, rgba(15,23,42,.72), rgba(23,37,84,.50) 42%, rgba(37,99,235,.36)),
        url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center 38% / cover no-repeat;
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.14);
    overflow: hidden;
    margin-bottom: 28px;
}

#blogTitle {
    padding: 38px 42px 22px !important;
}

#blogLogo {
    display: none;
}

#blogTitle h1 {
    margin: 0 !important;
}

#blogTitle h1 a {
    color: #fff !important;
    font-size: 34px !important;
    font-weight: 700;
    letter-spacing: 1px;
}

#blogTitle h2 {
    margin-top: 10px !important;
    color: rgba(255,255,255,.82) !important;
    font-size: 14px !important;
    display: block !important;
}

#blogTitle h2::before {
    content: "记录网络安全学习、实验与技术思考";
}

#navigator {
    background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
    backdrop-filter: blur(8px);
    padding: 0 28px 10px 14px !important;
}

#navList {
    margin: 0 !important;
    padding: 0 !important;
}

#navList li {
    margin-right: 8px;
}

#navList a {
    color: rgba(255,255,255,.92) !important;
    border-radius: 12px;
    padding: 8px 14px !important;
    display: inline-block;
}

#navList li:nth-child(1) a:hover { background: rgba(59,130,246,.20); }
#navList li:nth-child(2) a:hover { background: rgba(16,185,129,.18); }
#navList li:nth-child(3) a:hover { background: rgba(245,158,11,.18); }
#navList li:nth-child(4) a:hover { background: rgba(236,72,153,.18); }
#navList li:nth-child(5) a:hover { background: rgba(139,92,246,.18); }

#navList a:hover {
    color: #fff !important;
}

.blogStats {
    padding-right: 16px !important;
}

/* ========== 主体布局 ========== */
#main {
    display: flex;
    gap: 24px;
}

#mainContent {
    flex: 1;
    min-width: 0;
}

#sideBar {
    width: 290px;
}

/* ========== 首页文章卡片 ========== */
.day {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 22px !important;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.day:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59,130,246,.10);
}

.day:nth-of-type(3n+1) {
    border-top: 4px solid rgba(59,130,246,.65);
}

.day:nth-of-type(3n+2) {
    border-top: 4px solid rgba(16,185,129,.65);
}

.day:nth-of-type(3n) {
    border-top: 4px solid rgba(236,72,153,.58);
}

.dayTitle {
    background: none !important;
    margin-bottom: 10px !important;
}

.dayTitle a {
    color: #7b8794 !important;
    font-size: 13px;
    font-weight: 500;
}

.postTitle {
    margin: 8px 0 14px !important;
}

.postTitle a {
    color: #0f172a !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

.postTitle a:hover {
    color: var(--blue-deep) !important;
}

.c_b_p_desc {
    color: #475569 !important;
    font-size: 16px !important;
    line-height: 1.95 !important;
    margin-top: 6px !important;
}

.c_b_p_desc_readmore {
    font-weight: 600;
    margin-left: 6px;
}

.postDesc {
    margin-top: 16px !important;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
    color: #94a3b8 !important;
    font-size: 13px !important;
}

/* ========== 文章页容器 ========== */
#topics .post,
#post_detail {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 8px 0 20px;
}

#topics .postTitle,
#post_detail .postTitle {
    margin: 22px 40px 12px !important;
}

#cb_post_title_url {
    color: #0f172a !important;
    font-size: 32px !important;
    line-height: 1.4 !important;
    font-weight: 800 !important;
}

/* ========== 正文阅读体验核心 ========== */
#cnblogs_post_body {
    max-width: 860px;
    margin: 0 auto;
    padding: 8px 8px 0;
    color: #243447 !important;
    font-size: 17px !important;
    line-height: 1.95 !important;
    letter-spacing: .2px;
}

#cnblogs_post_body p {
    margin: 1.05em 0 !important;
}

#cnblogs_post_body h1,
#cnblogs_post_body h2,
#cnblogs_post_body h3,
#cnblogs_post_body h4 {
    color: #0f172a !important;
    line-height: 1.5 !important;
    margin-top: 1.8em !important;
    margin-bottom: .8em !important;
    font-weight: 700 !important;
    scroll-margin-top: 88px;
}

#cnblogs_post_body h1 {
    font-size: 30px !important;
    padding-bottom: .35em;
    border-bottom: 2px solid #dbeafe;
}

#cnblogs_post_body h2 {
    font-size: 25px !important;
    padding-left: 12px;
    border-left: 4px solid #60a5fa;
}

#cnblogs_post_body h3 {
    font-size: 21px !important;
}

#cnblogs_post_body h4 {
    font-size: 18px !important;
}

#cnblogs_post_body ul,
#cnblogs_post_body ol {
    padding-left: 2em !important;
    margin: 1em 0 !important;
}

#cnblogs_post_body li {
    margin: .45em 0 !important;
}

#cnblogs_post_body strong {
    color: #0f172a;
}

#cnblogs_post_body blockquote {
    margin: 1.4em 0 !important;
    padding: 14px 18px !important;
    border-left: 4px solid #60a5fa !important;
    background: #f8fbff !important;
    color: #475569 !important;
    border-radius: 10px;
}

#cnblogs_post_body hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* ========== 行内代码与代码块 ========== */
#cnblogs_post_body code {
    background: #eef4ff;
    color: #1d4ed8;
    border-radius: 6px;
    padding: .18em .42em;
    font-size: .92em;
}

#cnblogs_post_body pre {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
    color: #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 18px 20px !important;
    overflow-x: auto;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    margin: 1.4em 0 !important;
}

#cnblogs_post_body pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
}

/* ========== 图片 ========== */
#cnblogs_post_body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 22px auto !important;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

/* ========== 表格 ========== */
#cnblogs_post_body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0 !important;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

#cnblogs_post_body th {
    background: #eff6ff !important;
    color: #1e3a8a !important;
    font-weight: 700;
}

#cnblogs_post_body th,
#cnblogs_post_body td {
    border: 1px solid #e5e7eb !important;
    padding: 12px 14px !important;
    text-align: left;
}

/* ========== 左侧目录 ========== */
#custom-toc {
    position: fixed;
    left: max(12px, calc((100vw - 1220px) / 2 - 230px));
    top: 128px;
    width: 190px;
    max-height: calc(100vh - 150px);
    overflow: auto;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border: 1px solid #e8eef7;
    border-radius: 18px;
    box-shadow: var(--shadow-strong);
    padding: 14px 14px 12px;
    z-index: 20;
}

#custom-toc .toc-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
}

#custom-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#custom-toc li {
    margin: 0 0 6px;
}

#custom-toc a {
    display: block;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    padding: 7px 10px;
    border-radius: 10px;
    word-break: break-word;
}

#custom-toc li.toc-h2 a {
    border-left: 3px solid rgba(59,130,246,.35);
}

#custom-toc li.toc-h3 a {
    margin-left: 10px;
    font-size: 12px;
    border-left: 3px solid rgba(236,72,153,.25);
}

#custom-toc li.toc-h4 a {
    margin-left: 20px;
    font-size: 12px;
    border-left: 3px solid rgba(245,158,11,.22);
}

#custom-toc a:hover {
    background: #f8fbff;
    color: #2563eb;
}

#custom-toc a.active {
    background: linear-gradient(90deg, rgba(59,130,246,.12), rgba(236,72,153,.08));
    color: #1d4ed8;
    font-weight: 700;
}

/* ========== 文章元信息 ========== */
#blog_post_info_block,
.postDesc {
    color: #94a3b8 !important;
}

#blog_post_info_block a,
.postDesc a {
    color: #64748b !important;
}

#blog_post_info_block a:hover,
.postDesc a:hover {
    color: #2563eb !important;
}

/* ========== 侧边栏 ========== */
#sideBarMain {
    position: sticky;
    top: 20px;
}

#sideBarMain > div,
#sideBar .newsItem,
#sideBar .catListEssay,
#sideBar .catListPostCategory,
#sideBar .catListTag,
#sideBar .catListComment,
#sideBar .catListFeedback,
#sideBar .catListBlogRank,
#sideBar .catListLink,
#sideBar .mySearch {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 18px !important;
    padding: 16px 18px !important;
}

#sideBar h3,
#sideBar h4 {
    font-size: 16px !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
}

/* ========== 页脚 ========== */
#footer {
    margin-top: 30px !important;
    padding: 28px 0 40px !important;
    color: #94a3b8 !important;
    text-align: center;
}

/* ========== 移动端 ========== */
@media (max-width: 1400px) {
    #custom-toc {
        left: 16px;
    }
}

@media (max-width: 1200px) {
    #custom-toc {
        display: none !important;
    }
}

@media (max-width: 992px) {
    #main {
        display: block;
    }

    #sideBar {
        width: 100%;
        margin-top: 20px;
    }

    #cb_post_title_url {
        font-size: 26px !important;
    }

    #cnblogs_post_body {
        font-size: 16px !important;
        line-height: 1.85 !important;
    }

    .postTitle a {
        font-size: 21px !important;
    }

    #blogTitle {
        padding: 28px 24px 16px !important;
    }

    #blogTitle h1 a {
        font-size: 28px !important;
    }
}
