:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f97316;
    --text-color: #1e293b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* 热力图标动画效果 - 更新 */
@keyframes pulse-effect {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

.heat-icon {
    animation: pulse-effect 2.5s ease-in-out infinite;
    color: var(--secondary-color);
}

.heat-icon:nth-child(odd) {
    animation-delay: 0.7s;
}

/* 滚动条隐藏 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 新Logo动画 */
.logo-circle {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-circle:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.7);
}

/* 导航栏样式 */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 500;
}

.nav-link.active::after {
    width: 100%;
}

/* 卡片悬浮效果 */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}  

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-results .article-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.article-tags {
    padding: 10px 0;
}

.article-tags .badge {
    padding: 5px 10px;
    margin-right: 5px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
}

.article-tags .badge:hover {
    background-color: #5a6268;
} 
/* 确保 AdSense 广告不会导致页面滚动 */
ins.adsbygoogle {
    max-width: 100vw !important; /* 使用视口宽度而不是百分比 */
    margin-left: calc(-1 * var(--padding, 0.75rem)) !important; /* 抵消父容器的内边距 */
    margin-right: calc(-1 * var(--padding, 0.75rem)) !important;
    width: calc(100% + 2 * var(--padding, 0.75rem)) !important; /* 宽度加上两边内边距 */
    box-sizing: border-box !important;
    height: auto !important; /* 确保高度自适应 */
}

/* 确保 iframe 不会超出容器 */
iframe {
    max-width: 100vw !important;
    box-sizing: border-box !important;
    height: auto !important; /* 自适应高度 */
}

/* 移动设备上的额外约束 */
@media (max-width: 640px) {
    article, .article-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .article-content {
        padding-left: var(--padding, 0.75rem) !important;
        padding-right: var(--padding, 0.75rem) !important;
    }
    
    /* 处理广告的特殊样式 */
    ins.adsbygoogle, iframe.adsbygoogle {
        width: 100vw !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        position: relative !important;
    }
    
    /* 防止广告内容溢出 */
    ins.adsbygoogle iframe, iframe.adsbygoogle iframe {
        max-width: 100vw !important;
        height: auto !important; /* 自适应高度 */
    }
    
    /* 修复谷歌广告的全屏样式 */
    .google-auto-placed {
        width: 100vw !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        position: relative !important;
        height: auto !important; /* 确保高度自适应 */
    }
}
/* 增加文章段落的行距 */
.article-content p {
    margin-top: 1.5em;    /* 段落上方间距 */
    margin-bottom: 1.5em;  /* 段落下方间距 */
    line-height: 1.8;      /* 行高 */
}

/* 第一个段落不需要上边距 */
.article-content p:first-child {
    margin-top: 0;
}

/* 最后一个段落不需要下边距 */
.article-content p:last-child {
    margin-bottom: 0;
}

/* 修复有序列表和无序列表的样式 */
.article-content ol {
    list-style-type: decimal;
    margin-left: 1.5em;
    margin-top: 1em;
    margin-bottom: 1em;
    padding-left: 1em;
}

.article-content ul {
    list-style-type: disc;
    margin-left: 1.5em;
    margin-top: 1em;
    margin-bottom: 1em;
    padding-left: 1em;
}

.article-content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

/* 嵌套列表样式 */
.article-content ol ol,
.article-content ul ul,
.article-content ul ol,
.article-content ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* 二级有序列表使用字母 */
.article-content ol ol {
    list-style-type: lower-alpha;
}

/* 三级有序列表使用罗马数字 */
.article-content ol ol ol {
    list-style-type: lower-roman;
}

/* 优化超链接样式 */
.article-content a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    transition: color 0.2s, border-color 0.2s;
}

.article-content a:hover {
    color: #2563eb;
    border-bottom-color: rgba(37, 99, 235, 0.6);
}

/* 暗色模式下的链接样式 */
.dark .article-content a {
    color: #60a5fa;
    border-bottom-color: rgba(96, 165, 250, 0.3);
}

.dark .article-content a:hover {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.6);
}

/* 禁止页面水平滚动 */
body {
    overflow-x: hidden;
}

/* 确保主容器不会水平滚动 */
.max-w-4xl {
    overflow-x: hidden;
}

/* 确保所有内容都在容器内，防止水平滚动 */
.article-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
    max-width: 100%;
}

/* 确保图片不会超出容器 */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 确保代码块不会超出容器 */
.article-content pre {
    overflow-x: hidden;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 确保表格不会超出容器 */
.article-content table {
    display: block;
    width: 100%;
    overflow-x: hidden;
    max-width: 100%;
    table-layout: fixed;
}

/* 确保表格单元格不会超出 */
.article-content td,
.article-content th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 0;
}

/* 确保所有块级元素不会超出容器 */
.article-content * {
    max-width: 100%;
    box-sizing: border-box;
}

/* 移动端面包屑导航优化 */
@media (max-width: 640px) {
    /* 面包屑导航在移动端的特殊处理 */
    .article-container nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .article-container nav > * {
        flex-shrink: 1;
    }
    
    /* 确保面包屑导航中的长标题能够正确换行 */
    .article-container nav span:last-child {
        word-break: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
    
    /* 文章内容在移动端的额外约束 */
    .article-content {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
    
    /* 确保所有内联元素也能正确换行 */
    .article-content * {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* 特别处理可能很长的URL和代码 */
    .article-content a,
    .article-content code,
    .article-content pre {
        word-break: break-all;
        overflow-wrap: break-word;
    }
    
    /* 确保表格在移动端能够水平滚动而不是撑开页面 */
    .article-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .article-content table td,
    .article-content table th {
        white-space: nowrap;
        padding: 0.5rem;
    }
}

/* 通用移动端优化 */
@media (max-width: 768px) {
    /* 确保所有容器都不会超出视口宽度 */
    .article-container,
    .article-container * {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* 防止任何元素导致水平滚动 */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* 确保主容器不会超出视口 */
    .max-w-4xl {
        max-width: 100vw;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
/* 侧边栏固定定位样式 */
@media (min-width: 1024px) {
    .sidebar-fixed {
        position: fixed;
        top: 0;
        right: calc((100vw - 1280px) / 2 + 1.5rem);
        width: calc(33.333333% - 1.5rem);
        max-height: 100vh;
        overflow-y: auto;
        z-index: 10;
        padding-top: 2rem;
    }
    
    /* 为固定侧边栏添加滚动条样式 */
    .sidebar-fixed::-webkit-scrollbar {
        width: 4px;
    }
    
    .sidebar-fixed::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .sidebar-fixed::-webkit-scrollbar-thumb {
        background: rgba(156, 163, 175, 0.3);
        border-radius: 2px;
    }
    
    .sidebar-fixed::-webkit-scrollbar-thumb:hover {
        background: rgba(156, 163, 175, 0.5);
    }
} 