body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 100%;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

h1 {
    color: #1a73e8;
    margin-bottom: 30px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.upload-section {
    text-align: left;
}

.custom-file-upload {
    display: inline-block;
    padding: 8px 16px;
    cursor: pointer;
    background-color: #34a853;
    color: white;
    border-radius: 5px;
    transition: background 0.3s;
}

.custom-file-upload:hover {
    background-color: #2d8e47;
}

#excel-input {
    display: none;
}

.hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.score-board {
    font-size: 24px;
    font-weight: bold;
    color: #d93025;
}

.game-area {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-top: 20px;
}

.box-container {
    flex: 1;
}

h2 {
    color: #5f6368;
    font-size: 18px;
    margin-bottom: 10px;
}

.char-box {
    min-height: 400px;
    border: 2px dashed #dadce0;
    border-radius: 10px;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    background-color: #fafafa;
}

.char-tile {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.char-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #1a73e8;
}

.char-tile.selected {
    background-color: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
    font-weight: bold;
}

.char-tile.correct {
    background-color: #ceead6;
    border-color: #34a853;
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

.message {
    margin-top: 20px;
    height: 24px;
    font-weight: bold;
}

.message.success {
    color: #34a853;
}

.message.error {
    color: #d93025;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: #1a73e8;
    font-size: 32px;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 18px;
    color: #5f6368;
    margin-bottom: 30px;
}

#modal-restart-btn {
    padding: 12px 30px;
    font-size: 18px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

#modal-restart-btn:hover {
    background-color: #1557b0;
}
