
/* 页面整体样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 主色调渐变背景 */
    color: #ffffff;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明背景 */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.navbar.scrolled {
    background-color: #000000; /* 滚动后变为纯色 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #6EEB83; /* 点缀色 */
}

/* 主要内容容器 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
    padding: 100px 50px; /* 顶部留白以避免导航栏覆盖 */
}

/* 侧边栏样式 */
.sidebar {
    background-color: rgba(14, 47, 68, 0.8);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.sidebar img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.sidebar img:hover {
    transform: scale(1.05);
}

.sidebar h2 {
    font-size: 20px;
    margin-top: 20px;
    color: #6EEB83; /* 辅色 */
}

/* 内容区样式 */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 30px;
}

.content article {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px); /* 玻璃效果 */
}

.content h2, .content h3, .content h4 {
    color: #34C759; /* 辅色 */
}

.content p {
    font-size: 16px;
    color: #ffffff;
}

.content pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    overflow: auto;
    margin-top: 15px;
}

.content code {
    color: #6EEB83; /* 点缀色 */
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
.content img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 微交互效果 */
button, .btn-primary {
    background: linear-gradient(45deg, #34C759, #6EEB83);
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.5s ease, transform 0.3s ease;
}

button:hover, .btn-primary:hover {
    background: #6EEB83;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(50, 200, 150, 0.6);
}

/* 代码块样式 */
.code-block {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    overflow: visible;
    position: relative;
}

.code-block::before {
    content: 'CSS3 代码示例';
    position: absolute;
    top: -20px;
    left: 10px;
    background: #34C759;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

pre code {
    overflow: visible; /* 防止before遮挡 */
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr 2fr;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px;
    }

    .sidebar {
        display: none;
    }

    .content {
        grid-template-columns: 1fr;
    }
}

/* 视觉引导区 */
.hero {
    width: 100%;
    height: 300px;
    background: url('https://images.gptkong.com/demo/sample1.png') center center / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 50px;
}

.hero::after {
    content: '这是一个网页样式设计参考';
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    color: #ffffff;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 案例展示卡片 */
.case-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.case-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.case-card .card-content {
    padding: 20px;
}

.case-card .card-content h3 {
    margin-top: 0;
    color: #34C759;
}

.case-card .card-content p {
    color: #ffffff;
}

/* 点缀性装饰元素 */
.decorative-line {
    height: 4px;
    background: linear-gradient(90deg, #34C759, #6EEB83);
    margin: 20px 0;
    border-radius: 2px;
}


