* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1d428a 0%, #c9082a 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1d428a 0%, #c9082a 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 30px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #1d428a;
}

.btn-refresh {
    padding: 12px 24px;
    background: #1d428a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-refresh:hover {
    background: #152f63;
}

.tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 24px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #1d428a;
    color: #1d428a;
}

.tab-btn.active {
    background: #1d428a;
    color: white;
    border-color: #1d428a;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1d428a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.table-container {
    padding: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9fa;
}

td {
    padding: 15px;
    color: #212529;
}

.rank {
    font-weight: 700;
    color: #1d428a;
    font-size: 1.2em;
}

.team-name {
    font-weight: 600;
}

.conference-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.conference-east {
    background: #d4edda;
    color: #155724;
}

.conference-west {
    background: #fff3cd;
    color: #856404;
}

.win-pct {
    font-weight: 600;
    color: #28a745;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}

/* 可点击样式 */
.team-row {
    cursor: pointer;
}

.team-name.clickable {
    color: #1d428a;
    position: relative;
}

.team-name.clickable:hover {
    text-decoration: underline;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { 
        transform: translateY(50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #1d428a 0%, #c9082a 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-text {
    flex: 1;
}

.header-text h2 {
    margin: 0 0 5px 0;
    font-size: 1.8em;
}

.team-abbr-text {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 2px;
}

.close-btn {
    font-size: 2em;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.close-btn:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

.team-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.info-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
}

.info-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #1d428a;
}

.section-title {
    font-size: 1.3em;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.mini-loading {
    text-align: center;
    padding: 40px 20px;
}

.mini-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1d428a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 20px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s;
}

.game-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-card.completed {
    border-left-color: #28a745;
}

.game-card.upcoming {
    border-left-color: #ffc107;
}

.game-date {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 8px;
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.team-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.team-line.current-team {
    font-weight: 700;
    color: #1d428a;
}

.team-abbr {
    min-width: 50px;
}

.team-score {
    font-size: 1.3em;
    font-weight: 700;
    min-width: 40px;
}

.vs-divider {
    padding: 0 15px;
    color: #6c757d;
    font-weight: 600;
}

.win-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.game-status {
    font-size: 0.85em;
    text-align: right;
}

.status-final {
    color: #28a745;
    font-weight: 600;
}

.status-scheduled {
    color: #ffc107;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 1.1em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .hide-mobile {
        display: none;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
    
    /* 弹窗响应式 */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header-content {
        gap: 15px;
    }
    
    .team-logo {
        width: 60px;
        height: 60px;
    }
    
    .header-text h2 {
        font-size: 1.3em;
    }
    
    .team-abbr-text {
        font-size: 0.9em;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .team-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .game-matchup {
        flex-direction: column;
        gap: 5px;
    }
    
    .team-line {
        justify-content: space-between;
        width: 100%;
    }
    
    .vs-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    .controls {
        padding: 15px;
    }
    
    th, td {
        padding: 8px 5px;
        font-size: 0.85em;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .info-value {
        font-size: 1.2em;
    }
}
