/* --- 全局变量 --- */
:root {
    --bg-color: #1a1a1a;
    --primary-color: #2c2c2c;
    --secondary-color: #444;
    --font-color: #e0e0e0;
    --accent-color: #00bfff; /* DeepSkyBlue */
    --card-bg-color: #252525;
}

/* --- 基本样式重置与设定 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    line-height: 1.6;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../images/hero-bg.jpg') no-repeat center center/cover;
    background-attachment: fixed;
}

h1, h2, h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #fff;
}

ul {
    list-style: none;
}

section {
    padding: 60px 20px;
    max-width: 960px;
    margin: 0 auto;
    border-bottom: 1px solid var(--secondary-color);
    background-color: rgba(26, 26, 26, 0.5); /* 为内容板块添加半透明背景色 */
    scroll-margin-top: 60px; /* 滚动定位时为顶部固定的导航栏留出空间 */
}

section:last-of-type {
    border-bottom: none;
}

/* --- 导航栏 --- */
header {
    background-color: rgba(44, 44, 44, 0.75); /* 设置半透明背景 */
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--secondary-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

/* --- 主体内容 --- */
main {
    padding-top: 60px; /* 为固定的导航栏留出空间 */
}

/* --- 欢迎区 --- */
#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    position: relative; /* 为绝对定位的子元素提供参考 */
    background-color: transparent; /* 使欢迎区背景透明以显示body的背景图 */
    border-bottom: none; /* 取消欢迎区下方的边框 */
}

.hero-overlay-image {
    position: absolute;
    bottom: 20%; /* 距离底部20% */
    left: 50%;
    transform: translateX(-50%);
    width: 100px; /* 设置一个合适的宽度 */
    height: auto;
    opacity: 0.3; /* 轻微透明，更好地融入背景 */
    border-radius: 4px;
}

#hero h1 {
    font-size: 3rem;
}

#hero p {
    font-size: 1.2rem;
}

/* --- 项目展示 --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(37, 37, 37, 0.75); /* 项目卡片使用更高的不透明度 */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.2);
}

.card .tech {
    font-size: 0.9em;
    color: #ccc;
    margin: 10px 0;
}

.card .links a {
    margin-right: 10px;
}

/* --- 技能栈 --- */
.skills-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.skill-category {
    margin: 10px;
}

.skill-category ul li {
    background-color: var(--primary-color);
    padding: 5px 15px;
    margin: 5px 0;
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
}


/* --- 页脚 --- */
footer {
    text-align: center;
    padding: 20px;
    background-color: rgba(44, 44, 44, 0.75); /* 设置半透明背景 */
    border-top: 1px solid var(--secondary-color);
}
