* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    color: #ffce65;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.2em;
    color: #666;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background-color: #333;
    max-width: 800px;
    margin: 0 auto 50px auto;
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.grid-item {
    background-color: white;
    padding: 10px;
    text-align: center;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grid-item:hover {
    background-color: #f0f0f0;
}

.grid-item .title {
    font-weight: bold;
    font-size: 0.8em;
    color: #333;
    margin-bottom: 3px;
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding-bottom: 25px;
}

.grid-item img {
    max-width: 100%;
    max-height: 200px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.grid-item .live-title {
    font-size: 0.85em;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    width: 100%;
    padding: 0 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.modal h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffce65;
}

.search-container {
    margin-bottom: 20px;
    text-align: center;
}

.search-container input {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    border-color: #ffce65;
    box-shadow: 0 0 0 2px rgba(255, 206, 101, 0.2);
}

.live-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(80vh - 150px);
}

.live-item {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.live-item:hover {
    border-color: #ffce65;
    box-shadow: 0 2px 8px rgba(233,30,99,0.1);
    transform: translateY(-2px);
}

.live-item img {
    max-width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 5px;
}

.live-item .title {
    font-size: 0.8em;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 37px;
    margin-bottom: 3px;
}

.live-item .live-date {
    font-size: 0.7em;
    color: #666;
    text-align: center;
    margin-top: 2px;
}

.controls {
    text-align: center;
    margin-top: 10px;
}

.btn {
    background-color: #ffce65;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #fcbc31;
}



@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(5, 1fr);
        font-size: 0.75em;
    }
    
    .grid-item {
        min-height: 120px;
        padding: 8px;
    }
    
    .grid-item .live-title {
        -webkit-line-clamp: 2;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .live-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}