
/*  通用样式  */
body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.7;
    color: #f0f0f0;
    background: linear-gradient(135deg, #03071e, #370617, #6a040f, #9d0208, #d00000, #dc2f02, #e85d04, #f48c06, #faa307, #ffba08);
    background-size: 400% 400%;
    animation: gradientAnimation 30s ease infinite;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 避免水平滚动条 */
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.6em; }

p {
    font-size: 1.1em;
    color: #ddd;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

a {
    color: #ffb703;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffd700;
}

/*  容器和布局  */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px;
}

.section {
    padding: 80px 0;
    text-align: center;
}

.section-title {
    margin-bottom: 60px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-items: center;
}

.grid-item {
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

/*  导航栏  */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #eee;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
}

/*  Hero 区  */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 0 30px;
    overflow: hidden; /* 确保视差效果不超出 */
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.gptkong.com/demo/sample1.png') center/cover no-repeat;
    opacity: 0.3;
    animation: parallax-bg 60s linear infinite; /*  长时间动画，制造缓慢视差感  */
}

@keyframes parallax-bg {
    0% { background-position: 50% 0; }
    100% { background-position: 50% -100%; } /*  缓慢向下移动，模拟视差  */
}


.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    text-shadow: 4px 4px 5px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.4em;
    color: #ddd;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
}

/*  特点区块  */
.features-section {
    background-color: rgba(0, 0, 0, 0.1);
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.feature-icon img {
    max-width: 60%;
    max-height: 60%;
    opacity: 0.8;
}

.feature-title {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.feature-description {
    color: #ccc;
}

/*  示例文章区块  */
.article-section {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 60px 30px;
    border-radius: 15px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.article-section h2, .article-section h3, .article-section h4, .article-section p, .article-section ul, .article-section ol, .article-section table, .article-section pre {
    color: #eee; /* 示例文章内容文字颜色 */
    text-align: left; /* 示例文章内容左对齐 */
}

.article-section h2 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.article-section h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-section p, .article-section ul, .article-section ol {
    margin-bottom: 15px;
}

.article-section ul, .article-section ol {
    padding-left: 25px;
}

.article-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
}

.article-section th, .article-section td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    text-align: left;
}

.article-section th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: bold;
}

.article-section pre {
    background-color: rgba(0, 0, 0, 0.4);
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto; /* 代码块超出时显示横向滚动条，但尽量避免内容过长 */
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap; /* 代码换行 */
    word-wrap: break-word; /* 代码断字换行 */
    position: relative; /*  为代码预览容器定位做准备 */
}

.article-section pre code {
    display: block; /*  确保代码块独占一行，方便pre的样式控制 */
    padding: 0; /*  去除code默认padding，统一由pre控制 */
}


/* 代码预览容器 */
.code-preview-container {
    margin-top: 20px;
    text-align: center;
}

.code-preview {
    display: inline-block;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #eee; /* 预览背景色 */
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.code-preview h4 {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.code-preview-box {
    width: 100px;
    height: 80px;
    background: linear-gradient(to bottom, #001f3f, #4582ec); /*  预览效果示例背景 */
    border-radius: 5px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}

.code-preview-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff4d00;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.code-preview-button:hover {
    background-color: #ff7a00;
}


/*  页脚  */
.footer {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 30px 0;
    text-align: center;
    color: #ccc;
    font-size: 0.9em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/*  响应式设计  */
@media screen and (max-width: 1024px) {
    .container {
        padding: 15px 20px;
    }
    .section {
        padding: 60px 0;
    }
    .hero-title {
        font-size: 3em;
    }
    .hero-subtitle {
        font-size: 1.2em;
    }
    .nav-links {
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 2.5em;
    }
    .hero-subtitle {
        font-size: 1em;
    }
    .nav-links {
        gap: 15px;
        font-size: 0.9em;
    }
    .grid-container {
        grid-template-columns: 1fr; /*  平板竖屏及更小屏幕，网格变为单列  */
    }
}

@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 2em;
    }
    .hero-subtitle {
        font-size: 0.9em;
    }
    .nav-links {
        gap: 10px;
        font-size: 0.8em;
    }
    .container {
        padding: 10px 15px;
    }
    .section {
        padding: 40px 0;
    }
}

@media screen and (max-width: 320px) {
    .hero-title {
        font-size: 1.8em;
    }
}

