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

:root {
    --bg-dark: #0f1011;
    --bg-card: #16181a;
    --text-main: #e6e8ea;
    --text-muted: #8a8f98;
    --primary: #7c3aed;
    --primary-hover: #9d5cf7;
    --border-color: #2a2d32;
    --header-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: rgba(15, 16, 17, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

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

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

/* 主体内容区通用内边距 */
main {
    padding: 3rem 0;
}

/* 通用卡片样式 */
.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 页脚 */
.footer {
    background-color: var(--bg-card);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: underline;
}

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

/* 文章列表特定样式 */
.article-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.article-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.excerpt {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* 项目展示特定样式 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.project-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* 代码高亮 */
pre {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #333;
}

code {
    font-family: "Fira Code", monospace;
    color: #d4d4d4;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* 简单处理，移动端可不做展开菜单 */
    }
    .project-grid {
        grid-template-columns: 1fr;
    }
}