* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 100%;
    width: 100%;
    max-width: 800px;
}

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

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

.game-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

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

.label {
    font-weight: 600;
    color: #666;
}

#difficulty {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

#difficulty:hover {
    border-color: #764ba2;
    background: #f8f9ff;
}

#mines-count, #timer {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow-x: auto;
}

#game-board {
    display: inline-grid;
    gap: 2px;
    background: #ccc;
    padding: 2px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cell {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    border: 2px outset #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    position: relative;
}

.cell:hover:not(.revealed):not(.flagged) {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.cell.revealed {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-style: inset;
    cursor: default;
}

.cell.flagged {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.cell.mine {
    background: #ff4444;
}

.cell.mine.revealed {
    background: #ff0000;
    animation: explode 0.3s;
}

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

.message {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
    animation: slideIn 0.5s;
}

.message.hidden {
    display: none;
}

.message.win {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.message.lose {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-info {
        flex-direction: column;
        align-items: center;
    }
    
    .cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

