/* =================================================================
   1. 全局变量与重置 (Variables & Reset)
================================================================= */
:root {
    /* 背景：极光色 */
    --bg-gradient: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 50%, #fce4ec 100%);
    
    /* 材质：强玻璃（实）与轻玻璃（透） */
    --glass-heavy: rgba(255, 255, 255, 0.85);
    --glass-light: rgba(255, 255, 255, 0.45);
    
    --card-border: 1px solid rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    
    --text-main: #2d3748;
    --text-light: #718096;
    --primary-color: #38b2ac; 
    
    --radius: 20px; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', 'Noto Sans SC', "Microsoft YaHei", sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

a { text-decoration: none; color: inherit; transition: all 0.2s; }
a:hover { color: var(--primary-color); }

/* === 卡片基础 === */
.card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.article-list-card, .post-content-card { background: var(--glass-heavy); }
.sidebar, .clock-card, .calendar-card, .sticky-sidebar { background: var(--glass-light); }

/* =================================================================
   2. 首页布局 (Home Page Layout)
================================================================= */
.dashboard-container {
    display: grid;
    /* 首页列宽：左 240px */
    grid-template-columns: 240px 1fr 280px; 
    gap: 24px;
    
    /* 首页总宽：1280px */
    max-width: 1280px; 
    width: 95%;
    
    margin: auto; /* 垂直居中 */
    align-items: start; 
}

/* 左侧栏 */
.sidebar {
    display: flex; flex-direction: column; padding: 24px;
    min-height: 300px;
}
.profile-header { margin-bottom: 30px; text-align: center; }
.profile-header .avatar {
    width: 60px; height: 60px; border-radius: 50%; margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid rgba(255,255,255,0.8);
}
.profile-header h3 { justify-content: center; font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.tag { font-size: 0.6rem; background: rgba(56, 178, 172, 0.15); color: var(--primary-color); padding: 2px 6px; border-radius: 6px; margin-left: 5px; vertical-align: middle;}
.profile-info p { font-size: 0.75rem; color: var(--text-light); letter-spacing: 1px; }

.menu { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
    padding: 12px 16px; border-radius: 12px;
    display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.95rem;
}
.menu-item:hover, .menu-item.active { background: rgba(255,255,255, 0.7); color: var(--primary-color); }
.menu-item i { width: 24px; text-align: center; }

/* 中间文章列表 */
.center-column { display: flex; flex-direction: column; }
.article-list-card { padding: 30px; min-height: 500px; }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.card-header h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.article-list { list-style: none; }
.article-list li { margin-bottom: 15px; }
.article-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-radius: 12px;
    background: rgba(255,255,255, 0.5); 
    transition: all 0.2s;
}
.article-link:hover { background: #fff; transform: translateX(5px); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }

/* 右侧栏 */
.right-column { display: flex; flex-direction: column; gap: 24px; }
.clock-card { height: 100px; display: flex; align-items: center; justify-content: center; }
#digital-clock { font-size: 2.8rem; font-family: 'Nunito', sans-serif; font-weight: 300; letter-spacing: -1px; }

.calendar-card { padding: 24px; }
.calendar-header { text-align: center; margin-bottom: 15px; font-weight: 700; color: var(--text-main); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 10px; }
.calendar-weekdays span { font-size: 0.8rem; color: var(--text-light); font-weight: bold; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 8px; column-gap: 2px; text-align: center; }
.calendar-grid span { font-size: 0.9rem; padding: 6px 0; border-radius: 8px; cursor: default; font-family: 'Nunito', sans-serif; }
.calendar-grid span.prev-date, .calendar-grid span.next-date { color: #cbd5e0; }
.calendar-grid span.today { background: var(--primary-color); color: white; box-shadow: 0 2px 8px rgba(56, 178, 172, 0.4); }
.calendar-grid span.current-date:hover:not(.today) { background: rgba(255,255,255,0.8); }

/* =================================================================
   3. 文章页面布局 (Article Layout) - 完美对齐版
================================================================= */

/* 悬浮导航：右上角 */
.floating-menu {
    position: fixed; top: 30px; right: 40px; left: auto; z-index: 9999;
    background: var(--glass-light); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255, 0.6);
    border-radius: 50px; padding: 8px 12px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

img.nav-avatar-img {
    width: 40px !important; height: 40px !important; 
    border-radius: 50%; border: 2px solid #fff; 
    object-fit: cover; display: block; margin: 0 !important;
}

.float-links { display: flex; gap: 8px; }
.float-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text-light); transition: all 0.2s;
}
.float-btn:hover { background: #fff; color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* --- 文章容器 --- */
.post-layout-container {
    display: grid;
    
    /* === 核心对齐修复 === */
    /* 1. 左侧固定 240px (与首页 sidebar 宽度一致) */
    /* 2. 右侧 1fr 自适应 (确保总宽度填满容器) */
    grid-template-columns: 240px 1fr; 
    
    gap: 24px; /* 保持与首页一致的间距 */
    
    /* === 容器总宽与首页一致 === */
    max-width: 1280px; 
    width: 95%;
    
    margin: 60px auto;
    
    align-items: stretch; 
}

/* 顺序：目录左，内容右 */
.post-sidebar-column { order: 1; }
.post-main-column    { order: 2; }


/* --- 左侧目录：复刻首页侧边栏位置 --- */
.sticky-sidebar {
    position: -webkit-sticky;
    position: sticky; 
    
    /* 吸顶位置：距离顶部 24px，为了视觉平衡，可以略微调整 */
    top: 24px; 
    
    padding: 24px; /* 内边距与首页 Sidebar 一致 */
    border-radius: var(--radius);
    
    max-height: 85vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.sticky-sidebar:hover { scrollbar-color: rgba(0,0,0,0.1) transparent; }

.toc-title { margin-bottom: 15px; font-weight: bold; border-left: 4px solid var(--primary-color); padding-left: 10px; }
.toc-content { list-style: none; }
.toc-link { display: block; padding: 6px 10px; color: var(--text-light); font-size: 0.9rem; border-radius: 8px; transition: all 0.2s; }
.toc-link:hover, .toc-link.active { color: var(--primary-color); background: rgba(255,255,255,0.6); font-weight: 600; }


/* --- 文章内容 --- */
.post-content-card { padding: 50px; min-height: 60vh; }
.post-title { font-size: 2rem; font-weight: 700; margin-bottom: 15px; text-align: center; }
.post-meta { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; color: var(--text-light); font-size: 0.9rem; }
.post-body { line-height: 1.8; color: #333; }
.post-body h2 { font-size: 1.5rem; margin-top: 30px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.post-body img { max-width: 100%; border-radius: 12px; display: block; margin: 20px auto; }

/* 返回按钮 */
.back-home-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: var(--text-main); padding: 12px 35px; border-radius: 50px;
    font-weight: 600; font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: all 0.3s ease;
}
.back-home-btn:hover {
    background: #fff; color: var(--primary-color); transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(56, 178, 172, 0.25); 
}
.post-footer-nav { margin-top: 60px; text-align: center; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 30px; }

/* =================================================================
   4. 移动端适配
================================================================= */
@media (max-width: 1000px) {
    .dashboard-container { grid-template-columns: 1fr; max-width: 600px; }
    .sidebar, .right-column { display: none; } 
    
    .post-layout-container { grid-template-columns: 1fr; }
    .sticky-sidebar { display: none; }
    
    .floating-menu { top: 15px; left: 50%; right: auto; transform: translateX(-50%); padding: 6px 12px; }
    img.nav-avatar-img { width: 32px !important; height: 32px !important; }
}
/* =================================================================
   5. 归档页面 (Archives) - 复刻 Timeline 风格
================================================================= */

/* 归档页布局容器 - 类似于文章页，但更宽一点，居中 */
.archive-layout-container {
    max-width: 900px;
    width: 95%;
    margin: 80px auto 40px auto;
    display: flex;
    justify-content: center;
}

/* 归档主卡片 */
.archive-card {
    width: 100%;
    padding: 40px;
    background: var(--glass-heavy);
    min-height: 80vh;
}

/* --- 年份分组 --- */
.year-group {
    margin-bottom: 40px;
}

/* 年份头部 (例如: 2025 · 25 篇文章) */
.year-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--text-main);
}

.year-number {
    font-weight: 700;
    font-size: 1.2rem;
    width: 50px; /* 固定宽度对齐 */
}

.year-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9d9d9;
}

.year-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* --- 文章列表项 --- */
.year-list {
    display: flex;
    flex-direction: column;
}

.archive-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    cursor: pointer;
    
    /* 悬停时的背景条效果 */
    border-radius: 8px;
}

