/* 技术文档分享网站 - 主样式文件 */
/* 主色调：橙色，扁平化、简洁、偏技术感 */

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

:root {
    --primary-color: #ff6b35; /* 主色调橙色 */
    --primary-dark: #e55a2b;
    --primary-light: #ff8e63;
    --secondary-color: #2c3e50;
    --secondary-light: #34495e;
    --light-gray: #f5f7fa;
    --medium-gray: #e1e5eb;
    --dark-gray: #7f8c8d;
    --text-color: #333333;
    --text-light: #5d6d7e;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础排版 */
body {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

/* 段落 */
p {
    margin-bottom: 1.2rem;
}

/* 链接 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* 头部样式 */
.site-header {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    background-color: var(--primary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.site-nav a {
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.site-nav a:hover {
    text-decoration: none;
    color: var(--primary-light);
}

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

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

/* 主内容区 */
main {
    padding: 2rem 0;
    min-height: 70vh;
}

/* 分类入口 */
.category-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background-color: var(--primary-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--medium-gray);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.category-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 文章列表 */
.articles-section {
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.article-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--medium-gray);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.article-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.article-content h3 a {
    color: var(--secondary-color);
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--dark-gray);
    border-top: 1px solid var(--medium-gray);
    padding-top: 0.75rem;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 2rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--medium-gray);
}

.breadcrumb ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--dark-gray);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .current {
    color: var(--primary-color);
    font-weight: 500;
}

/* 文章内容 */
.article-content-full {
    line-height: 1.7;
}

.article-content-full h2 {
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--medium-gray);
}

.article-content-full h3 {
    margin-top: 2rem;
}

.article-content-full p {
    margin-bottom: 1.5rem;
}

.article-content-full ul, .article-content-full ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content-full li {
    margin-bottom: 0.5rem;
}

/* 相关文章 */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--medium-gray);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    color: var(--text-color);
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    text-decoration: none;
}

.pagination .current {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    font-weight: 500;
}

/* 页脚 */
.site-footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-description {
    color: var(--medium-gray);
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--medium-gray);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.copyright {
    color: var(--dark-gray);
    font-size: 0.9rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--secondary-light);
    width: 100%;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .site-nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}