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

/* 颜色变量 */
:root {
    --neon-purple: #8A2BE2;
    --electric-blue: #00faff;
    --dark-bg: #1e003c;
    --bright-orange: #ff8c00;
    --white: #ffffff;
    --light-gray: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --transition-speed: 0.3s;
}

/* 全局样式 */
body {
    font-family: 'Roboto Mono', monospace;
    background: linear-gradient(135deg, var(--dark-bg), var(--electric-blue));
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}

/* 头部 */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 0, 60, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

header .logo {
    font-size: 1.5rem;
    color: var(--electric-blue);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    transition: color var(--transition-speed);
}

nav ul li a:hover {
    color: var(--electric-blue);
}

/* 主内容 */
main {
    margin-top: 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

section {
    background: rgba(30, 0, 60, 0.6);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

section h2, section h3 {
    color: var(--electric-blue);
    margin-bottom: 10px;
}

section p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--white);
}

pre {
    background: #2b2b2b;
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
}

code {
    color: #f8f8f2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* 动态3D立方体 */
.cube-container {
    width: 200px;
    height: 200px;
    perspective: 1000px;
    margin: 0 auto 20px auto;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: spin 10s infinite linear;
}

.cube .side {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: var(--neon-purple);
    opacity: 0.9;
    border: 2px solid var(--electric-blue);
}

.cube .front  { transform: rotateY(  0deg) translateZ(100px); }
.cube .back   { transform: rotateY(180deg) translateZ(100px); }
.cube .right  { transform: rotateY( 90deg) translateZ(100px); }
.cube .left   { transform: rotateY(-90deg) translateZ(100px); }
.cube .top    { transform: rotateX( 90deg) translateZ(100px); }
.cube .bottom { transform: rotateX(-90deg) translateZ(100px); }

@keyframes spin {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to   { transform: rotateX(360deg) rotateY(360deg); }
}

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

.card {
    background: var(--dark-bg);
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.card-content h4 {
    margin-bottom: 10px;
    color: var(--electric-blue);
}

.card-content p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 按钮样式 */
.button {
    background: var(--electric-blue);
    color: var(--dark-bg);
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all var(--transition-speed);
}

.button:hover {
    background: var(--bright-orange);
    transform: scale(1.1);
}

/* 示例展示 */
.example-section {
    background: rgba(30, 0, 60, 0.7);
    padding: 20px;
    border-radius: 10px;
}

.example-section h2 {
    color: var(--bright-orange);
    margin-bottom: 15px;
}

.example-section article {
    background: #2b2b2b;
    padding: 15px;
    border-radius: 5px;
}

.example-section img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 5px;
    margin: 10px 0;
}

/* 图标样式 */
.icon {
    width: 50px;
    height: 50px;
    background: var(--electric-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: all var(--transition-speed);
}

.icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

/* 关闭链接属性说明 */
a {
    text-decoration: none;
    color: var(--electric-blue);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--bright-orange);
}

/* 响应式设计 */
@media (max-width: 1440px) {
    .container {
        max-width: 1024px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    header .logo {
        font-size: 1.2rem;
    }

    nav ul li a {
        font-size: 0.9rem;
    }

    .button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 10px;
    }

    .card img {
        height: 120px;
    }

    .button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 提示信息 */
.reference-note {
    text-align: center;
    font-size: 1rem;
    color: var(--bright-orange);
    margin-top: 20px;
}

