/* 现代化浅蓝色主题 - 带背景图片 */
:root {
    --primary-blue: #4a86e8;
    --light-blue: #e6f0ff;
    --medium-blue: #a0c1f9;
    --dark-blue: #2c5aa0;
    --accent-blue: #6aa2f8;
    --gradient-blue: linear-gradient(135deg, #4a86e8 0%, #6aa2f8 100%);
    --text-color: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #f9fbfe;
    --card-bg: rgba(255, 255, 255, 0.66);
    --glass-bg: rgba(255, 255, 255, 0.64);
    --shadow-sm: 0 4px 12px rgba(74, 134, 232, 0.08);
    --shadow-md: 0 8px 24px rgba(74, 134, 232, 0.12);
    --shadow-lg: 0 15px 35px rgba(74, 134, 232, 0.18);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --image-radius: 12px;
    --image-shadow: 0 4px 20px rgba(74, 134, 232, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
}

/* 背景图片样式 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/static/images/service/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
    filter: brightness(0.95) contrast(0.95);
}

/* 背景遮罩层 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(249, 251, 254, 0.68) 0%, rgba(230, 240, 255, 0.84) 100%);
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 玻璃形态效果头部 */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 1.2rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    transition: var(--transition);
    letter-spacing: -0.5px;
}

.logo a:hover {
    color: var(--dark-blue);
    transform: translateY(-1px);
}

.logo a::before {
    content: '✨';
    margin-right: 10px;
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 1.8rem;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav a:hover {
    color: var(--primary-blue);
    background: rgba(74, 134, 232, 0.08);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: var(--transition);
}

.nav a:hover::after {
    width: 70%;
}

/* 主要内容区域 */
main {
    padding: 3rem 0;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin: 2rem 0 4rem;
    background: var(--glass-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(74, 134, 232, 0.05) 10%, transparent 70%);
    z-index: -1;
}

.hero h2 {
    color: var(--dark-blue);
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color);
    opacity: 0.9;
    font-weight: 400;
}

/* 文章卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.post-card {
    background: var(--card-bg);
    padding: 2.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-blue);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.post-card h3 {
    margin-bottom: 1rem;
    color: var(--dark-blue);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.post-card h3 a:hover {
    color: var(--primary-blue);
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--light-blue);
    color: var(--primary-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: var(--transition);
    font-weight: 500;
}

.tag:hover {
    background-color: var(--primary-blue);
    color: white;
    cursor: pointer;
    transform: translateY(-1px);
}

.post-card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    align-self: flex-start;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--dark-blue);
    transform: translateX(5px);
}

.read-more::after {
    content: '→';
    margin-left: 5px;
    transition: var(--transition);
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* 文章详情页 */
.post-detail {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.post-header {
    margin-bottom: 2.5rem;
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(74, 134, 232, 0.1);
}

.post-header h1 {
    color: var(--dark-blue);
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content h2, .post-content h3, .post-content h4 {
    margin: 2rem 0 1.2rem;
    color: var(--dark-blue);
    position: relative;
    padding-left: 1.2rem;
}

.post-content h2::before, .post-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 80%;
    background: var(--primary-blue);
    border-radius: 3px;
}

.post-content p {
    margin-bottom: 1.5rem;
}

/* 修改后的代码块样式  */
.post-content pre {
    background: rgba(255, 255, 255, 0.25);
    /* backdrop-filter: blur(5px); */
    color: var(--text-color);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--transition);
}

.post-content pre:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-content code {
    background: rgba(74, 134, 232, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--primary-blue);
    font-weight: 500;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-blue);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: rgba(74, 134, 232, 0.03);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #555;
    position: relative;
}

.post-content blockquote::before {
    content: '"';
    position: absolute;
    top: 0;
    left: 10px;
    font-size: 3rem;
    color: rgba(74, 134, 232, 0.1);
    line-height: 1;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-blue);
    color: white;
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn:hover::before {
    left: 100%;
}

.post-navigation {
    text-align: center;
    margin: 3rem 0;
}

.cta-section {
    text-align: center;
    margin: 4rem 0;
}

/* 页脚样式 */
.footer {
    background: var(--gradient-blue);
    color: white;
    padding: 3.5rem 0 2.5rem;
    margin-top: 5rem;
    text-align: center;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.footer p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.empty-state p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* 文章内容图片样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: var(--image-radius);
    box-shadow: var(--image-shadow);
    border: 1px solid rgba(74, 134, 232, 0.1);
    transition: var(--transition);
}

/* 图片悬停效果 */
.post-content img:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 134, 232, 0.25);
}

/* 小图片居中显示 */
.post-content img[width*="100"],
.post-content img[width*="200"],
.post-content img[width*="300"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 图片标题样式 */
.post-content img + em {
    display: block;
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
}

/* 响应式图片处理 */
@media (max-width: 768px) {
    .post-content img {
        margin: 1.5rem auto;
        border-radius: 8px;
    }

    .post-content img:hover {
        transform: none; /* 移动端取消悬停动画 */
    }
}

/* 确保代码块中的图片不受影响 */
.post-content pre img {
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

/* 图片容器溢出保护 */
.post-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
}

/* 为超大图片添加滚动条 */
.post-content img {
    max-width: 100%;
    height: auto;
}

/* 如果图片是链接，保持样式一致 */
.post-content a img {
    border: 2px solid transparent;
    transition: var(--transition);
}

.post-content a:hover img {
    border-color: var(--primary-blue);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .post-detail {
        padding: 2rem;
    }

    .post-header h1 {
        font-size: 2.2rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 15px;
    }

    .hero {
        padding: 2.5rem 1.5rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .post-card {
        padding: 1.8rem;
    }

    .post-detail {
        padding: 1.5rem;
    }

    .post-header h1 {
        font-size: 1.8rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.post-card, .post-detail {
    animation: fadeInUp 0.6s ease-out;
}

.hero {
    animation: fadeIn 0.8s ease-out;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* 代码块包装容器 */
.code-block-wrapper {
    position: relative;
    margin: 2rem 0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(74, 134, 232, 0.1);
    overflow: hidden;
}

/* 代码头部样式 - 与代码块一体化 */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(74, 134, 232, 0.08);
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid rgba(74, 134, 232, 0.1);
    margin: 0;
}

.code-language {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(74, 134, 232, 0.2);
    color: var(--primary-blue);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(5px);
}

.copy-code-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 134, 232, 0.3);
}

.copy-code-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
}

/* 调整代码块样式以适应新的包装器 */
.post-content pre {
    margin: 0;
    border-radius: 0;
    border: none;
    background: rgba(255, 255, 255, 0.25);
}

.post-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* 确保原有的代码块在没有包装器时仍然有样式 */
.post-content pre:not(.codehilite) {
    border-radius: 12px;
    margin: 2rem 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .code-header {
        padding: 0.6rem 1rem;
    }

    .copy-code-btn {
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
    }
}

/* 代码高亮块的特定样式 */
.codehilite {
    position: relative;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 0 0 12px 12px;
}

/* 确保代码块在包装器内正确显示 */
.code-block-wrapper .codehilite {
    border-radius: 0;
}