/* 主页样式 - 极简列表风格 */

/* 头部导航栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Arial Black', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    letter-spacing: 2px;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav-link {
    font-size: 16px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* 主内容区 */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* 年份分组 */
.year-section {
    margin-bottom: 40px;
}

.year-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--light-text);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

/* 文章列表 - 时间线样式 */
.article-list {
    position: relative;
    padding-left: 40px;
}

.article-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--border-color) 0%, var(--border-color) 100%);
}

.article-item {
    position: relative;
    padding-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.article-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.article-item:hover::before {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.article-item:last-child {
    padding-bottom: 0;
}

/* 首页文章封面缩略图 */
.article-cover-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.article-cover-thumb[style*="display: none"] {
    display: none !important;
}

.article-cover-thumb:not([style*="display: none"]) {
    display: inline-block !important;
}

.article-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-item:hover .article-cover-thumb img {
    transform: scale(1.1);
}

.article-title {
    font-size: 16px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
    line-height: 1.6;
}

.article-title:hover {
    color: var(--accent-color);
}

.article-date {
    font-size: 13px;
    color: var(--light-text);
    margin-left: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

.empty-message,
.error-message {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--light-text);
    font-size: 14px;
}

.error-message {
    color: #e74c3c;
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo {
        font-size: 20px;
    }

    .nav {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-link {
        font-size: 13px;
        padding: 4px 8px;
    }

    .main-content {
        padding: 20px 12px;
        padding-bottom: 120px;
    }

    .article-list {
        padding-left: 24px;
    }

    .article-list::before {
        left: 7px;
    }

    .article-item::before {
        left: -20px;
        top: 6px;
        width: 5px;
        height: 5px;
    }

    .article-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-bottom: 16px;
    }

    .article-title {
        font-size: 15px;
        line-height: 1.5;
    }

    .article-date {
        margin-left: 0;
        font-size: 11px;
    }

    .year-title {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .year-section {
        margin-bottom: 28px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-md);
    }

    .category-item {
        padding: var(--spacing-lg);
    }

    .category-icon {
        width: 80px;
        height: 80px;
    }

    .category-icon img {
        width: 50px;
        height: 50px;
    }

    .category-name {
        font-size: 20px;
    }

    .category-desc {
        font-size: 13px;
    }
}

/* ========== GitHub风格热力图 ========== */
.heatmap-section {
    margin-bottom: 40px;
    padding: 24px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.heatmap-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.heatmap-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
    font-size: 10px;
    color: var(--light-text);
}

/* 星期标签 */
.heatmap-weekdays {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    padding-bottom: 14px;
}

.heatmap-weekdays span {
    height: 10px;
    line-height: 10px;
    font-size: 10px;
}

/* 主区域 */
.heatmap-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: auto;
}

/* 月份标签 */
.heatmap-months {
    display: flex;
    flex-direction: row;
    height: 12px;
    min-width: max-content;
}

.heatmap-months span {
    font-size: 10px;
    color: var(--light-text);
    min-width: 40px;
}

/* 热力图网格 */
.heatmap-grid {
    display: flex;
    flex-direction: row;
    gap: 2px;
    height: 84px;
    min-width: max-content;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
}

.heatmap-cell:hover {
    outline: 1px solid var(--primary-color);
    z-index: 10;
}

/* 彩虹渐变色 - 浅色模式 */
.heatmap-level-0 {
    background-color: #ebedf0;
}

.heatmap-level-1 {
    background: linear-gradient(135deg, #a8e6cf 0%, #7fcdbb 100%);
}

.heatmap-level-2 {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb347 100%);
}

.heatmap-level-3 {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.heatmap-level-4 {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

/* 彩虹渐变色 - 深色模式 */
body.dark-mode .heatmap-level-0 {
    background-color: #2d2d2d;
}

body.dark-mode .heatmap-level-1 {
    background: linear-gradient(135deg, #1a5f3f 0%, #2d8a6b 100%);
}

body.dark-mode .heatmap-level-2 {
    background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

body.dark-mode .heatmap-level-3 {
    background: linear-gradient(135deg, #c0392b 0%, #e67e22 100%);
}

body.dark-mode .heatmap-level-4 {
    background: linear-gradient(135deg, #6c3483 0%, #af7ac5 100%);
}

/* 底部图例 */
.heatmap-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
    font-size: 10px;
    color: var(--light-text);
}

.heatmap-less,
.heatmap-more {
    font-size: 10px;
}

.heatmap-levels {
    display: flex;
    gap: 2px;
}

.heatmap-level-item {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Tooltip */
.heatmap-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.heatmap-tooltip.active {
    opacity: 1;
}

.heatmap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .heatmap-section {
        padding: 16px;
        margin-bottom: 24px;
    }

    .heatmap-wrapper {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .heatmap-main {
        min-width: 320px;
    }

    .heatmap-cell {
        width: 8px;
        height: 8px;
    }

    .heatmap-grid {
        height: 70px;
    }

    .heatmap-level-item {
        width: 8px;
        height: 8px;
    }

    .heatmap-weekdays {
        padding-bottom: 12px;
    }
}
