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

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: #0a0e27;
    background-image:
        linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        linear-gradient(225deg, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    color: #e2e8f0;
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部样式 */
header {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000; /* 确保头部在最顶层 */
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* 导航样式 */
nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

nav a:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

nav a.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* 语言切换按钮 */
.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.lang-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    transform: translateY(-2px);
}

.lang-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* 主要内容区域 */
main {
    padding: 2rem 0;
}

/* 部分标题样式 - 修复遮挡问题 */
section {
    margin: 3rem 0;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    position: relative;
    z-index: 10; /* 确保标题在新闻内容之上 */
    padding-top: 1rem; /* 额外顶部间距 */
}

/* 新闻列表样式 */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.news-item {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1; /* 确保新闻项在标题下方 */
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.news-content {
    padding: 1.5rem;
}

.news-category {
    display: inline-block;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: #3b82f6;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    text-decoration: none;
    display: block;
}

.news-title:hover {
    color: #3b82f6;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.news-source {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.news-time {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* 比赛列表样式 */
.matches-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.match-item {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.match-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.match-vs {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

.match-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.match-score {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.match-status {
    text-align: center;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-live {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-upcoming {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-finished {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.match-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* 积分榜样式 */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.standings-table th,
.standings-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.standings-table th {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.team-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.page-btn:hover:not(.disabled) {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    transform: translateY(-2px);
}

.page-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
    font-size: 1.2rem;
}

/* 底部样式 */
footer {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2rem 0;
    margin-top: 3rem;
}

footer .container {
    text-align: center;
    color: #94a3b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        width: 100%; /* 确保在移动端占满100%宽度 */
        align-items: stretch; /* 确保子元素拉伸以填充容器 */
    }

    nav {
        justify-content: center;
        width: 100%; /* 确保导航占满宽度 */
        flex-wrap: wrap;
    }

    .news-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .match-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .standings-table {
        font-size: 0.9rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.5rem;
    }
}

/* 电脑端额外样式 - 修复标题遮挡问题 */
@media (min-width: 769px) {
    main {
        padding: 3rem 0; /* 增加主内容区域的顶部间距 */
    }
    
    section {
        margin: 4rem 0; /* 增加章节间的间距 */
    }
    
    section h2 {
        padding-top: 1.5rem; /* 增加标题顶部间距 */
        margin-bottom: 2.5rem; /* 增加标题底部间距 */
    }
}

/* 适配大屏幕 */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
}

/* 栏目导航样式 */
#category-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

#category-nav::-webkit-scrollbar {
    height: 4px;
}

#category-nav::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

#category-nav a {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: #94a3b8;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

#category-nav a:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#category-nav a.active {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    #category-nav {
        padding-bottom: 1rem;
        gap: 0.4rem;
    }

    #category-nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}
