/* 
   ==========================================================================
   Cnblogs Modern Cream Skin (v2.2 - Post View & Calendar Fix)
   Base Color: #F9F5F0
   Style: Ultra-Clean, Airy, Modern Typography with Rich Interactions
   ========================================================================== 
*/

:root {
    /* 核心色板 */
    --bg-base: #F9F5F0;
    --bg-gradient-start: #F9F5F0;
    --bg-gradient-end: #FFFCF7;
    
    --primary-color: #8B5E3C;      /* 摩卡棕 */
    --accent-color: #D4A373;       /* 拿铁色 */
    --text-main: #333333;          /* 深灰 */
    --text-light: #777777;         /* 浅灰 */
    --border-color: rgba(139, 94, 60, 0.1);
    
    /* 空间系统 (Spacious) */
    --gap-xl: 50px;
    --gap-lg: 30px;
    --gap-md: 20px;
    --radius-lg: 24px;  /* 更大的圆角 */
    --radius-sm: 12px;
    
    /* 卡片系统 (Glassmorphism Enhanced) */
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 10px 40px -10px rgba(139, 94, 60, 0.08); /* 更柔和的扩散阴影 */
    --hover-shadow: 0 20px 50px -10px rgba(139, 94, 60, 0.15);
    
    /* 字体栈 */
    --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --code-font: "Fira Code", Consolas, Monaco, "Courier New", monospace;
}

/* --- 全局重置 --- */
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; font-size: 16px; } /* 提升基准字号 */

body {
    font-family: var(--font-stack);
    font-size: 1rem;
    line-height: 1.9; /* 增加行高 */
    color: var(--text-main);
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
}

a { color: var(--text-main); text-decoration: none; transition: all 0.3s ease; position: relative; }
a:hover { color: var(--primary-color); }

/* --- 链接下划线动效 (不仅限于导航) --- */
.postCon a, .postDesc a, #navList a, .postBody a:not(.btn) {
    display: inline-block;
}
.postCon a::after, .postDesc a::after, #navList a::after, .postBody a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease-in-out;
}
.postCon a:hover::after, .postDesc a:hover::after, #navList a:hover::after, .postBody a:not(.btn)::after {
    width: 100%;
}

/* --- 布局容器 --- */
#home {
    max-width: 1280px; /* 加宽主容器 */
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    padding: 0 30px;
}

/* --- 顶部导航栏 (Header) --- */
#header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 40px 50px;
    margin-bottom: 40px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.3s ease;
}
#header:hover { transform: translateY(-2px); }

#blogTitle h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
#blogTitle h1 a { background: linear-gradient(45deg, var(--primary-color), var(--accent-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
#blogTitle h2 { font-size: 1.1rem; color: var(--text-light); font-weight: 400; margin-top: 12px; opacity: 0.8; letter-spacing: 1px; }

#navigator { margin-top: 30px; }
#navList { 
    display: flex; 
    justify-content: center; 
    gap: 40px; 
    list-style: none; 
    padding: 0;
}

#navList li a {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s;
}

#navList li a:hover {
    color: var(--primary-color);
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* --- 主体区域 Layout --- */
#main {
    display: grid;
    grid-template-columns: 1fr 340px; /* 侧边栏加宽 */
    gap: 40px;
}

#mainContent { min-width: 0; }
#sideBar { min-width: 0; }

/* --- 文章列表卡片 (.day) --- */
.day {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 50px; /* 更加宽敞的内边距 */
    margin-bottom: 40px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    overflow: hidden; /* 防止内容溢出圆角 */
}

.day:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.dayTitle { display: none; } 

.postTitle {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;
    line-height: 1.3;
    padding-left: 0;
    border-left: none; /* 去除原有左边框，改用更现代的标题样式 */
}

.postTitle a { color: var(--text-main); background-image: linear-gradient(transparent 70%, rgba(212, 163, 115, 0.2) 70%); background-size: 0% 100%; background-repeat: no-repeat; transition: background-size 0.3s; }
.postTitle a:hover { color: var(--primary-color); background-size: 100% 100%; }

.postCon {
    font-size: 16px;
    color: #555;
    line-height: 1.9;
    margin-bottom: 30px;
    font-weight: 400;
}

