* {
    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, #8e44ad 0%, #9b59b6 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: #9b59b6;
    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: #9b59b6;
}

.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;
}

.game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

/* 信息面板 */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 150px;
}

.info-box h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.score-display,
.level-display,
.lines-display {
    font-size: 32px;
    font-weight: bold;
    color: #9b59b6;
    text-align: center;
}

.next-preview canvas {
    display: block;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 5px;
}

/* 游戏区域 */
.game-area {
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    display: block;
    background: #000;
    border-radius: 5px;
}

.game-over-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.game-over-message h2 {
    font-size: 32px;
    color: #9b59b6;
    margin: 0;
}

.game-over-message p {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.game-over-message button {
    padding: 12px 30px;
    background: #9b59b6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.game-over-message button:hover {
    background: #8e44ad;
    transform: scale(1.05);
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-btn {
    padding: 15px 30px;
    background: white;
    border: 2px solid #9b59b6;
    color: #9b59b6;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.control-btn:hover {
    background: #9b59b6;
    color: white;
}

.control-btn.start-btn {
    background: #9b59b6;
    color: white;
}

.control-btn.start-btn:hover {
    background: #8e44ad;
}

/* 操作指南 */
.controls-guide {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.controls-guide h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.key {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 5px 12px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    color: #333;
}

.desc {
    color: #666;
    font-size: 14px;
}

/* 移动端控制 */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.mobile-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #9b59b6;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #9b59b6;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mobile-btn:active {
    background: #9b59b6;
    color: white;
    transform: scale(0.95);
}

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

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

.about-content h1, .guide-content h1 {
    color: #9b59b6;
    font-size: 42px;
    margin-bottom: 30px;
    text-align: center;
}

.about-content h2, .guide-content h2 {
    color: #8e44ad;
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.about-content h3, .guide-content h3 {
    color: #9b59b6;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.about-content p, .guide-content p {
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
    font-size: 16px;
}

.about-content ul, .about-content ol,
.guide-content ul, .guide-content ol {
    margin-left: 40px;
    margin-bottom: 20px;
}

.about-content li, .guide-content li {
    line-height: 2;
    color: #555;
    margin-bottom: 10px;
    font-size: 16px;
}

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

.feature-item {
    background: #f8f4fb;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e8d4f2;
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.2);
}

.feature-item h3 {
    color: #9b59b6;
    margin-bottom: 15px;
    font-size: 20px;
}

.feature-item p {
    margin: 0;
    font-size: 15px;
}

.contact-info, .tip-box {
    background: #f8f4fb;
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
}

.tip-box {
    border-left: 4px solid #9b59b6;
}

.tip-box strong {
    color: #9b59b6;
}

/* 响应式设计 */
@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);
    }

    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .info-panel,
    .control-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .info-box {
        flex: 1;
        min-width: 120px;
    }

    .next-preview {
        flex-basis: 100%;
    }

    .controls-guide {
        display: none;
    }

    .mobile-controls {
        display: flex;
    }

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

    .about-content h1, .guide-content h1 {
        font-size: 32px;
    }

    .about-content h2, .guide-content h2 {
        font-size: 24px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 20px;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .info-box {
        padding: 15px;
    }

    .score-display,
    .level-display,
    .lines-display {
        font-size: 24px;
    }

    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

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

    .about-content h2, .guide-content h2 {
        font-size: 22px;
    }

    .about-content h3, .guide-content h3 {
        font-size: 18px;
    }
}
