
/* 
整体页面样式配置
====================================
此样式表采用现代Web技术，包括Flexbox和Grid布局，确保页面在各种设备上具有良好的响应性。
主色调为深蓝色，辅以灰色和亮橙色，营造科技感与专业性。通过线性渐变、阴影效果和关键帧动画，提升页面的视觉层次和互动体验。
*/

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1;
    line-height: 1.6;
    transition: background 0.5s ease;
}

/* 头部导航栏样式 */
header {
    background: rgba(44, 62, 80, 0.9);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #e67e22;
}

nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #e67e22;
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* 主要内容区域样式 */
.main-content {
    padding: 100px 20px 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: #f1c40f;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    text-align: center;
}

h2 {
    font-size: 2em;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.8em;
    margin-top: 40px;
}

h4 {
    font-size: 1.6em;
    margin-top: 30px;
}

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

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #e67e22, #f1c40f);
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background: linear-gradient(45deg, #d35400, #f39c12);
    transform: scale(1.05);
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 代码块样式 */
pre code {
    background: #2c3e50;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    display: block;
    font-family: 'Courier New', Courier, monospace;
    color: #ecf0f1;
    margin-bottom: 20px;
    position: relative;
}

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

/* 文章区块样式 */
.article-section {
    margin-bottom: 50px;
}

.article-section:nth-child(even) {
    background: rgba(52, 73, 94, 0.8);
    padding: 20px;
    border-radius: 10px;
}

.article-section:nth-child(odd) {
    background: rgba(44, 62, 80, 0.6);
    padding: 20px;
    border-radius: 10px;
}

/* 按需折叠区域样式 */
.collapsible {
    background-color: #34495e;
    color: #ecf0f1;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: #3d566e;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: #2c3e50;
    border-radius: 0 0 5px 5px;
    margin-bottom: 20px;
}

.content p {
    margin: 10px 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }
    nav a {
        margin: 10px 0;
    }
    .main-content {
        padding: 120px 10px 30px 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.8em;
    }
    h3 {
        font-size: 1.6em;
    }
    h4 {
        font-size: 1.4em;
    }
    p {
        font-size: 14px;
    }
    .button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

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

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 图标样式 */
.icon-line {
    stroke: #ecf0f1;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.3s ease;
}

.icon-line:hover {
    stroke: #e67e22;
}

/* 数据可视化仪表盘样式 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.chart {
    background: #2c3e50;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #f1c40f;
}

/* 个性化推荐样式 */
.recommendation {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
}

.recommendation-item {
    flex: 0 0 80%;
    margin-right: 20px;
    background: #34495e;
    border-radius: 10px;
    scroll-snap-align: center;
    transition: transform 0.3s ease;
}

.recommendation-item:hover {
    transform: scale(1.05);
}

/* 统一图标样式 */
.icon {
    width: 50px;
    height: 50px;
    transition: transform 0.3s ease, fill 0.3s ease;
}

.icon:hover {
    transform: scale(1.2);
    fill: #e67e22;
}

