/* css/style.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #34495e;
    --light-bg: #f8f9fa;
    --gradient-blue: linear-gradient(135deg, #3498db, #2c3e50);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Helvetica Neue', Arial, 'PingFang SC', sans-serif;
    color: var(--text-color);
    line-height: 1.8;
    background-color: var(--light-bg);
}

/* 头部样式 */
.site-header {
    background: var(--gradient-blue);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.logo {
    font-size: 2rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    justify-content: center;
    list-style: none;
    padding: 1rem 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color var(--transition-speed);
}

.main-nav a.active,
.main-nav a:hover {
    background-color: rgba(255,255,255,0.15);
}

/* 文章卡片 */
.article-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed);
}

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

/* 元信息样式 */
.meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9em;
    color: #666;
}

.category {
    padding: 0.3rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.85em;
    text-transform: uppercase;
}

.category.ai { background: var(--accent-color); }
.category.cloud { background: var(--secondary-color); }

/* 页脚样式 */
.site-footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    color: #fff;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: opacity var(--transition-speed);
}

.social-links a:hover {
    opacity: 0.8;
}

/* 专题页头部 */
.category-header {
    padding: 6rem 2rem;
    text-align: center;
    background-size: cover;
    background-position: center;
    margin-top: -1rem; /* 消除头部间隙 */
}

.category-header.ai {
    background-image: linear-gradient(rgba(231, 76, 60, 0.85), rgba(231, 76, 60, 0.85)),
                      url('../images/ai-bg.jpg');
}

.category-header.cloud {
    background-image: linear-gradient(rgba(52, 152, 219, 0.85), rgba(52, 152, 219, 0.85)),
                      url('../images/cloud-bg.jpg');
}

/* 作者简介 */
.author-profile {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    margin: 2rem 0;
}

.author-profile img {
    width: 100%;
    border-radius: 50%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

@media (max-width: 480px) {
    .article-card {
        padding: 1.5rem;
    }

    .meta-info {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }
}

/* 新增组件 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-speed);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Consolas', monospace;
}

.timeline {
    border-left: 3px solid var(--secondary-color);
    padding-left: 2rem;
    margin: 2rem 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 0.3rem;
    width: 1.2rem;
    height: 1.2rem;
    background: var(--secondary-color);
    border-radius: 50%;
}
/* 在原有CSS基础上添加/修改以下内容 */

/* ====================
   全局链接样式
   ==================== */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 特殊链接类型 */
/* 导航链接 */
.main-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width var(--transition-speed);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* 文章内链 */
.article-content a {
    color: var(--accent-color);
    border-bottom: 1px dotted currentColor;
}

.article-content a:hover {
    border-bottom-style: solid;
}

/* 标签链接 */
.tag a {
    display: inline-block;
    padding: 0.3em 0.8em;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 1em;
    margin: 0.2em;
}

.tag a:hover {
    background: rgba(52, 152, 219, 0.2);
    text-decoration: none;
}

/* ====================
   页脚深度优化
   ==================== */
.site-footer {
    background: var(--primary-color);
    color: rgba(255,255,255,0.8);
    border-top: 4px solid var(--secondary-color);
}

.footer-section {
    padding: 1.5rem;
    position: relative;
}

.footer-section::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 70%;
    background: rgba(255,255,255,0.1);
}

.footer-section:last-child::after {
    display: none;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.2rem;
}

.footer-section li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.9em;
}

/* 社交媒体图标优化 */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all var(--transition-speed);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .footer-section::after {
        display: none;
    }

    .footer-section {
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .footer-section:last-child {
        border-bottom: none;
    }

    .footer-section li {
        padding-left: 0;
    }

    .footer-section li::before {
        display: none;
    }
}