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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #c0c0c0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    overflow: auto;
}

.container {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 15px;
    text-align: center;
    max-width: 90%;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #000;
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: none;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
    flex-wrap: wrap;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.label {
    font-weight: bold;
    color: #555;
}

#mine-count, #timer {
    background: #000;
    color: #ff0000;
    padding: 2px 8px;
    border: 1px inset #c0c0c0;
    font-weight: bold;
    min-width: 40px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.restart-btn {
    background: #c0c0c0;
    color: #000;
    border: 2px outset #c0c0c0;
    padding: 4px 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    font-family: 'Noto Sans SC', sans-serif;
}

.restart-btn:hover {
    background: #d0d0d0;
}

.restart-btn:active {
    border: 2px inset #c0c0c0;
}

.game-status {
    margin: 10px 0;
    font-weight: bold;
    font-size: 1.1rem;
    background: #c0c0c0;
    color: #000;
}

.game-status.playing {
    background: #c0c0c0;
    color: #000;
}

.game-status.won {
    background: #c0c0c0;
    color: #008000;
}

.game-status.lost {
    background: #c0c0c0;
    color: #ff0000;
}

.game-board {
    display: inline-block;
    border: 3px inset #c0c0c0;
    background: #c0c0c0;
    padding: 3px;
    flex-shrink: 0;
}

.cell {
    width: 26px;
    height: 26px;
    border: 2px outset #c0c0c0;
    background: #c0c0c0;
    display: inline-block;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    font-family: 'MS Sans Serif', sans-serif;
}

.cell:hover {
    background: #d0d0d0;
}

.cell.revealed {
    border: 1px solid #808080;
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #c0c0c0;
    border-bottom-color: #c0c0c0;
    background: #c0c0c0;
    cursor: default;
}

.cell.mine {
    background: #ff0000;
    color: #000;
}

.cell.flagged {
    background: #c0c0c0;
    color: #ff0000;
    font-weight: bold;
}

.cell.flagged::after {
    content: '⚑';
    font-size: 1rem;
}

.cell.mine.revealed::after {
    content: '*';
    font-size: 16px;
    font-weight: bold;
}

.cell.number-1 { color: #0000ff; font-weight: bold; }
.cell.number-2 { color: #008000; font-weight: bold; }
.cell.number-3 { color: #ff0000; font-weight: bold; }
.cell.number-4 { color: #000080; font-weight: bold; }
.cell.number-5 { color: #800000; font-weight: bold; }
.cell.number-6 { color: #008080; font-weight: bold; }
.cell.number-7 { color: #000000; font-weight: bold; }
.cell.number-8 { color: #808080; font-weight: bold; }

.game-controls {
    margin: 20px 0;
}

.difficulty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.difficulty label {
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

#difficulty-select {
    padding: 2px 6px;
    border: 2px inset #c0c0c0;
    background: #c0c0c0;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
}

.instructions {
    text-align: left;
    background: #c0c0c0;
    padding: 10px;
    border: 1px inset #c0c0c0;
    margin-top: 10px;
    flex-shrink: 1;
    overflow-y: auto;
}

.instructions h3 {
    color: #000;
    margin-bottom: 5px;
    text-align: center;
    font-size: 1.2rem;
}

.instructions ul {
    list-style-position: inside;
    color: #000;
    line-height: 1.4;
    font-size: 0.9rem;
}

.instructions li {
    margin-bottom: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-height: 98vh;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 8px;
        padding: 6px;
    }
    
    .cell {
        width: 20px;
        height: 20px;
        line-height: 16px;
        font-size: 10px;
    }
    
    .difficulty {
        flex-direction: column;
        gap: 4px;
    }
    
    .instructions {
        padding: 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .cell {
        width: 18px;
        height: 18px;
        line-height: 14px;
        font-size: 9px;
    }
    
    h1 {
        font-size: 1.3em;
    }
}