/*==============================================================================
 * 博客园美化 — 页面定制 CSS 代码
 * 粘贴位置: https://i.cnblogs.com/settings → 页面定制CSS代码
 * 皮肤选择: Custom (勾选"禁用模板默认CSS")
 *============================================================================*/

/* =========================== CSS 变量 =========================== */
:root {
    /* 主题色 */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --accent: #f59e0b;

    /* 背景 */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-code: #1e293b;

    /* 文字 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-code: #e2e8f0;

    /* 边框 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* 布局 */
    --content-width: 800px;
    --sidebar-width: 280px;
    --header-height: 56px;

    /* 过渡 */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* 字体 */
    --font-body: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --font-heading: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* =========================== 全局重置 =========================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::-webkit-scrollbar {
    width: 6px;
}
body::-webkit-scrollbar-track {
    background: transparent;
}
body::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

/* =========================== 顶部导航 #header =========================== */
/* 单行固定顶栏：左侧标题+副标题，右侧导航菜单 */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
}

/* ---- 左侧: 博客标题区 ---- */
#blogTitle {
    display: flex !important;
    align-items: baseline;
    gap: 14px;
    height: auto !important;
    flex-shrink: 0;
}

#blogTitle h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

#blogTitle h1 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}
#blogTitle h1 a:hover {
    color: var(--primary);
}

#blogTitle h2 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: 0.04em;
    padding-left: 14px;
    border-left: 1.5px solid var(--border);
}

/* ---- 右侧: 导航菜单 ---- */
#navigator {
    display: flex !important;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
    height: auto !important;
    border: none !important;
    margin: 0 !important;
    background: transparent !important;
}

#navList {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#navList li {
    margin: 0;
    padding: 0;
    list-style: none;
}

#navList a {
    display: inline-block;
    padding: 5px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color var(--transition);
    position: relative;
    white-space: nowrap;
}

/* 下划线动画 */
#navList a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 1px;
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width var(--transition);
}

#navList a:hover {
    color: var(--primary);
}
#navList a:hover::after {
    width: 100%;
}

/* 统计信息 */
.blogStats {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-left: 6px;
}

/* ---- 隐藏不需要的元素 ---- */
#header hr,
#header br {
    display: none;
}

/* =========================== 主体布局 #main =========================== */
body {
    padding-top: calc(var(--header-height) + 20px);
}

#main {
    max-width: calc(var(--content-width) + var(--sidebar-width) + 60px);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
}

#mainContent {
    flex: 0 1 var(--content-width);
    min-width: 0;
    max-width: var(--content-width);
}

#sideBar {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
}

/* =========================== 文章列表 .post =========================== */
.day {
    margin-bottom: 20px;
}

.dayTitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}

.postTitle {
    margin-bottom: 8px;
}

.postTitle a {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition);
    line-height: 1.5;
}

.postTitle a:hover {
    color: var(--primary);
}

.postDesc {
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.postDesc a {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 12px;
}

/* 文章摘要卡片效果 */
.postSeparator {
    display: none;
}

.day .postTitle,
.day .postDesc {
    padding-left: 16px;
    border-left: 2px solid transparent;
    transition: border-color var(--transition);
}

.day:hover .postTitle,
.day:hover .postDesc {
    border-left-color: var(--primary-light);
}

/* =========================== 文章详情页 #post_detail =========================== */
.postBody,
#cnblogs_post_body {
    font-size: 1rem;
    line-height: 1.85;
    word-break: break-word;
}

#cnblogs_post_body h1 { font-size: 1.8rem; font-weight: 700; margin: 2em 0 0.8em; border-bottom: 2px solid var(--border-light); padding-bottom: 0.4em; }
#cnblogs_post_body h2 { font-size: 1.5rem; font-weight: 700; margin: 1.8em 0 0.6em; border-left: 4px solid var(--primary); padding-left: 14px; }
#cnblogs_post_body h3 { font-size: 1.25rem;font-weight: 600; margin: 1.5em 0 0.5em; }
#cnblogs_post_body h4 { font-size: 1.1rem; font-weight: 600; margin: 1.3em 0 0.4em; }
#cnblogs_post_body h5, #cnblogs_post_body h6 { font-size: 1rem; font-weight: 600; margin: 1.2em 0 0.3em; }

#cnblogs_post_body p {
    margin: 0.8em 0;
}

#cnblogs_post_body strong {
    font-weight: 600;
}

#cnblogs_post_body blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    border-left: 4px solid var(--primary);
    background: rgba(59,130,246,0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

#cnblogs_post_body blockquote p {
    margin: 0.3em 0;
}

