/* 全局样式 - 重置浏览器默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 网页背景图片设置 - 核心样式 */
body {
    background-image: url('1.jpg');       /* 背景图片路径，命名为bg.jpg */
    background-attachment: fixed;          /* 背景固定不随页面滚动 */
    background-repeat: no-repeat;           /* 背景不重复平铺 */
    background-position: center center;     /* 背景图居中显示 */
    background-size: cover;                 /* 背景图等比缩放覆盖整个视口 */
    background-color: #f0f8ff;              /* 备用背景色，图片加载失败时显示 */
    color: #333;
    line-height: 1.6;
}

/* 头部样式 - 半透明背景不遮挡图片 */
.header {
    text-align: center;
    padding: 80px 20px;
    background-color: rgba(255, 255, 255, 0.8); /* 白色半透明背景 */
    border-radius: 0 0 20px 20px;              /* 底部圆角 */
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); /* 文字阴影增强可读性 */
}

.header p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* 导航栏样式 - 固定定位+阴影 */
.nav {
    background-color: rgba(52, 152, 219, 0.95); /* 半透明蓝色导航栏 */
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 导航栏阴影 */
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s; /* 悬停过渡效果 */
}

.nav a:hover {
    background-color: rgba(41, 128, 185, 0.8);
}

.nav a:visited {
    color: #ecf0f1;
}

/* 主要内容区样式 - 卡片式布局 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.section {
    margin-bottom: 60px;
    background-color: rgba(255, 255, 255, 0.9); /* 白色半透明内容区 */
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* 内容区阴影 */
    backdrop-filter: blur(5px);                /* 背景模糊增强层次感 */
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
}

/* 关于我部分样式 - 图片与文字布局 */
.about-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap; /* 响应式布局，小屏幕自动换行 */
    justify-content: center;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #3498db;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); /* 图片立体阴影 */
    transition: transform 0.5s; /* 悬停旋转效果过渡 */
}

.avatar:hover {
    transform: rotate(2deg) scale(1.02);
}

.about-text {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
}

/* 技能网格布局 - 响应式卡片 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.skill-item {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3498db; /* 左侧彩色边框 */
}

.skill-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.skill-item h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* 兴趣爱好表格样式 - 强化边框和背景 */
.hobbies-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    border: 2px solid #3498db; /* 表格外边框加粗 */
    border-radius: 8px;        /* 表格圆角 */
    overflow: hidden;          /* 圆角边框生效 */
}

.hobbies-table, th, td {
    border: 1px solid #3498db; /* 统一边框颜色 */
}

th {
    background-color: #3498db; /* 表头背景色 */
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-top: 1px solid #3498db;
    transition: background-color 0.3s; /* 行悬停过渡 */
}

tr:nth-child(even) {
    background-color: #f0f8ff; /* 偶数行浅蓝背景 */
}

tr:hover {
    background-color: #e1f0fd; /* 鼠标悬停时背景色 */
}

caption {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: left;
}

/* 表单样式 - 交互优化 */
.contact-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.05rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s; /* 焦点效果过渡 */
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.submit-btn:hover {
    background-color: #27ae60;
    transform: translateY(-3px);
}

/* 页脚样式 - 深色半透明背景 */
.footer {
    text-align: center;
    padding: 40px 20px;
    background-color: rgba(44, 62, 80, 0.9); /* 深色半透明背景 */
    color: white;
    margin-top: 80px;
    border-radius: 20px 20px 0 0; /* 顶部圆角 */
}

.footer p {
    font-size: 1rem;
    opacity: 0.9;
}