/* =========================================================
   「书生·琉璃」 - 博客园专属定制主题 (宽屏修复终极版)
========================================================= */

/* -----------------------------------
   0. 全局底层背景
----------------------------------- */
body {
    background: linear-gradient(120deg, #f0f4f8 0%, #e6eff5 50%, #f4f6f9 100%) !important;
    background-attachment: fixed !important;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    margin: 0; padding: 0;
}

/* 恢复 wrapper 为标准流布局，仅限制两侧安全呼吸宽度 */
#wrapper {
    display: block !important; 
    padding: 0 70px; 
    box-sizing: border-box;
    max-width: none !important;
    width: 100% !important;
}


/* -----------------------------------
   1. 头部区域 (琉璃质感与文字流光)
----------------------------------- */
#header {
    width: 100%; 
    background: linear-gradient(135deg, rgba(242, 247, 255, 0.85) 0%, rgba(248, 245, 255, 0.82) 50%, rgba(238, 245, 255, 0.85) 100%) !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(116, 160, 214, 0.25) !important; 
    
    /* 【修改】：缩小头部距离下方内容的外部间距（原30px -> 15px） */
    margin-bottom: 15px !important; 
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

#top {
    text-align: center;
    /* 【修改】：缩小主标题上下内边距 */
    padding: 30px 0 15px 0 !important; 
    background: transparent !important; border: none !important; box-shadow: none !important;
}

#subtitle { display: none !important; }
.blog-title { background: none !important; border: none !important; margin: 0; padding: 0; }

#Header1_HeaderTitle {
    display: inline-block; 
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-decoration: none !important; 
    color: #74a0d6; 
    background: linear-gradient(135deg, #6c9ce6 0%, #958bc9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; 
    text-shadow: 0px 4px 15px rgba(116, 160, 214, 0.15);
    transition: all 0.3s ease;
}

#Header1_HeaderTitle:hover {
    text-shadow: 0px 4px 25px rgba(116, 160, 214, 0.5);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.1); 
    transform: translateY(-2px);
}

#sub {
    background: transparent !important; border: none !important; box-shadow: none !important;
    color: #7a8b9e; text-align: center; font-size: 13px;
    /* 【修改】：缩小副标题(统计文字)距离底部的内边距 */          
    padding-bottom: 10px !important;     
}


/* -----------------------------------
   2. 主体布局 (修复重叠与错位的核心)
----------------------------------- */
/* 将 main_container 设为隐藏的弹性外框，让内部元素左右排列 */
#main_container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    
    background: transparent !important; 
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* 将纯白卡片样式转移给左侧“文章列表真正的主容器” */
#main_content {
    flex: 1; /* 自动撑满扣除侧边栏后的所有剩余空间 */
    min-width: 0; /* 防止超长代码撑爆网页 */
    
    background: rgba(255, 255, 255, 0.95) !important; 
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04) !important;
    padding: 30px !important;
    border: 1px solid rgba(220, 230, 240, 0.6);
    margin: 0 !important;
}


/* -----------------------------------
   3. 侧边菜单栏 (强行拉回左侧并优化间距)
----------------------------------- */
#leftmenu {
    order: -1 !important; 
    width: 280px !important; 
    margin-left: 0 !important;     
    /* 【修改】：缩小侧边栏与右侧文章列表的间距（原30px -> 15px） */
    margin-right: 15px !important; 
    
    background: rgba(255, 255, 255, 0.92) !important;
    
    /* 强化圆角，配合后面的滚动条美化 */
    border-radius: 16px !important; 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    padding: 25px;
    border: 1px solid rgba(220, 230, 240, 0.6);
    box-sizing: border-box;
    
    position: -webkit-sticky !important; position: sticky !important;
    top: 20px; /* 往上提一点点 */
    height: fit-content; max-height: calc(100vh - 40px); 
    
    /* 允许滚动，但隐藏横向滚动条溢出 */
    overflow-y: auto; 
    overflow-x: hidden;
}

/* 侧边栏内部排版优化 */
#leftmenu h3 {
    font-size: 15px; color: #2c3e50; border-bottom: 2px solid #eef2f7;
    padding-bottom: 10px; margin: 20px 0 15px 0; font-weight: 700;
}
#leftmenu h3:first-child { margin-top: 0; }
#leftmenu ul { padding: 0; margin: 0; list-style: none; }
#leftmenu li { margin-bottom: 12px; line-height: 1.5; font-size: 14px; }
#leftmenu a { color: #5c6b7a; text-decoration: none; transition: all 0.2s; }
#leftmenu a:hover { color: #74a0d6; padding-left: 6px; }


