body {
    margin: 0;
    font-family: Arial;
    background: #0d1117;
    color: #c9d1d9;
}

/* 顶部 */
header {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: #161b22;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #58a6ff;
}

nav a {
    color: #c9d1d9;
    margin-left: 20px;
    text-decoration: none;
}

nav a:hover {
    color: #58a6ff;
}

/* 首页大字 */
.hero {
    position: relative;
    height: 100vh;
    background: #0d1117;
    min-height: 300px;
}

@media (max-width: 600px) {
    .hero {
        height: 40vh;
    }
}

#heroCanvas {
        position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    text-align: center;
    color: white;

    z-index: 2;
}

/* 标题 */
.hero-overlay h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

/* 副标题 */
.hero-overlay p {
    font-size: 18px;
    color: #8b949e;
}

/* 按钮 */
.hero-overlay button {
    margin-top: 20px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #58a6ff;
    color: white;
    cursor: pointer;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100px;

    background: linear-gradient(to bottom, transparent, #0d1117);
}

/* 通用 section */

section {
    padding: 60px 40px;

    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*  ////// 卡片 //////*/
.card {
    background: #161b22;
    padding: 20px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 12px;
    transition: 0.3s;
    width: 75%;
    margin: auto;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px #58a6ff44;
}

.card a {
    color: #58a6ff;
    text-decoration: none;
}

.card a:hover {
    text-decoration: underline;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 30px rgba(88,166,255,0.2);
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: #0d1117;
    border-radius: 8px;
}

/* 内容区 */
.card-content {
    padding: 15px;
}

/* 按钮区 */
.card-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    
}


.card-buttons a {
    padding: 6px 12px;
    border-radius: 6px;
    background: #58a6ff;
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.card-buttons a:hover {
    background: #1f6feb;
}

/* #projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
} */

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    background: #161b22;
}



/* 项目页 */

/* 项目页整体 */
.project-page {
    max-width: 900px;
    margin: auto;
}

/* 头部 */
.project-hero {
    text-align: center;
    padding: 60px 20px;
}

.project-hero h1 {
    font-size: 40px;
    color: #58a6ff;
}

/* 按钮 */
.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #58a6ff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

.btn:hover {
    background: #1f6feb;
}

/* 图片 */
.project-img {
    width: 100%;
    border-radius: 10px;
    margin-top: 20px;
}

/* 段落 */
section {
    margin-bottom: 40px;
}

/* 代码块 */
pre {
    background: #0d1117;
    color: #c9d1d9;
    padding: 16px 20px;
    border-radius: 12px;
    overflow-x: auto;

    border: 1px solid #30363d;

    font-family: "Fira Code", "Consolas", monospace;
    font-size: 14px;
    line-height: 1.6;

    position: relative;
}

/* 左侧装饰条（重点） */
pre::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #58a6ff;
    border-radius: 12px 0 0 12px;
}

/* code本体 */
code {
    color: #c9d1d9;
}

pre::after {
    content: "C++"; /* 可以按需要改 */
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 12px;
    color: #8b949e;
}