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

body {
    margin: 0;
    font-family: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* 页面切换 */
.page {
    display: none;
    padding: 20px;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 首页 Hero */
.hero {
    text-align: center;
    padding: 40px 20px 30px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #fff;
}

.hero p {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

/* 模式选择 */
.mode-selection {
    padding: 0 20px;
}

.difficulty-cards {
    display: flex;
    gap: 12px;
}

.difficulty-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 16px;
    padding: 24px 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-align: center;
}

.difficulty-card:hover {
    transform: translateY(-3px);
}

.difficulty-card.easy {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

.difficulty-card.medium {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.difficulty-card.hard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.difficulty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.difficulty-card h3 {
    margin: 0;
    font-size: 16px;
}

/* 游戏页面 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 16px;
}

.back-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.level-info {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.hint-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
}

/* 游戏区域 */
.game-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px 12px;
}

.target-mini {
    flex-shrink: 0;
}

.target-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

#target-canvas {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: block;
}

.play-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 12px;
}

.play-area-container {
    position: relative;
    display: flex;
    justify-content: center;
}

#game-canvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    background: #f8f9fa;
    border-radius: 12px;
    touch-action: none;
}

/* 成功覆盖层 */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-overlay.hidden {
    display: none;
}

.success-emoji {
    font-size: 48px;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 32px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 关卡进度 */
.level-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.progress-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

.progress-dot.completed {
    background: #fff;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    max-width: 260px;
    width: 100%;
}

.modal-emoji {
    font-size: 48px;
    margin-bottom: 8px;
}

.modal-content h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    background: #f0f0f0;
    color: #333;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

/* 提示弹窗 */
.hint-content {
    max-width: 240px;
}

#hint-text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* 响应式 */
@media (max-width: 400px) {
    .hero h1 {
        font-size: 24px;
    }
    
    .difficulty-icon {
        font-size: 28px;
    }
    
    .difficulty-card h3 {
        font-size: 14px;
    }
}


