
/* 重置默认样式，确保一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局字体和背景色，使用科技感强的蓝色系作为主色调 */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: linear-gradient(135deg, #1E3C72, #2A5298);
    color: #333;
    padding: 20px;
}

/* 容器设置，采用响应式网格布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式，包含显著提示信息 */
.header {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header::before {
    content: "这是一个网页样式设计参考";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF9800;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 标题样式 */
h2, h3, h4 {
    color: #2A5298;
    margin-bottom: 15px;
}

h2 {
    font-size: 24px;
    border-bottom: 2px solid #FF9800;
    padding-bottom: 10px;
}

h3 {
    font-size: 20px;
    margin-top: 25px;
}

h4 {
    font-size: 18px;
    margin-top: 20px;
}

/* 段落样式 */
p {
    margin-bottom: 20px;
    text-indent: 2em;
}

/* 代码块样式，与正文区分 */
pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    margin-bottom: 20px;
    position: relative;
}

pre code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    color: #2A5298;
}

/* 代码块标题样式 */
pre code::before {
    content: "CSS3 示例代码";
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

/* 图片样式，圆角、阴影和悬停效果 */
img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 按钮样式，采用径向渐变和过渡效果 */
.button {
    background: radial-gradient(circle, #FF9800, #F44336);
    border: none;
    color: white;
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: radial-gradient(circle, #4CAF50, #2E7D32);
    transform: translateY(-3px);
}

/* 卡片组件样式 */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 模态框样式 */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* 动画关键帧 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* 加载动画样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2A5298;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: rotate 1s linear infinite;
    margin: 100px auto;
}

/* 导航栏样式 */
nav {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #FF9800;
}

/* 响应式设计，确保在不同设备上的适配 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 10px 0;
    }
}

/* 折叠区域样式 */
.collapsible {
    background-color: #2A5298;
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: #FF9800;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 5px;
}

.content.show {
    display: block;
}

