/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', system-ui, -apple-system, sans-serif;
    background: #f0f4fb;
    color: #1e293b;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== 导航栏 ===== */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 4px 24px rgba(26, 42, 74, 0.06);
    padding: 0;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 32px rgba(26, 42, 74, 0.12);
}
.glass-nav .nav-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.glass-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #0f1a2e;
    text-decoration: none;
    letter-spacing: -0.3px;
    transition: color 0.25s ease;
}
.glass-nav .nav-brand:hover {
    color: #1a2a4a;
}
.glass-nav .brand-icon {
    display: inline-block;
    font-size: 22px;
    color: #3b82f6;
    animation: gentleGlow 3s ease-in-out infinite;
}
@keyframes gentleGlow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}
.glass-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.glass-nav .nav-link {
    position: relative;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border-radius: 40px;
    transition: color 0.3s ease, background 0.2s ease;
}
.glass-nav .nav-link:hover {
    color: #1a2a4a;
    background: rgba(59, 130, 246, 0.08);
}
.glass-nav .nav-link.active {
    color: #1e3a8a;
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}
.glass-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #1a2a4a, #3b82f6);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
}
.glass-nav .nav-link:hover::after,
.glass-nav .nav-link.active::after {
    width: 60%;
}

/* ===== 页脚 ===== */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
    margin-top: 40px;
    width: 100%;
}
.site-footer a {
    color: #475569;
    text-decoration: none;
}
.site-footer a:hover {
    color: #2563eb;
}

/* ===== 内容区布局（侧边栏 + 主内容） ===== */
.content-wrapper {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px 40px;
    align-items: flex-start;
    box-sizing: border-box;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 1000px;
    overflow: hidden;
    margin-left: 48px;
}

/* ============================================================
   侧边栏（所有样式集中管理）
   ============================================================ */
.sidebar-widget {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
    padding: 20px 16px 22px;
    background-color: #faf6ed;
    background-image:
        linear-gradient(to right, rgba(180, 160, 140, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(180, 160, 140, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* --- 头像 + 名字 + 简介 --- */
.widget-avatar img {
    width: 144px;
    height: 144px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}
.widget-name {
    font-size: 16px;
    font-weight: 600;
    color: #0f1a2e;
    margin: 6px 0 4px 0;
}
.widget-bio {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0 0;
    line-height: 1.5;
}

/* --- 社交媒体 --- */
.widget-social {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 8px 0 12px 0;
}
.widget-social a {
    color: #64748b;
    font-size: 18px;
    transition: color 0.2s, transform 0.2s;
}
.widget-social a:hover {
    color: #2563eb;
    transform: translateY(-2px);
}

/* --- 圆角矩形块（博客入口、标签、状态） --- */
.widget-block {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    padding: 10px 14px 12px;
    margin-top: 10px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: background 0.2s;
}
.widget-block:hover {
    background: rgba(255, 255, 255, 0.75);
}

.widget-block-title {
    font-size: 12px;
    font-weight: 600;
    color: #0f1a2e;
    margin: 0 0 4px 0;
    letter-spacing: 0.3px;
    opacity: 0.7;
}

.widget-block-link {
    font-size: 14px;
    font-weight: 500;
    color: #b45309;
    text-decoration: none;
    transition: color 0.2s;
}
.widget-block-link:hover {
    color: #d97706;
    text-decoration: underline;
}

.widget-status-text {
    font-size: 14px;
    color: #334155;
    margin: 0;
}

/* --- 标签云 --- */
.widget-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.widget-tag {
    font-size: 11px;
    color: #475569;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 10px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.widget-tag:hover {
    background: #ffffff;
    border-color: #3b82f6;
    color: #2563eb;
}

/* --- 网站运行天数 --- */
.widget-age {
    margin-top: 20px;
    padding-top: 8px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(180, 160, 140, 0.08);
    opacity: 0.75;
    transition: opacity 0.3s;
}
.widget-age:hover {
    opacity: 1;
}
.age-number {
    font-weight: 500;
    color: #64748b;
    font-size: 13px;
}

/* ============================================================
   页面背景斜向色带
   ============================================================ */
.bg-stripe {
    position: fixed;
    left: 0;
    top: -80px;
    width: 100%;
    height: calc(100vh + 160px);
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(120deg,
            transparent 0%,
            transparent 20%,
            rgba(245, 230, 170, 0.35) 20%,
            rgba(245, 230, 170, 0.35) 32%,
            rgba(190, 215, 170, 0.38) 32%,
            rgba(190, 215, 170, 0.38) 44%,
            rgba(165, 205, 175, 0.40) 44%,
            rgba(165, 205, 175, 0.40) 56%,
            rgba(145, 200, 195, 0.40) 56%,
            rgba(145, 200, 195, 0.40) 68%,
            rgba(175, 205, 225, 0.35) 68%,
            rgba(175, 205, 225, 0.35) 80%,
            transparent 80%,
            transparent 100%
        );
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px 30px;
        align-items: center;
    }

    .sidebar-wrapper {
        margin-top: 12px !important;
        width: 100%;
        max-width: 1000px;
    }

    /* ===== 手机端侧边栏：只显示作者信息 ===== */
    .sidebar-widget {
        flex: none;
        width: 100%;
        max-width: 1000px;
        position: static;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        background-color: #faf6ed;
        background-image:
            linear-gradient(to right, rgba(180, 160, 140, 0.12) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(180, 160, 140, 0.12) 1px, transparent 1px);
        background-size: 16px 16px;
        background-position: 0 0;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    /* 手机端隐藏所有附加模块 */
    .widget-social,
    .widget-block,
    .widget-calendar,
    .widget-age,
    .widget-badge,
    .widget-wandering,
    .widget-egg,
    .widget-divider {
        display: none !important;
    }

    .widget-avatar img {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .widget-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
        min-width: 0;
    }

    .widget-name {
        font-size: 14px;
        margin: 0;
        font-weight: 600;
    }

    .widget-bio {
        font-size: 12px;
        margin: 0;
        line-height: 1.3;
        color: #64748b;
    }

    .main-content {
        flex: none;
        width: 100%;
        max-width: 1000px;
        margin-left: 0;
        margin-top: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .home-content {
        width: 100%;
        margin: 0 auto;
        padding: 40px 24px 30px;
        border-radius: 32px !important;
        box-sizing: border-box;
    }

    .home-content,
    .blog-main,
    .post-article {
        padding: 24px 16px 20px !important;
    }

    .glass-nav .nav-container {
        height: 60px;
        padding: 0 16px;
    }
    .glass-nav .nav-brand {
        font-size: 17px;
        gap: 6px;
    }
    .glass-nav .brand-icon {
        font-size: 18px;
    }
    .glass-nav .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}