
/* 颜色变量定义 */
:root {
    --primary-color: #2c3e50; /* 主色调 深蓝 */
    --secondary-color: #8e44ad; /* 辅色 调和紫 */
    --accent-color: #e67e22; /* 点缀色 橙色 */
    --highlight-color: #27ae60; /* 点缀色 绿色 */
    --background-color: #1a1a1a; /* 背景色 深灰 */
    --text-color: #ecf0f1; /* 文字颜色 浅灰 */
    --border-color: #34495e; /* 边框颜色 蓝灰 */
}

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.9);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

.navbar a {
    color: var(--text-color);
    margin: 0 15px;
    text-decoration: none;
    position: relative;
    font-size: 16px;
}

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.navbar a:hover::after {
    width: 100%;
}

/* 主要内容区域 */
.main-content {
    padding-top: 80px; /* 留出导航栏高度 */
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

/* 文章样式 */
article {
    background: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 40px;
}

article h2, article h3, article h4 {
    color: var(--highlight-color);
    margin-top: 20px;
}

article p {
    font-size: 16px;
    margin: 15px 0;
}

article pre {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

article code {
    color: #1abc9c;
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    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.5);
}

/* 卡片式设计 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 视差段落 */
.parallax-section {
    position: relative;
    height: 100vh;
    background-image: url('https://images.gptkong.com/demo/sample1.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-align: center;
}

.parallax-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 10px;
    transition: transform 0.5s ease;
}

.parallax-section:hover .parallax-content {
    transform: scale(1.05);
}

/* 动效图标 */
.icon {
    width: 50px;
    height: 50px;
    background-image: url('https://images.gptkong.com/demo/sample2.png');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.icon:hover {
    transform: rotate(20deg) scale(1.2);
    filter: brightness(1.2);
}

/* 加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOut 1s ease forwards;
    animation-delay: 3s;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(236, 240, 241, 0.3);
    border-top: 6px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* 背景与透视效果 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2c3e50, #8e44ad);
    transform: perspective(1000px) rotateY(10deg);
    transition: transform 0.5s ease;
}

.background:hover {
    transform: perspective(1000px) rotateY(0deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 20px;
    }
    .navbar a {
        margin: 0 10px;
        font-size: 14px;
    }
    .card-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .parallax-section {
        height: 60vh;
    }
    .chart {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar a {
        margin: 5px 0;
        font-size: 12px;
    }
    .card-container {
        grid-template-columns: 1fr;
    }
    .button {
        width: 100%;
        padding: 15px;
        font-size: 1em;
    }
    .icon {
        width: 40px;
        height: 40px;
    }
}

