
/* 全局样式重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设定主色调与配色方案 */
:root {
    --main-color: #2c3e50; /* 深蓝色，作为主色 */
    --secondary-color: #3498db; /* 蓝色，增强层次感 */
    --accent-color: #e67e22; /* 橙色，作为点缀色 */
    --background-color: #ecf0f1; /* 淡灰色，作为背景色 */
    --text-color: #2c3e50; /* 文字主色 */
    --light-bg: rgba(255, 255, 255, 0.2); /* 磨砂玻璃背景色 */
}

/* 设置页面背景，采用冷色系渐变 */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--main-color), var(--secondary-color));
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

/* 磨砂玻璃效果 */
.frosted-glass {
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    transition: backdrop-filter 0.3s ease-in-out;
}

.frosted-glass:hover {
    backdrop-filter: blur(15px);
}

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

/* 文章内容样式 */
article {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

h2, h3, h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #34495e;
}

/* 代码块样式 */
pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    position: relative;
}

pre::before {
    content: "代码示例";
    position: absolute;
    top: -20px;
    left: 10px;
    background: var(--main-color);
    color: #ecf0f1;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 图片样式与悬停效果 */
img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

.navbar a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--accent-color);
}

/* 多层次下拉菜单 */
.menu-item {
    position: relative;
    list-style: none;
}

.dropdown {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.menu-item:hover .dropdown {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.dropdown a {
    padding: 10px 20px;
    display: block;
    color: #2c3e50;
    text-decoration: none;
}

.dropdown a:hover {
    background: #ecf0f1;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮样式 */
.button {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.button:hover {
    transform: scale(1.1);
    background: #d35400;
}

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

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

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .menu-item {
        width: 100%;
        text-align: center;
    }
    .case-card {
        flex: 1 1 100%;
    }
}

