
/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #0F172A, #1E293B);
    color: #E2E8F0;
    overflow-x: hidden;
    position: relative;
}

/* 动态粒子云 */
.particle-system {
    position: absolute;
    width: 100%;
    height: 200px;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    background: transparent;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #8B5CF6;
    border-radius: 50%;
    opacity: 0.7;
    animation: float 15s linear infinite;
}

@keyframes float {
    from {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
    to {
        transform: translateY(-500px) translateX(200px);
        opacity: 0;
    }
}

/* 左侧导航栏 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100%;
    background: #1E293B;
    padding-top: 60px;
    z-index: 2;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin: 20px 0;
}

.sidebar nav ul li a {
    color: #E2E8F0;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 20px;
    display: block;
    transition: background 0.3s, color 0.3s;
}

.sidebar nav ul li a:hover {
    background: #8B5CF6;
    color: #ffffff;
    border-radius: 4px;
}

/* 主要内容区域 */
.main-content {
    margin-left: 220px;
    padding: 60px 40px 40px 40px;
    background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.95));
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    color: #8B5CF6;
    margin-bottom: 20px;
    text-align: center;
}

.main-content h3, .main-content h4 {
    color: #8B5CF6;
    margin-top: 30px;
    margin-bottom: 15px;
}

.main-content p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.main-content pre {
    background: #1E293B;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.main-content code {
    color: #8B5CF6;
    font-family: 'Courier New', Courier, monospace;
}

.main-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.main-content table, th, td {
    border: 1px solid #8B5CF6;
}

.main-content th, td {
    padding: 10px;
    text-align: left;
}

.main-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.main-content img {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 10px 0;
}

/* 悬浮卡片 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.card {
    background: #1E293B;
    border-radius: 12px;
    padding: 20px;
    width: calc(33.333% - 20px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

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

.card img {
    width: 100%;
    border-radius: 8px;
}

.card h4 {
    margin: 15px 0 10px 0;
    color: #8B5CF6;
}

.card p {
    font-size: 14px;
    line-height: 1.4;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #8B5CF6;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.button:hover {
    animation: rippleEffect 0.6s forwards;
}

@keyframes rippleEffect {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    100% {
        box-shadow: 0 0 20px 20px rgba(255, 255, 255, 0);
    }
}

/* 动态进度条 */
.progress-bar {
    width: 100%;
    background: #374151;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-inner {
    height: 10px;
    width: 0;
    background: #8B5CF6;
    animation: loadProgress 3s forwards;
}

@keyframes loadProgress {
    to {
        width: 100%;
    }
}

/* 响应式设计 */
@media (max-width: 1440px) {
    .card {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 1200px) {
    .card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 180px;
    }
    .main-content {
        margin-left: 180px;
        padding: 60px 20px 20px 20px;
    }
    .card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 150px;
    }
    .main-content {
        margin-left: 150px;
        padding: 50px 15px 15px 15px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 40px 10px 10px 10px;
    }
    .card {
        width: 100%;
    }
}

@media (max-width: 320px) {
    .main-content h2 {
        font-size: 1.8em;
    }
    .sidebar nav ul li a {
        font-size: 16px;
    }
}

/* 提示信息 */
.reference-note {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(139, 92, 246, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

/* 视差滚动 */
.parallax {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

/* 短代码预览效果 */
.code-preview {
    background: #1E293B;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-preview code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    color: #8B5CF6;
}

/* 图标动画 */
.icon {
    transition: transform 0.3s, opacity 0.3s;
}

.icon:hover {
    transform: rotate(15deg) scale(1.1);
    opacity: 0.9;
}

