/* ------ Index Page Specific Styles (Adapted from test.html) ------ */

/* ----- 页面主体 ----- */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    flex: 1;
}

.content-grid {
    /*display: grid;*/
    /*grid-template-columns: 2.4fr 1fr;*/
    /*gap: 2rem;*/
    /*align-items: start;*/
}

/* --- 左侧主信息流 (杂志化横排) --- */
.main-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.article-card {
    background-color: var(--card-bg, #FFFFFF);
    border-radius: var(--border-radius, 16px);
    box-shadow: var(--shadow-sm, 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03));
    transition: all 0.4s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    padding: 1.5rem;
    gap: 2rem;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.02));
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover, 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02));
    border-color: rgba(99, 102, 241, 0.05);
}

.img-wrapper {
    width: 200px;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #F1F5F9;
}

.article-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.article-card:hover img {
    transform: scale(1.05);
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.tag.life {
    background-color: #EEF2FF;
    color: #4F46E5;
}

.tag.thoughts {
    background-color: #FDF4FF;
    color: #C026D3;
}

.tag.memo {
    background-color: #F1F5F9;
    color: #475569;
}

/* 默认 tag 样式 (如果 Typecho 输出的分类名不固定) */
.tag.default {
    background-color: #EEF2FF;
    color: #4F46E5;
}

.date,
.read-time {
    color: var(--text-lighter, #94A3B8);
}

/* 头像样式 */
.meta-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
}

.title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.4;
    transition: color 0.3s;
    color: var(--text-main, #0F172A);
}

.article-card:hover .title {
    color: var(--accent-color, #6366F1);
}

.excerpt {
    color: var(--text-muted, #64748B);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 右侧侧边栏 (紧凑碎片列表) --- */
.sidebar {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-right: 6px;
    /* 防止内容被滚动条遮挡 */
}

/* sidebar 专属滚动条美化 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color, rgba(0, 0, 0, 0.1));
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color, #6366F1);
}

.widget-card {
    background: var(--card-bg, #FFFFFF);
    border-radius: var(--border-radius, 16px);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.02));
    padding: 1.5rem;
    box-shadow: var(--shadow-sm, 0 4px 6px -1px rgba(0, 0, 0, 0.05));
    transition: all 0.3s ease;
}

.widget-card:hover {
    box-shadow: var(--shadow-hover, 0 20px 25px -5px rgba(0, 0, 0, 0.05));
    border-color: rgba(99, 102, 241, 0.05);
}

.widget-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-lighter, #94A3B8);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color, rgba(0, 0, 0, 0.06));
}

/* 博客信息 Widget */
.widget-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.widget-profile img.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 0.8rem;
    border: 2px solid var(--border-color);
}

.widget-profile .author-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.widget-profile .blog-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.widget-stat {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
}

.widget-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.widget-stat-item .count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.widget-stat-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.widget-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget-categories-list li a {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background-color: var(--tag-bg, #EEF2FF);
    color: var(--tag-text, #4F46E5);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.widget-categories-list li a:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* 评论 Widget */
.widget-comments {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-comments li {
    font-size: 0.85rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-comments li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-comments .comment-author {
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
}

.widget-comments .comment-excerpt {
    color: var(--text-muted);
    line-height: 1.5;
    display: block;
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 保证短文卡片 snippet-card 在左栏混排能正常显示 */
.snippet-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.25rem;
    background: var(--card-bg, #FFFFFF);
    border-radius: var(--border-radius, 16px);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.02));
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-sm, 0 4px 6px -1px rgba(0, 0, 0, 0.05));
    /* margin-bottom relies on main-feed gap */
}

.snippet-card::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 15%;
    height: 70%;
    width: 3px;
    background: var(--accent-color, #6366F1);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.snippet-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-hover, 0 20px 25px -5px rgba(0, 0, 0, 0.05));
    transform: translateX(4px);
}

.snippet-card:hover::before {
    opacity: 1;
}

.snippet-card .title {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
}
.snippet-card:hover .title {
    color: var(--accent-color, #6366F1);
}
.snippet-card .excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ----- 顶部 Hero 区域 ----- */
.hero {
    /*margin-bottom: 2.5rem;*/
    text-align: left;
    /*min-height: 140px;*/
}

/* 天气/时空组件 */
.weather-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: #FFFFFF;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm, 0 4px 6px -1px rgba(0, 0, 0, 0.05));
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.weather-widget:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    /*margin-bottom: 1rem;*/
    letter-spacing: -0.02em;
    line-height: 1.4;
    color: var(--text-main, #0F172A);
}

/* 打字机光标 */
.type-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background-color: var(--accent-color, #6366F1);
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* 分页容器居中并避免遮挡内容 */
.page-navigator {
    margin-top: 2rem;
    text-align: center;
    grid-column: 1 / -1;
}

.page-navigator li {
    display: inline-block;
    margin: 0 5px;
}

.page-navigator li a {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    text-decoration: none;
}

.page-navigator li.current a {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}


/* ----- 响应式适配 ----- */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-top: 2rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .article-card {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .img-wrapper {
        width: 100%;
        height: 180px;
    }
}

/* Fix container width avoiding scrolling */
.container {
    padding-left: 15px;
    padding-right: 15px;
}


/* ====================
   天气背景基础样式
   ==================== */
.hero {
    position: relative;
    padding: 3rem 2rem; /* 增加内边距让背景更有呼吸感 */
    /*margin-bottom: 4rem;*/
    border-radius: var(--border-radius);
    overflow: hidden; /* 防止天气元素溢出 */
    transition: background 0.8s ease; /* 天气切换时的柔和过渡 */
    /* 默认给个极淡的底色 */
    /*background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);*/
}

.hero-content {
    position: relative;
    z-index: 10; /* 确保文字在动画之上 */
}

.weather-bg {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 1;
    pointer-events: none; /* 防止挡住文字选区 */
}

/* --- 天气状态背景色 --- */
/*.hero.weather-sunny { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }*/
/*.hero.weather-cloudy { background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%); }*/
/*.hero.weather-rainy { background: linear-gradient(135deg, #e0e7ff 0%, #94a3b8 100%); }*/
/*.hero.weather-snowy { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); }*/

/* ====================
   动画元素样式
   ==================== */

/* 1. 太阳 (Sunny) */
.weather-sun {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(253,230,138,0.8) 0%, rgba(253,230,138,0) 70%);
    border-radius: 50%;
    animation: sunPulse 4s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* 2. 云朵 (Cloudy) */
.weather-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    filter: blur(8px);
    animation: cloudDrift linear infinite;
}

@keyframes cloudDrift {
    0% { transform: translateX(-150px); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateX(800px); opacity: 0; }
}

/* 3. 雨滴 (Rainy) */
.weather-rain {
    position: absolute;
    background: linear-gradient(to bottom, rgba(99,102,241,0), rgba(99,102,241,0.4));
    width: 2px;
    border-radius: 2px;
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(-20px) skewX(-15deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(300px) skewX(-15deg); opacity: 0; }
}

/* 4. 雪花 (Snowy) */
.weather-snow {
    position: absolute;
    /*background: #fff;*/
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
    animation: snowFall linear infinite;
}

@keyframes snowFall {
    0% { transform: translateY(-20px) translateX(0); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(300px) translateX(30px); opacity: 0; }
}