
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用无衬线体字体，提高可读性 */
    background: linear-gradient(135deg, #4A90E2, #9013FE); /* 渐变背景，传达科技感 */
    color: #333; /* 统一的文本颜色，保持内容的清晰度 */
    line-height: 1.6; /* 行高设置，提升文本的可读性 */
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部，始终可见 */
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8); /* 半透明背景，增强层次感 */
    backdrop-filter: blur(10px); /* 模糊背景，提高视觉效果 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影，增加深度感 */
    z-index: 1000; /* 保证导航栏在最上层 */
    transition: background 0.3s ease; /* 背景过渡效果 */
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 1); /* 滚动后背景变为完全不透明 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); /* 阴影加深，增强视觉效果 */
}

/* 导航链接样式 */
.navbar a {
    color: #000;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: transform 0.2s ease, color 0.2s ease; /* 悬停时平滑过渡效果 */
}

.navbar a:hover {
    transform: scale(1.1); /* 放大效果 */
    color: #6B73FF; /* 颜色变化，突出交互效果 */
}

/* 主视觉区域样式 */
.main-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 50px; /* 内边距，确保内容不被遮挡 */
    background: rgba(255, 255, 255, 0.3); /* 半透明背景，增强层次感 */
    background: linear-gradient(-45deg, #6B73FF, #000DFF, #00FDC1, #FF6BAA); /* 多色渐变背景 */
    background-size: 400% 400%; /* 背景大小，配合动画 */
    animation: gradientAnimation 15s ease infinite; /* 动态渐变动画 */
    border-radius: 10px; /* 圆角效果，提升视觉美感 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 阴影效果，增加深度 */
}

/* 渐变动画关键帧 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 卡片式设计样式 */
.card {
    background: #ffffff; /* 卡片背景为白色，突出内容 */
    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); /* 阴影加深，提升视觉效果 */
}

/* 按钮样式 */
.btn {
    background: #6B73FF; /* 按钮背景色 */
    color: #fff; /* 按钮文本颜色 */
    padding: 10px 20px; /* 内边距 */
    border: none; /* 去除边框 */
    border-radius: 5px; /* 圆角效果 */
    cursor: pointer; /* 鼠标指针为手形 */
    transition: background 0.3s ease, transform 0.3s ease; /* 悬停时的过渡效果 */
}

.btn:hover {
    background: #000DFF; /* 背景色变化 */
    transform: translateY(-3px); /* 向上移动 */
}