.postDesc {
    font-size: 14px;
    color: #aaa;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.postDesc a { color: var(--accent-color); font-weight: 600; margin-left: 10px; }

/* --- 博文正文样式优化 (Post View) --- */
.postBody { font-size: 16px; line-height: 1.9; color: #333; }
.postBody h2, .postBody h3, .postBody h4 { margin: 40px 0 20px; font-weight: 700; color: #2c2c2c; }
.postBody h2 { font-size: 1.6rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 10px; display: inline-block; }
.postBody h3 { font-size: 1.4rem; padding-left: 15px; border-left: 4px solid var(--primary-color); }
.postBody p { margin-bottom: 25px; text-align: justify; }

/* 引用块美化 */
.postBody blockquote {
    background: rgba(139, 94, 60, 0.05);
    border-left: 5px solid var(--primary-color);
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #666;
    font-style: italic;
    position: relative;
}
.postBody blockquote::before {
    content: '"';
    font-size: 60px;
    color: rgba(139, 94, 60, 0.1);
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: serif;
}

/* 图片美化 */
.postBody img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 20px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease;
}
.postBody img:hover { transform: scale(1.02); }

/* 代码块美化 */
.cnblogs_code, pre {
    background: #282c34 !important;
    color: #abb2bf !important;
    border: none !important;
    border-radius: var(--radius-sm);
    padding: 20px !important;
    font-family: var(--code-font) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 30px 0 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow-x: auto;
}
.cnblogs_code span { color: #abb2bf !important; font-family: var(--code-font) !important; }

/* 列表样式 */
.postBody ul, .postBody ol { margin-bottom: 25px; padding-left: 25px; }
.postBody ul li { list-style: disc; margin-bottom: 8px; color: #444; }
.postBody ol li { list-style: decimal; margin-bottom: 8px; color: #444; }

/* --- 评论区美化 (Comments) --- */
#blog-comments-placeholder, #comment_form {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    margin-top: 40px;
}

.feedbackItem {
    border-bottom: 1px dashed var(--border-color);
    padding: 25px 0;
    display: flex;
    flex-direction: column;
}
.feedbackItem:last-child { border-bottom: none; }

.feedbackListSubtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.feedbackListSubtitle a { color: var(--primary-color); font-weight: 600; }

.blog_comment_body {
    background: rgba(255,255,255,0.6);
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    margin-top: 10px;
    position: relative;
}
.blog_comment_body::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0; 
    height: 0; 
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255,255,255,0.6);
}

/* 评论输入框 */
#tbCommentBody {
    width: 100%;
    height: 150px;
    background: rgba(255,255,255,0.8);
    border: 2px solid #eee;
    border-radius: var(--radius-sm);
    padding: 15px;
    font-family: var(--font-stack);
    font-size: 15px;
    transition: all 0.3s;
}
#tbCommentBody:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 94, 60, 0.1);
    background: #fff;
}

#btn_comment_submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 94, 60, 0.3);
}
#btn_comment_submit:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 94, 60, 0.4);
}

/* --- 分页导航 (.topicListFooter) --- */
.topicListFooter {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}
.topicListFooter a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    background: rgba(139, 94, 60, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s;
}
.topicListFooter a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* --- 侧边栏样式 (Sidebar) --- */
#sideBar { display: flex; flex-direction: column; gap: 30px; }

.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, .catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListComment, .catListView, .catListFeedback, .mySearch, .sidebar-widget {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.3s ease;
}

.sidebar-widget:hover, .newsItem:hover, .catListEssay:hover, .catListLink:hover {
    transform: translateY(-5px);
}

.catListTitle, .widget-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
    position: relative;
    display: flex;
    align-items: center;
}
/* 标题下的装饰短线 */
.catListTitle::after, .widget-title::after {
    content: ''; position: absolute; bottom: -8px; left: 0; width: 30px; height: 3px; background: var(--accent-color); border-radius: 2px;
}
.catListTitle::before { display: none; } /* 移除原有圆点 */

#sideBar ul li { margin-bottom: 12px; }
#sideBar a { color: #555; font-size: 15px; display: block; padding: 5px 0; transition: transform 0.2s; }
#sideBar a:hover { color: var(--primary-color); transform: translateX(5px); }

