
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 线性渐变背景 */
    color: #333;
    overflow-x: hidden; /* 禁止横向滚动 */
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(30, 60, 114, 0.9); /* 半透明背景 */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */
}

nav a {
    color: #fff;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #ff6600; /* 悬停时颜色变化 */
}

/* 头部英雄区 */
.hero {
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 60, 114, 0.5); /* 半透明覆盖层 */
}

.hero-text {
    color: #fff;
    font-size: 48px;
    opacity: 0;
    animation: fadeIn 2s forwards; /* 渐现动画 */
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 内容区域样式 */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 自动适应的网格布局 */
    gap: 20px;
    padding: 60px 40px;
    background-color: #f5f5f5; /* 浅灰背景 */
    color: #333;
}

.section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* 卡片阴影效果 */
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.section:hover {
    transform: translateY(-10px); /* 悬停时轻微上移 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.section img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 图片阴影 */
    transition: transform 0.3s;
}

.section img:hover {
    transform: scale(1.05); /* 悬停时放大 */
}

/* 按钮样式 */
.btn {
    background-color: #ff6600; /* 亮橙色背景 */
    border: none;
    padding: 15px 30px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    border-radius: 4px;
}

.btn:hover {
    background-color: #e65c00; /* 悬停时颜色变化 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 代码块样式 */
pre {
    background-color: #2a5298; /* 深蓝背景 */
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    overflow: visible; /* 防止::before样式被遮挡 */
    position: relative;
}

pre::before {
    content: 'CSS3 代码示例';
    position: absolute;
    top: -20px;
    left: 0;
    background: #ff6600;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #2a5298;
    color: #fff;
}

td pre {
    margin: 0;
}

/* 底部样式 */
footer {
    background-color: #2a5298;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    flex-wrap: wrap;
}

.footer-section {
    margin: 10px 0;
}

.footer-section a {
    color: #ff6600;
    margin-right: 15px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #e65c00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .hero {
        height: 60vh;
    }
    
    .footer-section {
        width: 100%;
        text-align: center;
    }
}