#cnblogs_post_body ul,
#cnblogs_post_body ol {
    padding-left: 1.6em;
    margin: 0.8em 0;
}

#cnblogs_post_body li {
    margin: 0.3em 0;
}

/* =========================== 表格 =========================== */
#cnblogs_post_body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

#cnblogs_post_body th {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
}

#cnblogs_post_body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

#cnblogs_post_body tr:nth-child(even) td {
    background: #fafbfc;
}

#cnblogs_post_body tr:hover td {
    background: rgba(59,130,246,0.04);
}

/* =========================== 代码块 =========================== */
#cnblogs_post_body pre {
    background: var(--bg-code) !important;
    color: var(--text-code);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 1.2em 0;
    position: relative;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-md);
}

#cnblogs_post_body pre::before {
    content: '';
    display: block;
    height: 12px;
    margin: -8px -12px 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='12'%3E%3Ccircle cx='6' cy='6' r='6' fill='%23ff5f57'/%3E%3Ccircle cx='26' cy='6' r='6' fill='%23febc2e'/%3E%3Ccircle cx='46' cy='6' r='6' fill='%2328c840'/%3E%3C/svg%3E") no-repeat;
}

#cnblogs_post_body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(59,130,246,0.1);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

#cnblogs_post_body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* =========================== 侧边栏 #sideBar =========================== */
#sideBar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: flex-start;
}

.sidebar-block {
    background: var(--bg-sidebar);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    transition: box-shadow var(--transition);
}

.sidebar-block:hover {
    box-shadow: var(--shadow-md);
}

.sidebar-block h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-block h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* 公告 */
#profile_block a,
#sideBar a {
    color: var(--text-primary);
    transition: color var(--transition);
}
#sideBar a:hover {
    color: var(--primary);
}

#sideBar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sideBar li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

#sideBar li:last-child {
    border-bottom: none;
}

#sideBar li a {
    display: block;
    padding: 4px 0;
    transition: padding var(--transition);
}
#sideBar li a:hover {
    padding-left: 6px;
}

/* 搜索框 */
#sideBar input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition);
    background: var(--border-light);
}
#sideBar input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    background: #fff;
}

/* =========================== 顶部标题栏美化 =========================== */
.postTitle,
.entrylistPosttitle {
    font-family: var(--font-heading);
}

.post .postTitle a:visited {
    color: var(--text-muted);
}

/* 文章发布信息 */
.postDesc,
.post .postDesc a,
#post-date,
.entrylistItemDesc {
    color: var(--text-muted) !important;
    font-size: 0.82rem;
}

/* =========================== 按钮样式 =========================== */
input[type="submit"],
input[type="button"],
button,
.c_b_p_desc_readmore a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff !important;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
input[type="submit"]:hover,
button:hover,
.c_b_p_desc_readmore a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}

/* =========================== 分页 =========================== */
.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}

.pager a,
.Pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.pager a:hover,
.Pager a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59,130,246,0.04);
}
.pager .current,
.Pager .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* =========================== 评论区域 =========================== */
#blog-comments-placeholder {
    margin-top: 40px;
}

.feedback_area_title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.feedbackItem {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.feedbackCon {
    margin-top: 8px;
    line-height: 1.7;
}

.feedbackItem .layer {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* =========================== 底部 Footer =========================== */
#footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

#footer a {
    color: var(--text-muted);
}
#footer a:hover {
    color: var(--primary);
}

/* =========================== 响应式 =========================== */
@media (max-width: 1024px) {
    #main {
        flex-direction: column;
        max-width: var(--content-width);
        padding: 0 16px;
    }

    #mainContent {
        max-width: 100%;
    }

    #sideBar {
        flex: none;
        width: 100%;
        position: static;
    }
}

@media (max-width: 640px) {
    #header {
        padding: 0 14px;
    }

    #blogTitle h1 {
        font-size: 0.9rem;
    }

    #blogTitle h2 {
        display: none;   /* 小屏隐藏副标题 */
    }

    #navList {
        gap: 10px;
    }

    #navList a {
        font-size: 0.75rem;
    }

    .blogStats {
        display: none;   /* 小屏隐藏统计 */
    }

    #cnblogs_post_body h1 { font-size: 1.4rem; }
    #cnblogs_post_body h2 { font-size: 1.2rem; }
    #cnblogs_post_body h3 { font-size: 1.05rem; }
    #cnblogs_post_body pre { padding: 14px 16px; font-size: 0.8rem; }
}