/* --- 侧边栏 - 个人资料卡片 --- */
.profile-card { text-align: center; padding-top: 40px; }
.avatar-container {
    width: 120px; height: 120px; margin: 0 auto 20px; position: relative;
    background: #fff; border-radius: 50%; padding: 5px; /* 增加内圈白边 */
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* 针对 SVG 的强制样式 */
.avatar-img, .avatar-container svg {
    width: 100% !important; height: 100% !important;
    border-radius: 50%; display: block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.profile-card:hover .avatar-img, .profile-card:hover .avatar-container svg { transform: rotate(15deg) scale(1.05); }

/* 占位符样式 */
.placeholder-circle {
    width: 100%; height: 100%; border-radius: 50%; background: #f0f0f0; color: #ccc;
    display: flex; align-items: center; justify-content: center; font-weight: bold; border: 2px dashed #ddd;
}

.profile-name { font-size: 22px; margin-bottom: 8px; color: var(--text-main); }
.profile-bio { font-size: 14px; color: var(--text-light); margin-bottom: 25px; line-height: 1.6; }

.social-links { display: flex; justify-content: center; gap: 15px; }
.social-links a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-color);
    background: rgba(139, 94, 60, 0.08);
    border-radius: 50%;
    transition: all 0.3s;
}
.social-links a svg { width: 20px; height: 20px; }
.social-links a:hover { background: var(--primary-color); color: #fff; transform: translateY(-3px); }

/* --- 目录样式 --- */
#catalog-box ul { padding-left: 15px; border-left: 2px solid #eee; margin-left: 5px; }
#catalog-box li { list-style: none; font-size: 14px; margin: 10px 0; }
#catalog-box a { color: #666; display: block; padding: 2px 0; transition: color 0.2s; }
#catalog-box a:hover { color: var(--primary-color); font-weight: 600; transform: translateX(3px); }

/* --- 现代化日历样式 (Calendar - Critical Fix) --- */
#blogCalendar { width: 100%; margin-bottom: 20px; }
#blogCalendar table { 
    width: 100%; 
    border-collapse: separate; /* 关键：允许单元格间距 */
    border-spacing: 0 5px;     /* 垂直间距 */
    border: none; 
}
#blogCalendar td, #blogCalendar th { border: none; text-align: center; padding: 5px 0; font-family: var(--font-stack); }

/* 月份标题 */
#blogCalendar #blogCalendarTitle { 
    font-size: 18px; font-weight: 700; color: var(--primary-color); 
    padding-bottom: 15px; display: block; text-align: center;
    margin-bottom: 10px; border-bottom: 1px dashed var(--border-color);
}
#blogCalendar #blogCalendarTitle a { color: var(--primary-color); }

/* 星期头 */
#blogCalendar th { font-size: 12px; color: #aaa; font-weight: 600; text-transform: uppercase; }

/* 日期单元格 */
#blogCalendar td { 
    font-size: 14px; color: var(--text-main); 
    position: relative; z-index: 1; transition: all 0.3s;
    height: 36px; width: 36px; /* 强制方形区域 */
    vertical-align: middle;
}

/* 有文章的日期 (链接) */
#blogCalendar td a { 
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; 
    border-radius: 50%; 
    color: var(--primary-color); font-weight: 600;
    transition: all 0.3s;
    margin: 0 auto;
}
#blogCalendar td a:hover { background: var(--accent-color); color: #fff; box-shadow: 0 4px 10px rgba(212, 163, 115, 0.4); transform: scale(1.1); }

/* 今天的日期 (Critical Fix v2) - 使用更高权重的选择器 */
#blogCalendar table tr td#today, 
#blogCalendar td#today { 
    color: #fff !important; 
    font-weight: bold !important; 
    background-color: var(--primary-color) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(139, 94, 60, 0.3) !important;
    /* 如果里面有 a 标签，确保颜色继承 */
}
#blogCalendar table tr td#today a,
#blogCalendar td#today a {
    color: #fff !important;
}

/* 移除之前的伪元素干扰 */
#blogCalendar #today::after { display: none !important; }

/* 上下月导航 */
.Cal { border: none !important; }
#blogCalendar .CalTitle { display: none; } 
#blogCalendar .CalNextPrev a { color: var(--text-light); font-size: 12px; }
#blogCalendar .CalNextPrev a:hover { color: var(--primary-color); }

/* --- 底部 Footer --- */
#footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px;
    color: #999;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

/* --- 响应式适配 (Mobile) --- */
@media (max-width: 900px) {
    #home { padding: 0 15px; margin: 20px auto; }
    #main { grid-template-columns: 1fr; gap: 20px; }
    #header { padding: 30px 20px; }
    #navList { gap: 15px; flex-wrap: wrap; }
    .day { padding: 30px 20px; }
    .postTitle { font-size: 1.5rem; }
    .postBody blockquote { margin: 20px 0; padding: 15px; }
}