/* 自定义动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-slide-up {
    animation: slideUp 1s ease-out 0.3s both;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* 文章卡片悬停效果 */
.article-card {
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
}

/* 文本截断 */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    min-height: 48px;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
}

/* 渐变背景效果 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 增强的Markdown样式 */
.prose {
    line-height: 1.7;
    color: #374151;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose ul li {
    list-style-type: disc;
}

.prose ol li {
    list-style-type: decimal;
}

.prose blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
    background: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
}

.prose a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: #2563eb;
}

.prose strong {
    font-weight: 600;
    color: #111827;
}

.prose em {
    font-style: italic;
}

.prose hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

.prose tr:nth-child(even) {
    background-color: #f9fafb;
}

/* 代码块样式 */
.prose pre {
    background: #1f2937;
    border-radius: 0.5rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #374151;
}

.prose code {
    background: #e5e7eb;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prose pre code {
    background: transparent;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.95em;
    line-height: 1.5;
}

/* 语法高亮颜色 */
.prose pre code .keyword { color: #ff79c6; font-weight: 600; }
.prose pre code .string { color: #f1fa8c; }
.prose pre code .comment { color: #6272a4; font-style: italic; }
.prose pre code .function { color: #50fa7b; }
.prose pre code .number { color: #bd93f9; }
.prose pre code .class { color: #8be9fd; }
.prose pre code .operator { color: #ff79c6; }
.prose pre code .punctuation { color: #f8f8f2; }
.prose pre code .property { color: #f1fa8c; }
.prose pre code .tag { color: #ff79c6; }
.prose pre code .attr-name { color: #50fa7b; }
.prose pre code .attr-value { color: #f1fa8c; }

/* 图片样式 */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 任务列表 */
.prose input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .prose table {
        font-size: 0.875rem;
    }
    
    .prose th, .prose td {
        padding: 0.5rem;
    }
}

/* 星空背景样式 */
.stars-background {
    position: relative;
    /* background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%); */
    background: url('/static/images/default.png') center center / cover no-repeat; 
    transform: translate3d(0px, 0px, 0px);
    min-height: 100vh;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 5s infinite ease-in-out;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.star:hover {
    transform: scale(2);
    background: #ffd700;
    box-shadow: 0 0 15px #ffd700;
    z-index: 10;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 3s infinite ease-in-out;
}

/* 画廊容器 */
.gallery-container {
    position: relative;
    padding: 2rem 0;
    /* margin-bottom: 2rem; */
    overflow: hidden;
    min-height: 280px; /* 固定最小高度，避免内容变化导致页面跳动 */
}

/* 文章画廊布局 */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 3rem;
    margin-bottom: 1rem;
    min-height: 280px; /* 确保有足够的高度容纳内容 */
    transition: all 0.55s cubic-bezier(0.4, 0, 0.2, 1); /* 更平滑的过渡效果 */
    position: relative;
    will-change: transform, opacity; /* 性能优化 */
}

.article-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-height: 240px !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.no-articles {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        grid-column: 1 / -1;
        padding: 3rem;
        text-align: center;
        background-color: rgba(249, 250, 251, 0.8);
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

.no-articles svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #9CA3AF;
}

.no-articles h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-articles p {
    color: #6B7280;
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.5;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* 保留旧的横向滚动样式，以防需要 */
.article-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 3rem 1.5rem 3rem 1.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 0rem;
}

.article-scroll-container::-webkit-scrollbar {
    display: none;
}

.article-card-horizontal {
    flex: 0 0 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.article-card-horizontal:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* 画廊导航箭头 */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    transition: all 0.3s ease;
    color: #1f2937;
    font-size: 1.2rem;
}

.gallery-nav:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.gallery-nav-left {
    left: 15px;
}

.gallery-nav-right {
    right: 15px;
}

/* 页码指示器 */
.gallery-pagination {
    position: absolute;
    bottom: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    font-size: 0.9rem;
}

/* 加载动画 */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
    color: #6b7280;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-left-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 文章卡片淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.article-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    animation-fill-mode: both;
}

/* 页面切换动画 */
.gallery-fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 加载状态指示器 */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeInOut 1.5s ease;
    opacity: 0;
    pointer-events: none;
}

.loading-indicator .spinner {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* 保留旧的分页导航样式，以防需要 */
.pagination-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 9999px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.pagination-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.pagination-button.disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination-button.disabled:hover {
    transform: none;
}

.pagination-info {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 9999px;
    font-weight: 500;
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-gallery {
        grid-template-columns: 1fr;
    }
}

/* 文章列表区域间距调整 */
.articles-section {
    padding-bottom: 3rem !important;
}

/* 微信风格文章容器 - 增强兼容性 */
.wechat-article {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin: 20px 0;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

/* 确保Markdown样式在微信容器内正常工作 */
.wechat-article .prose {
    all: unset;
}

.wechat-article h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 16px;
    color: #000;
    border-bottom: none;
}

.wechat-article h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 14px;
    color: #000;
}

.wechat-article h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 12px;
    color: #000;
}

.wechat-article p {
    margin-bottom: 16px;
    text-align: justify;
}

.wechat-article ul, .wechat-article ol {
    margin: 16px 0;
    padding-left: 24px;
}

.wechat-article li {
    margin-bottom: 8px;
}

.wechat-article blockquote {
    background: #f8f9fa;
    border-left: 4px solid #07c160;
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 4px;
    color: #666;
}

.wechat-article code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.wechat-article pre {
    background: #1f2937;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    border: 1px solid #374151;
}

.wechat-article pre code {
    background: transparent;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.95em;
    line-height: 1.5;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 微信风格代码语法高亮 */
.wechat-article pre code .keyword { color: #ff79c6; font-weight: 600; }
.wechat-article pre code .string { color: #f1fa8c; }
.wechat-article pre code .comment { color: #6272a4; font-style: italic; }
.wechat-article pre code .function { color: #50fa7b; }
.wechat-article pre code .number { color: #bd93f9; }
.wechat-article pre code .class { color: #8be9fd; }
.wechat-article pre code .operator { color: #ff79c6; }
.wechat-article pre code .punctuation { color: #f8f8f2; }
.wechat-article pre code .property { color: #f1fa8c; }
.wechat-article pre code .tag { color: #ff79c6; }
.wechat-article pre code .attr-name { color: #50fa7b; }
.wechat-article pre code .attr-value { color: #f1fa8c; }

.wechat-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.wechat-article th, .wechat-article td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.wechat-article th {
    background: #f8f9fa;
    font-weight: 600;
}

.wechat-article img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

.wechat-article a {
    color: #576b95;
    text-decoration: none;
}

.wechat-article a:hover {
    text-decoration: underline;
}

.wechat-article hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 24px 0;
}