.archive-item:hover {
    background: rgba(255,255,255,0.5);
}

/* 1. 左侧日期 (11-25) */
.archive-date {
    width: 50px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: left;
    flex-shrink: 0;
}

/* 2. 中间时间轴节点 */
.archive-timeline-node {
    position: relative;
    width: 30px; /* 节点区域宽度 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

/* 那个灰色的线 (装饰) */
.node-line {
    position: absolute;
    top: 20px; /* 从圆点下方开始 */
    bottom: -20px; /* 延伸到下一个列表项 */
    width: 1px;
    background: #eee;
    z-index: 0;
    /* 最后一个元素隐藏线 */
    display: block;
}
.archive-item:last-child .node-line {
    display: none;
}

/* 那个圆点 */
.node-dot {
    width: 6px;
    height: 6px;
    background: #d9d9d9;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s;
}

/* 悬停时圆点变大变色 */
.archive-item:hover .node-dot {
    background: var(--primary-color);
    transform: scale(1.5);
    box-shadow: 0 0 0 4px rgba(56, 178, 172, 0.1);
}
.archive-item:hover .archive-title {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* 3. 右侧信息 (标题 + 标签) */
.archive-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 标签靠右 */
    overflow: hidden;
}

.archive-title {
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
}

.archive-tags {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.archive-tags span {
    font-size: 0.75rem;
    color: var(--text-light);
    background: rgba(0,0,0,0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .archive-tags { display: none; } /* 手机端隐藏标签，防止太挤 */
    .year-header { font-size: 0.9rem; }
}