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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-controls {
    text-align: center;
    margin-bottom: 20px;
}

.encyclopedia-btn {
    background: linear-gradient(145deg, #4299e1, #3182ce);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.encyclopedia-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.game-instruction {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
}

.game-instruction p {
    font-size: 1.3rem;
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.5;
}

.encyclopedia-promo {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 20px;
    margin: 15px auto;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.encyclopedia-promo p {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin: 5px 0;
    line-height: 1.4;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 40px;
}

.ingredients-section, .cooking-section, .encyclopedia-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.ingredients-section h2, .cooking-section h2, .encyclopedia-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #4a5568;
    font-size: 1.8rem;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.ingredient-item {
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.ingredient-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #4299e1;
}

.ingredient-item:active {
    transform: scale(0.95);
}

.ingredient-item.added {
    opacity: 0.5;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e0);
    border-color: #a0aec0;
    cursor: not-allowed;
}

.ingredient-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 8px;
}

.ingredient-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    display: block;
}

.cooking-area {
    min-height: 200px;
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.cooking-placeholder {
    text-align: center;
    color: #718096;
}

.cooking-placeholder p {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.cooking-placeholder .hint {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}

.selected-ingredients {
    margin-bottom: 25px;
}

.ingredient-slots {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.ingredient-slot {
    width: 120px;
    height: 120px;
    border: 3px dashed #cbd5e0;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ingredient-slot.filled {
    border: 3px solid #4299e1;
    background: linear-gradient(145deg, #ebf8ff, #bee3f8);
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.2);
}

.slot-placeholder {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
    padding: 10px;
    line-height: 1.3;
}

.ingredient-slot .added-ingredient {
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    flex-direction: column;
    gap: 8px;
}

.ingredient-slot .added-ingredient img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

.ingredient-slot .added-ingredient span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d3748;
}

.ingredient-slot .remove-ingredient {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(245, 101, 101, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ingredient-slot .remove-ingredient:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

.cooking-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.cook-btn {
    background: linear-gradient(145deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.cook-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.cook-btn:disabled {
    background: linear-gradient(145deg, #a0aec0, #718096);
    cursor: not-allowed;
    opacity: 0.6;
}

.cook-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.added-ingredient {
    background: linear-gradient(145deg, #48bb78, #38a169);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
    position: relative;
}

.added-ingredient img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.remove-ingredient {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.remove-ingredient:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.remove-ingredient:active {
    transform: scale(0.9);
}

.dish-result {
    background: linear-gradient(145deg, #fef5e7, #fed7aa);
    border: 2px solid #f6ad55;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
}

.failure-hint {
    background: linear-gradient(145deg, #fef2f2, #fecaca);
    border: 2px solid #f87171;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
    animation: shake 0.5s ease-in-out;
}

.failure-hint h3 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.failure-hint p {
    color: #991b1b;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.5;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.dish-result h3 {
    color: #c05621;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.dish-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.dish-image {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dish-details {
    text-align: left;
    flex: 1;
}

.dish-details h4 {
    color: #c05621;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.dish-details p {
    color: #744210;
    line-height: 1.5;
}

.clear-btn {
    background: linear-gradient(145deg, #f56565, #e53e3e);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .ingredients-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 15px;
    }
}




.encyclopedia-intro {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(145deg, #e6fffa, #b2f5ea);
    border-radius: 15px;
    border: 1px solid #81e6d9;
}

.encyclopedia-intro p {
    color: #234e52;
    font-size: 1.1rem;
    margin: 10px 0;
    line-height: 1.4;
}

.encyclopedia-stats {
    margin-top: 15px;
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 600;
}

.encyclopedia-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    overflow-y: auto;
    padding: 10px;
}

.encyclopedia-item {
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.encyclopedia-item.locked {
    filter: grayscale(80%);
    opacity: 0.7;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

.encyclopedia-item.unlocked {
    filter: none;
    opacity: 1;
    background: linear-gradient(145deg, #f0fff4, #c6f6d5);
    border-color: #68d391;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

.encyclopedia-item.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.dish-image-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 10px;
    overflow: hidden;
}

.encyclopedia-item img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.encyclopedia-item.locked img {
    filter: blur(1px);
    opacity: 0.8;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.lock-overlay span {
    font-size: 1.5rem;
    color: white;
}

.encyclopedia-item h4 {
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.encyclopedia-item.locked h4 {
    color: #718096;
}

.encyclopedia-item p {
    color: #718096;
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.unlock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(72, 187, 120, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .ingredients-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .encyclopedia-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .ingredients-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .ingredient-item {
        padding: 12px 8px;
    }

    .ingredient-item img {
        width: 35px;
        height: 35px;
    }

    .ingredient-item span {
        font-size: 0.8rem;
    }

    .encyclopedia-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 8px;
    }

    .encyclopedia-item {
        padding: 15px 12px;
    }

    .dish-image-container {
        width: 50px;
        height: 50px;
        margin: 0 auto 8px;
    }

    .encyclopedia-item h4 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .encyclopedia-item p {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .lock-overlay span {
        font-size: 1.2rem;
    }

    .unlock-indicator {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
}
