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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 顶部样式 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    flex-shrink: 0;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background-color: #ffd700;
    color: #1e3c72;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255,215,0,0.4);
}

.tournament-info {
    flex: 1;
    margin-left: 1.5rem;
}

.tournament-info h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.tournament-info p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Tab导航样式 */
.tab-nav {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.tab-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.tab-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    min-width: max-content; /* Ensure all tabs are visible */
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #2a5298;
    background-color: rgba(42,82,152,0.05);
}

.tab-btn.active {
    color: #2a5298;
    border-bottom-color: #2a5298;
    font-weight: bold;
}

/* 内容区域 */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 刷新按钮样式 */
.refresh-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.refresh-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0,123,255,0.3);
}

.tab-content {
    display: none;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #2a5298;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

/* 赛事规则样式 */
.rules-content h3 {
    color: #1e3c72;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.rules-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.rules-content li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* 比赛结果样式 */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.match {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.match:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    min-width: 0;
}

/* 胜者和败者的颜色 */
.team.winner {
    background-color: rgba(255,215,0,0.2); /* 淡金色 */
    border: 2px solid rgba(255,215,0,0.5);
    box-shadow: 0 0 15px rgba(255,215,0,0.2);
}

.team.loser {
    background-color: rgba(128,128,128,0.1); /* 淡灰色 */
    border: 2px solid rgba(128,128,128,0.3);
}

/* 未出结果的比赛 */
.team.pending {
    background-color: rgba(34,139,34,0.2); /* 墨绿色 */
    border: 2px solid rgba(34,139,34,0.5);
}

.team.winner::after {
    content: '🏆';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.player {
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 20px;
    margin: 0.3rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.player:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.vs {
    text-align: center;
    font-weight: bold;
    color: #666;
    font-size: 1.2rem;
    position: relative;
}

.result {
    text-align: center;
    margin-top: 0.5rem;
}

.win {
    background-color: #28a745;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(40,167,69,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40,167,69,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(40,167,69,0); }
    100% { box-shadow: 0 0 0 0 rgba(40,167,69,0); }
}

@keyframes fadeIn {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* 响应式设计 */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .tournament-info {
        margin-left: 0;
    }

    .tournament-info h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .tab-content h2 {
        font-size: 1.5rem;
    }

    .team {
        padding: 0.8rem;
    }

    .player {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .vs {
        font-size: 1rem;
        white-space: nowrap;
    }
}

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

    .tournament-info h1 {
        font-size: 1.3rem;
    }

    .tab-nav {
        padding: 0 0.5rem;
    }

    .tab-btn {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .rules-content h3 {
        font-size: 1.2rem;
    }

    .match {
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .team {
        padding: 0.6rem;
    }

    .player {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }

    .vs {
        font-size: 0.9rem;
        width: 20px;
    }

    .result {
        font-size: 0.85rem;
    }
}