/* -----------------------------------
   4. 底部 Footer 修复
----------------------------------- */
#footer {
    display: block !important;
    clear: both !important; /* 强制清除所有浮动，确保老实待在最底下 */
    width: 100% !important;
    margin-top: 40px !important;
    padding-bottom: 30px !important;
    text-align: center;
}


/* -----------------------------------
   5. 博客列表卡片特效
----------------------------------- */
.post {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px !important;
    margin-bottom: 25px !important;
    border: 1px solid rgba(230, 235, 240, 1);
    transition: all 0.3s ease;
}
.post:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 100, 200, 0.06);
    border-color: rgba(116, 160, 214, 0.3);
}
.postTitle2 { color: #2c3e50 !important; font-size: 1.4rem !important; font-weight: 700 !important; text-decoration: none !important; transition: color 0.2s ease; }
.postTitle2:hover { color: #74a0d6 !important; }
.c_b_p_desc { color: #5c6b7a !important; line-height: 1.8; margin-top: 15px; }


/* -----------------------------------
   6. 左右诗词挂件 (保持古典排版)
----------------------------------- */
.custom-poetry-widget {
    position: fixed; top: 0; bottom: 0; z-index: 9999;
    display: flex; justify-content: center; align-items: center;     
    background: linear-gradient(135deg, rgba(144, 180, 230, 0.45) 0%, rgba(175, 165, 215, 0.35) 50%, rgba(163, 181, 198, 0.45) 100%);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    padding: 0 3px;         
    font-family: "KaiTi", "楷体", STKaiti, serif;
    font-size: 18px; color: #2c3e50;                        
    writing-mode: vertical-rl; white-space: nowrap;    
    letter-spacing: 4px; line-height: 2.5;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.6);
    transition: background 0.3s ease;
}
.custom-poetry-widget:hover { background: linear-gradient(135deg, rgba(144, 180, 230, 0.55) 0%, rgba(175, 165, 215, 0.45) 50%, rgba(163, 181, 198, 0.55) 100%); }
#poetry-left { left: 0; border-right: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 2px 0 15px rgba(0, 0, 0, 0.03); }
#poetry-right { right: 0; border-left: 1px solid rgba(255, 255, 255, 0.4); box-shadow: -2px 0 15px rgba(0, 0, 0, 0.03); }

/* =========================================
   清除原生主题为侧边栏预留的顽固空白与隔离线
========================================= */
#content {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;      /* 【核心修复】：强行干掉那条残留的左侧隔离线 */
    box-shadow: none !important;  /* 保险起见，把可能存在的原生阴影也抹除 */
    background: transparent !important; 
}

/* -----------------------------------
   7. 移动端/小屏幕自适应防崩坏保护
----------------------------------- */
@media screen and (max-width: 1024px) {
    .custom-poetry-widget { display: none !important; }
    #wrapper { padding: 0 15px !important; } 
    #main_container { flex-direction: column !important; }
    
    /* 移动端排版修正 */
    #leftmenu { 
        order: 2 !important; /* 【核心修正】：在手机上取消插队，让菜单掉回文章最下方，优先展示文章内容 */
        width: 100% !important; 
        margin-right: 0 !important; 
        margin-top: 25px !important; 
        position: static !important; 
        max-height: none !important; 
    }
    #main_content { padding: 20px 15px !important; width: 100% !important; box-sizing: border-box; }
}

/* =========================================
   全局 / 侧边栏 滚动条高级美化 (消灭丑陋直角)
========================================= */

/* 针对侧边栏的滚动条进行瘦身和圆角化 */
#leftmenu::-webkit-scrollbar {
    width: 6px; /* 滚动条变极细 */
}

/* 滚动条轨道（透明且带圆角） */
#leftmenu::-webkit-scrollbar-track {
    background: transparent; 
    border-radius: 10px; 
}

/* 滚动条滑块（半透明琉璃质感） */
#leftmenu::-webkit-scrollbar-thumb {
    background: rgba(180, 195, 210, 0.5); /* 默认微透灰蓝色 */
    border-radius: 10px; /* 强行切出圆弧角 */
}

/* 鼠标悬停在滑块上时加深颜色 */
#leftmenu::-webkit-scrollbar-thumb:hover {
    background: rgba(116, 160, 214, 0.8); 
}