/* 升级 4 色动态点点 */
.visual-top {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.visual-top i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0 !important;
    animation: dot-pulse 2s infinite ease-in-out;
}

/* 定义 4 个颜色 */
.visual-top i:nth-child(1), .visual-top i.dot-blue { background: #4285F4; animation-delay: 0s; }
.visual-top i:nth-child(2), .visual-top i.dot-red { background: #EA4335; animation-delay: 0.2s; }
.visual-top i:nth-child(3), .visual-top i.dot-yellow { background: #FBBC05; animation-delay: 0.4s; }
.visual-top i:nth-child(4), .visual-top i.dot-green { background: #34A853; animation-delay: 0.6s; }

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px currentColor; }
}

/* 升级上升趋势柱状图动画 */
.visual-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 160px;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(26,115,232,0.02), transparent);
    border-radius: 16px;
}

.visual-bars i {
    flex: 1;
    background: linear-gradient(180deg, #1a73e8, #8ab4f8);
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.visual-bars i::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    100% { transform: translateX(100%); }
}

/* 初始高度与动画 */
.visual-bars i:nth-child(1) { height: 30%; animation: bar-grow 1.2s ease-out forwards; }
.visual-bars i:nth-child(2) { height: 50%; animation: bar-grow 1.2s ease-out 0.2s forwards; }
.visual-bars i:nth-child(3) { height: 75%; animation: bar-grow 1.2s ease-out 0.4s forwards; }
.visual-bars i:nth-child(4) { height: 95%; animation: bar-grow 1.2s ease-out 0.6s forwards; }

@keyframes bar-grow {
    from { height: 0; }
}

/* 高端卡片悬浮效果 */
.visual-card {
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.visual-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(26,115,232,0.1);
    border-color: #1a73e8;
}

/* 文章详情页侧边栏布局优化 - 适配不同分辨率笔记本 */
.ast-article-layout {
    display: flex; /* 使用 flex 代替 grid 以获得更好的弹性控制 */
    gap: 32px;
    margin: 30px 0;
    align-items: flex-start;
}

.ast-article-main {
    flex: 1;
    min-width: 0;
}

.ast-sidebar {
    width: 280px; /* 稍微缩小侧边栏宽度以适配窄屏 */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ast-article-page {
    max-width: 1240px !important;
    padding: 0 20px !important;
}

.ast-sidebar-widget {
    background: #fff;
    border: 1px solid #e8eef8;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(15, 40, 90, 0.04);
}

.ast-sidebar-widget h3 {
    font-size: 17px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f4f8;
    color: #172033;
}

.ast-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ast-sidebar-list li {
    margin-bottom: 12px;
    line-height: 1.4;
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 8px;
}

.ast-sidebar-list li:last-child {
    border-bottom: 0;
}

.ast-sidebar-list a {
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
    display: block;
}

.ast-sidebar-list a:hover {
    color: #1a73e8;
}

.ast-sidebar-list time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* 相关文章推荐 */
.ast-related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #edf1f7;
}

.ast-related-posts h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

.ast-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 分页样式优化 */
.ast-pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.ast-pagination .nav-links {
    display: flex;
    gap: 8px;
}

.ast-pagination a, .ast-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8eef8;
    color: #5f6b7a;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* 响应式断点调整：仅在真正的小屏幕（如手机）下才换行 */
@media (max-width: 820px) {
    .ast-article-layout {
        flex-direction: column;
    }
    .ast-sidebar {
        width: 100%;
        order: 2;
    }
    .ast-related-grid {
        grid-template-columns: 1fr;
    }
}