/* 主标题与副标题样式 */
h1, h2, h3, h4 {
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，增强科技感 */
    color: #000DFF; /* 标题颜色 */
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 文章内容样式 */
article {
    max-width: 1200px; /* 最大宽度，确保内容不拥挤 */
    margin: 0 auto; /* 居中对齐 */
    padding: 100px 20px 50px 20px; /* 内边距，避免与导航栏重叠 */
    background: rgba(255, 255, 255, 0.8); /* 半透明背景 */
    border-radius: 10px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 阴影效果，增加深度感 */
}

/* 段落样式 */
article p {
    font-size: 16px; /* 正文字号 */
    color: #333;
    margin-bottom: 20px;
}

/* 代码块样式 */
pre {
    background: #f5f5f5; /* 代码块背景色 */
    padding: 15px;
    border-radius: 5px;
    overflow: auto; /* 溢出处理 */
    margin-bottom: 20px;
}

code {
    font-family: 'Courier New', Courier, monospace; /* 使用等宽字体 */
    color: #d63384; /* 代码字体颜色 */
    position: relative;
}

code::before {
    content: "CSS3 示例代码"; /* 添加标题 */
    position: absolute;
    top: -1.5em;
    left: 0;
    font-size: 14px;
    color: #555;
}

/* 图片样式 */
img.decorative {
    border-radius: 10px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 悬停时的过渡效果 */
}

img.decorative:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* 阴影加深 */
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-visual {
        flex-direction: column;
        padding: 80px 20px;
    }

    .main-visual img {
        max-width: 100%;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 20px;
    }

    .navbar a {
        margin: 0 10px;
        font-size: 14px;
    }

    article {
        padding: 80px 10px 40px 10px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .navbar a {
        margin: 0 5px;
        font-size: 12px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    article {
        padding: 60px 5px 30px 5px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1rem;
    }
}

/* 提示文字样式 */
.alert-text {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFEB3B;
    color: #333;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    font-size: 16px;
}

/* 按钮折叠区域样式 */
.collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapse.show {
    max-height: 1000px; /* 足够大的值以容纳展开内容 */
}

/* 激活的折叠区域 */
.collapse.show {
    padding: 20px;
}

/* 点缀色彩应用 */
.highlight {
    color: #FF6B6B; /* 亮橙色，用于吸引注意力 */
    font-weight: bold;
}

/* 分隔线样式 */
.separator {
    height: 2px;
    background: linear-gradient(90deg, #6B73FF, #000DFF);
    border: none;
    margin: 40px 0;
}

/* 过渡效果 */
.transition-all {
    transition: all 0.3s ease;
}

/* 图片容器 */
.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.image-container img {
    width: 320px;
    height: 320px;
    object-fit: cover;
}

/* 视觉引导区样式 */
.visual-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease forwards;
}

/* 渐隐上升动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 链接样式 */
a {
    color: #6B73FF;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #000DFF;
}

/* 折叠按钮样式 */
.toggle-button {
    background: none;
    border: none;
    color: #6B73FF;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: color 0.3s ease;
}

.toggle-button:hover {
    color: #000DFF;
}

/* 信息层次清晰 */
.section {
    margin-bottom: 60px;
}

.section h2 {
    border-bottom: 2px solid #6B73FF;
    padding-bottom: 10px;
}

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

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

table th {
    background: #6B73FF;
    color: #fff;
}

table tr:nth-child(even) {
    background: #f9f9f9;
}

/* 优化布局 */
.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 20px;
}

/* 列占位 */
.col-4 {
    grid-column: span 4;
}

.col-6 {
    grid-column: span 6;
}

.col-12 {
    grid-column: span 12;
}

/* 流式布局 */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 文本阴影 */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 阴影效果 */
.shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 按钮渐变 */
.btn-gradient {
    background: linear-gradient(45deg, #6B73FF, #000DFF);
    color: #fff;
}

/* 按钮悬停渐变变化 */
.btn-gradient:hover {
    background: linear-gradient(45deg, #000DFF, #6B73FF);
}

/* 隐藏内容 */
.hidden {
    display: none;
}

/* 展示内容 */
.visible {
    display: block;
}

/* 滚动动画 */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 列表样式 */
ul.custom-list {
    list-style: none;
    padding: 0;
}

ul.custom-list li {
    background: url('bullet.png') no-repeat left center;
    padding-left: 25px;
    margin-bottom: 10px;
}

/* 高级选择器 */
article p:nth-child(odd) {
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 5px;
}

/* 标注样式 */
mark {
    background: #FFEB3B;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 表单隐藏 */
form {
    display: none;
}

/* 图表容器样式 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 图表绘制样式 */
.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* 互动工具样式 */
.tool {
    background: #6B73FF;
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.tool:hover {
    background: #000DFF;
}

/* 用户定制内容样式 */
.user-content {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
}

/* 实时数据展示区 */
.data-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 数据卡片样式 */
.data-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.data-card .number {
    font-size: 2.5rem;
    color: #000DFF;
    margin-bottom: 10px;
}

.data-card .label {
    font-size: 1rem;
    color: #666;
}

/* 黄金比例色彩搭配 */
.primary-color {
    color: #4A90E2; /* 主色调 */
}

.secondary-color {
    color: #6B73FF; /* 辅助色 */
}

.accent-color {
    color: #FF6B6B; /* 点缀色 */
}

/* 背景渐变 */
.background-gradient {
    background: linear-gradient(135deg, #4A90E2 70%, #6B73FF 25%, #FF6B6B 5%);
}

/* 阴影与层次 */
.layered {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 放大与缩小 */
.zoom {
    transition: transform 0.3s ease;
}

.zoom:hover {
    transform: scale(1.05);
}

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

/* 确保pre code溢出可见 */
pre code {
    overflow: visible;
}

/* 表格响应式 */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    table tr {
        margin-bottom: 15px;
    }

    table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        font-weight: bold;
        text-align: left;
    }
}

/* 隐藏文本输入框及相关元素 */
input, textarea, button.submit {
    display: none;
}

