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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 100;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
}

/* 封面页面样式 */
.cover-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
}

.cover-image {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 30px;
}

.start-button {
    padding: 18px 40px;
    font-size: 24px;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-button:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* 选关页面样式 */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.level-item {
    background: #f7fafc;
    border: 3px solid #cbd5e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.level-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.level-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-item.locked:hover {
    transform: none;
    box-shadow: none;
}

.level-item.active {
    border-color: #4CAF50;
    background: #e6ffed;
}

.level-number {
    font-size: 32px;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 10px;
}

.level-name {
    font-size: 14px;
    color: #718096;
}

.back-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    background: #718096;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-button:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.3);
}

/* 游戏页面样式 */
h1 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 32px;
}

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 10px;
}

#level-info {
    color: #2d3748;
    font-size: 18px;
    font-weight: bold;
}

#instruction {
    color: #718096;
    font-size: 14px;
}

#gameCanvas, #creatorCanvas {
    border: 3px solid #cbd5e0;
    border-radius: 10px;
    background: #ffffff;
    cursor: move;
}

#level-name-input {
    padding: 12px 20px;
    font-size: 16px;
    border: 3px solid #cbd5e0;
    border-radius: 8px;
    width: 200px;
}

.game-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

#check-win-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#check-win-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#check-win-btn:active {
    transform: translateY(0);
}

#back-to-levels-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    background: #718096;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#back-to-levels-btn:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.3);
}

#success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(72, 187, 120, 0.95);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

#failure-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.hidden {
    display: none;
}
