/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a1a, #1a1a3a, #0a0a1a);
    color: #fff;
    overflow-x: hidden;
}

/* 跳过导航链接 */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ff7e5f;
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff7e5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #feb47b;
    font-size: 1.2rem;
}

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

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Logo区域 */
.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0 30px;
}

.railway-logo {
    width: 500px;
    height: 357px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px #a24f49);
    animation: fourColorSmooth 20s ease-in-out infinite;
}

/* 四色平滑交替发光动画 */
@keyframes fourColorSmooth {
    0% {
        filter: drop-shadow(0 0 15px #a24f49);
    }
    20% {
        filter: drop-shadow(0 0 25px #a24f49);
    }
    25% {
        filter: drop-shadow(0 0 15px #a24f49);
    }
    26% {
        filter: drop-shadow(0 0 15px #377a4d);
    }
    45% {
        filter: drop-shadow(0 0 25px #377a4d);
    }
    50% {
        filter: drop-shadow(0 0 15px #377a4d);
    }
    51% {
        filter: drop-shadow(0 0 15px #4f76da);
    }
    70% {
        filter: drop-shadow(0 0 25px #4f76da);
    }
    75% {
        filter: drop-shadow(0 0 15px #4f76da);
    }
    76% {
        filter: drop-shadow(0 0 15px #feb47b);
    }
    95% {
        filter: drop-shadow(0 0 25px #feb47b);
    }
    100% {
        filter: drop-shadow(0 0 15px #feb47b);
    }
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(255, 126, 95, 0.3);
}

.subtitle {
    font-size: 1.3rem;
    max-width: 800px;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* 最新文章 */
.recent-articles {
    max-width: 1000px;
    margin: 40px 0;
    width: 100%;
}

.section-heading {
    font-size: 2rem;
    color: #feb47b;
    margin-bottom: 30px;
    text-align: left;
    width: 100%;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.article-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    transition: all 0.3s ease;
}

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

.article-card h3 {
    margin-bottom: 10px;
}

.article-card a {
    color: #feb47b;
    text-decoration: none;
    font-size: 1.2rem;
}

.article-card a:hover {
    text-decoration: underline;
}

.article-card time {
    color: #aaa;
    font-size: 0.9rem;
}

/* 粒子效果显示区域 */
.particles-display {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-name {
    font-size: 2.2rem;
    font-weight: 600;
    margin-top: 30px;
    padding: 15px 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* 站点介绍 */
.site-info {
    max-width: 800px;
    margin-top: 40px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-info h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #feb47b;
}

.site-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* 栏目入口 */
.sections {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
    max-width: 1000px;
}

.section-item {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.section-item:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.section-item h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #feb47b;
}

.section-item p {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.8;
}

/* 面包屑导航 */
.breadcrumb {
    max-width: 1000px;
    width: 100%;
    margin-top: 40px;
    text-align: left;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    margin-right: 10px;
}

.breadcrumb li:not(:last-child):after {
    content: ">";
    margin-left: 10px;
    color: #aaa;
}

.breadcrumb a {
    color: #feb47b;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 126, 95, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
    color: white;
    font-size: 1.5rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: rgba(255, 126, 95, 1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 126, 95, 0.4);
}

/* 页脚 */
.footer {
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    font-size: 1rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #feb47b;
}

.contact {
    font-size: 0.9rem;
    opacity: 0.6;
}

.contact a {
    color: #ccc;
    text-decoration: none;
}

.contact a:hover {
    color: #feb47b;
}

/* 辅助类 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .particles-display {
        height: 250px;
    }
    
    .theme-name {
        font-size: 1.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .section-item {
        min-width: 100%;
    }
    
    .railway-logo {
        width: 400px;
        height: 286px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-info {
        padding: 20px;
    }
    
    .site-info h2 {
        font-size: 1.5rem;
    }
    
    .particles-display {
        height: 200px;
    }
    
    .railway-logo {
        width: 300px;
        height: 214px;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .railway-logo {
        width: 250px;
        height: 179px;
    }
}