/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景设置 */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('BG.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: slideDown 0.6s ease-out;
}

.logo h1 {
    color: #1a73e8;
    font-size: 2rem;
    margin-left: 20px;
}

.nav ul {
    display: flex;
    list-style: none;
    margin-right: 20px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #1a73e8;
    background-color: rgba(26, 115, 232, 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1a73e8;
    transition: width 0.3s ease;
}

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

/* 主内容区域 */
.main-content {
    flex: 1;
    animation: fadeIn 0.8s ease-out;
}

.section {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    animation: slideUp 0.6s ease-out;
}

.section.active {
    display: block;
    animation: slideUp 0.6s ease-out;
}

/* 英雄区域 */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.1), rgba(26, 115, 232, 0.05));
    border-radius: 10px;
    animation: fadeIn 1s ease-out;
}

.hero h2 {
    color: #1a73e8;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    color: #555;
}

/* 文章卡片 */
.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.post-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eaeaea;
    animation: slideUp 0.5s ease-out;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(26, 115, 232, 0.2);
}

.post-header {
    margin-bottom: 15px;
}

.post-title {
    color: #1a73e8;
    font-size: 1.5rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.post-card:hover .post-title {
    color: #0d5cb6;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.post-category {
    background: #e3f2fd;
    color: #1a73e8;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
}



.post-excerpt p {
    color: #555;
    line-height: 1.7;
}

.read-more-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
}

.read-more-btn:hover {
    background: #0d5cb6;
    transform: scale(1.05);
}

/* 关于页面 */
.about-content, .contact-content {
    line-height: 1.8;
    color: #555;
    padding: 20px 0;
}

.about-content p, .contact-content p {
    margin-bottom: 15px;
}

.contact-content ul {
    margin-top: 15px;
    padding-left: 20px;
}

.contact-content li {
    margin-bottom: 10px;
}





/* 文章查看器 */
.post-viewer {
    position: relative;
}

.post-content {
    padding-top: 40px;
}

.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.back-btn:hover {
    background: #0d5cb6;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Markdown内容样式 */
.markdown-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.markdown-content h1 {
    font-size: 2.2rem;
    color: #1a73e8;
    margin-top: 1.2em;
    margin-bottom: 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #eaeaea;
    position: relative;
}

.markdown-content h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: #1a73e8;
}

.markdown-content h2 {
    font-size: 1.8rem;
    color: #2563eb;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #eee;
}

.markdown-content h3 {
    font-size: 1.4rem;
    color: #3b82f6;
    margin-top: 1.3em;
    margin-bottom: 0.7em;
}

.markdown-content h4 {
    font-size: 1.2rem;
    color: #4f46e5;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

.markdown-content p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.markdown-content a {
    color: #1a73e8;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.markdown-content a:hover {
    color: #0d5cb6;
    border-bottom: 1px solid #1a73e8;
}

.markdown-content ul, .markdown-content ol {
    margin: 1.2em 0;
    padding-left: 2em;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.5em;
    position: relative;
}

.markdown-content li::marker {
    color: #1a73e8;
}

.markdown-content blockquote {
    border-left: 5px solid #1a73e8;
    padding: 15px 20px;
    margin: 20px 0;
    background: linear-gradient(to right, #f0f7ff, #f8fbff);
    color: #555;
    font-style: italic;
    position: relative;
    border-radius: 0 8px 8px 0;
}

.markdown-content blockquote::before {
    content: """;
    font-size: 4em;
    position: absolute;
    top: -10px;
    left: 10px;
    color: rgba(26, 115, 232, 0.1);
    font-family: Georgia, serif;
}

.markdown-content blockquote p {
    margin-bottom: 0;
    padding-left: 20px;
}

.markdown-content strong {
    color: #1a73e8;
    font-weight: 600;
}

.markdown-content em {
    color: #d63384;
    font-style: italic;
}

.markdown-content code {
    background: #f8fafc;
    padding: 3px 7px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: #b91c1c; /* 深红色，更深更清晰 */
    font-size: 0.9em;
    border: 1px solid #e2e8f0;
}

.markdown-content pre {
    background: #f1f5f9;
    padding: 45px 20px 20px 20px; /* 增加顶部填充，为复制按钮和标签留出空间 */
    border-radius: 10px;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #0f172a; /* 深黑色，比之前更深 */
    font-size: 0.95em;
    line-height: 1.6;
}

.markdown-content pre::before {
    content: 'Code';
    position: absolute;
    top: 8px;
    left: 15px;
    background: #1a73e8;
    color: white;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

/* 复制按钮样式 */
.copy-button {
    position: absolute;
    top: 8px;
    right: 10px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
    z-index: 10;
}

.copy-button:hover {
    background: #cbd5e1;
    color: #334155;
}

.copy-button.copied {
    background: #10b981;
    color: white;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.markdown-content table, .markdown-content th, .markdown-content td {
    border: 1px solid #e2e8f0;
}

.markdown-content th {
    background: linear-gradient(to bottom, #2563eb, #1d4ed8);
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
}

.markdown-content td {
    padding: 12px;
}

.markdown-content tr:nth-child(even) {
    background-color: #f8fafc;
}

.markdown-content tr:hover {
    background-color: #f1f5f9;
}

.markdown-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.markdown-content hr {
    height: 1px;
    border: 0;
    background: linear-gradient(to right, transparent, #d1d5db, transparent);
    margin: 30px 0;
}

.markdown-content details {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.markdown-content summary {
    font-weight: 600;
    cursor: pointer;
    padding: 5px;
    color: #1a73e8;
}

.markdown-content summary::marker {
    color: #1a73e8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .nav ul {
        margin: 20px 0;
        justify-content: center;
    }
    
    .logo h1 {
        margin: 0 0 10px 0;
    }
    
    .posts-container {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .post-card {
        padding: 20px;
    }
}