* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 60px;
    user-select: none;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 10px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #667eea;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s;
}

/* 主容器 */
.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding: 20px;
}

.container {
    background: #f0f0f0;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 100%;
}

.header {
    background: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 8px 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.1s;
}

.difficulty-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.difficulty-btn.active {
    background: #a0a0a0;
    border-color: #808080 #ffffff #ffffff #808080;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 10px;
    margin-bottom: 10px;
}

.counter {
    background: #000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 28px;
    font-weight: bold;
    padding: 5px 10px;
    border: 2px solid #808080;
    min-width: 80px;
    text-align: center;
}

.reset-btn {
    width: 50px;
    height: 50px;
    font-size: 30px;
    background: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    cursor: pointer;
    transition: all 0.1s;
}

.reset-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.game-board {
    background: #c0c0c0;
    border: 3px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 10px;
    display: inline-block;
}

.board {
    display: grid;
    gap: 0;
    background: #808080;
}

.cell {
    width: 30px;
    height: 30px;
    background: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.1s;
}

.cell:active {
    transform: scale(0.95);
}

.cell.revealed {
    background: #bdbdbd;
    border: 1px solid #808080;
    cursor: default;
}

.cell.flagged::before {
    content: '🚩';
    font-size: 20px;
}

.cell.mine::before {
    content: '💣';
    font-size: 20px;
}

.cell.mine-exploded {
    background: #ff0000;
}

.cell.mine-wrong::before {
    content: '❌';
    font-size: 18px;
}

.cell[data-count="1"] { color: #0000ff; }
.cell[data-count="2"] { color: #008000; }
.cell[data-count="3"] { color: #ff0000; }
.cell[data-count="4"] { color: #000080; }
.cell[data-count="5"] { color: #800000; }
.cell[data-count="6"] { color: #008080; }
.cell[data-count="7"] { color: #000000; }
.cell[data-count="8"] { color: #808080; }

/* 游戏结束遮罩 */
.game-over-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-overlay.show {
    display: flex;
}

.game-over-message {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    animation: popIn 0.3s ease-out;
}

.game-over-message h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.game-over-message p {
    font-size: 18px;
    margin-bottom: 20px;
}

.game-over-message button {
    padding: 12px 30px;
    font-size: 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.game-over-message button:hover {
    background: #5568d3;
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 关于页面样式 */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

.about-content h1 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 20px;
    text-align: center;
}

.about-content h2 {
    color: #764ba2;
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.about-content p {
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
}

.about-content ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.about-content li {
    line-height: 1.8;
    color: #555;
    margin-bottom: 8px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.feature-item h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.contact-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: left 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .container {
        padding: 10px;
    }

    .cell {
        width: 25px;
        height: 25px;
        font-size: 16px;
    }

    .cell.flagged::before,
    .cell.mine::before {
        font-size: 16px;
    }

    .counter {
        font-size: 22px;
        min-width: 60px;
    }

    .reset-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .difficulty-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .about-content {
        padding: 30px 20px;
    }

    .about-content h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 22px;
        height: 22px;
        font-size: 14px;
        border-width: 2px;
    }

    .cell.flagged::before,
    .cell.mine::before {
        font-size: 14px;
    }

    .counter {
        font-size: 18px;
        min-width: 50px;
        padding: 3px 6px;
    }

    .reset-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .nav-logo {
        font-size: 20px;
    }

    .about-content h1 {
        font-size: 24px;
    }

    .about-content h2 {
        font-size: 20px;
    }
}
