body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f8ff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    overflow: auto;
}

.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.game-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
    min-width: 0;
}

.info-section {
    width: 280px;
    background-color: #fff;
    border-left: 2px solid #27ae60;
    padding: 15px;
    overflow-y: auto;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    text-align: center;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: bold;
    padding: 0 5px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    grid-auto-rows: minmax(140px, auto);
    gap: 6px;
    padding: 5px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    min-height: 400px;
}

.card {
    width: 100%;
    height: 140px;
    position: relative;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: bold;
    padding: 4px;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    background-color: white;
    border: 1px solid #ddd;
    color: #333;
    user-select: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* 选中状态 */
.card.selected {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
    transform: scale(1.05);
    z-index: 10;
}

/* 错误配对状态 */
.card.incorrect {
    animation: shake 0.5s;
    border-color: #e74c3c;
    background-color: #fadbd8;
}

/* 匹配成功消失 */
.card.matched {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.card.food {
    background-color: #e8f5e9;
    border-color: #81c784;
    color: #2e7d32;
}

.card.disease {
    background-color: #ffebee;
    border-color: #e57373;
    color: #c62828;
}

.card-image {
    font-size: 36px;
    margin-bottom: 8px;
}

.card-type {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: normal;
}

.card-content {
    font-size: 14px;
    line-height: 1.2;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
    align-self: center;
}

button:hover {
    background-color: #2980b9;
}

.info-panel {
    background-color: #f8f9fa;
    border: 1px solid #27ae60;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.info-panel h3 {
    color: #27ae60;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
}

.info-panel p {
    color: #555;
    line-height: 1.4;
    margin: 0;
    font-size: 0.9rem;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    /* 不再强制列数，使用 auto-fill */
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .info-section {
        width: 100%;
        border-left: none;
        border-top: 2px solid #27ae60;
        max-height: 200px;
    }
    
    .game-section {
        min-height: 70vh;
    }
}

@media (max-width: 768px) {
    .game-board {
        gap: 6px;
    }
    
    .card {
        height: 120px;
    }
    
    .card-image {
        font-size: 28px;
    }
    
    .card-content {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .game-board {
        gap: 4px;
        /* 在非常小的屏幕上允许更小的列宽以容纳更多列，或者保持原样 */
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .card {
        height: 110px;
    }
    
    .card-image {
        font-size: 24px;
    }
    
    .card-content {
        font-size: 11px;
    }
}